chicken-janitors
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-janitors] #1328: (import (only ...)) strange behaviour


From: Chicken Trac
Subject: [Chicken-janitors] #1328: (import (only ...)) strange behaviour
Date: Mon, 12 Sep 2016 17:17:15 -0000

#1328: (import (only ...)) strange behaviour
---------------------+--------------------------------
 Reporter:  caolan   |                 Owner:
     Type:  defect   |                Status:  new
 Priority:  major    |             Milestone:  someday
Component:  unknown  |               Version:  4.11.0
 Keywords:           |  Estimated difficulty:
---------------------+--------------------------------
 I noticed that I had to manually (use posix) before loading the LMDB
 module. But the module already does: (import (only posix create-directory
 delete-directory))

 That has led to the following test cases:

 {{{
 ;; create-directory not defined
 (import (only posix create-directory))
 (print create-directory)
 (print delete-directory)
 }}}

 {{{
 ;; delete-directory is imported when it shouldn't be
 (use (only posix create-directory))
 (print create-directory)
 (print delete-directory)
 }}}

 And this shows how I manually (use posix) beforehand to get around this
 issue:

 {{{
 ;; module A (a.scm)
 (module a *
   (import chicken scheme)
   (import (only posix create-directory))
   (print create-directory)
   (print delete-directory))
 }}}

 {{{
 (use posix)
 (load "a.scm")
 (import a)
 }}}

 This now correctly imports _only_ the create-directory procedure. If I
 remove the (use posix) line, it will fail as in the first example. I can
 also replace (use posix) with (require-library posix) and it will work.

 These examples were just run in csi - however I originally found it by
 using the system's installed lmdb module inside my own module compiled via
 csc.

--
Ticket URL: <https://bugs.call-cc.org/ticket/1328>
CHICKEN Scheme <https://www.call-cc.org/>
CHICKEN Scheme is a compiler for the Scheme programming language.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]