[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: lexbind: how to replace lexical-let approach to hide secrets
From: |
Stefan Monnier |
Subject: |
Re: lexbind: how to replace lexical-let approach to hide secrets |
Date: |
Wed, 30 Mar 2011 17:12:37 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
> 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?
Using lexbind, yes. Using `let', no.
> And
> is there a smarter way to do it?
> Sample code:
> (let ((data "my secret"))
> (lexical-let ((data data)) (lambda () data)))
When lexical-binding is set:
(let ((data "my secret"))
(lambda () data))
returns something like (closure ((data . "my secret") t) () data).
If you wan to hide the value, then use:
(let ((data (let ((sym (make-symbol "foo")))
(set sym "secret")
sym)))
(lambda () (symbol-value data)))
which is similar to the what lexical-let ends up doing.
Stefan
- lexbind ready for merge, Stefan Monnier, 2011/03/29
- Re: lexbind ready for merge, Daniel Colascione, 2011/03/29
- Re: lexbind ready for merge, Stefan Monnier, 2011/03/29
- Re: lexbind ready for merge, Daniel Colascione, 2011/03/30
- Re: lexbind ready for merge, Juanma Barranquero, 2011/03/30
- lexbind: how to replace lexical-let approach to hide secrets (was: lexbind ready for merge), Ted Zlatanov, 2011/03/30
- Re: lexbind: how to replace lexical-let approach to hide secrets,
Stefan Monnier <=
- Re: lexbind: how to replace lexical-let approach to hide secrets, David Kastrup, 2011/03/30
- Re: lexbind: how to replace lexical-let approach to hide secrets, Daniel Colascione, 2011/03/30
- Re: lexbind: how to replace lexical-let approach to hide secrets, Ted Zlatanov, 2011/03/31
- Re: lexbind: how to replace lexical-let approach to hide secrets, Stephen J. Turnbull, 2011/03/31
- Re: lexbind ready for merge, Daniel Colascione, 2011/03/30
- Re: lexbind ready for merge, Juanma Barranquero, 2011/03/30
- Re: lexbind ready for merge, Stefan Monnier, 2011/03/30
Re: lexbind ready for merge, Tassilo Horn, 2011/03/30