[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] set-read-syntax!
From: |
Felix |
Subject: |
Re: [Chicken-hackers] set-read-syntax! |
Date: |
Wed, 21 Apr 2010 20:23:02 +0200 (CEST) |
From: Jim Ursetto <address@hidden>
Subject: [Chicken-hackers] set-read-syntax!
Date: Tue, 20 Apr 2010 02:05:46 -0500
> I have a module "foo" that uses set-read-syntax!. Although this is a
> form of syntax, it is not stored in the .import file with macro
> syntax. Therefore it will not be available at compile time when a
> user does (use foo).
>
> The Chicken 3 solution is to force users to compile with -X foo if
> they want the read syntax. That seems excessive for Chicken 4--no
> need to load the entire module at compile time--but I don't know any
> other way to do it. Except if I make a separate file
> "foo-read-syntax" with just the set-read-syntax! call, which the user
> must still load with `-X foo-read-syntax`.
>
> Other solutions?
>
You can use `begin-for-syntax' to place arbitrary code into the import
library. The real problem here is that the currently compiled file is
read *before* resolving imports, so the read syntax is available too
late. I can currently not provide anything better than what you suggest.
cheers,
felix