[REBOL] Set on path values
From: rudolf:meijer:telenet:be at: 12-Aug-2007 23:09
I like the ++ or incr function (incr: func ['val [word!]] [set val 1 + get
val]) which saves lot of writing when updating counters. My problem is that
many of my counters are not single words (which is what the set function
requires) but rather paths like suit-size/:hand/:suit (from a bridge program
-- the paths contain computed values, which could also have been written
/(hand)/(suit) etc.).
Does anyone have a suggestion for a one-argument function that will do
[suit-size/:hand/:suit: suit-size/:hand/:suit + 1] just like incr cnt would
do [cnt: cnt + 1]?
Thanks in advance
Rudolf Meijer