guile-user
[Top][All Lists]
Advanced

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

Re: Newbie seeks guiding hands.


From: Gary Benson
Subject: Re: Newbie seeks guiding hands.
Date: Fri, 23 Mar 2001 16:54:32 +0000 (GMT)

On 23 Mar 2001, Rob Browning wrote:

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

What does the use-module (ice-9 slib) bit mean?

> 
>   ;; 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
> 

[ address@hidden ][ PGP 85A8F78B ][ http://inauspicious.org/ ]




reply via email to

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