[REBOL] Re: Bug! in assignment to date! values with stacked set-path values
From: lmecir:mbox:vol:cz at: 15-Nov-2002 8:07
> Yes, but func are already fetched twice, why not path?
(-: It looks to me, that we always want the opposite of the actual
I think (Praetera censeo), that functions should be fetched just once and
a: func [x] [type? :x 1]
b: func [x] [type? :x 2]
a a: :b
Should yield 1 (Carthaginem esse delendam).
Joel can call my request "the principle of the least surprise", but there is
another reason to change the current behaviour: we can avoid some nasty
errors/interpreter crashes/bugs this way.
OTOH, set-paths are different animals.
a/1: (a: "3" #"2")
Here everybody is surprised, that the last operation, which is the path-set
somewhat magically "occurs" (at least partially) before the paren!
evaluation, which, again, seems to violate "the principle of the least
Nevertheless, paths can be evaluated like above and it makes perfect sense
a: make object! [f: does [a: make object! [f: does ] 1]]
a/f ; == 1
This makes perfect sense to me, although:
make object! [
f: func 
Another thing I want to mention is, that while
a/1: #"3" ; == "32"
the same operation used for dates yields:
a/day: 1 ; == 1
, which doesn't look unified.