emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] trunk r117982: * ses.el (ses-calculate-cell): bind row


From: Stefan Monnier
Subject: Re: [Emacs-diffs] trunk r117982: * ses.el (ses-calculate-cell): bind row and col dynamically to
Date: Fri, 03 Oct 2014 08:17:48 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

>> Why use cl-progv here?  It's *much* less efficient than a plain `let'.
> Well, I can revert to let if you want, but I thought --- mistakenly? ---
> that a 'let' combined with the lexical binding cookie would make a
> lexical binding to what is in the body of let, and that there may be
> some functions (e.g. ses-export-tab) using these row col maxrow and
> maxcol without explicit argument passing.

The normal way to get a dynamically-scoped let-binding is to do:

   (defvar ses-foo)
   ...
   (defun ses-bar (..)
     ..
     (let ((ses-foo toto))
       ...))

> These function would then get incorrect nil values from the defvar's.

The defvar does not give any value to the variable.  It only declares it
as dynamically scoped.

> Please let me know if the correct way forward would be to have a let
> *AND* functions using explicit argument passing to get row, col, maxrow,
> maxcol etc... Then I can do the changes accordingly.

Thanks.  But I already changed the code in a way that makes
row/col/maxrow/maxcol statically scoped anyway.


        Stefan



reply via email to

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