unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#47538: ice-9 regex procedures not found when trying to use from r7rs-style defined library
@ 2021-04-01  7:06 Arvydas Silanskas
  2021-05-02 13:50 ` Andy Wingo
  0 siblings, 1 reply; 3+ messages in thread
From: Arvydas Silanskas @ 2021-04-01  7:06 UTC (permalink / raw)
  To: 47538

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

Consider files

foo-runner.scm:
(import (foo)
        (scheme write))
(display (bar))

foo.scm:
(define-library (foo)
    (import
      (scheme base)
      (ice-9 regex))
    (export bar)

    (begin
      (define (bar)
        (make-regexp "a"))))

Running this with guile -L . foo-runner.scm, yields error
foo.scm:1:0: In procedure bar:
Unbound variable: make-regexp

It seems using other libraries is fine; eg it works if I change foo.scm to
(define-library (foo)
    (import
      (scheme base)
      (ice-9 match))
    (export bar)

    (begin
      (define (bar)
        (match "a" (_ "bar")))))

It also works if I try using regexp from application instead of module; eg
if I change foo-runner.scm to
(import (foo)
        (scheme write)
        (ice-9 regex))
(display (make-regexp "a"))

I'm running version 3.0.5, installed through debian testing branch package
manager

[-- Attachment #2: Type: text/html, Size: 1209 bytes --]

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

* bug#47538: ice-9 regex procedures not found when trying to use from r7rs-style defined library
  2021-04-01  7:06 bug#47538: ice-9 regex procedures not found when trying to use from r7rs-style defined library Arvydas Silanskas
@ 2021-05-02 13:50 ` Andy Wingo
  2021-05-02 15:32   ` lloda
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Wingo @ 2021-05-02 13:50 UTC (permalink / raw)
  To: Arvydas Silanskas; +Cc: 47538-close

Hi,

On Thu 01 Apr 2021 09:06, Arvydas Silanskas <nma.arvydas.silanskas@gmail.com> writes:

> foo.scm:
> (define-library (foo)
>     (import 
>       (scheme base)
>       (ice-9 regex))
>     (export bar)
>
>     (begin
>       (define (bar)
>         (make-regexp "a"))))

The issue AFAIU is that make-regexp is part of (guile), and not exported
by (ice-9 regex).  You would need to add (only (guile) make-regexp) to
your import set.  I know it's somewhat terrible but perhaps in the near
future we will be able to replace this regexp support with something
more consistent.

Please reopen if I misunderstood the bug.

Cheers,

Andy





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

* bug#47538: ice-9 regex procedures not found when trying to use from r7rs-style defined library
  2021-05-02 13:50 ` Andy Wingo
@ 2021-05-02 15:32   ` lloda
  0 siblings, 0 replies; 3+ messages in thread
From: lloda @ 2021-05-02 15:32 UTC (permalink / raw)
  To: Andy Wingo; +Cc: Arvydas Silanskas, 47538


Perhaps an acceptable fix would be to re-export from (ice-9 regex) before eventually deprecating the other export.

> On 2 May 2021, at 15:50, Andy Wingo <wingo@igalia.com> wrote:
> 
> Hi,
> 
> On Thu 01 Apr 2021 09:06, Arvydas Silanskas <nma.arvydas.silanskas@gmail.com> writes:
> 
>> foo.scm:
>> (define-library (foo)
>>    (import 
>>      (scheme base)
>>      (ice-9 regex))
>>    (export bar)
>> 
>>    (begin
>>      (define (bar)
>>        (make-regexp "a"))))
> 
> The issue AFAIU is that make-regexp is part of (guile), and not exported
> by (ice-9 regex).  You would need to add (only (guile) make-regexp) to
> your import set.  I know it's somewhat terrible but perhaps in the near
> future we will be able to replace this regexp support with something
> more consistent.
> 
> Please reopen if I misunderstood the bug.
> 
> Cheers,
> 
> Andy
> 
> 
> 






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

end of thread, other threads:[~2021-05-02 15:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-01  7:06 bug#47538: ice-9 regex procedures not found when trying to use from r7rs-style defined library Arvydas Silanskas
2021-05-02 13:50 ` Andy Wingo
2021-05-02 15:32   ` 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).