I don't think you can load a gambit file like this in jazz.
Here's what I do :
I create a standard scheme file in my project directory, then in my
product.jazz :
(import (jazz.io))
(definition (run)
(initialize-aliases)
(set-current-directory {Directory User "lib" REST_OF_THE
PATH_TO_YOUR_SCHEME_FILE})
(load YOUR_SCHEME_FILE))
$ cat yankee.scm
(define (xray . rest)
(map (lambda (x) (* x x)) rest))
$ cat bravo.scm
(load "yankee")
(display (xray 1 2 3))
(newline)
$ gsi bravo
149
$
Since we're going to modularize it, I will create 2 packages and move
those files into alpha and zulu.
$ cat ~/jazz_user/lib/Zilch/src/zulu/yankee.scm
(module zulu.yankee
(define (xray . rest)
(map (lambda (x) (* x x)) rest)))
$ cat lib/Dummy/src/alpha/bravo.scm
(module alpha.bravo
(require (zulu.yankee))
(display (xray 1 2 3))
(newline))
$ jazz
JazzScheme v2.1.2 beta
> (jazz.load-module 'alpha.bravo)
149
> ,q
$
For every repository, Jazz will scan the folder structure of the
packages to find {alpha/bravo.scm alpha/bravo.jazz
alpha/bravo/_bravo.scm alpha/bravo/_bravo.jazz}. If it finds 2 of
these in the same repository, it fails.
Now, the code above will fails on the merest typo, which is not
something we want for Jazz. Library will code-walk and warn of free
symbols.
(library alpha.bravo scheme
(require (zulu.yankee))
(native xray)
(display (xray 1 2 3))
(newline))
or
(library alpha.bravo scheme
(import (zulu.yankee))
(display (xray 1 2 3))
(newline))
In these sample, all symbols are known. {library require} are special
forms, {native import} are imported from the core dialect, {display
newline} from the scheme dialect, xray is imported or declared as
native.
Could not reproduce this problem. It was probably fixed. Did you pull
the latest changes?
> * When you remove a product, can't create one with same name
> Says "Project already exists"
This is a misunderstanding due to a bad error message. It is not a
check for an existing project in the workbench but a check for an
existing directory where the project would end up being created. I
have improved the error message for all creation actions so that you
would now get :
Project already exists: C:/Home/jazz_user/lib/Test/
> * Why does the "Gomuko" sample take 5 seconds to respond after a
> click? This looks really bad.
It takes a long time because you are running the project interpreted
and both gomoku and c4 rely on a minimax algorithm to evaluate
variations to a depth of 4. But I totally aggree that for a newcomer
that doesn't know what is happening , it looks really bad. I added a
new module-uptodate-binary? primitive to return if a module has an
up-to-date binary and both projects are now using it to display a
warning message. Good point!
> * I can't figure out how the project/module system works. To try to
> learn, I created a new Gambit project. Then I created a Gambit file:
>
> test.scm:
> ------------------------------
> (library test3.main gambit
> (define (foo)
> (print "Hello World"))
> )
> ------------------------------
>
> Then I edited the "product.jazz" file:
> ------------------------------
> (library test3.product jazz
>
> (import (test3.main))
>
> (definition (run)
> (foo)
> (thread-sleep! 2.5))
> ------------------------------
>
> But the error says "test3.main" not found. How does the project know
> to include my module?
>
>
The element you are missing is: how does the module system find a
module? Given a module a.b.c how does it know what file to load that
will be defining the a.b.c module? As Stephane Le Cornec said, the
module system will try every package and assumes that inside a
package, module a.b.c will be found at one of the following :
- a/b/c.scm
- a/b/c.jazz
- a/b/c/_c.scm
- a/b/c/_c.jazz
This said, your test3.main library should then be in :
HOME/jazz_user/lib/Test/src/test3/main.scm. Note that a package can
define a starting 'root' for where its modules are located and by
default it is "src". This is why there is a /src/ in the above path.
PS: Be careful, the product run / update / build functions now receive
a 'descriptor' argument to have access to the product declaration
inside the package. Your run function will thus become :
(definition (run descriptor)
(foo)
(thread-sleep! 2.5))
Hope this helps make things clearer.
Guillaume Cartier