At 11/29/99 02:12 PM -0800, you wrote:
>
>Here are three more questions:
>
>    1. x/:i  syntax can get but not set values in a block... why?

This path notation is a shorthand for getting values
in a series.  Compared to the functional approach
(using pick and change) it is limited, but I believe
that we can add what is needed (although it does start
to look a bit like perl or something:  x/:i: 10 ).  It
would be consistent, because you can write x/5: 10

To do what you want for now you will need to write something
like:

   change at x i 10


>    2. y: make string! 100   creates a string of length 0... why?
>            rebol dictionary entry implies 100 would be length or
>            value...

The size of the string is 100.  The length of the string is 0.
In other words, the MAKE created an initial allocation for the
string of 100 chars.  However, the string is empty... it has
no characters, so it's length is zero.

Note that using MAKE like this is really not necessary.
REBOL strings automatically grow in size.  That
is, you can create a string of size 1, then add 99 chars to it
w/o a problem.  The MAKE is only used for efficiency, when you
know the length of the string you want.

We should improve the explanation in the dictionary to clarify.

>     3. is there any difference between a 1-dimensional array
>            and a block or series?

No. They are the same, except that the ARRAY function usually
fills every element of the array with a default value, such as
zero or none.  That allows you to access all elements of the
array in a random order from the beginning.  You would not be
able to do this with a new block, until you had filled it with
default values yourself.

-Carl

(PS to Docs Dept: Add to docs.)

Reply via email to