Kevin,

Typical advice is to not use macros (implicitly used in the gists to build 
a CF DSL) when functions or data will suffice. Sometimes however the 
syntactic sugar is quite tasty and hard to overlook. I do not have enough 
knowledge of the domain to suggest what might be the correct approach in 
this case.

Some additional comments:
- your use of with-foo pattern is not idiomatic afaics; this pattern is 
typically used to scope run-time resource usage
- in relation to parameters: the means by which defrecord introduces record 
attributes may be instructive (if you go the DSL route)

rgds
Craig

On Tuesday, November 26, 2013 7:11:42 PM UTC+11, Kevin Bell wrote:
>
> Hey Craig,
>
> Thanks for the input. Forgive my naiveté, but I gather you're implying 
> that the DSL-ishness is desirable? That makes sense, and it seems to be 
> inline with what I'm learning about the lisp mindset. 
>
> You're suggestion is actually a lot more like an option that I was 
> considering but didn't do because it seemed to depart from things like 
> project.clj that I was emulating. But it might actually make sense to take 
> it a step further to make the scoping within CloudFormation templates more 
> explicit.
>
> I updated my gist with an even more DSL-like concept: 
> https://gist.github.com/bellkev/7653342<https://www.google.com/url?q=https%3A%2F%2Fgist.github.com%2Fbellkev%2F7653342&sa=D&sntz=1&usg=AFQjCNF5RUFgHxpojQ1x0EPxJFQ09ibA3A>
>
> On Monday, November 25, 2013 11:49:20 PM UTC-8, Craig wrote:
>>
>>
>> I don't know much about CF templates, but stripping some detail from your 
>> middle fragment moves further from data and to a DSL:
>>
>> (deftemplate my-template
>>   :aws-template-format-version "2010-09-09"
>>   :description "My description"
>>   
>>   (param my-parameter :type :string :description "My string parameter")
>>   
>>   (mapping my-mapping
>>            :first-level-key-one {:second-level-key-one "Value"}
>>            :first-level-key-two {:second-level-key-two "Another Value"})
>>   
>>   (condition my-condition (not my-parameter))
>>   (condition my-second-condition (= (-> my-mapping :first-level-key-one 
>> :second-level-key-one) my-parameter))
>>   
>>   (resource my-instance aws.ec2/instance :image-id "ami-79fd7eee")
>>   
>>   (output my-first-output (:instance-type my-instance))
>>   (output my-second-output my-parameter))
>>
>> Craig
>>
>>
>> On Tuesday, November 26, 2013 3:41:29 PM UTC+11, Kevin Bell wrote:
>>>
>>> Hey folks, I'm working on a tool to enable the generation of AWS 
>>> CloudFormation templates using a Clojure-based syntax kind of like 
>>> leiningen's project.clj. I'm working on how the syntax should look to be 
>>> most clojurey, and I wonder if anyone has some input: 
>>> https://gist.github.com/bellkev/7653342<https://www.google.com/url?q=https%3A%2F%2Fgist.github.com%2Fbellkev%2F7653342&sa=D&sntz=1&usg=AFQjCNF5RUFgHxpojQ1x0EPxJFQ09ibA3A>
>>>
>>> I should add that I'm very new to Clojure and using this project as an 
>>> opportunity to learn more about the language internals. So please forgive 
>>> any particularly non-idiomatic Clojure...
>>>
>>> Thanks!!
>>>
>>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to