Trouble trying to understand how low level macros interact with module system.
"Igor Hjelmstrom Vinhas Ribeiro" <[email protected]> Sat, 29 Nov 2008 22:08:11 -0300
| Newsgroups | gmane.comp.java.sisc.user |
|---|---|
| Message-ID | <[email protected]> |
--===============3433032330915595010==
Content-Type: multipart/alternative;
boundary="----=_Part_77391_18334685.1228007291908"
------=_Part_77391_18334685.1228007291908
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Hello!
I am trying to understand how the module system used by SISC
interacts with the low-level macros that SISC supports.
Specifically, I am trying to figure out why the follow snippet of
code, an anonymous module that exports amacro and thefunc,
doesn't work.
(module (amacro thefunc)
(define-macro amacro (lambda () (thefunc)))
(define (thefunc) (display "\n\n===\n\n")))
After I pasted it in the REPL, when I call (amacro) I get:
#;> (amacro)
Error: undefined variable 'thefunc'.
console:16:7: <indeterminate call>
Curiously, if I just go ahead and type (thefunc) it works:
#;> (thefunc)
===
#;>
Is anyone able to explain to me why this happens?
Regards,
Igor.
------=_Part_77391_18334685.1228007291908
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Hello!<br><div class="gmail_quote"><br> I am trying to understand how the module system used by SISC<br>interacts with the low-level macros that SISC supports.<br><br> Specifically, I am trying to figure out why the follow snippet of<br>
code, an anonymous module that exports amacro and thefunc,<br>
doesn't work.<br><br> (module (amacro thefunc)<br> (define-macro amacro (lambda () (thefunc)))<br> (define (thefunc) (display "\n\n===\n\n")))<br><br> After I pasted it in the REPL, when I call (amacro) I get:<br>
<br> #;> (amacro)<br> Error: undefined variable 'thefunc'.<br> console:16:7: <indeterminate call><br><br> Curiously, if I just go ahead and type (thefunc) it works:<br><br> #;> (thefunc)<br><br>
<br> ===<br><br> #;> <br><br> Is anyone able to explain to me why this happens?<br><br>Regards,<br><font color="#888888"> Igor.<br>
</font></div><br>
------=_Part_77391_18334685.1228007291908--
--===============3433032330915595010==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
--===============3433032330915595010==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Sisc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sisc-users
--===============3433032330915595010==--