|
|
>> You can't do "c at 2", but there's no reason you couldn't do "c `at` 2".
>
> If this were C++, it would actually be "c.at(2)".
OK.
> But I suppose that since Haskell is not an OO language and its dot operator
> probably means something else altogether, making it like that would probably
> be difficult (and would probably require a complete syntax redesign).
The dot can mean two different things. "x . y" means function
composition. "x.y" is a qualified name. (It means the variables "y" from
module "x".)
>> You're going to love this...
>
>> It's "not". As in "not (x == y)".
>
> Why suddenly have one operator be a comprehensible word? Were they
> uninspired when they thought up that one? :P
Heh. If you mean "why isn't it some random symbol?" then the answer is
"you can only use symbols for *binary* functions, not *unary* functions
such as NOT".
Oh, you're going to love this... The logical AND and OR functions are
"&&" and "||" respectively, but Haskell *also* has functions named "and"
and "or". They take the logical AND or OR of a list of booleans.
Hey, I said Haskell was a great language. I never said the standard
libraries were perfect. ;-) I'm sure you can probably name a few
unfortunately design choices of the C++ libraries too...
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
|