unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Weird import behaviour of digital modules
@ 2024-06-07 19:51 Yuval Langer
  2024-06-08 13:59 ` lloda
  0 siblings, 1 reply; 4+ messages in thread
From: Yuval Langer @ 2024-06-07 19:51 UTC (permalink / raw)
  To: guile-user

In this commit I have the WEIRDEST behaviour:

https://codeberg.org/kakafarm/guile-srfi-189/commit/6e72cc50cc6b068de726f6e97b249a5af26d883c

When I run the following command at the repository worktree root:

```
guix shell -C guile -- guile -L . test-guile.scm
```

all tests pass, but at line 24 of test-body.scm we have:

```
(import (srfi 189))
```

and that should not work on Guile, right?  That's why we have SRFIs
located at `(srfi srfi-189)`, no?

Thank you,
Yuval Langer.



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

* Re: Weird import behaviour of digital modules
  2024-06-07 19:51 Weird import behaviour of digital modules Yuval Langer
@ 2024-06-08 13:59 ` lloda
  2024-06-08 17:30   ` Tomas Volf
  0 siblings, 1 reply; 4+ messages in thread
From: lloda @ 2024-06-08 13:59 UTC (permalink / raw)
  To: Yuval Langer; +Cc: guile-user



> On 7 Jun 2024, at 21:51, Yuval Langer <yuval.langer@gmail.com> wrote:
> 
> In this commit I have the WEIRDEST behaviour:
> 
> https://codeberg.org/kakafarm/guile-srfi-189/commit/6e72cc50cc6b068de726f6e97b249a5af26d883c
> 
> When I run the following command at the repository worktree root:
> 
> ```
> guix shell -C guile -- guile -L . test-guile.scm
> ```
> 
> all tests pass, but at line 24 of test-body.scm we have:
> 
> ```
> (import (srfi 189))
> ```
> 
> and that should not work on Guile, right?  That's why we have SRFIs
> located at `(srfi srfi-189)`, no?
> 
> Thank you,
> Yuval Langer.

hi Yuval, 

guile has supported the format (srfi n) in import clauses for a while. Modules can't have numbers as names in general, this only works for srfis and specifically for this format. For example (srfi 4 gnu) won't work. Also only import works, not use-modules. Iirc the support was added for r6rs or r7rs compatibility.

regards




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

* Re: Weird import behaviour of digital modules
  2024-06-08 13:59 ` lloda
@ 2024-06-08 17:30   ` Tomas Volf
  2024-06-08 21:15     ` lloda
  0 siblings, 1 reply; 4+ messages in thread
From: Tomas Volf @ 2024-06-08 17:30 UTC (permalink / raw)
  To: lloda; +Cc: Yuval Langer, guile-user

[-- Attachment #1: Type: text/plain, Size: 443 bytes --]

On 2024-06-08 15:59:12 +0200, lloda wrote:
> Modules can't have numbers as names in general

Modules most definitely *can* have numbers as names, my Advent of Code solutions
are stored in files matching $YEAR/$DAY pattern (e.g. 2023/01.scm) and it works
just fine, both define-module and use-modules.

Have a nice day,
Tomas Volf

--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: Weird import behaviour of digital modules
  2024-06-08 17:30   ` Tomas Volf
@ 2024-06-08 21:15     ` lloda
  0 siblings, 0 replies; 4+ messages in thread
From: lloda @ 2024-06-08 21:15 UTC (permalink / raw)
  To: Tomas Volf; +Cc: Yuval Langer, guile-user



> On 8 Jun 2024, at 19:30, Tomas Volf <~@wolfsden.cz> wrote:
> 
> On 2024-06-08 15:59:12 +0200, lloda wrote:
>> Modules can't have numbers as names in general
> 
> Modules most definitely *can* have numbers as names, my Advent of Code solutions
> are stored in files matching $YEAR/$DAY pattern (e.g. 2023/01.scm) and it works
> just fine, both define-module and use-modules.

i stand corrected. But then why isn't srfi/n a symlink to srfi/srfi-n instead of the way it's done that only works with import?

regards

  daniel


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

end of thread, other threads:[~2024-06-08 21:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-07 19:51 Weird import behaviour of digital modules Yuval Langer
2024-06-08 13:59 ` lloda
2024-06-08 17:30   ` Tomas Volf
2024-06-08 21:15     ` lloda

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