POV-Ray : Newsgroups : povray.off-topic : Why is Haskell interesting? : Re: Why is Haskell interesting? Server Time
4 Sep 2024 17:22:00 EDT (-0400)
  Re: Why is Haskell interesting?  
From: Darren New
Date: 27 Feb 2010 18:04:18
Message: <4b89a4f2$1@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.