emacs-devel
[Top][All Lists]
Advanced

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

lexbind: how to replace lexical-let approach to hide secrets (was: lexbi


From: Ted Zlatanov
Subject: lexbind: how to replace lexical-let approach to hide secrets (was: lexbind ready for merge)
Date: Wed, 30 Mar 2011 08:24:46 -0500
User-agent: Gnus/5.110016 (No Gnus v0.16) Emacs/24.0.50 (gnu/linux)

On Wed, 30 Mar 2011 13:35:56 +0200 Juanma Barranquero <address@hidden> wrote: 

JB> On Wed, Mar 30, 2011 at 06:10, Daniel Colascione
JB> <address@hidden> wrote:

>> Even if it's not particularly common, being consistent with Common Lisp and
>> having fewer special cases are good things.  Some people use constructs like
>> this to create module-private variables (which is a bad idea, but that
>> doesn't stop people doing it.)

JB> Why a bad idea? It's a common idiom for private, persistent variables.

Slightly related: auth-source.el uses `lexical-let' to define lambda
accessors for secrets (so printing them, for instance, won't show a
password).  Will the secrets still be hidden in the lexbind branch?  And
is there a smarter way to do it?

Sample code:

(let ((data "my secret"))
  (lexical-let ((data data)) (lambda () data)))

Thanks
Ted




reply via email to

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