This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

require vs. load



Hi Kawa folks!

I've got a question about (require <thing>) 
vs. (load "thing.scm").  I think the following
might be a bug, (or I just haven't read enough
of the docs...) 

I'm running this out of the CVS repository on 
9/15/2001.

;;;;;;;;;;;;;;;;;;;;;;
;; start
;; file atest.scm
;;
(define (a-test id)
   (begin
      (display id)
      (newline)
      1))

;; end of file atest.scm
;;;;;;;;;;;;;;;;;;;;;;
;; start of file test.scm
;;

(require <atest>)

(define (test)
   (let* ((p (a-test "HI")))
      (display p)
      (newline)))
      
;; end of file test.scm
;;;;;;;;;;;;;;;;;;;;;;

Then at the command line:

kawa -C atest.scm
kawa -C test.scm


When I run:
kawa -e "(require <test>) (test)"

I get the following...

java.lang.NullPointerException
        at test.test(test.scm:8)
        at test.apply0(test.scm)
        at gnu.expr.ModuleBody.applyN(ModuleBody.java:145)
        at gnu.expr.ModuleMethod.applyN(ModuleMethod.java:61)
        at gnu.mapping.Procedure.apply(Procedure.java:102)
        at gnu.mapping.CallContext.run(CallContext.java:184)
        at gnu.expr.ModuleExp.evalModule(ModuleExp.java:184)
        at kawa.Shell.run(Shell.java:77)
        at kawa.Shell.runString(Shell.java:113)
        at kawa.repl.main(repl.java:115)

Yet, if i :
bash-2.03$ kawa 
#|kawa:1|# (load "test.scm")    
#|kawa:2|# (test)
HI
1
#|kawa:3|# 

Everything works as expected.
Is there anything else I need to do to load
the atest module?

Thanks in advance,
-Eric

-- 
If your life was a horse, you'd have to shoot it.

Eric Gustafson 
eric@spectrologic.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]