On Mon, Mar 10, 2014 at 01:26:08PM +0100, Sandra Snan wrote:
> Dear chicken-users;
> I have a simple program that does most of its heavy lifting at compile
> time.
> 
> To demonstrate the issue, I've written two stubs (as simple as I could
> make them but still show the issue I'm having).
> 
> File number one is called ticket-stub.scm:
> -----8<----
> (use s (srfi 1))
> 
> (define-syntax create-tickets
>   (ir-macro-transformer
>    (lambda (f i c)
>      `(list
>        ,@(filter-map
>         (lambda (x)
>           (if (s-contains? "enemy-" x)
>               #f
>               (s-prepend "friendly-" x)))
>         cells)))))
> 
> (print (first (create-tickets)))
> ----->8----

Hello Sandra,

The above program uses the procedures provided by the "s" egg at
expansion time, so you need to load and import them at the syntax level:

(begin-for-syntax (use s))

Or, in newer CHICKENs:

(use-for-syntax s)

The reason it worked with 4.7.0 and not with 4.8.0 is that this is
really a bug: at compile time, procedures imported for runtime should
not be available unless they're explicitly imported.  That's the
entry in 4.8.0's NEWS: "Fixed a bug that caused imported identifiers
to leak into the macroexpansion/compile-time environment"

Cheers,
Peter
-- 
http://www.more-magic.net

_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to