Re: [Chicken-users] unbound variable: export

2006-10-23 Thread felix winkelmann

On 10/23/06, Andreas Zwinkau [EMAIL PROTECTED] wrote:

On Mon, 23 Oct 2006 08:20:51 +0200
felix winkelmann [EMAIL PROTECTED] wrote:
 Can you provide the exact compilation instructions you
 used to build cackle-base.so?
Just csc -s cackle-base.scm.

I uploaded the relevant files to http://beza1e1.tuxen.de/files/cackle/


Thanks - I could reproduce the problem.

This is caused by several things working in conjunction here:
syntax-case expands each toplevel-expression completely before it is passed to
the evaluator/compiler. The include forms in cackle-base.scm are toplevel-
expressions and when they include the code of the other files, the
(use syntax-case)
in cackle-dispatch.scm will replace the (toplevel-) macro-expander by a new
one, but that will only be in effect when the next toplevel expression is
expanded. The current one is still expanded by the low-level/define-macro
expander, which handles declare differently than syntax-case.

A solution is to put the (use syntax-case) into cackle-base.scm (for example
right at the start). It also emphasizes that all included files use the same
language (i.e. chicken + syntax-case).


cheers,
felix

--
http://galinha.ucpel.tche.br:8081/blog/blog.ssp


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] unbound variable: export

2006-10-21 Thread Andreas Zwinkau
I'm trying to build an egg, but can't get a working shared library:

 csi cackle-base.so 
Version 2, Build 3 - linux-unix-gnu-x86 - [ dload ptables ]
(c)2000-2005 Felix L. Winkelmann
; loading cackle-base.so ...
; loading /usr/lib/chicken/http-server.so ...
; loading library regex ...
; loading /usr/lib/chicken/http-utils.so ...
Error: unbound variable: export
 csi  
Version 2, Build 3 - linux-unix-gnu-x86 - [ dload ptables ]
(c)2000-2005 Felix L. Winkelmann
#;1 (load-library 'cackle-base)
; loading library cackle-base ...
Error: (load-library) unable to load library
cackle-base
#f

The library cackle-base is a base file, which includes three other
files. All these files have their own use and declare export
statements. Is that a problem? The unbound variable error seems to
occur, when it comes to the second included file.

-- 
Gottes Segen!
Andi


  | Mail: [EMAIL PROTECTED] 
  | Web: http://beza1e1.tuxen.de
  | Jabber: [EMAIL PROTECTED]


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] unbound variable: export

2006-10-21 Thread felix winkelmann

On 10/21/06, Andreas Zwinkau [EMAIL PROTECTED] wrote:

I'm trying to build an egg, but can't get a working shared library:

 csi cackle-base.so
Version 2, Build 3 - linux-unix-gnu-x86 - [ dload ptables ]
(c)2000-2005 Felix L. Winkelmann
; loading cackle-base.so ...
; loading /usr/lib/chicken/http-server.so ...
; loading library regex ...
; loading /usr/lib/chicken/http-utils.so ...
Error: unbound variable: export
 csi
Version 2, Build 3 - linux-unix-gnu-x86 - [ dload ptables ]
(c)2000-2005 Felix L. Winkelmann
#;1 (load-library 'cackle-base)
; loading library cackle-base ...
Error: (load-library) unable to load library
cackle-base
#f

The library cackle-base is a base file, which includes three other
files. All these files have their own use and declare export
statements. Is that a problem? The unbound variable error seems to
occur, when it comes to the second included file.


How exactly are you using export? If you compiled cackle-base.scm
with the -shared option, load-library will not work, BTW.


cheers,
felix


--
http://galinha.ucpel.tche.br:8081/blog/blog.ssp


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] unbound variable: export

2006-10-21 Thread Andreas Zwinkau
 How exactly are you using export? 

$ cat cackle-base.scm 
(define-extension cackle-base)
(include cackle-server.scm)
[...]
$ cat cackle-server.scm 
(use http-server http-utils)
(declare (export cackle:server))
[...]

 If you compiled cackle-base.scm with the -shared option,
 load-library will not work, BTW.
I'm confused about load-library now, because i thought, this is
exactly what it is used for??

-- 
Gottes Segen!
Andi


  | Mail: [EMAIL PROTECTED] 
  | Web: http://beza1e1.tuxen.de
  | Jabber: [EMAIL PROTECTED]


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users