[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] [PATCH] Fix for #884
From: |
Felix |
Subject: |
Re: [Chicken-hackers] [PATCH] Fix for #884 |
Date: |
Sat, 07 Jul 2012 22:41:17 +0200 (CEST) |
From: Peter Bex <address@hidden>
Subject: [Chicken-hackers] [PATCH] Fix for #884
Date: Sat, 7 Jul 2012 11:56:13 +0200
> Hi all,
>
> Here's a patch that fixes #884. The problem was that when modules
> declarations are canonicalized, all subexpressions are canonicalized
> in the dynamic extent of a with-property-restore.
>
> The define-type call expands to a call to ##sys#put/restore!, which
> sets a property on the user-defined type's symbol which will be restored
> as soon as with-property-restore returns. Originally, ##core#the calls
> would simply be kept (but stripped of all syntax), which means the
> final form would be (##core#the footype #t '"bar"). This form survives
> the call to with-property-restore and thus the canonicalization process.
> (you can see this when you run "csc -scrutinize -debug 2 test.scm")
>
> The scrutinizer gets invoked much later when the complete source has
> been canonicalized, but at this time it doesn't know about this footype
> anymore and you get the error. The reason it works when the custom type
> is defined outside a module is because there is no with-property-restore
> call involved in canonicalization of the toplevel forms.
>
> The fix is simple; make the canonicalization process canonicalize type
> names to core names by looking up the custom name and converting it to
> a "core" typename while still inside the dynamic extent of
> the with-property-restore call in canonicalize-expression.
>
Not that I understood anything of the above, but I assume you know
what you're doing and pushed the patch.
cheers,
felix