[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: what is the problem?



Ah, ok, what I really meant was that it didn't have the
lexical scope one would associated with Lisp today.

Do you mean you couldn't rebind (rebind, not reset)
globals?

Maybe this would be a good group to ask this question:
is there any use for local, dynamic variables?  The
only time I've ever used dynamic scope is to rebind
globals like *print-base* or *standard-output*.

--pg

--- Jeremy Hylton <jeremy@alum.mit.edu> wrote:
> >>>>> "PG" == Paul Graham <paulgraham@yahoo.com> writes:
> 
>   PG> Perl has been getting Lispier, but it started further away from
>   PG> Lisp than Python and Ruby.  As a first approximation, Python
>   PG> seems to be an inadvertant reinvention of a 1970s
>   PG> dynamically-scoped Lisp (except for s-expressions and thus
>   PG> macros).  It seems as if these ideas came to Python indirectly
>   PG> via Modula-3, which was based in part on Lisp.
> 
> Python wasn't dynamically scoped.  It didn't support nested scopes at
> all.  Every function regardless of whether it was nested inside
> another function had access to two namespaces -- the local namespace
> and the global/builtin namespace.  The determination of the global
> namespace is static; it's the globals where the function was defined.
> 
> I believe these odd scoping rules are the result of some bad
> experiences with Pascal, where nesting functions was one of the few
> structuring techniques for large programs.  So several people were
> familiar with large Pascal programs that were very hard to understand
> because they used many nested functions.  Python, then, wanted to
> discourage this style of programming.
> 
> Jeremy
> 


__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com