[gambit-list] Macros in Black Hole
David N Murray
dmurray at jsbsystems.com
Fri Feb 5 08:56:01 EST 2010
On Feb 5, Per Eckerdal scribed:
> > I just figured this out today:
> > $ cat ~/.gambcini
> > ; load blackhole, always
> > (load "~~/lib/syntax-case")
> > (load "~~/lib/modules/build")
> > $ gsc -:s,dar
> > Gambit v4.6.0
>
> That will work. The load syntax-case will be a no-op, though, because BH and syntax-case attach to the same callback so BH will overwrite syntax-case. So I don't think you get syntax-case macros even if you do it that way. The code that I run before the REPL starts is this:
>
> (and (equal? (path-strip-directory (car (command-line))) "bsc")
> (load "~~lib/modules/build")
> (let ()
> (##namespace ("module#"))
> (##include "~~lib/gambit#.scm")
>
> ;; It's possible to do some configuration of BH here if desired.
>
> (println "Loaded Black Hole.")))
>
>
> I have a symlink in PATH that points to gsc. That way I can start Black Hole by running bsc and non-black hole gambit isn't affected.
>
> /Per
>
Thanks Per.
I remember I had to play with it to get it to work. The load order
actually mattered. If I didn't load syntax-case:
> (import (std srf1/1))
*** ERROR -- No such file or directory
(path-normalize
"srf1/1.scm"
#f
"C:\\tools\\GAMBIT~1\\v4.6.0\\lib\\modules\\std\\")
If I load syntax-case last:
> (import (std srfi/1))
*** ERROR -- invalid module specifier (std srfi/1)
I'm basically a newbie to Scheme, but I have a couple of months playing
with Chicken. I really liked Chicken's module system and eggs and see BH
in a similar role (modules and controlled namespaces that R5RS doesn't
provide). Once I get a set of libraries up and running, I can't imagine
using Gambit without BH loaded.
Thanks,
Dave
More information about the Gambit-list
mailing list