[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Loading multiple versions of a Module
From: |
Ludovic Courtès |
Subject: |
Re: Loading multiple versions of a Module |
Date: |
Sun, 03 May 2020 21:33:50 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) |
Hi Martin,
Martin Becze <address@hidden> skribis:
> Guile currently doesn't allow loading multiple versions of a Module. For
> example this will not work.
>
> --- start.scm
> (import (a) (b (2)))
> (helloA)
> (helloB)
>
> --- a/a.scm
> (library (a)
> (export helloA)
> (import (rnrs) (b (1)))
> (define helloA (lambda ()
> (display "hello from A1\n")
> (helloB))))
>
> --- b1/b.scm
> (library (b (1))
> (export helloB)
> (import (rnrs)))
>
> (define helloB (lambda ()
> (display "hello from B1\n")))
>
> --- b2/b.scm
> (library (b (2))
> (export helloB)
> (import (rnrs))
> (define helloB (lambda () (display "hello from B2\n"))))
>
> Is there are away to get around this? What is the reason for this
> behavior? Is it part of r6rs or something?
I’m not sure what R6RS says, but Guile supports only one instance of a
module with a given name at run time.
The only way around it would be to give the two modules different names.
HTH,
Ludo’.