guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: namespaces, goops, etc.


From: thi
Subject: Re: namespaces, goops, etc.
Date: Fri, 3 Nov 2000 13:29:45 -0800

   From: "Lars J. Aas" <address@hidden>
   Date: Fri, 3 Nov 2000 21:40:20 +0100

   Where is `export' documented?  Couldn't find any references to it
   anywhere...

i couldn't either, but here is the relevant entry from the ChangeLog:

1998-07-16  Mikael Djurfeldt  <address@hidden>

        * boot-9.scm (export, export-syntax): New special forms: Export
        bindings from a module.  `(export name1 name2 ...)' can be used at
        the top of a module (after `define-module') to specify which names
        should be exported.  It can be used as an alternative to
        `define-public'.  `export-syntax' works equivalently to `export'
        but is intended for export of syntactic keywords.

to be fair, i just tried to abuse `export' in the same way
`define-public' can be abused (see below).  guile didn't complain, but
the specified binding was not exported, so i guess there's some measure
of safety in using `export' over `define-public'...

thi


________________________
;;; random.scm

(define-module (my module))

(define (blah) #t)

(define (nothing-is-real)
  (export blah)
  #t)

(export nothing-is-real)


______________________________
guile> (version)
"1.4.1"
guile> (load 'random.scm)
guile> (use-modules (my module))
guile> nothing-is-real
#<procedure nothing-is-real ()>
guile> blah
ERROR: In expression blah:
ERROR: Unbound variable: blah
ABORT: (unbound-variable)
guile> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]