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

[REBOL] Re: On mutability and sameness

From: gjones05:mail:orion at: 6-Jun-2001 10:13

From: "Joel Neely"
> Hi, again, > > Minor update to previous message... > > Ladislav Mecir wrote: > > > > I am pretty sure, that the feature you are describing is not a > > bug. The reason for the behaviour is pretty simple. Rebol values > > of type TUPLE! DATE! INTEGER! and some other types are immutable... > > > > The oddity I described appears to reside in the /DATE "refinement" > itself, based on this: > > >> a: now == 6-Jun-2001/9:05:53-5:00 > >> a/date == 6-Jun-2001 > >> a/date/date == 6-Jun-2001 > >> a/date/date/date/date/date/day == 6 > > so that /DATE behaves less like a component selector and more like > a function that takes a (complete) DATE! value and returns another > DATE! value with the TIME! component set to none.
I think you are on to something with this hypothesis. I have expounded on a concept from an earlier post. This gives more proof in the pudding: ;First, the components of the full date time and zone a/now ; == 6-Jun-2001/10:04:33-5:00 a/1 ; == 2001 a/2 ; == 6 a/3 ; == 6 a/4 ; == 10:04:33 a/4/1 ; == 10 a/4/2 ; == 4 a/4/3 ; == 33 a/5 ; == -5:00 ;Now for just the "date" portion, notice the zone element (#5)? a: now ; == 6-Jun-2001/10:04:33-5:00 a/date ; == 6-Jun-2001 a/date/1 ; == 2001 a/date/2 ; == 6 a/date/3 ; == 6 a/date/4 ; == none a/date/5 ; == 0:00 --Scott Jones