[E-Lang] Operators #4: Indexing!
Mark S. Miller
markm@caplet.com
Mon, 09 Apr 2001 23:18:47 -0700
At 04:10 PM Monday 4/9/01, Bill Frantz wrote:
>Does this mean I can build mutable collections for arrays (as opposed to
>vectors) and then use the Fortran like notation to access them? For
>example:
If by "arrays (as opposed to vectors)" you mean N dimensional (as opposed to
just one dimensional), then yes. No such data type is built in, but you're
free to build one and the Fortran-like syntax will work just fine.
1)
>array[5,7] := 1.47
2)
>foo := array[6,9]
>
>I would expect these to expand to:
>
>array op__setitem(1.47, [5,7])
Nope. #1 currently expands to
array put(5, 7, 1.47)
and will expand to
array op__setitem(5, 7, 1.47)
>array op__getitem([6,9])
Nope. #2 currently expands to
foo := array get(6, 9)
and will expand to
foo := array op__getitem(6, 9)
Cheers,
--MarkM