guile-user
[Top][All Lists]
Advanced

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

Re: Newbie seeks guiding hands.


From: Rob Browning
Subject: Re: Newbie seeks guiding hands.
Date: 23 Mar 2001 11:07:34 -0600
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

Gary Benson <address@hidden> writes:

> How do modules work? Would they, for instance, allow me to write a
> function called evaluate, safe in the knowledge that it would not
> conflict with functions called evaluate in other parts of the code?

Exactly.  So you can say:

  (define-module (benson-project good-bits)
    :use-module (ice-9 slib))

  ;; or just (use-modules (ice-9 slib)) here instead...

  (define (some-local-function x y z)
    ;; whatever
    result)

  (define (some-global-function a b c d)
    (+ (some-local-function a b c)
       d))

  (export some-global-function)

Now if other code calls

  (use-modules (benson-project good-bits))

they'll be able to use some-global-function, but won't be able to see
some-local-function...

Hope this helps.

-- 
Rob Browning <address@hidden> PGP=E80E0D04F521A094 532B97F5D64E3930



reply via email to

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