[m-dev.] Introduce !! rather than ^elem() for indexing
Simon Taylor
stayl at cs.mu.OZ.AU
Thu Oct 11 18:36:05 AEST 2001
On 09-Oct-2001, Ralph Becket <rafe at cs.mu.OZ.AU> wrote:
> I believe that Haskell uses !! to access array members (and possibly
> list members etc. too).
>
> `A !! I' is syntactically more economical than the current Mercury
> convention of using `A ^ elem(I)'. However, to make substitution of
> the form `A !! I := X' parse would require some work.
I don't think it works very well when field accesses or updates are
nested. To me,
X !! 1 ^ field := Value
doesn't (mentally) parse as well as
X ^ elem(1) ^ field := Value.
> Any takers?
Not me.
Simon.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list