unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Unable to import (ice-9 psyntax)
@ 2023-02-15  2:14 Robby Zambito
  2023-02-15  6:43 ` Damien Mattei
  2023-02-16 11:23 ` Maxime Devos
  0 siblings, 2 replies; 8+ messages in thread
From: Robby Zambito @ 2023-02-15  2:14 UTC (permalink / raw)
  To: guile-user

Hello,

For some reason I am having trouble importing the (ice-9 psyntax)
module. Whenever I try to import it, I get the following error:

scheme@(guile-user)> (import (ice-9 psyntax))
While compiling expression:
No variable named syntax? in #<module (#{ g122}#) 7f539f071320>

I have Guile 3.0.9 installed from Guix, running on x86_64. I've tried
using a Guix pure container, importing it transitively through R7RS
libraries rather than directly in the REPL. All yield the same error.

Any ideas would be appreciated :)

Robby



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

* Re: Unable to import (ice-9 psyntax)
  2023-02-15  2:14 Unable to import (ice-9 psyntax) Robby Zambito
@ 2023-02-15  6:43 ` Damien Mattei
  2023-02-15 20:18   ` Maxime Devos
  2023-02-16 11:23 ` Maxime Devos
  1 sibling, 1 reply; 8+ messages in thread
From: Damien Mattei @ 2023-02-15  6:43 UTC (permalink / raw)
  To: Robby Zambito; +Cc: guile-user

same problem:

(base) mattei@MacBook-Pro-Touch-Bar library-FunctProg % guile
GNU Guile 3.0.8.99-f3ea8
Copyright (C) 1995-2022 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guile-user)> (import (ice-9 psyntax))
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-auto-compile argument to disable.
;;; compiling /usr/local/share/guile/3.0/ice-9/psyntax.scm
;;; compiled
/Users/mattei/.cache/guile/ccache/3.0-LE-8-4.6/usr/local/share/guile/3.0/ice-9/psyntax.scm.go
While compiling expression:
No variable named syntax? in #<module (#{ g116}#) 1017f9320>
scheme@(guile-user)>

On Wed, Feb 15, 2023 at 3:21 AM Robby Zambito <contact@robbyzambito.me>
wrote:

> Hello,
>
> For some reason I am having trouble importing the (ice-9 psyntax)
> module. Whenever I try to import it, I get the following error:
>
> scheme@(guile-user)> (import (ice-9 psyntax))
> While compiling expression:
> No variable named syntax? in #<module (#{ g122}#) 7f539f071320>
>
> I have Guile 3.0.9 installed from Guix, running on x86_64. I've tried
> using a Guix pure container, importing it transitively through R7RS
> libraries rather than directly in the REPL. All yield the same error.
>
> Any ideas would be appreciated :)
>
> Robby
>
>


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

* Re: Unable to import (ice-9 psyntax)
  2023-02-15  6:43 ` Damien Mattei
@ 2023-02-15 20:18   ` Maxime Devos
  2023-02-15 23:48     ` Damien Mattei
  0 siblings, 1 reply; 8+ messages in thread
From: Maxime Devos @ 2023-02-15 20:18 UTC (permalink / raw)
  To: Damien Mattei, Robby Zambito; +Cc: guile-user


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



On 15-02-2023 07:43, Damien Mattei wrote:
> same problem:
> 
> (base) mattei@MacBook-Pro-Touch-Bar library-FunctProg % guile
> GNU Guile 3.0.8.99-f3ea8
> Copyright (C) 1995-2022 Free Software Foundation, Inc.
> 
> Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
> This program is free software, and you are welcome to redistribute it
> under certain conditions; type `,show c' for details.
> 
> Enter `,help' for help.
> scheme@(guile-user)> (import (ice-9 psyntax))
> ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
> ;;;       or pass the --no-auto-compile argument to disable.
> ;;; compiling /usr/local/share/guile/3.0/ice-9/psyntax.scm
> ;;; compiled
> /Users/mattei/.cache/guile/ccache/3.0-LE-8-4.6/usr/local/share/guile/3.0/ice-9/psyntax.scm.go
> While compiling expression:
> No variable named syntax? in #<module (#{ g116}#) 1017f9320>
> scheme@(guile-user)>

Questions:

   * is /usr/local/lib/guile/3.0/ccache present in %load-compiled-path?
   * does /usr/local/lib/guile/3.0/ccache exist?
   * does /usr/local/lib/guile/3.0/ccache/ice-9/psyntax.go exist?
   * is /usr/local/lib/guile/3.0/ccache/ice-9/psyntax.go newer than
     /usr/local/share/guile/3.0/ice-9/psyntax.scm going by mtime?

