[E-Lang] Operators #4: Indexing!
Bill Frantz
frantz@pwpconsult.com
Mon, 9 Apr 2001 16:10:08 -0700
At 7:39 PM -0700 4/6/01, Mark S. Miller wrote:
>The relevant parts of Python page
>http://www.python.org/doc/current/ref/sequence-types.html would have us expand
>
> thing[key]
>
>to
>
> thing op__getitem(key)
>
>and expand
>
> thing[key] := value
>
>to
>
> thing op__setitem(key, value)
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:
array[5,7] := 1.47
and
foo := array[6,9]
I would expect these to expand to:
array op__setitem(1.47, [5,7])
and
array op__getitem([6,9])
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