emacs-devel
[Top][All Lists]
Advanced

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

Re: lexbind: how to replace lexical-let approach to hide secrets


From: David Kastrup
Subject: Re: lexbind: how to replace lexical-let approach to hide secrets
Date: Wed, 30 Mar 2011 23:56:59 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

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

All of which, by necessity, contain the necessary material to get at the
secret in the bytecode/closure/funcell.  Where, of course, it is
reasonable easy to retrieve it.  And that is actually overkill, since
you can always just call that closure.

Anybody care to tell me what the point of this exercise is actually
supposed to be?

-- 
David Kastrup




reply via email to

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