merits of Lisp vs Python

Juan R. juanrgonzaleza at canonicalscience.com
Wed Dec 13 04:06:01 EST 2006


greg ha escrito:

> Juan R. wrote:
>
> > I see no dinamism on your example, just static overloading.
>
> There's nothing static about it:
>
>    q = raw_input()
>    if q == "A":
>      a = 1
>      b = 2
>    else:
>      a = "x"
>      b = "y"
>    c = a + b
>
> There is no way that the compiler can statically
> determine what the + operator needs to do here.

Before or after the input? :]

No, it is not that i did mean. Of course, the operation for c is
dinamic, but just statically overloading the +. The definition for c
could be adapted to the cases and introduced on the if.

I would call dinamic code, for instance, if the if, the different cases
and the def for c could be modified on the fly _á la_ LISP macro style.




More information about the Python-list mailing list