Here is a collection of the stuff I have done in Scheme that I decided to release. I use GNU Guile Scheme for my Scheme system because it is powerful and Free.
These are libraries that either someone else or I wrote. If someone else wrote it, I probably just ported it to guile 1.7 (and decided that it was too much work to just release a patch).
(use-modules
(proc-rename))
. This library exports one procedure:
(symbol-prefix-renamer newprefix)
. So what does it do
exactly (I'm the master of delayed explanation)? When you
(use-modules (foo bar))
and you want to rename the
symbols in the module, right now you have to use
symbol-prefix-proc
. This creates a problem: What if
the author of the module already prefixed the module and you
don't want to use the prefix s/he chose? Enter
symbol-prefix-renamer
. Give it the prefix you would
like to replace the old prefix with as it's argument and it will
rename all of the prefixes to use the new prefix (or add a
prefix if the symbol is un-prefixed). E.g. if you create a
renamer that renames the prefix to foo
these are
the transformations you will get: bar:foo => foo:foo,
bar => foo:bar, quux:moo:foo => foo:moo:foo
. I have
decided to release this into the public domain.UPDATE
(2002-07-16):
I have updated the implementation; it is better now (I
guess it could be faster too). Also, the module is now
(proc-rename) instead of (cke proc-rename).
These are just a few miscellaneous things I have written that might be useful to other people.
(vector-resize some-vec
newsize)
. It will destructively modify some-vec and
resize it to the newsize. If the newsize is smaller it will be
shrunk, if it is larger it will be expanded and the additional
elements will be unspecified. If you are using this with a
Scheme system other than Guile, just remove the
(use-modules (ice-9 syncase))
at the top of the
file and it should work since Guile uses the r5rs macro
implementation that most other Scheme systems use.I write stuff in Scheme when I want to do it fast. Writing stuff in C or C++ is much more time consuming than using Scheme, unless I have to do more low level stuff (or write an X app...guile-gtk isn't really all that great, but gnome-guile 2.0 should be much better). Here are a few small programs that I have written in Scheme. NOTE: I have only tested these with Guile 1.7 and 1.5.x! They may work with older versions. If they do, then email me telling me what version it was.
Last modified: Mon May 17 13:20:22 EDT 2004