manpagez: man pages & more
info bigloo
Home | html | info | man
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

25.1.2 Importing an extern variable

The <variable-clause> denotes importation of variables.

 
<variable-clause> → ( <typed-ident> <c-name>)
     | (macro <typed-ident> <string>)
     | (macro <typed-ident> (<typed-ident>+) <string>)
     | (infix macro <typed-ident> (<typed-ident>+) <string>)

Only extern “non-macro” variables are mutable (that is mutable using the set! construction). Bigloo does not emit “extern C prototype” for variables introduced by a macro clause. <string> is the C name of variable. The Scheme name of that variable is extracted from the <typed-ident>.

Here is an example of variable importations:

 
(module example
   (extern (c-var::double "c_var")
           (macro bufsiz::long "BUFSIZ")))

(print "c-var: " c-var)
(set! c-var (+ 1.0 c-var))
(print "c-var: " c-var)
(print "bufsize: " BUFSIZ)

© manpagez.com 2000-2026
Individual documents may contain additional copyright information.