[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] s11n among different chicken versions
From: |
Daishi Kato |
Subject: |
Re: [Chicken-users] s11n among different chicken versions |
Date: |
Mon, 7 Aug 2006 17:04:54 +0900 |
On 8/7/06, felix winkelmann <address@hidden> wrote:
On 8/7/06, Daishi Kato <address@hidden> wrote:
>
> If the procedure ID is really re-used, the fallback procedure is never
> called, isn't it?
That's correct, unfortunately.
OK, I found another weird behavior.
Procedures of hash-tables are referenced in a dump file,
but when I run deserialize (w/ different chicken version),
the fallback is called more then once for the same ID.
I'm afraid there is a bug in backref handling with the procedure
returned by the fallback.
>
> If I could not find any solution to this, my final resort would be
> editting the binary dump file to change procedure IDs.
I think it would be better to write a custom version of
"deserialize", the last few lines look like this:
(switch tag
...
(procedure-tag
(let ((id (fetch)))
;; >>>>>> do some custom processing here <<<<<<<<<<<
(cond ((##core#inline "set_procedure_ptr" x
(##sys#make-c-string id))
(fetchslots x 1) )
(fallback
(let ((proc (fallback id)))
(vector-set! backrefs r proc)
proc) )
(else (error 'deserialize "unable to deserialize
procedure - no
table entry found" id))) ) )
(else (error 'deserialize "invalid tag" tag)) ) ) ) ) ) )
(fetch) ) )
It shouldn't be to hard to add some hook there to do any custom
handling of specific IDs. But, again, it's slippy terrain you're moving
on.
I understand it's slippy, but I also think it's useful.
Isn't it possible to add a trap at "do some custom processing here"
that calls an optional procedure, just like the fallback procedure,
so that I don't need to modify the s11n code?
In this case, it is desired to pass not only a procedure ID but also
the lambda info that is shown when you run chicken-dump.
I hope this makes sense.
Daishi