unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Chong Yidong <cyd@stupidchicken.com>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: emacs-devel@gnu.org
Subject: Re: e and pi
Date: Sat, 18 Sep 2010 15:10:54 -0400	[thread overview]
Message-ID: <87ocbux3y9.fsf@stupidchicken.com> (raw)
In-Reply-To: <jwv1v8rcv5o.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Sat, 18 Sep 2010 10:30:24 +0200")

Stefan Monnier <monnier@IRO.UMontreal.CA> 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
example:

  (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	other threads:[~2010-09-18 19:10 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-16 13:25 e and pi Stefan Monnier
2010-09-16 13:44 ` Deniz Dogan
2010-09-16 15:37   ` Stefan Monnier
2010-09-16 13:47 ` Leo
2010-09-16 15:39   ` Stefan Monnier
2010-09-16 14:27 ` Helmut Eller
2010-09-16 15:44   ` Stefan Monnier
2010-09-16 18:52     ` Helmut Eller
2010-09-16 14:44 ` Jason Rumney
2010-09-16 22:54 ` Chong Yidong
2010-09-17  0:04   ` Deniz Dogan
2010-09-17  0:14   ` Wojciech Meyer
2010-09-17  7:00   ` David Kastrup
2010-09-17  8:09   ` Simon Leinen
2010-09-17  8:15     ` David Kastrup
2010-09-17  9:06       ` Stephen J. Turnbull
2010-09-17  9:21         ` David Kastrup
2010-09-17  9:47   ` Helmut Eller
2010-09-17 15:11   ` Stefan Monnier
2010-09-17 15:22     ` Lars Magne Ingebrigtsen
2010-09-17 15:56       ` Helmut Eller
2010-09-17 22:13         ` Stefan Monnier
2010-09-17 15:44     ` Wojciech Meyer
2010-09-17 15:50     ` Chong Yidong
2010-09-17 16:06       ` Wojciech Meyer
2010-09-17 16:18       ` Helmut Eller
2010-09-17 16:45         ` Glenn Morris
2010-09-17 17:14           ` Glenn Morris
2010-09-18 10:01         ` Eli Zaretskii
2010-09-18 10:21           ` Helmut Eller
2010-09-18 11:07             ` Eli Zaretskii
2010-09-18 11:26               ` Helmut Eller
2010-09-18 10:50           ` David Kastrup
2010-09-18 11:09             ` Eli Zaretskii
2010-09-18 14:27               ` Stephen J. Turnbull
2010-09-18 14:32               ` Andreas Schwab
2010-09-18 15:11           ` Drew Adams
2010-09-17 22:17       ` Stefan Monnier
2010-09-18  1:10         ` Chong Yidong
2010-09-18  8:30           ` Stefan Monnier
2010-09-18 19:10             ` Chong Yidong [this message]
2010-09-18 21:37               ` Uday S Reddy
2010-09-19  0:57                 ` Drew Adams
2010-09-18 13:43           ` Juanma Barranquero
2010-09-18 14:53             ` Stefan Monnier
2010-09-18 15:01               ` Lars Magne Ingebrigtsen
2010-09-18 16:00                 ` Stefan Monnier
2010-09-19 10:07               ` Juanma Barranquero
2010-09-17 16:14     ` Drew Adams
2010-09-18 15:12       ` tomas
2010-09-18 17:52         ` David Kastrup
2010-09-19 19:13           ` tomas
2010-09-17 23:35     ` Uday S Reddy
2010-09-17 16:55 ` Sam Steingold
2010-09-17 22:16   ` Stefan Monnier
2010-09-17 22:55     ` Drew Adams
  -- strict thread matches above, loose matches on Subject: below --
2010-09-17  4:20 MON KEY
2010-09-18  5:58 MON KEY
2010-09-18 14:50 ` Stefan Monnier
2010-09-19  2:03   ` MON KEY
2010-09-18 16:07 ` David De La Harpe Golden

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ocbux3y9.fsf@stupidchicken.com \
    --to=cyd@stupidchicken.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@IRO.UMontreal.CA \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).