Greetings,
Maxime

[-- 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] 8+ messages in thread

* Re: Unable to import (ice-9 psyntax)
  2023-02-15 20:18   ` Maxime Devos
@ 2023-02-15 23:48     ` Damien Mattei
  2023-02-16 11:18       ` Maxime Devos
  0 siblings, 1 reply; 8+ messages in thread
From: Damien Mattei @ 2023-02-15 23:48 UTC (permalink / raw)
  To: Maxime Devos; +Cc: Robby Zambito, guile-user

On Wed, Feb 15, 2023 at 9:18 PM Maxime Devos <maximedevos@telenet.be> wrote:

>
>
> On 15-02-2023 07:43, Damien Mattei wrote:
> > same problem:
> >
> > (base) mattei@MacBook-Pro-Touch-Bar library-FunctProg % guile
> > GNU Guile 3.0.8.99-f3ea8
> > Copyright (C) 1995-2022 Free Software Foundation, Inc.
> >
> > Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
> > This program is free software, and you are welcome to redistribute it
> > under certain conditions; type `,show c' for details.
> >
> > Enter `,help' for help.
> > scheme@(guile-user)> (import (ice-9 psyntax))
> > ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
> > ;;;       or pass the --no-auto-compile argument to disable.
> > ;;; compiling /usr/local/share/guile/3.0/ice-9/psyntax.scm
> > ;;; compiled
> >
> /Users/mattei/.cache/guile/ccache/3.0-LE-8-4.6/usr/local/share/guile/3.0/ice-9/psyntax.scm.go
> > While compiling expression:
> > No variable named syntax? in #<module (#{ g116}#) 1017f9320>
> > scheme@(guile-user)>
>
> Questions:
>
>    * is /usr/local/lib/guile/3.0/ccache present in %load-compiled-path?
>
yes :
scheme@(guile-user)> %load-compiled-path
$1 = ("/opt/homebrew/lib/guile/3.0/site-ccache"
"/usr/local/lib/guile/3.0/ccache" "/usr/local/lib/guile/3.0/site-ccache")


>    * does /usr/local/lib/guile/3.0/ccache exist?
>
yes

>    * does /usr/local/lib/guile/3.0/ccache/ice-9/psyntax.go exist?
>
no:
-rw-r--r--   1 root  wheel   88581 12 jan 08:12 pretty-print.go
-rw-r--r--   1 root  wheel  516629 12 jan 08:12 psyntax-pp.go
-rw-r--r--   1 root  wheel   76493 12 jan 08:12 q.go


   * is /usr/local/lib/guile/3.0/ccache/ice-9/psyntax.go newer than
>      /usr/local/share/guile/3.0/ice-9/psyntax.scm going by mtime?
>

-rw-r--r--   1 root  wheel  188229 12 jan 08:12 psyntax-pp.scm
-rw-r--r--   1 root  wheel  153430 12 jan 08:12 psyntax.scm

>
> Greetings,
> Maxime
>

note that this problem is not affecting my codes....
Damien


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

* Re: Unable to import (ice-9 psyntax)
  2023-02-15 23:48     ` Damien Mattei
@ 2023-02-16 11:18       ` Maxime Devos
  2023-02-16 11:26         ` Maxime Devos
  0 siblings, 1 reply; 8+ messages in thread
From: Maxime Devos @ 2023-02-16 11:18 UTC (permalink / raw)
  To: Damien Mattei; +Cc: Robby Zambito, guile-user


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



On 16-02-2023 00:48, Damien Mattei wrote:
> -rw-r--r--   1 root  wheel  516629 12 jan 08:12 psyntax-pp.go
 > [...]
> 
> 
>         * is /usr/local/lib/guile/3.0/ccache/ice-9/psyntax.go newer than
>           /usr/local/share/guile/3.0/ice-9/psyntax.scm going by mtime?
> 
> 
> -rw-r--r--   1 root  wheel  188229 12 jan 08:12 psyntax-pp.scm


 From the information you have given me, I can't tell which one is 
newest.  You'll need to provide the milliseconds or more precise.

Greetings,
Maxime.

[-- 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] 8+ messages in thread

