|
|
Warp wrote:
> [] is used almost universally for indexing in most languages
Well, most based on C syntax. The rest (Pascal, Fortran, Ada, etc) use ().
> data)). Is there a logical reason why Haskell chooses an odd syntax of
> "x ! y" for the same thing than most other languages express as "x[y]"?
I would guess it makes the thing into an infix operator, while x[y] is
neither prefix, postfix, infix, or ... whatever.
Plus, list literals are [ ... ], so I'm guessing that x [ y ] is ambiguous
as to whether you're calling function x with an argument htat's a
one-element list containing y.
Now, why they picked ! instead of (say) @ is beyond me. "@" is what I've
seen used in all the languages that make this strictly an infix operator.
--
Darren New, San Diego CA, USA (PST)
The question in today's corporate environment is not
so much "what color is your parachute?" as it is
"what color is your nose?"
Post a reply to this message
|
|