|
From: | Abdulaziz Ghuloum |
Subject: | Re: [Chicken-users] Problem accessing macro from module |
Date: | Mon, 22 Jan 2007 12:50:20 -0500 |
On Jan 22, 2007, at 12:00 PM, address@hidden wrote:
Not all Scheme compilers do so. For example, under my (unreleased) compiler: $ cat pfn.scm (define-syntax fn (syntax-rules () ((fn (p ...) body) (lambda (p ...) body)) ((fn name (p ...) body) (define (name p ...) body)))) (fn hello-world () (display "Hello, world!\n")) $ cat weird.scm (load "pfn.so") (hello-world) (fn goodbye-world () (display "Goodbye, cruel world!\n")) (goodbye-world) $ ikarus Ikarus Scheme (Build 2007-01-22) Copyright (c) 2006-2007 Abdulaziz Ghuloum > (compile-file "pfn.scm" "pfn.so" 'replace) > ^D $ ikarus Ikarus Scheme (Build 2007-01-22) Copyright (c) 2006-2007 Abdulaziz Ghuloum > (load "weird.scm") Hello, world! Goodbye, cruel world! > ^D The problem is that chicken does not have proper integration of psyntax. This shows up in many places (try changing the value of memv and use case when syntax-case is loaded; or try changing lambda and use let). This behavior is found in not only chicken but in almost all systems that use psyntax (other than Chez and Ikarus). For compilable macros to work, a few minor changes need to be made to the psyntax implementation (egg) in chicken. Mainly, the ctem and rtem values need to be set to appropriate values when evaluating in the repl and when compiling a file. (described in psyntax.ss under /Initial mode sets/.) Aziz,,, |
[Prev in Thread] | Current Thread | [Next in Thread] |