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

[REBOL] Re: On mutability and sameness

From: larry:ecotope at: 6-Jun-2001 16:07

Hi Joel
> But it is equally inaccurate to assume that they are fixed-size > scalar values, isn't it? > > >> foo: 9.8.7.6.5.4.3.2.1.0 > == 9.8.7.6.5.4.3.2.1.0 > >> repeat i 10 [print foo/:i] >> foo: 1.2.3.4.5.6.7.8.9.10.11
** Syntax Error: Invalid tuple -- 1.2.3.4.5.6.7.8.9.10.11 Not necessarily, they could be fixed size at 10 bytes (which BTW shows that Volker's rule of 8 bytes does not hold). The "scalar" types could be tagged pointers (references) as suggested by Volker. A few bits in the pointer could designate the type and whether the value is contained within the pointer. As you probably know this is a common way of implementing "scalar" types in Scheme. For tuples, there could some bits in the pointer that say how long the tuple is with a max of 10. It is interesting to note that when an empty block is created:
>> b: make block! 10000
system/stats shows that 16 bytes of memory have been allocated for each block element. This might indicate that REBOL "pointers" or "references" are 16 bytes in length. Just a speculation... Regards -Larry PS This is fun too:
>> foo: 1.........
== 1.0.0.0.0.0.0.0.0.0