unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#28837: Guile 2.2.2: Loading srfi-1 with merge-generics breaks "map"
@ 2017-10-14 17:30 Andrew Erlanger
  2017-10-17  1:11 ` David Pirotte
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Erlanger @ 2017-10-14 17:30 UTC (permalink / raw)
  To: 28837


Re-creation:

1. Make a directory (I call it 'mytest')

2. In the directory, make a file f.scm containing:

(define-module (mytest f)
  #:use-module (oop goops)
  #:use-module (srfi srfi-1)
  #:duplicates (merge-generics))

3. In the directory, make a file test.scm containing:

(add-to-load-path (dirname (getcwd)))

(use-modules (mytest f))

4. Navigate to the directory in a terminal, and start the Guile REPL.

5. In the REPL, enter the two following commands:

(load "test.scm")

,in (mytest f) map

The last command returns:

While executing meta-command:
ERROR: Unbound variable: map

That is, the 'map' primitive becomes unbound in the context of (mytest
f). Any procedures which both
    (a) relying on map, and
    (b) are defined and exported in (mytest f),
throw the above error as well.

Please let me know if I can clarify.

- Andrew





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

* bug#28837: Guile 2.2.2: Loading srfi-1 with merge-generics breaks "map"
  2017-10-14 17:30 bug#28837: Guile 2.2.2: Loading srfi-1 with merge-generics breaks "map" Andrew Erlanger
@ 2017-10-17  1:11 ` David Pirotte
  0 siblings, 0 replies; 2+ messages in thread
From: David Pirotte @ 2017-10-17  1:11 UTC (permalink / raw)
  To: Andrew Erlanger; +Cc: 28837

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

Hi Andrew,

> (define-module (mytest f)
>   #:use-module (oop goops)
>   #:use-module (srfi srfi-1)
>   #:duplicates (merge-generics))

You need at least 

  #:duplicates (merge-generics
                replace)

but as I recommended in an earlier message, you should extend the default set

  #:duplicates (merge-generics
		replace
		warn-override-core
		warn
		last)

> ,in (mytest f) map

> While executing meta-command:
> ERROR: Unbound variable: map

The above will fix your problem.

David

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2017-10-17  1:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-14 17:30 bug#28837: Guile 2.2.2: Loading srfi-1 with merge-generics breaks "map" Andrew Erlanger
2017-10-17  1:11 ` David Pirotte

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