* Re: Unable to import (ice-9 psyntax)
  2023-02-15  2:14 Unable to import (ice-9 psyntax) Robby Zambito
  2023-02-15  6:43 ` Damien Mattei
@ 2023-02-16 11:23 ` Maxime Devos
  2023-02-16 13:39   ` Robby Zambito
  1 sibling, 1 reply; 8+ messages in thread
From: Maxime Devos @ 2023-02-16 11:23 UTC (permalink / raw)
  To: Robby Zambito, guile-user


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



On 15-02-2023 03:14, Robby Zambito wrote:
> Hello,
> 
> For some reason I am having trouble importing the (ice-9 psyntax)
> module. [...]

This is an undocumented module; you aren't supposed to import it 
directly.  In fact, looking at the first few lines of ice-9/psyntax.scm, 
ice-9/psyntax.scm is part of the (guile) module; there does not exist a 
separate (ice-9 psyntax) module:

   (eval-when (compile)
     (set-current-module (resolve-module '(guile))))

The only use of psyntax is in ice-9/boot.scm:

module/ice-9/boot-9.scm:;; $sc-dispatch is an implementation detail of 
psyntax. It is used by
module/ice-9/boot-9.scm:(primitive-load-path "ice-9/psyntax-pp")

... and that uses ice-9/psyntax-pp.scm, not ice-9/psyntax.scm (the 
former is generated from the latter when Guile itself is compiled).

What are you trying to import (ice-9 psyntax) for?

Greetings,
Maxime.

[-- 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] 8+ messages in thread

* Re: Unable to import (ice-9 psyntax)
  2023-02-16 11:18       ` Maxime Devos
@ 2023-02-16 11:26         ` Maxime Devos
  0 siblings, 0 replies; 8+ messages in thread
From: Maxime Devos @ 2023-02-16 11:26 UTC (permalink / raw)
  To: Damien Mattei; +Cc: Robby Zambito, guile-user


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



On 16-02-2023 12:18, Maxime Devos wrote:
> 
> 
> On 16-02-2023 00:48, Damien Mattei wrote:
>> -rw-r--r--   1 root  wheel  516629 12 jan 08:12 psyntax-pp.go
>  > [...]
>>
>>
>>         * is /usr/local/lib/guile/3.0/ccache/ice-9/psyntax.go newer than
>>           /usr/local/share/guile/3.0/ice-9/psyntax.scm going by mtime?
>>
>>
>> -rw-r--r--   1 root  wheel  188229 12 jan 08:12 psyntax-pp.scm
> 
> 
>  From the information you have given me, I can't tell which one is 
> newest.  You'll need to provide the milliseconds or more precise.

I think this line of questioning is irrelevant -- see other e-mail, and 
also I can reproduce the 'compiling .../psyntax.scm' thing.

Greetings,
Maxime.

[-- 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] 8+ messages in thread

* Re: Unable to import (ice-9 psyntax)
  2023-02-16 11:23 ` Maxime Devos
@ 2023-02-16 13:39   ` Robby Zambito
  0 siblings, 0 replies; 8+ messages in thread
From: Robby Zambito @ 2023-02-16 13:39 UTC (permalink / raw)
  To: Maxime Devos; +Cc: guile-user


Maxime Devos <maximedevos@telenet.be> writes:

> What are you trying to import (ice-9 psyntax) for?

I am trying to write a portable R7RS library which does a relative
include for its implementation. The code can be found here:
https://git.robbyzambito.me/robby/meta-json.git/tree/lib/zambyte/meta/json.sld?id=334e09f3388a74b5982138b57abb2021e12cf598#n66

The include-library-declarations (and include) in Guile work relative to
the working directory rather than from the calling file (contrary to the
documentation in the Guile manual), which is not desireable for a
library. Instead I'm trying to use include-from-path, which is defined
in (ice-9 psyntax). The problem is that include-from-path seems to be
available by default in Guile, but it was undefined when I was using it
in my R7RS library.

Asking your question made me realize (ice-9 psyntax) does not actually
export include-from-path though. In a nearly complete shot in the dark,
I instead imported (only (guile) include-from-path), which actually does
the trick!

https://git.robbyzambito.me/robby/meta-json.git/tree/lib/zambyte/meta/json.sld?id=7bf0fa24e0df6949d2e1f6c57fb67539d674810a#n67

This works as I wanted :)

Thanks,
Robby



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

end of thread, other threads:[~2023-02-16 13:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-15  2:14 Unable to import (ice-9 psyntax) Robby Zambito
2023-02-15  6:43 ` Damien Mattei
2023-02-15 20:18   ` Maxime Devos
2023-02-15 23:48     ` Damien Mattei
2023-02-16 11:18       ` Maxime Devos
2023-02-16 11:26         ` Maxime Devos
2023-02-16 11:23 ` Maxime Devos
2023-02-16 13:39   ` Robby Zambito

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