[gambit-list] Text Template

James Long longster at gmail.com
Sat Sep 8 19:20:51 EDT 2007


You can't really mix in chunks of code with snow (or any package
system), as symbols won't get resolved correctly and such.  Basically
to use a snow package you have to make your chunk of code a snow
package, which is easy enough.

Just stick the package form at the top of the file, and then require
the json package:

(package* myprogram/v1.0.0
   (require: json/v1))

The json functions will now be available.  To load your new package in
with gsi, it'd be something like this:

> (include "/usr/share/snow/base/snow.scm")  ; include snow macros
> (include-cd* "myprogram.scm")  ; makes sure includes work the way they should
> (load-program* "myprogram.scm")

You should be able to reference your functions without fully qualified
names.  If you want to just run the program, use the snow script like
this:

$ snow -- myprogram.scm

I think Snow could use a shorter, more "how to use" documentation page.

James

On 9/8/07, jonnay at jonnay.net <jonnay at jonnay.net> wrote:
> I'm considering it, but I haven't had enough time to really explore snow
> and try and make it work.
>
> Which does bring up a question, how do I load a snow a package from within
> gsi?  Say (for instance) I have a large body of code, and I want to start
> using the json snow package with it, where do i start?  Most of my
> attempts to do this have failed dueto some symbols not being defined.
>
> > Hi,
> >
> > I think you should definitely consider turning Text Template to a Snow
> > package!
> >
> > Cheers,
> >
> > Dominique
>
>
> _______________________________________________
> Gambit-list mailing list
> Gambit-list at iro.umontreal.ca
> https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
>


-- 
James Long
Coptix, Inc.
longster at gmail.com



More information about the Gambit-list mailing list