[-- 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 --]
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
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
>
>
>