mit-scheme-devel
[Top][All Lists]
Advanced

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

Re: [MIT-Scheme-devel] fasl hook or something


From: Joe Marshall
Subject: Re: [MIT-Scheme-devel] fasl hook or something
Date: Tue, 11 May 2010 10:24:56 -0700

On Tue, May 11, 2010 at 9:47 AM, Matt Birkholz
<address@hidden> wrote:
>> From: Joe Marshall <address@hidden>
>> Date: Mon, 10 May 2010 16:59:53 -0700
>>
>> The reason I want to intern is to have EQ-ness.
>
> My definition of intern refers specifically to eq?.  If
>
>        (not (eq? (thing.unique t1) (thing.unique t2)))
>
> then the re-intern-unique function needs some work.

Specifically, I want (eq? t1 t2)

> What are you dumping?  It is one object -- a "wrapper" object?
> Whether an rb-tree or just a list of data, you must provide a working
> re-intern-datum function, and run it over the fasloaded copy, no?
>
> How about using the existing fasl hook, i.e. the load function?  Dump
> code.
>
>    (map re-intern-datum '(#[datum 1] #[datum 2] #[datum 3]))
>
> That gets the work done at load time.
>
> Warmer?  Can I get a usage case?  Someone is flying blind here.  :-}


The specific case I had in mind was timestamps (as their own datatype,
not as universal times).  I'd like it to be the case that they are interned,
so that (eq? t1 t2) is true iff t1 and t2 are the same instant of time.  I don't
want to have a special (timestamp=? t1 t2) function.

The problem occurs if someone writes a program with a form like this in it:

(define *jan-1-2000* (make-timestamp (make-decoded-time 0 0 0 1 1 2000)))

and then they compile the program.  I want the timestamp to be reconstructed
and re-interned when the program is loaded so that it remains EQ? to existing
timestamps.



-- 
~jrm



reply via email to

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