[E-Lang] Operators #4: Indexing!
Bill Frantz
frantz@pwpconsult.com
Tue, 10 Apr 2001 11:03:03 -0700
At 11:18 PM -0700 4/9/01, Mark S. Miller wrote:
>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)
>
Even better.
Cheers - Bill
-------------------------------------------------------------------------
Bill Frantz | Microsoft Outlook, the | Periwinkle -- Consulting
(408)356-8506 | hacker's path to your | 16345 Englewood Ave.
frantz@netcom.com | hard disk. | Los Gatos, CA 95032, USA