unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Advice for importing things in a Guile module
@ 2023-06-29  9:35 Zelphir Kaltstahl
  2023-12-24 16:19 ` Zelphir Kaltstahl
  2023-12-25 23:23 ` Maxime Devos
  0 siblings, 2 replies; 3+ messages in thread
From: Zelphir Kaltstahl @ 2023-06-29  9:35 UTC (permalink / raw)
  To: Guile User

Hello Guile Users!

Due to https://lists.gnu.org/archive/html/guile-user/2023-06/msg00020.html I am 
currently relying on `define-module', instead of `library'. However, I have not 
found a way to do the `(import (except (something) excluded-binding ...))' 
thing. So I have imports looking like the following example:

~~~~
(define-module (encode)
   #:use-module (rnrs base)
   #:use-module ((guile)
                 #:select (lambda* λ))

   ;; SRFI 1: list procedures
   #:use-module ((srfi srfi-1)
                 #:select (drop take first second third))

   ;; and more stuff here ...
   )
~~~~

However, this results in warnings when loading (load "filename.scm") the module, 
such as:

~~~~
WARNING: (encode): `map' imported from both (rnrs base) and (srfi srfi-1)
~~~~

What can I do to use everything from rnrs base, except where things clash and 
avoid the warnings? Is there a way with `define-module' to import everything 
except something specific?

Currently, it seems to me that `define-module' is more flexible, when it comes 
to re-exporting things, but `library' more flexible when importing things.

Best regards,
Zelphir

-- 
repositories:https://notabug.org/ZelphirKaltstahl


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

* Re: Advice for importing things in a Guile module
  2023-06-29  9:35 Advice for importing things in a Guile module Zelphir Kaltstahl
@ 2023-12-24 16:19 ` Zelphir Kaltstahl
  2023-12-25 23:23 ` Maxime Devos
  1 sibling, 0 replies; 3+ messages in thread
From: Zelphir Kaltstahl @ 2023-12-24 16:19 UTC (permalink / raw)
  To: guile-user

Hello Guile Users!

Does anyone know more about this?

I wish you all a merry Christmas or other holiday you might be celebrating.
Zelphir

On 6/29/23 11:35, Zelphir Kaltstahl wrote:
> Hello Guile Users!
>
> Due to https://lists.gnu.org/archive/html/guile-user/2023-06/msg00020.html I 
> am currently relying on `define-module', instead of `library'. However, I have 
> not found a way to do the `(import (except (something) excluded-binding ...))' 
> thing. So I have imports looking like the following example:
>
> ~~~~
> (define-module (encode)
>   #:use-module (rnrs base)
>   #:use-module ((guile)
>                 #:select (lambda* λ))
>
>   ;; SRFI 1: list procedures
>   #:use-module ((srfi srfi-1)
>                 #:select (drop take first second third))
>
>   ;; and more stuff here ...
>   )
> ~~~~
>
> However, this results in warnings when loading (load "filename.scm") the 
> module, such as:
>
> ~~~~
> WARNING: (encode): `map' imported from both (rnrs base) and (srfi srfi-1)
> ~~~~
>
> What can I do to use everything from rnrs base, except where things clash and 
> avoid the warnings? Is there a way with `define-module' to import everything 
> except something specific?
>
> Currently, it seems to me that `define-module' is more flexible, when it comes 
> to re-exporting things, but `library' more flexible when importing things.
>
> Best regards,
> Zelphir
>
-- 
repositories: https://notabug.org/ZelphirKaltstahl




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

* Re: Advice for importing things in a Guile module
  2023-06-29  9:35 Advice for importing things in a Guile module Zelphir Kaltstahl
  2023-12-24 16:19 ` Zelphir Kaltstahl
@ 2023-12-25 23:23 ` Maxime Devos
  1 sibling, 0 replies; 3+ messages in thread
From: Maxime Devos @ 2023-12-25 23:23 UTC (permalink / raw)
  To: Zelphir Kaltstahl, Guile User


[-- Attachment #1.1.1: Type: text/plain, Size: 678 bytes --]



Op 29-06-2023 om 11:35 schreef Zelphir Kaltstahl:
> What can I do to use everything from rnrs base, except where things 
> clash and avoid the warnings?
Set #:duplicates to (last), and order things from low-preference to high 
preference (like you are doing currently). Alternatively, set it to 
(first) and do things in the reverse order.

(See: (guile)Creating Guile modules. Untested.).

> Is there a way with `define-module' to 
> import everything except something specific?

Yes, modify Guile to implement such functionality.  Given that such 
functionality exists for (define-)library, it wouldn't expect much trouble.

Best regards,
Maxime Devos.

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 929 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

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

end of thread, other threads:[~2023-12-25 23:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-29  9:35 Advice for importing things in a Guile module Zelphir Kaltstahl
2023-12-24 16:19 ` Zelphir Kaltstahl
2023-12-25 23:23 ` Maxime Devos

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