Why not use juxtaposition to indicate function application

Kiuhnm kiuhnm03.4t.yahoo.it
Fri Mar 16 12:31:06 EDT 2012


On 3/16/2012 17:13, Prasad, Ramit wrote:
>>>> I confess i've indulged in Haskell and found
>>>>       f a
>>>> more readable than
>>>>       f(a)
>>>
>>> Hmmm... What about:
>>>
>>>       f a b
>>>
>>> versus
>>>
>>>       f(a(b))
>>>
>>> or was it supposed to be read as
>>>
>>>       f(a)(b)
>>>
>>>
>>> or as
>>>
>>>      f(a, b)
>>>
>>> ?-)
>>
>> That would be
>>     f (a b)          # Haskell
>>     f(a(b))          # Python
>
> I have not used Haskell so far, but in this case I think I prefer the
> 'Explicit is better than implicit.'

Are you sure that
   "call the function f with the params a and b"
is better than
   f a b
or
   f(a,b)
?

> I would probably always forget if it should be
>
> f a b
>
> or
>
> f ( a b )

You wouldn't, because Haskel's way is more regular and makes a lot of 
sense: parentheses are for grouping and that's it.

Kiuhnm



More information about the Python-list mailing list