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

Re: [Scheme-reports] Are generated toplevel definitions secret?



On Tue, May 24, 2011 at 11:15 PM, Aaron W. Hsu <arcfide@x> wrote:
> On Tue, 24 May 2011 17:10:50 -0400, Andy Wingo <wingo@x> wrote:
>
>> Well why not have the name of "t" be "t" plus some string which depends
>> only on the incoming form -- like its hash value.  (Or the outgoing
>> form; the considerations are different but similar.)
>
>> That way you do preserve the "compatible recompilation" aspect, trading
>> off true secrecy, but hey.  Oh well.
>
> I am interested to see if you come up with something that preserves this
> capability while preserving hygiene. A straight hash of the input form
> will not be enough, because the form could be evaluated multiple times,
> and each time it would have to have a different identifier internally.
>

One thing I was playing around with in my Scheme dialect was an
extension to syntax rules (as well as quasi-syntax) that had a
unquote-uniq; so for the example Andy Wingo gave earlier:

  (define-syntax define-const
    (syntax-rules ((t ,$t))
      ((_ name val)
       (define t val)
       (define-syntax name (syntax-rules () ((_) t))))))

,$ was usually bound to gensym, but it could be bound to UUID-5 or the
like. I haven't used it much, nor studied the implications thereof,
but would something like this satisfy the problem?

>        Aaron W. Hsu

 -- Sz.



-- 
====
Q. How many Prolog programmers does it take to change a lightbulb?
A. No.

_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports