bugGuile - Bugs: bug #17504, use-modules -- module (foo) using...

 
 

bug #17504: use-modules -- module (foo) using (foo list) causes error.

Submitter:  None
Submitted:  Tue 22 Aug 2006 11:50:42 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 21 Oct 2007 01:32:36 PM UTC, comment #2: 

(This is an old bug, but still worth answering.)

Because of the recursive hierarchical naming scheme used by modules, one cannot use `list' (or any other primitive procedure name like `eval', `+', `define', etc.) as the component of a module name.  For instance, `(nested-ref the-scm-module '(list))' returns the `list' procedure, because `list' is bound within `the-scm-module' to a procedure, not a module.  Conversely, `(define-module (x y))' binds `y' within module `(x)' to another module.

More information about nested references is available in `boot-9.scm'.

Ludovic Courtès <civodul>
Group administrator
Tue 22 Aug 2006 11:52:15 PM UTC, comment #1: 

I forgot to add

guile> (version)
"1.6.8"

Anonymous
Tue 22 Aug 2006 11:50:42 PM UTC, original submission:  

1. Create files foo.scm and bar.scm in the current directory containing the following

foo.scm:
(define-module (foo)
  #:use-module (foo list))

bar.scm:
(define-module (bar)
  #:use-module (bar lst))

2. Create subdirectories ./foo and ./bar.
3. Create file ./foo/list.scm

foo/list.scm:
(define-module (foo list))

4. Create file ./bar/lst.scm

bar/lst.scm:
(define-module (bar lst))

5. Start guile in directory containing foo.scm and bar.scm.
6. guile> (use-modules (bar)) ; succeeds
7. guile> (use-modules (foo))

==>
<unnamed port>: In procedure process-define-module in expression (process-define-module (list # # ...)):
<unnamed port>: not-a-record #<primitive-procedure list>
ABORT: (misc-error)

Type "(backtrace)" to get more information or "(debug)" to enter the debugger.

System:

% uname -a
==> Darwin stoat.local 8.7.1 Darwin Kernel Version 8.7.1: Wed Jun  7 16:19:56 PDT 2006; root:xnu-792.9.72.obj~2/RELEASE_I386 i386 i386

Hardware:

  Machine Name:         Mac mini
  Machine Model:        Macmini1,1
  CPU Type:             Intel Core Duo
  Number Of Cores:      2
  CPU Speed:            1.66 GHz
  L2 Cache (shared):    2 MB
  Memory:               512 MB
  Bus Speed:            667 MHz
  Boot ROM Version:     MM11.004B.B00
  Serial Number:        *********
  SMC Version:          1.3f4



Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by civodul (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-10-21 civodul Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code