Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: paths & lookups & change

From: brett:codeconscious at: 19-Oct-2003 3:44

> test/:key: test/:key + 1 > > How can I do such a thing? Using to-set-path? I tried but failed. Robert
You can sort of, but you may not want to :-)
>> test: ["Bug Report" 1]
== ["Bug Report" 1]
>> key: "Bug Report"
== "Bug Report"
>> do reduce [to-set-path reduce ['test :key] 1 + test/:key]
== ["Bug Report" 2]
>> test
== ["Bug Report" 2] Alternatively perphaps a change in your data format (adding some metadata) will help:
>> test: reduce ["Bug Report" [count 1]]
== ["Bug Report" [count 1]]
>> test/:key/count: test/:key/count + 1
== [count 2]
>> test
== ["Bug Report" [count 2]] Brett.