C. G. Montgomery <cgm@[EMAIL PROTECTED]
> wrote:
> Michael michael.kalus@[EMAIL PROTECTED]
wrote:
>
>> Is & a forth word? How about &! ?
>
> The words & and &! are among those defined in the fsl-util files in the
> Auxiliary code provided with the Library:
> http://www.taygeta.com/fsl/scilib.html
>
> Unfortunately, these and a number of other FSL words are defined only by
a
> particular implementation rather than fully specified, so other
> implementations may provide the same functionality differently. In
other
> words, full phrases such as the ones you quote, have standard effects,
> while the individual words may behave differently.
Bleh. That's not very helpful. How about putting it this way?
name{ ( -- elements )
& ( "array-name" -- array )
An `elements` reference is sufficient to access the elements of the
array, but words which modify the array's structure need a full array
reference. You can only get an array reference for dynamically
allocated arrays, as the structure of a statically allocated array can't
be modified.
&! ( elements array -- ) \ set ARRAY so that it refers to ELEMENTS
}malloc ( array u -- ) \ allocate U elements for ARRAY
}free ( array -- ) \ free the elements of ARRAY
Or does this abstraction break down in some cases?
--Josh


|