On Wed, Dec 10, 2008 at 2:13 PM, Daniel Eklund <[EMAIL PROTECTED]> wrote:
>
>
> As an off-hand comment made without careful reading, I can imagine
> there being great utility in a special reader-syntax for paths. XSLT
> embeds xpath, and groovy embeds gpath. I am unsure at this point the
> exact
> > user> (path-rebind nested-structure [:nested1 :nested2 :final-data]
> > "new data")
> > {:nested1 {:nested2 {:final-data "new data", :level 2}, :level
> > 1}, :level 0}
>
> Congratulations, you've implemented 'assoc-in' :-)
>
> user=> (assoc-in nested-structure [:nested1 :nested2 :final-data]
> > One thing I immediately ran up against were certain situations where
> > I have a map and want to "modify" a value several levels deep into
> > the hierarchy. Imagine the following structure:
>
> > (def nested-structure { :level 0,
> > :nested1 { :level 1,
> >
On Wed, Dec 10, 2008 at 1:40 PM, Daniel Eklund <[EMAIL PROTECTED]> wrote:
>
> user> (path-rebind nested-structure [:nested1 :nested2 :final-data]
> "new data")
> {:nested1 {:nested2 {:final-data "new data", :level 2}, :level
> 1}, :level 0}
Congratulations, you've implemented 'assoc-in' :-)
use
On Wednesday 10 December 2008 10:40, Daniel Eklund wrote:
> Hi all,
>
> ...
>
> One thing I immediately ran up against were certain situations where
> I have a map and want to "modify" a value several levels deep into
> the hierarchy. Imagine the following structure:
>
> (def nested-structure { :
Hi all,
I am relatively new to clojure. I am trying to port some toy code I
wrote for common lisp a few years ago (a boggle-like game which needs
a dictionary prefix trie to trim possible word matches).
My old code was fairly imperative in nature when creating the
dictionary trie, and so now I a