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

[REBOL] Re: [array] Some other questions

From: joel:neely:fedex at: 22-Nov-2003 7:29

Hi, Andrew, A J Martin wrote:
> Anton wrote: > >>Watch out though, each item in chickenfarm is the same chicken object: > > Yes! You've found a bug in 'array! >
It's not a bug, since AFAIK there's no published specification that says ARRAY should behave any differently than it does. We've seen this issue before, in connection with other reference types, as in
>> foo: "Hi!"
== "Hi!"
>> gorp: array/initial 10 foo
== ["Hi!" "Hi!" "Hi!" "Hi!" "Hi!" "Hi!" "Hi!" "Hi!" "Hi!" "Hi!"]
>> foo/2: #"a"
== "Ha!"
>> gorp
== ["Ha!" "Ha!" "Ha!" "Ha!" "Ha!" "Ha!" "Ha!" "Ha!" "Ha!" "Ha!"] Given the available documentation for ARRAY:
>> ? array
USAGE: ARRAY size /initial value DESCRIPTION: Makes and initializes a series of a given size. ARRAY is a function value. ARGUMENTS: size -- Size or block of sizes for each dimension (Type: integer block) REFINEMENTS: /initial -- Specify an initial value for all elements value -- Initial value (Type: any) it is consistent that the (single!) initial value is uses for all elements. -jn-