[Top][All Lists]

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

Re: e and pi

From: Chong Yidong
Subject: Re: e and pi
Date: Sat, 18 Sep 2010 15:10:54 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>> If function argument names are the problem, why not just give them
>> static scope, overriding any existing dynamic bindings?  While it's
>> idiomatic elisp to use `let' to bind dynamic variables, AFAICT no one
>> uses function arguments to do the same.
> No, the issue is:
>   does (let ((foo bar)) ...) bind `foo' lexically or dynamically?

You're switching examples.  Remember, I originally asked what's the
exact problem with binding `e' dynamically.  You came up with this

  (defun make-inc (e)
    (lambda (m) (+ e m)))

  (let ((f (make-inc 3)))
    (funcall f 5))

I agree that static scoping is much better in this example.  But we
could fix this simply by imposing static scope on function arguments.
So, is there an equivalent scenario in which the proposed change to
`let' is clearly desireable?

> That's been used for ages in Common-Lisp.  And it's the only
> reasonable way to convert Elisp packages from dynamic-scoping to
> static-scoping without having to change all `let' to something else
> (like lexical-let).

My question is, what's the advantage that we gain from automagically
converting to static scoping?  If 99% of the static scoping advantage
involves static scoping of function args, while 99% of the disruption
comes from converting `let' forms, then maybe we should do one and not
the other.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]