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

unofficial mirror of bug-guile@gnu.org 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/guile-bugs/0 guile-bugs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 guile-bugs guile-bugs/ https://yhetil.org/guile-bugs \
		bug-guile@gnu.org
	public-inbox-index guile-bugs

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.lisp.guile.bugs
	nntp://news.gmane.io/gmane.lisp.guile.bugs


AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git