[REBOL] Re: Bug! in assignment to date! values with stacked set-path values
From: lmecir:mbox:vol:cz at: 12-Nov-2002 9:46
----- Original Message -----
From: "Andrew Martin"
Subject: [REBOL] Bug! in assignment to date! values with stacked set-path
> >> x: now/date ; Get fresh value.
> == 12-Nov-2002
> >> x/month: x/day: 1 ; Now stack up the assignments.
> == 1 ; correct value is returned, but...
> >> x
> == 12-Jan-2002 ; Note that only the MONTH is altered...
This is an artifact that is caused by immutability of dates. (you may
remember the discussion on the subject) The
expression is only a hack, no real mutation occurs. Exactly the same hack
can be written to modify the bits of integer numbers as I have shown.