Hi Seth,

See below...

Seth wrote:
>  >> a: [1 2 3 4 5]
> == [1 2 3 4 5]
>  >> b: [""]
> == [""]
>  >> x: index? a
> == 1
>  >> append b/:x "hi"
> == "hi"

At this point, take a look at the value of B to see why:

 >> b
== ["hi"]
 >> fourth b
** Script Error: Out of range or past end
** Near: fourth b
 >>
 >> b/:x
== none
 >>

>  >> x: index? find a 4
> == 4

At this point B has no fourth element (ergo B/:X returns NONE) so...

>  >> append b/:x "hi"
> ** Script Error: append expected series argument of type: series port
> ** Near: append b/:x "hi"
> 
> In theory, shouldn't append do it's thing on b/4 ... What's with the 
> error? :\
> 

...you can't treat that (non-existent) element as a series.

Unlike Perl, which automatically allocates and meaningfully initializes
previously non-existent data, REBOL requires that a value exist and be
of the correct type for whatever operation you attempt to perform on it.

-jn-




-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.

Reply via email to