bug-kawa
[Top][All Lists]
Advanced

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

[Bug-kawa] [bug #34859] (require ...) behaves differently between repl a


From: Robin Abbi
Subject: [Bug-kawa] [bug #34859] (require ...) behaves differently between repl and direct invocation
Date: Fri, 18 Nov 2011 23:43:44 +0000
User-agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.36 Safari/535.7

URL:
  <http://savannah.gnu.org/bugs/?34859>

                 Summary: (require ...) behaves differently between repl and
direct invocation
                 Project: Kawa
            Submitted by: coderobot
            Submitted on: Fri 18 Nov 2011 23:43:43 GMT
                Category: Scheme language
                Severity: 3 - Normal
              Item Group: Unexpected result
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

1. Create a library 'messages.scm' with two functions:

(define hello
  (lambda (name)
     (format "hello ~a" name)))

(define goodbye
  (lambda (name)
     (format "goodbye ~a" name)))

2. Compile using the kawac Ant task.

3. Create a program "controller.scm" to use the above defined functions

(require <com.example.messages>)
(format #t "~a~%" (com.example.messages:hello "world"))

Compile (using kawac as before)

Run: java -cp build/classes:kawa-1.11.jar com.example.controller

Output: "hello world"

4. Now try to do the same thing from the repl

Start the repl:

java -cp build/classes:kawa-1.11.jar kawa.repl

then at the prompt:

(require <com.example.messages>) [ENTER]
(format "~a~!" (com.example.messages:goodbye "world"))

and get the output:

"no slot 'goodbye' in com.example.messages"

6. Workaround: If I explicitly use (export goodbye) in messages.scm then the
repl finds the method ok.

I was not expecting this difference in behaviours between invocation direct
and invocation at the repl. Possibly same as bug report #32726?




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?34859>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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