On Mon, Aug 31, 2009 at 09:14:38AM -0400, Chas Emerick wrote:
> > You could define your own let-like construct for this:
> >
> >
> > (defmacro letmap [[m kvs & mkvs] & body]
> > (if m
> > `(let [~m {}
> >~@(mapcat (fn [[k v]] `(~m (assoc ~m ~k ~v))) kvs)]
> > (letmap ~mkvs
On Aug 31, 2009, at 6:56 AM, Achim Passen wrote:
>> I would like to simplify it to something like:
>>
>> {:radius 20
>>:diameter (* 2 (% :radius))
>>:circumference (* pi (% :diameter))}
>>
>> where % is the map itself.
>
> You could define your own let-like construct for this:
>
>
> (d
Hi!
Am 31.08.2009 um 11:27 schrieb Timo Mihaljov:
> I have some code that looks like this:
>
>(let [radius 20
> diameter (* 2 radius)
> circumference (* pi diameter)]
> {:radius radius
> :diameter diameter
> :circumference circumference})
>
> I would like t
Hi,
On Aug 31, 11:27 am, Timo Mihaljov wrote:
> When defining a map literal, is it possible to reference the map that is
> being defined?
I don't think this is possible.
> I have some code that looks like this:
>
> (let [radius 20
> diameter (* 2 radius)
> circumference