chicken-hackers
[Top][All Lists]
Advanced

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

[Chicken-hackers] [PATCH] Fix breakage for dependencies of foreigners an


From: Peter Bex
Subject: [Chicken-hackers] [PATCH] Fix breakage for dependencies of foreigners and bind egg (and a few more) due to keyword refactor
Date: Fri, 24 May 2019 22:44:01 +0200
User-agent: NeoMutt/20170113 (1.7.2)

Hi all,

Mario noticed that quite a few eggs broke after the keyword CR was
merged.  I had a look and it seems to be that many of them break
because of either bind (14 reverse dependencies) or foreigners (11
broken reverse dependencies), and they both do something to load
already compiled code at compile time.

It turns out that when this happens, and the compiled code being
executed inside the compiler registers an lf[] which refers to
a keyword, *and* that keyword had been interned already (typically
in the source which causes the compiled code to be loaded *afterwards*),
you'll get a weird error that says:

  Error: during expansion of (import ...) - bad argument type - not
     a symbol: #:destructor

Or something like it.

The minimal repo case I can come up with is:

$ cat foo-code.scm
(print #:foo)

$ cat test.scm
(begin-for-syntax (load "foo-code.so"))
(print #:foo)

$ csc -s foo-code.scm
$ csc test.scm

The fix is relatively straightforward, see attached patch.  It just
changes the check_ call to a predicate check for symbol or keyword.

Cheers,
Peter

Attachment: 0001-Fix-obscure-bug-triggered-by-marking-keywords-persis.patch
Description: Text Data

Attachment: signature.asc
Description: PGP signature


reply via email to

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