help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: questioning let


From: David Kastrup
Subject: Re: questioning let
Date: Wed, 24 Feb 2010 12:36:27 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.92 (gnu/linux)

Andreas Roehler <andreas.roehler@online.de> writes:

> Hi,
>
> behaviour of the example code below puzzles me. Would
> expect setting of arg by external function, but inside
> `let', recognised. But remains `1'.
>
> (defun arg-setting ()
>   (interactive)
>   (let ((arg 1))
>     (message "%s" arg)
>     (arg-extern arg)
>     (message "%s" arg)))
>
> (defun arg-extern (arg)
>   (setq arg (1- arg)))
>
> Any help?

The argument binding in arg-extern is the innermost one and consequently
the only affected one.  If you make the function argument-less, it will
likely work as expected by you, affecting the binding in arg-setting.

-- 
David Kastrup


reply via email to

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