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

27.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)

This document was generated on March 31, 2014 using texi2html 5.0.

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