[Top][All Lists]

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

Re: is part of the wiki's hello world example broken?

From: ipcore
Subject: Re: is part of the wiki's hello world example broken?
Date: Tue, 7 Apr 2020 10:16:32 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0

Your should be named "". Doing `(import NAME)` will pull in automatically. (You don't need to `,l`, btw)

In your example, when you run `(import test)`, the interpreter does not find a local, and so goes looking for it in $CHICKEN_REPOSITORY_PATH. There, it finds and loads the "test" egg, as you can see from this line:

> ; loading /usr/local/chicken-5.2.0/lib/chicken/11/ ...

The documentation could probably be a bit more explicit on this.

On 4/7/20 12:16 AM, Daniel Ortmann wrote:
On this page:

Following these instructions:

    If you want to keep macro-definitions in a separate file, use import

    % csc -s hello.scm -j test % csc -s test.import.scm

I get 'unbound variable' for both hello and greet.
My own user error?  Or does something (perhaps doc) need updating?

dortmann@dortmann-linux2:ssax$ cat hello.scm
;; hello.scm

(module test (hello greet)
   (import scheme)

   (define-syntax greet
     (syntax-rules ()
       ((_ whom)
          (display "Hello, ")
          (display whom)
          (display " !\n") ) ) ) )

   (define (hello)
     (greet "world") )  )
dortmann@dortmann-linux2:ssax$ rlwrap csi
(c) 2008-2020, The CHICKEN Team
(c) 2000-2007, Felix L. Winkelmann
Version 5.2.0 (rev 317468e4)
linux-unix-gnu-x86-64 [ 64bit dload ptables ]

Type ,? for help.
#;1> ,l
; loading ...
#;1> (import test)
; loading /usr/local/chicken-5.2.0/lib/chicken/11/ ...
; loading /usr/local/chicken-5.2.0/lib/chicken/11/ ... ; loading /usr/local/chicken-5.2.0/lib/chicken/11/ ... ; loading /usr/local/chicken-5.2.0/lib/chicken/11/ ... ; loading /usr/local/chicken-5.2.0/lib/chicken/11/ ... ; loading /usr/local/chicken-5.2.0/lib/chicken/11/ ... ; loading /usr/local/chicken-5.2.0/lib/chicken/11/ ... ; loading /usr/local/chicken-5.2.0/lib/chicken/11/ ...
#;2> (hello)

_*Error: unbound variable: hello*_

         Call history:

         <syntax>          (hello)
_*        <eval>    (hello)       <--*_
#;2> (greet "you")

_*Error: unbound variable: greet*_

         Call history:

         <syntax>          (greet "you")
_*        <eval>    (greet "you") <--*_

reply via email to

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