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

[REBOL] Re: Bug! in assignment to date! values with stacked set-path values

From: rotenca:telvia:it at: 12-Nov-2002 14:45

Hi Ladislav, Andrew, Carl
> This is an artifact that is caused by immutability of dates. (you may > remember the discussion on the subject) The > > x/month: 1 > > 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.
It seems to me that the mutation hack is not enough to explain this. The problem is that all the value are pre-fetched before the first assign start, else with or without mutation the result should be right. Instead, the pre-fetch works only with mutable values. The bug is prefetch the value of set-path. Neither parens can correct the problem. Look at this:
>> a: "aaa" probe a/2: (a: "bbb" #"c") a
aca == "bbb" As you can see the a/2 continue to refer to the old string "aaa" also when the parens block has changed the 'a value with "bbb". I can be wrong but i do not see any mutation hack here. --- Ciao Romano