On Sun, Mar 15, 2009 at 1:48 PM, William <w7c
...@gmail.com> wrote:
> I keep trying and keep failing at some basic tasks.
> I have a bunch of gambit code that I would like to run/debug
> with jazz, and i also want to do GUI development. But I just
> can't get started. At the risk of seeming stupid, here is where
> I am. I generally move quickly between different languages
> and development environments, but doing so requires some
> clues and familiar concepts to transfer across.
> My strategy is to just create a simple project and run it,
> but I cannot even do that!
> Notes:
> * Seems to be a problem creating a Gambit project with a capital
> letter as first character of name, as in "Test".
> Error says "Test.product" is defining "test.product"
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