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

 
 

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

Submitted by:  None
Submitted on:  Tue 22 Aug 2006 11:50:42 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project 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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 21 Oct 2007 01:32:36 PM UTCcivodulOpen/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1