Trouble trying to understand how low level macros interact with module system.

"Igor Hjelmstrom Vinhas Ribeiro" <[email protected]> Sat, 29 Nov 2008 22:02:51 -0300
Newsgroups gmane.comp.java.sisc.user
Message-ID <[email protected]>
--===============3183543746590291518==
Content-Type: multipart/alternative; 
	boundary="----=_Part_77378_32493842.1228006971630"

------=_Part_77378_32493842.1228006971630
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_77378_32493842.1228006971630
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hello!<br><br>&nbsp;&nbsp; I am trying to understand how the module system used by SISC<br>interacts with the low-level macros that SISC supports.<br><br>&nbsp; Specifically, I am trying to figure out why the follow snippet of<br>&nbsp; code, an anonymous module that exports amacro and thefunc,<br>
&nbsp; doesn&#39;t work.<br><br>&nbsp;&nbsp; (module (amacro thefunc)<br>&nbsp; &nbsp;&nbsp; (define-macro amacro (lambda () (thefunc)))<br>&nbsp; &nbsp;&nbsp; (define (thefunc) (display &quot;\n\n===\n\n&quot;)))<br><br>&nbsp; After I pasted it in the REPL, when I call (amacro) I get:<br>
<br>&nbsp;&nbsp; #;&gt; (amacro)<br>&nbsp;&nbsp; Error: undefined variable &#39;thefunc&#39;.<br>&nbsp;&nbsp; console:16:7: &lt;indeterminate call&gt;<br><br>&nbsp; Curiously, if I just go ahead and type (thefunc) it works:<br><br>&nbsp;&nbsp; #;&gt; (thefunc)<br><br>
<br>&nbsp;&nbsp; ===<br><br>&nbsp;&nbsp; #;&gt; <br><br>&nbsp;&nbsp; Is anyone able to explain to me why this happens?<br><br>Regards,<br>&nbsp;Igor.<br>

------=_Part_77378_32493842.1228006971630--


--===============3183543746590291518==
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=/
--===============3183543746590291518==
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

--===============3183543746590291518==--