Python syntax in Lisp and Scheme

Andrew Dalke adalke at mindspring.com
Thu Oct 9 04:39:31 EDT 2003


Dave Benjamin:
> Interestingly enough:
>
> "The language is strongly-typed, but without declarations. Types are
>  determined from context."
>                 - http://ftp.cwi.nl/abc/abc.intro
>
> Sounds like type inference to me.

Sound like dynamic typing to me.  Python is strongly-typed
but without declarations, and the type is determined as needed.
But I don't know enough about ABC to authoritatively declare
that it does/does not do type inferencing.  My guess is that it
does not.

> Also:
>
> "There is no GOTO statement in ABC, and expressions do not have
> side-effects."
>                 - http://homepages.cwi.nl/~steven/abc/teaching.html
>
> Hints both at the statement/expression dichotomy of Python and the issue
> that side-effects make it difficult to reason about a program, one of the
> most important assertions made by functional proponents (IMHO).

I think you're reading too much into it.  The example code
doesn't look at all functional to me, as in (from the main page)

   HOW TO RETURN words document:
      PUT {} IN collection
      FOR line IN document:
         FOR word IN split line:
            IF word not.in collection:
               INSERT word IN collection
      RETURN collection

It looks like 'line' and 'word' can take on many values,
which a sure sign of something other than fp.

                    Andrew
                    dalke at dalkescientific.com






More information about the Python-list mailing list