Duncan Booth wrote:
> ·······@ziplip.com wrote in
> ·············································@ziplip.com:
>
>> 1. f(x,y,z) sucks. f x y z would be much easier to type (see Haskell)
>> 90% of the code is function applictions. Why not make it convenient?
>
> What syntax do you propose to use for
isn't it obvious? What ML, Haskell (and I suppose Dylan) use:
> f(x(y,z)),
f (x y z)
> f(x(y(z))),
f (x (y z))
> f(x,y(z))
f x (y z)
> f(x(y),z)
f (x y) z
> f(x)(y)(z)
(((f x) y) z)
In each of these cases, my version uses as many or fewer syntactic elements
(commas and parens) than yours. The problem with Python is that it also
lacks uniformity here (think "print" and "del").
Now look at some more realistic code
sin(x) + 2 / atan z
sin x + 2 / atan z
the latter is exactly how you would write this in math.
Anyway, I'm not advocating incompatible changes to the language
(that's unrealistic). I'm saying people should be kicked in the nuts when
they try to design their own languages unless they already know a few
*smart* languages (Lisp, Haskell, etc.). Java, C#, Pascall and Basic are not
smart. Also, since many Pythonista aren't programmers, and may never
learn such smart languages, my aim was to give them a little perspective.
You, Pythonista, are like naive little children who have to be
taught about the world, while Haskellers and Lispers are
experienced old men.
But to be _wise_ like me, it's not enough to grow a beard or
know Lisp or Haskell. You have to know *both*, because they are
so different, you have to grok monads and master macros.
Lisp is strict, Haskell is lazy
Lisp is dynamically typed, Haskell is statically typed
Lisp has OO, Haskell does not
Haskell uses monadic IO, Lisp does not
Haskell has indentation-based syntax, Lisp uses S-expressions.
When you know both Lisp and Haskell (and maybe a few other
languages) then other languages seem like small variations
on some old theme (or just plain bad ideas like C# and X++)
Anyway, this discussion is boring me. I'll leave you to
argue amongst yourselves. My job here is done.
420
P.S. Lulu aka David Mertz, I hate to say this, but you are the
BIGGEST idiot in comp.lang.python I've encountered so far.
P.P.S. You can have O(1) function calls in the interpreter (see Lisp).
Just one other thing that was done unWISEly in Python.
·······@ziplip.com wrote in separate messages:
>
> Anyway, this discussion is boring me. I'll leave you to
> argue amongst yourselves. My job here is done.
..that job now proven as having been to start a language flame-fest.
"420", please stay out of comp.lang.python in the future. I also
suspect the comp.lang.functional and comp.lang.lisp people, being
reasonable beings, would wish the same for their respective groups.
-Peter
·······@ziplip.com wrote in
·············································@ziplip.com:
> In each of these cases, my version uses as many or fewer syntactic
> elements (commas and parens) than yours. The problem with Python is
> that it also lacks uniformity here (think "print" and "del").
I fail to see the lack of uniformity. "print" and "del" are statements, and
like other statement (think "if", "for") they don't require parentheses.
Function calls do require parentheses because that is the way most people
who use procedural languages are accustomed to seeing function calls.
--
Duncan Booth ······@rcp.co.uk
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?