unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Loading multiple versions of a Module
@ 2020-05-01 22:28 Martin Becze
  2020-05-03 19:33 ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Martin Becze @ 2020-05-01 22:28 UTC (permalink / raw)
  To: guile-user

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?

Thanks!,
-Martin



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Loading multiple versions of a Module
  2020-05-01 22:28 Loading multiple versions of a Module Martin Becze
@ 2020-05-03 19:33 ` Ludovic Courtès
  2020-05-03 21:13   ` Martin Becze
  0 siblings, 1 reply; 4+ messages in thread
From: Ludovic Courtès @ 2020-05-03 19:33 UTC (permalink / raw)
  To: guile-user

Hi Martin,

Martin Becze <mjbecze@riseup.net> 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’.




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Loading multiple versions of a Module
  2020-05-03 19:33 ` Ludovic Courtès
@ 2020-05-03 21:13   ` Martin Becze
  2020-05-04  8:23     ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Martin Becze @ 2020-05-03 21:13 UTC (permalink / raw)
  To: guile-user, Ludovic Courtès

Would this be something that is open to change? Would there be an objections to changing this behavior? I think this problem will hurt modularity and growth of the guile ecosystem in the future. From a cursory look at the code I don't see any technical reason for this. 



On May 3, 2020 2:33:50 PM CDT, "Ludovic Courtès" <ludo@gnu.org> wrote:
>Hi Martin,
>
>Martin Becze <mjbecze@riseup.net> 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’.
>
>

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Loading multiple versions of a Module
  2020-05-03 21:13   ` Martin Becze
@ 2020-05-04  8:23     ` Ludovic Courtès
  0 siblings, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2020-05-04  8:23 UTC (permalink / raw)
  To: Martin Becze; +Cc: guile-user

Hi,

Martin Becze <mjbecze@riseup.net> skribis:

> Would this be something that is open to change? Would there be an objections to changing this behavior? I think this problem will hurt modularity and growth of the guile ecosystem in the future. From a cursory look at the code I don't see any technical reason for this. 

Currently, there’s a single module name space and version numbers are
not part of the module name (the R6RS module system arrived a decade or
two after Guile’s).

I think it would be interesting to allow for multiple versions of a
module to coexist (although a single application using several versions
of the same library may be problematic from an engineering viewpoint).
However, as always with this kind of change to the core, compatibility
considerations may make that endeavor very challenging.

Thanks,
Ludo’.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-05-04  8:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-01 22:28 Loading multiple versions of a Module Martin Becze
2020-05-03 19:33 ` Ludovic Courtès
2020-05-03 21:13   ` Martin Becze
2020-05-04  8:23     ` Ludovic Courtès

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).