all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: [Emacs-diffs] trunk r117982: * ses.el (ses-calculate-cell): bind row and col dynamically to
       [not found] <E1XYsSM-0001rK-MF@vcs.savannah.gnu.org>
@ 2014-09-30 16:00 ` Stefan Monnier
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2014-09-30 16:00 UTC (permalink / raw
  To: Vincent Belaïche, emacs-devel

> +	     (cl-progv '(row col maxrow maxcol) (list ,row (+ ,c ,mincol) ,maxrow ,maxcol)
> +	       ,@body)))))))

Why use cl-progv here?  It's *much* less efficient than a plain `let'.

> +	  (setq newval (cl-progv '(row col)
> +			   (list row col)

Same here.


        Stefan



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Emacs-diffs] trunk r117982: * ses.el (ses-calculate-cell): bind row and col dynamically to
@ 2014-10-03  9:00 Vincent Belaïche
  2014-10-03 12:17 ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: Vincent Belaïche @ 2014-10-03  9:00 UTC (permalink / raw
  To: Stefan Monnier; +Cc: Vincent Belaïche, emacs-devel

Stefan Monnier a écrit :
>> +	     (cl-progv '(row col maxrow maxcol) (list ,row (+ ,c ,mincol) ,maxrow ,maxcol)
>> +	       ,@body)))))))
>
> 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. These function would then get
incorrect nil values from the defvar's.

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.

  Vincent.




>> +	  (setq newval (cl-progv '(row col)
>> +			   (list row col)
>
> Same here.
>
>
>         Stefan
>



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Emacs-diffs] trunk r117982: * ses.el (ses-calculate-cell): bind row and col dynamically to
  2014-10-03  9:00 Vincent Belaïche
@ 2014-10-03 12:17 ` Stefan Monnier
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2014-10-03 12:17 UTC (permalink / raw
  To: Vincent Belaïche; +Cc: emacs-devel

>> 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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-10-03 12:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <E1XYsSM-0001rK-MF@vcs.savannah.gnu.org>
2014-09-30 16:00 ` [Emacs-diffs] trunk r117982: * ses.el (ses-calculate-cell): bind row and col dynamically to Stefan Monnier
2014-10-03  9:00 Vincent Belaïche
2014-10-03 12:17 ` Stefan Monnier

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.