diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2017-02-20 00:06:40 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2017-02-20 00:06:40 -0800 |
commit | a69c9fb665459e2bfdbda1bf80741a0af31a7faf (patch) | |
tree | f0bc974f8805049e6b9a4e6864886298fbaa05a4 | |
parent | 4684239efa63dc1b2c1cbe37ef7d3062029f5532 (diff) | |
download | slib-upstream.tar.gz slib-upstream.zip |
New upstream version 3b5upstream/3b5upstream
-rw-r--r-- | ANNOUNCE | 172 | ||||
-rwxr-xr-x[-rw-r--r--] | Bev2slib.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | COPYING | 0 | ||||
-rw-r--r-- | ChangeLog | 421 | ||||
-rw-r--r-- | FAQ | 33 | ||||
-rw-r--r-- | Makefile | 579 | ||||
-rw-r--r-- | README | 27 | ||||
-rwxr-xr-x[-rw-r--r--] | RScheme.init | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | SLIB.ico | bin | 9326 -> 9326 bytes | |||
-rwxr-xr-x[-rw-r--r--] | STk.init | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | Template.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | alist.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | alist.txi | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | alistab.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | array.scm | 4 | ||||
-rwxr-xr-x[-rw-r--r--] | array.txi | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | arraymap.scm | 4 | ||||
-rwxr-xr-x[-rw-r--r--] | arraymap.txi | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | batch.scm | 4 | ||||
-rwxr-xr-x[-rw-r--r--] | bigloo.init | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | break.scm | 1 | ||||
-rwxr-xr-x[-rw-r--r--] | byte.scm | 1 | ||||
-rwxr-xr-x[-rw-r--r--] | byte.txi | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | bytenumb.scm | 7 | ||||
-rwxr-xr-x[-rw-r--r--] | bytenumb.txi | 1 | ||||
-rwxr-xr-x[-rw-r--r--] | chap.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | chap.txi | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | charplot.scm | 1 | ||||
-rwxr-xr-x[-rw-r--r--] | chez.init | 8 | ||||
-rwxr-xr-x[-rw-r--r--] | cie1931.xyz | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | cie1964.xyz | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | ciesia.dat | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | ciesid65.dat | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | clrnamdb.scm | 40 | ||||
-rwxr-xr-x[-rw-r--r--] | cltime.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | coerce.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | coerce.txi | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | collect.scm | 3 | ||||
-rwxr-xr-x[-rw-r--r--] | collectx.scm | 4 | ||||
-rwxr-xr-x[-rw-r--r--] | color.scm | 15 | ||||
-rwxr-xr-x[-rw-r--r--] | color.txi | 24 | ||||
-rwxr-xr-x[-rw-r--r--] | colornam.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | colornam.txi | 3 | ||||
-rwxr-xr-x[-rw-r--r--] | colorspc.scm | 32 | ||||
-rwxr-xr-x[-rw-r--r--] | comlist.scm | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | comparse.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | comparse.txi | 0 | ||||
-rwxr-xr-x | configure | 377 | ||||
-rwxr-xr-x[-rw-r--r--] | crc.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | cring.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | cvs.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | cvs.txi | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | daylight.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | daylight.txi | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | db2html.scm | 1 | ||||
-rwxr-xr-x[-rw-r--r--] | db2html.txi | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | dbcom.scm | 1 | ||||
-rwxr-xr-x[-rw-r--r--] | dbinterp.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | dbrowse.scm | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | dbsyn.scm | 14 | ||||
-rwxr-xr-x[-rw-r--r--] | dbutil.scm | 6 | ||||
-rwxr-xr-x[-rw-r--r--] | dbutil.txi | 3 | ||||
-rwxr-xr-x[-rw-r--r--] | debug.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | defmacex.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | determ.scm | 1 | ||||
-rwxr-xr-x[-rw-r--r--] | determ.txi | 6 | ||||
-rwxr-xr-x[-rw-r--r--] | dft.scm | 1 | ||||
-rwxr-xr-x[-rw-r--r--] | dft.txi | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | differ.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | differ.txi | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | dirs.scm | 17 | ||||
-rwxr-xr-x[-rw-r--r--] | dirs.txi | 18 | ||||
-rwxr-xr-x[-rw-r--r--] | dwindtst.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | dynamic.scm | 4 | ||||
-rwxr-xr-x[-rw-r--r--] | dynwind.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | elk.init | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | eval.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | factor.scm | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | factor.txi | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | fdl.texi | 80 | ||||
-rwxr-xr-x | fluid-let.scm | 39 | ||||
-rwxr-xr-x[-rw-r--r--] | fluidlet.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | format.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | format.texi | 7 | ||||
-rwxr-xr-x[-rw-r--r--] | formatst.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | gambit.init | 1 | ||||
-rwxr-xr-x[-rw-r--r--] | genwrite.scm | 169 | ||||
-rwxr-xr-x[-rw-r--r--] | getopt.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | getparam.scm | 1 | ||||
-rwxr-xr-x[-rw-r--r--] | getparam.txi | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | glob.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | glob.txi | 3 | ||||
-rwxr-xr-x[-rw-r--r--] | grapheps.ps | 186 | ||||
-rwxr-xr-x[-rw-r--r--] | grapheps.scm | 94 | ||||
-rwxr-xr-x[-rw-r--r--] | grapheps.txi | 68 | ||||
-rwxr-xr-x | guile-2.init | 714 | ||||
-rwxr-xr-x[-rw-r--r--] | guile.init | 392 | ||||
-rwxr-xr-x | guile.use | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | hash.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | hashtab.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | hashtab.txi | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | html4each.scm | 40 | ||||
-rwxr-xr-x[-rw-r--r--] | html4each.txi | 12 | ||||
-rwxr-xr-x[-rw-r--r--] | htmlform.scm | 3 | ||||
-rwxr-xr-x[-rw-r--r--] | htmlform.txi | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | http-cgi.scm | 27 | ||||
-rwxr-xr-x[-rw-r--r--] | http-cgi.txi | 23 | ||||
-rwxr-xr-x[-rw-r--r--] | indexes.texi | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | jscheme.init | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | kawa.init | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | limit.scm | 6 | ||||
-rwxr-xr-x[-rw-r--r--] | limit.texi | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | lineio.scm | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | lineio.txi | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | linterp.scm | 4 | ||||
-rwxr-xr-x[-rw-r--r--] | linterp.txi | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | logical.scm | 1 | ||||
-rwxr-xr-x[-rw-r--r--] | macrotst.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | macscheme.init | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | macwork.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | manifest.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | manifest.txi | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | matfile.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | matfile.txi | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | math-integer.scm | 20 | ||||
-rwxr-xr-x[-rw-r--r--] | math-integer.txi | 20 | ||||
-rwxr-xr-x[-rw-r--r--] | math-real.scm | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | mbe.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | minimize.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | minimize.txi | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | mitscheme.init | 127 | ||||
-rwxr-xr-x[-rw-r--r--] | mkclrnam.scm | 66 | ||||
-rwxr-xr-x[-rw-r--r--] | mkclrnam.txi | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | mklibcat.scm | 369 | ||||
-rwxr-xr-x[-rw-r--r--] | mkpltcat.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | modular.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | modular.txi | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | mulapply.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | mularg.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | mwdenote.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | mwexpand.scm | 5 | ||||
-rwxr-xr-x[-rw-r--r--] | mwsynrul.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | mzscheme.init | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | nbs-iscc.txt | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | ncbi-dna.scm | 1 | ||||
-rwxr-xr-x[-rw-r--r--] | ncbi-dna.txi | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | null.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | obj2str.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | obj2str.txi | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | object.scm | 4 | ||||
-rwxr-xr-x[-rw-r--r--] | object.texi | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | paramlst.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | peanosfc.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | peanosfc.txi | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | phil-spc.scm | 3 | ||||
-rwxr-xr-x[-rw-r--r--] | phil-spc.txi | 6 | ||||
-rwxr-xr-x[-rw-r--r--] | pnm.scm | 1 | ||||
-rwxr-xr-x[-rw-r--r--] | pnm.txi | 3 | ||||
-rwxr-xr-x[-rw-r--r--] | pp.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | ppfile.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | prec.scm | 342 | ||||
-rwxr-xr-x[-rw-r--r--] | printf.scm | 1 | ||||
-rwxr-xr-x[-rw-r--r--] | priorque.scm | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | priorque.txi | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | process.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | promise.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | pscheme.init | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | psxtime.scm | 1 | ||||
-rwxr-xr-x[-rw-r--r--] | qp.scm | 7 | ||||
-rwxr-xr-x[-rw-r--r--] | queue.scm | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | queue.txi | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | r4rsyn.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | randinex.scm | 1 | ||||
-rwxr-xr-x[-rw-r--r--] | randinex.txi | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | random.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | random.txi | 3 | ||||
-rwxr-xr-x[-rw-r--r--] | ratize.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | ratize.txi | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | rdms.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | recobj.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | record.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | repl.scm | 0 | ||||
-rw-r--r-- | require.scm | 9 | ||||
-rwxr-xr-x[-rw-r--r--] | resenecolours.txt | 0 | ||||
-rw-r--r-- | rmdsff.scm | 317 | ||||
-rw-r--r-- | rmdsff.txi | 68 | ||||
-rwxr-xr-x[-rw-r--r--] | root.scm | 6 | ||||
-rwxr-xr-x | s7.init | 417 | ||||
-rwxr-xr-x[-rw-r--r--] | saturate.txt | 42 | ||||
-rwxr-xr-x[-rw-r--r--] | sc2.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | sc4opt.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | sc4sc3.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | scaexpp.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | scaglob.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | scainit.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | scamacr.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | scanf.scm | 4 | ||||
-rwxr-xr-x[-rw-r--r--] | scaoutp.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | scheme2c.init | 0 | ||||
-rw-r--r-- | scheme48.init | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | schmooz.scm | 22 | ||||
-rwxr-xr-x[-rw-r--r--] | schmooz.texi | 3 | ||||
-rwxr-xr-x[-rw-r--r--] | scm.init | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | scmacro.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | scsh.init | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | selfset.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | sierpinski.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | simetrix.scm | 17 | ||||
-rwxr-xr-x[-rw-r--r--] | sisc.init | 4 | ||||
-rwxr-xr-x[-rw-r--r--] | slib.1 | 4 | ||||
-rwxr-xr-x[-rw-r--r--] | slib.doc | 10 | ||||
-rwxr-xr-x[-rw-r--r--] | slib.info | 2890 | ||||
-rw-r--r-- | slib.nsi | 14 | ||||
-rwxr-xr-x | slib.sh | 34 | ||||
-rw-r--r-- | slib.spec | 77 | ||||
-rwxr-xr-x[-rw-r--r--] | slib.texi | 641 | ||||
-rwxr-xr-x[-rw-r--r--] | solid.scm | 8 | ||||
-rwxr-xr-x[-rw-r--r--] | solid.txi | 5 | ||||
-rwxr-xr-x[-rw-r--r--] | sort.scm | 15 | ||||
-rwxr-xr-x[-rw-r--r--] | soundex.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | srfi-1.scm | 1 | ||||
-rwxr-xr-x[-rw-r--r--] | srfi-1.txi | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | srfi-11.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | srfi-2.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | srfi-23.scm | 0 | ||||
-rwxr-xr-x | srfi-39.scm | 81 | ||||
-rwxr-xr-x[-rw-r--r--] | srfi-61.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | srfi-8.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | srfi-9.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | srfi.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | srfi.txi | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | stdio.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | strcase.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | strport.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | strsrch.scm | 32 | ||||
-rwxr-xr-x[-rw-r--r--] | structure.scm | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | subarray.scm | 12 | ||||
-rwxr-xr-x[-rw-r--r--] | subarray.txi | 14 | ||||
-rwxr-xr-x[-rw-r--r--] | synchk.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | synclo.scm | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | synrul.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | t3.init | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | timecore.scm | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | timezone.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | top-refs.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | top-refs.txi | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | trace.scm | 5 | ||||
-rwxr-xr-x[-rw-r--r--] | transact.scm | 10 | ||||
-rwxr-xr-x[-rw-r--r--] | transact.txi | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | tree.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | tree.txi | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | trnscrpt.scm | 6 | ||||
-rwxr-xr-x[-rw-r--r--] | tsort.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | tsort.txi | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | tzfile.scm | 5 | ||||
-rwxr-xr-x[-rw-r--r--] | umbscheme.init | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | uri.scm | 16 | ||||
-rwxr-xr-x[-rw-r--r--] | uri.txi | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | values.scm | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | version.txi | 4 | ||||
-rwxr-xr-x[-rw-r--r--] | vet.scm | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | vet.txi | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | vscm.init | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | withfile.scm | 0 | ||||
-rw-r--r-- | wttest.scm | 136 | ||||
-rwxr-xr-x | wttree-test.scm | 232 | ||||
-rwxr-xr-x[-rw-r--r--] | wttree.scm | 170 | ||||
-rwxr-xr-x[-rw-r--r--] | xml-parse.scm | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | xml-parse.txi | 3 | ||||
-rwxr-xr-x[-rw-r--r--] | yasyn.scm | 0 |
270 files changed, 6911 insertions, 3138 deletions
@@ -1,172 +1,62 @@ -This message announces the availability of Scheme Library release slib-3b1. +This message announces the availability of Scheme Library release slib-3b5. SLIB is a portable Scheme library providing compatibiliy and utility functions for all standard Scheme implementations. -SLIB supports Bigloo, Chez, ELK 3.0, GAMBIT 3.0, Guile, JScheme, -MacScheme, MITScheme, PLT Scheme (DrScheme and MzScheme), Pocket -Scheme, RScheme, scheme->C, Scheme48, SCM, SCM Mac, scsh, SISC, Stk, -T3.1, umb-scheme, and VSCM. +SLIB supports Bigloo, Chez, ELK-3.0, Gambit-4.0, Gauche-0.9, Guile, +JScheme, MacScheme, MITScheme, Pocket-Scheme, RScheme, S7, scheme->C, +Scheme48, SCM, SCM-Mac, scsh, SISC, Stk, T3.1, umb-scheme, and VSCM. SLIB is free software. It has a Permissive-Non-Warranty license -(http://swiss.csail.mit.edu/~jaffer/SLIB_COPYING.txt). +<http://people.csail.mit.edu/jaffer/SLIB_COPYING.txt>. Documentation and distributions in several formats are linked from SLIB's home page: - http://swiss.csail.mit.edu/~jaffer/SLIB.html + <http://people.csail.mit.edu/jaffer/SLIB> Links to distributions of SLIB and related softwares are at the end of this message. - -=-=- -slib-3b1 news: + -=-=-=-=- - * Larceny (Scheme) is supported. +slib-3b5 news: - From Ivan Shmakov: +SLIB's new multidimensional space-filling package has algorithms which +unify the encoding and decoding of Hilbert and Peano curves of any +rank, their inverses, and novel variations. Read the paper at +<http://arxiv.org/abs/1402.1807> - * scheme48.init (slib:os-strings): Fixed init for 1.7 (and 1.3). - (defmacro:eval, defmacro:load): Fixed. +Otherwise, slib-3b5 is a minor release. Details at +<http://cvs.savannah.gnu.org/viewvc/*checkout*/slib/slib/ChangeLog> - From Rob Browning: + * rmdsff.scm (make-cell, integer->coordinates) + (coordinates->integer): Don't depend on LETREC* behavior. - * guile.init (implementation-vicinity): Just (%site-dir). - (file-position, gentemp): module-replace! - (library-vicinity): Try (%search-load-path "slib/guile.init"). + * Makefile, mklibcat.scm, rmdsff.scm, slib.texi (space-filling): + Added "rmdsff.scm" and documentation. - From Aubrey Jaffer: + * phil-spc.scm, schmooz.scm, slib.texi: Because TeXinfo-5 changed + the rules, don't allow text between @defun and @defunx. - * Logo and icon. + * usercat: Use local copy of "schmooz.scm". - * Added program-arguments to System-Interface section in Manual. - - * *.init: implementation-vicinity can be overridden by - implementation-specific environment variable: - MITSCHEME_IMPLEMENTATION_PATH - VSCM_IMPLEMENTATION_PATH - STK_IMPLEMENTATION_PATH - RSCHEME_IMPLEMENTATION_PATH - JSCHEME_IMPLEMENTATION_PATH - GAMBIT_IMPLEMENTATION_PATH - ELK_IMPLEMENTATION_PATH - CHEZ_IMPLEMENTATION_PATH - BIGLOO_IMPLEMENTATION_PATH - GUILE_IMPLEMENTATION_PATH - MZSCHEME_IMPLEMENTATION_PATH - - * FAQ, slib.spec, Makefile: Always put - between slib and version. - - * byte.scm: Rewritten based on uniform arrays. - - * random.scm (random): Err when passed negative number. - - * srfi-1.scm (lset<=): Fixed to use first argument. - - * transact.scm (word:lock!): Don't try to read file until after - call-with-open-ports returns. - (describe-file-lock): Handle case when file isn't locked. - (windows:user-email-address): Much simplified; updated to - Windows-XP from Windows-95. - (describe-file-lock): Added diagnostic to current-error-port. - - * rdms.scm (open-table): Return #f for failure per documentation. - - * solid.scm (light:point, light:spot): Fixed. - - * prec.scm (prec:parse-delimited): First (recursive) clause was - missing argument. - - * determ.scm (matrix:inverse, matrix->lists): Corrected - documentation. - - * clrnamdb.scm, resenecolours.txt: Updated to Resene-2007. - - * slib.texi (Spectra): Clarified action of features cie1964, - cie1931, and ciexyz. - - * glob.scm, slib.texi: Removed glob as alias for filename. - - * dirs.scm: Require 'filename instead of 'glob. - - * require.scm: Condition SRFI scan on srfi-0. - - * mklibcat.scm: Feature-name is srfi-0 (was srfi). - - * mbe.scm (macro:eval): defmacro:eval. - (macro:load): defmacro:load. - - * defmacex.scm (defmacro:expand*): Use macroexpand instead of - macroexpand-1 in preparation for macroexpand-1 deprecation. - - * slib.nsi: Added *.init files. - - * README (Implementation-specific Instructions): Updated. - - * scheme48.init (char-code-limit): 128; does ascii conversions. - (1+, -1+): Removed; choked Scheme48-1.7. - Added SRFIs as found in Scheme-48 release-notes. - (scheme-implementation-version): Lose text after number. - (program-arguments): Removed dummy definition. - - * scsh.init (program-arguments): Defined to command-line per - http://practical-scheme.net/wiliki/schemexref.cgi?command-line - (library-vicinity, implementation-vicinity): Find path once. - - * scheme2c.init, kawa.init, umbscheme.init - (implementation-vicinity): find path once. - - * vscm.init (slib:features): Added macro. - - * RScheme.init (slib:features): Added defmacro. - - * mzscheme.init (slib:features): Added syntax-case. - - * guile.init, sisc.init (macro:load): slib:load-source. - - * umbscheme.init, pscheme.init (defmacro:eval, defmacro:load): - Simplified. - - * kawa.init, mitscheme.init, bigloo.init, gambit.init, - jscheme.init: (re)moved some comments. - - * Template.scm, t3.init, STk.init, macscheme.init, scheme2c.init, - scsh.init, chez.init, elk.init (slib:features): Added defmacro. - - * guile.init ((ice-9 slib)): "ice-9/slib.scm" doesn't become valid - (and shorter) until version guile-1.8.3. - - * mzscheme.init: Renamed from DrScheme.init. - (slib:features): Added format. - (slib:load-compiled): Handle SRFI requires. - - * Makefile (catalogs): Copy "mkpltcat.scm" to "mkimpcat.scm" in - mzscheme's implementation-vicinity. - (mkfiles): Added "mkpltcat.scm". - - * mkpltcat.scm: "mkimpcat.scm" for mzscheme which adds all - supported SRFIs to the catalog. - - * Makefile (ciefiles): Separated from Scheme sourcefiles. - (test): Unmaintained target removed. - - -=-=- + -=-=-=-=- SLIB is available from: - http://swiss.csail.mit.edu/ftpdir/scm/slib-3b1.zip - http://swiss.csail.mit.edu/ftpdir/scm/slib-3b1-1.noarch.rpm - http://swiss.csail.mit.edu/ftpdir/scm/slib-3b1-1.exe - swiss.csail.mit.edu:/pub/scm/slib-3b1.zip - swiss.csail.mit.edu:/pub/scm/slib-3b1-1.noarch.rpm - swiss.csail.mit.edu:/pub/scm/slib-3b1-1.exe + <http://groups.csail.mit.edu/mac/ftpdir/scm/slib-3b5.zip> +Also available as RPM: + <http://groups.csail.mit.edu/mac/ftpdir/scm/slib-3b5-1.src.rpm> + <http://groups.csail.mit.edu/mac/ftpdir/scm/slib-3b5-1.noarch.rpm> +Also available as MS-Windows installer: + <http://groups.csail.mit.edu/mac/ftpdir/scm/slib-3b5-1.exe> SLIB-PSD is a portable debugger for Scheme (requires emacs editor): - http://swiss.csail.mit.edu/ftpdir/scm/slib-psd1-3.tar.gz - swiss.csail.mit.edu:/pub/scm/slib-psd1-3.tar.gz + <http://groups.csail.mit.edu/mac/ftpdir/scm/slib-psd1-3.tar.gz> SCHELOG is an embedding of Prolog in Scheme+SLIB: - http://www.ccs.neu.edu/home/dorai/schelog/schelog.html + <http://www.ccs.neu.edu/home/dorai/schelog/schelog.html> Programs for printing and viewing TexInfo documentation (which SLIB has) come with GNU Emacs or can be obtained via ftp from: - ftp://ftp.gnu.org/pub/gnu/texinfo/texinfo-4.8.tar.gz + <ftp://ftp.gnu.org/pub/gnu/texinfo> diff --git a/Bev2slib.scm b/Bev2slib.scm index 30562f5..30562f5 100644..100755 --- a/Bev2slib.scm +++ b/Bev2slib.scm @@ -1,3 +1,424 @@ +2015-01-14 Aubrey Jaffer <jaffer@dv7t> + + * require.scm (*slib-version*): Bumped from 3b4 to 3b5. + +2014-04-07 Aubrey Jaffer <agj@alum.mit.edu> + + * rmdsff.scm (make-cell, integer->coordinates) + (coordinates->integer): Don't depend on LETREC* behavior. + +2014-03-30 Aubrey Jaffer <agj@alum.mit.edu> + + * rmdsff.scm: Removed #+CHOICE code comments. + +2014-03-13 Aubrey Jaffer <agj@alum.mit.edu> + + * rmdsff.scm: Improved algorithim eliminates gratuitous 0 digit at + top level. + +2014-02-10 Aubrey Jaffer <agj@alum.mit.edu> + + * Makefile, mklibcat.scm, rmdsff.scm, slib.texi (space-filling): + Added "rmdsff.scm" and documentation. + +2014-02-08 Aubrey Jaffer <agj@alum.mit.edu> + + * phil-spc.scm, schmooz.scm, slib.texi: Because TeXinfo-5 changed + the rules, don't allow text between @defun and @defunx. + + * usercat: Use local copy of "schmooz.scm". + +2013-05-08 Aubrey Jaffer <jaffer@dv7> + + * require.scm (*slib-version*): Bumped from 3b3 to 3b4. + +2013-01-17 Aubrey Jaffer <agj@alum.mit.edu> + + * strsrch.scm (substring?, substring-ci?): Replaced the + skip-vector with an alist (to work with wide characters). + +2013-01-10 Andy Wingo + + * README: Update documentation for Guile. + + * guile-2.init: + * guile.init: Factor an initialization file for Guile 2.0 and + later out of guile.init. This does not change the interface, + though -- loading guile.init will load guile-2.init if + appropriate, and otherwise executes its own code. + + * slib.nsi: + * Makefile (ifiles): Update build scripts. + +2012-12-29 Aubrey Jaffer <agj@alum.mit.edu> + + * slib.texi (Root Finding): Added note about root multiplicity. + +2012-06-27 Aubrey Jaffer <agj@alum.mit.edu> + + * structure.scm (define-structure): Reconciled with documentation. + +2012-04-09 Aubrey Jaffer <agj@alum.mit.edu> + + * Makefile (upgnu): Added target to upload to ftp.gnu.org. + +2012-01-11 Aubrey Jaffer <agj@alum.mit.edu> + + * slib.texi, logical.scm (integer->list): Negative k not allowed. + +2011-12-14 Aubrey Jaffer <agj@alum.mit.edu> + + * Makefile (html/slib, $(DESTDIR)$(htmldir)slib): HTML generated + by `makeinfo --html'. + +2011-10-25 Aubrey Jaffer <agj@alum.mit.edu> + + * Makefile (snapdir, infodir, htmldir): Added defaults so make + works with empty "config.status". + +2011-10-13 Aubrey Jaffer <agj@alum.mit.edu> + + * grapheps.ps (whole-page): Extract bounds from %%BoundingBox. + +2011-10-11 Aubrey Jaffer <agj@alum.mit.edu> + + * grapheps.scm, grapheps.ps (plot-text-column): Added. + +2011-10-10 Aubrey Jaffer <agj@alum.mit.edu> + + * grapheps.ps: Added copyright and license. + +2011-09-05 Aubrey Jaffer <agj@alum.mit.edu> + + * mklibcat.scm (collect): Changed to macro load. + +2011-06-05 Pierpaolo Bernardi + + * wttree.scm (wt-tree/union-merge): Added from MIT-Scheme; updated + license. + +2011-05-28 Aubrey Jaffer <agj@alum.mit.edu> + + * slib.texi (Bit-Twiddling): Clarified relationship between + list->integer and integer->list. + +2011-05-20 Aubrey Jaffer <agj@alum.mit.edu> + + * xml-parse.scm (ssax:read-string): Corrected typo. + +2011-04-11 Bill Schottstaedt (using Scheme-lint) + + * tzfile.scm (tzfile:read-bool): Simplified conditional. + + * sort.scm (sort!, sort): Removed unused variable. + + * solid.scm (scene:overcast, light:point): Removed unused variables. + + * root.scm (secant:find-root-1): Removed unused variable. + + * object.scm (make-generic-predicate): Simplified conditional. + + * mwexpand.scm (mw:finalize-body): Removed unused variables. + + * genwrite.scm (generic-write): Removed unused variable. + + * factor.scm (Solovay-Strassen-prime?): Simplified conditional. + + * bytenumb.scm (ieee-float->bytes, ieee-double->bytes): Removed + unused variable. + + * batch.scm (batch:run-script): Corrected arguments to batch:dialect. + (batch:extender): Corrected arguments to batch:call-with-output-script. + +2011-02-28 Aubrey Jaffer <agj@alum.mit.edu> + + * Makefile (collectx.scm): Always create, and don't depend on, + "collect.sc". + +2011-01-31 Aubrey Jaffer <agj@alum.mit.edu> + + * grapheps.scm (plot): Fixed documentation. + +2011-01-26 Aubrey Jaffer <agj@alum.mit.edu> + + * subarray.scm (subarray): Fixed documentation. + +2011-01-19 Aubrey Jaffer <agj@alum.mit.edu> + + * uri.scm (uri:decode-query): Don't split values on cr. + +2010-12-20 Aubrey Jaffer <agj@alum.mit.edu> + + * mklibcat.scm (precedence-parse): No longer needs defmacro. + + * mitscheme.init: Removed support for defmacro + when (mit-scheme-release>= 9 0). + + * wttree-test.scm (prop-wt-tree/index): Now covers everything + which wttest.scm does. Removed wttest.scm. + +2010-12-18 Aubrey Jaffer <agj@alum.mit.edu> + + * wttree-test.scm: Ported wttree test suite from Kazu Yamamoto. + (main): Demacroized. + +2010-12-17 Kazu Yamamoto + + * wttree.scm: Fixed bug where tree balance was lost by deletions + <http://hagi.is.s.u-tokyo.ac.jp/~yh/bst.pdf>. + +2010-12-01 Aubrey Jaffer <agj@alum.mit.edu> + + * mkclrnam.scm (load-rgb-txt): Added method for XKCD dictionary. + +2010-11-11 Aubrey Jaffer <agj@alum.mit.edu> + + * mkclrnam.scm (load-rgb-txt): Added method for "bang" dictionary. + +2010-11-10 Aubrey Jaffer <agj@alum.mit.edu> + + * colorspc.scm (L*a*b*:DE*94): From + <http://www.brucelindbloom.com/index.html?Eqn_DeltaE_CIE94.html> + replaced wedged L*C*h:DE*94. + + * mkclrnam.scm (load-rgb-txt): Added method for FED-STD-595C. + +2010-11-03 Aubrey Jaffer <agj@alum.mit.edu> + + * mkclrnam.scm (load-rgb-txt): Extract color-names from "ntc.js". + +2010-09-16 Aubrey Jaffer <agj@alum.mit.edu> + + * scanf.scm (*scanf): Handle array-ref argument expressions. + +2010-08-29 Aubrey Jaffer <agj@alum.mit.edu> + + * grapheps.scm (set-font): Take optional "encoding" argument. + + * grapheps.ps: Squelch trailing .0 in axis numbers. + +2010-07-08 Aubrey Jaffer <agj@alum.mit.edu> + + * slib.sh, gosh.init: Added support for (gosh) Gauche-0.9. + +2010-07-02 Aubrey Jaffer <agj@alum.mit.edu> + + * require.scm (*slib-version*): Bumped from 3b2 to 3b3. + + * dbutil.scm (close-database): Close read-only databases. + +2010-06-19 Aubrey Jaffer <agj@alum.mit.edu> + + * Makefile: INSTALL_INFO = ginstall-info + + * slib.texi (Lists as sequences): Corrected `last' example. + +2010-05-31 Aubrey Jaffer <agj@alum.mit.edu> + + * configure: Improved portability of trailing / detection. + + * saturate.txt, clrnamdb.scm: Updated now that interpolation is fixed. + + * colorspc.scm (wavelength->XYZ): Interpolation was backwards. + +2010-05-22 Aubrey Jaffer <agj@alum.mit.edu> + + * configure (ac_default_prefix): Was lacking trailing /. + +2010-04-14 Aubrey Jaffer <agj@alum.mit.edu> + + * Makefile (allfiles): Added "version.txi". + +2010-03-13 Aubrey Jaffer <agj@alum.mit.edu> + + * clrnamdb.scm, saturate.txt: Fixed several problems. + + * mkclrnam.scm (load-rgb-txt): Added input method for XCMS colors. + + * color.scm (color->L*a*b*): Corrected conversion from L*a*b*. + (color->string): Reduced precision on L*a*b*, L*u*v*, and L*C*h. + + * slib.texi (Define-Structure): Corrected documentation and example. + +2010-02-23 Aubrey Jaffer <agj@alum.mit.edu> + + * Makefile (Makefile): Runs ./configure to create config.status. + +2010-02-11 Aubrey Jaffer <agj@alum.mit.edu> + + * Makefile: Reorganized per http://www.gnu.org/prep/standards/ + + * guile.init (char-code-limit, scheme-file-suffix, read, array?): + Conditioned for Guile-1.9.7. + +2010-02-04 Aubrey Jaffer <agj@alum.mit.edu> + + * configure: GNU-style configuration for installation creates + config.status, which is included by Makefile. + +2010-02-03 Aubrey Jaffer <agj@alum.mit.edu> + + * guile.init (browse-url, vector->array, array->vector) + (random:chunk): Conditional definitions choke Guile-2. + +2010-02-01 Aubrey Jaffer <agj@alum.mit.edu> + + * Makefile: include config.status for install directories. + + * configure: Added Shell script for GNU-compatible configuration. + +2010-01-30 Aubrey Jaffer <agj@alum.mit.edu> + + * slib.texi (Installation): Added link to Guile manual. + Corrected @exdent usage. + +2010-01-28 Aubrey Jaffer <agj@alum.mit.edu> + + * guile.init: 1.8.6 needs exports. + (define): Don't redefine in guile-2 (1.9). + + * guile.use: Added; has just (use-modules (ice-9 slib)). + + * slib.sh (guile): Added: -l ${SCHEME_LIBRARY_PATH}guile.use + conditioned on "guile.use" existence. + +2010-01-27 Aubrey Jaffer <agj@alum.mit.edu> + + * math-integer.scm (remainder, modulo): Fixed documentation. + + * limit.scm (finite?): Added definition. + +2009-12-16 Aubrey Jaffer <agj@alum.mit.edu> + + * qp.scm (qp): Don't truncate symbols when printing. + +2009-10-22 Aubrey Jaffer <agj@alum.mit.edu> + + * transact.scm (word:lock!): Truncate email components so MS-Word + style ~$ckfile fits in 162.B. + +2009-10-21 Aubrey Jaffer <agj@alum.mit.edu> + + * dirs.scm (directory*-for-each): Added. + +2009-09-30 Aubrey Jaffer <agj@alum.mit.edu> + + * Makefile (install, uninstall): Added ciefiles. + +2009-09-19 Aubrey Jaffer <agj@alum.mit.edu> + + * srfi-39.scm (make-parameter, parameterize): Added. + +2009-09-11 Aubrey Jaffer <agj@alum.mit.edu> + + * s7.init: Added init file for S7, part of the Snd sound-editor. + +2009-08-14 Aubrey Jaffer <agj@alum.mit.edu> + + * grapheps.ps (bargraph, impulse): Fixed for ranges not containing 0. + +2009-08-02 Aubrey Jaffer <jaffer@localhost.localdomain> + + * require.scm (*slib-version*): Bumped from 3b1 to 3b2. + +2009-07-24 Clemens Fischer + + * html4each.scm (htm-fields): Value always is string. + +2009-07-18 Aubrey Jaffer <agj@alum.mit.edu> + + * prec.scm (prec:parse): Removed input newline flushing. + +2009-07-03 Aubrey Jaffer <agj@alum.mit.edu> + + * prec.scm (prec:parse): Added initial-column argument. + +2009-07-03 Sarah V. Jaffer + + * prec.scm: Rewrote to make thread-safe; fluid-let variables + replaced with `dyn' argument to most procedures. + +2009-06-15 Aubrey Jaffer <agj@alum.mit.edu> + + * prec.scm (prec:parse-nofix, prec:parse-postfix): Changed set! of + *syn-rules* to fluid-let. + +2009-06-05 Andrea Girotto + + * kawa.init (scheme-implementation-version): Update for Kawa-1.9.3. + +2009-05-17 Aubrey Jaffer <agj@alum.mit.edu> + + * dynamic.scm (dynamic-environment-rtd, dynamic-rtd): + * priorque.scm (make-heap): + * queue.scm (make-queue): + * synclo.scm (make-reserved-name-item): + * values.scm (values): In SISC (1.16.6), the second argument to + 'record-constructor' is not optional. Second arguments added. + + * sisc.init (syncase:eval, syncase:load): Added. + +2009-02-10 Adam Sampson + + * Makefile (install): Fixed DESTDIR use. + +2008-12-14 Aubrey Jaffer <agj@alum.mit.edu> + + * format.texi (Format Interface): Updated meta-information. + +2008-12-13 Aubrey Jaffer <agj@alum.mit.edu> + + * slib.texi (Catalog Creation): Added mention of implcat. + (Compiled and Implementation-Specific Features): Added section. + +2008-12-09 Aubrey Jaffer <agj@alum.mit.edu> + + * tzfile.scm (tzfile:read): Made warning more informative. + (tzfile:read): Commented out warning. + +2008-12-07 Aubrey Jaffer <agj@alum.mit.edu> + + * slib.texi (System Interface): The procedure `system' is Posix. + +2008-11-15 Aubrey Jaffer <agj@alum.mit.edu> + + * fdl.texi: Updated to Version 1.3. + + * mitscheme.init(system): Now called run-shell-command. + (print-call-stack): Added dummy definition for trace. + +2008-06-18 Aubrey Jaffer <agj@alum.mit.edu> + + * require.scm (report:print): Report locations if given filename + argument. + +2008-05-17 Aubrey Jaffer <agj@alum.mit.edu> + + * html4each.scm (htm-fields): Treat DTDs like comments. Fixed + handling of closing tags. Corrected documentation. + +2008-04-09 Aubrey Jaffer <agj@alum.mit.edu> + + * qp.scm (qp): Don't add newlines when *qp-width* is #f. + + * trace.scm (debug:trace-procedure): Increased indent increment to + 2; wrap at column 31 so that depths 16 to 31 are offset. + + * guile.init (list->array): Redefine to take 3 arguments. + (vector->array, array->vector): Define if missing. + +2008-02-25 Aubrey Jaffer <agj@alum.mit.edu> + + * guile.init (implementation-vicinity): Thomas Bushnell points out + that %site-dir mashes all slibcat for all versions together. + %library-dir (since Guile-1.6) is the versioned directory. + (library-vicinity): Last resort changed to "/usr/share/slib/". + +2008-02-10 Aubrey Jaffer <agj@alum.mit.edu> + + * slib.texi (Input/Output): Fixed typo in file-position. + (System): Macro:load doesn't affect current-error-port. + 2008-02-01 Aubrey Jaffer <jaffer@aubrey.jaffer> * require.scm (*slib-version*): Bumped from 3a5 to 3b1. @@ -1,5 +1,13 @@ -FAQ (Frequently Asked Questions and answers) for SLIB Scheme Library (slib-3b1). -Written by Aubrey Jaffer (http://swiss.csail.mit.edu/~jaffer). +FAQ (Frequently Asked Questions and answers) for SLIB Scheme Library (slib-3b5). +Written by Aubrey Jaffer (http://people.csail.mit.edu/jaffer). + + TOPICS: + + INTRODUCTION AND GENERAL INFORMATION + SLIB INSTALLATION PROBLEMS + USING SLIB PROCEDURES + MACROS + SRFI INTRODUCTION AND GENERAL INFORMATION @@ -10,19 +18,20 @@ utility functions for all standard scheme implementations. [] What is Scheme? -Scheme is a programming language in the Lisp family. +The Algorithmic Language Scheme is a programming language in the Lisp +family. [] Which implementations has SLIB been ported to? -SLIB supports Bigloo, Chez, ELK 3.0, GAMBIT 3.0, Guile, JScheme, +SLIB supports Bigloo, Chez, ELK 3.0, Gambit 4.0, Guile, JScheme, MacScheme, MITScheme, PLT Scheme (DrScheme and MzScheme), Pocket -Scheme, RScheme, scheme->C, Scheme48, SCM, SCM Mac, scsh, Stk, T3.1, -umb-scheme, and VSCM. +Scheme, RScheme, S7, scheme->C, Scheme48, SCM, SCM Mac, scsh, SISC, +Stk, T3.1, umb-scheme, and VSCM. [] How can I obtain SLIB? SLIB is available via http from: - http://swiss.csail.mit.edu/~jaffer/SLIB.html + http://people.csail.mit.edu/jaffer/SLIB.html SLIB is available via ftp from: swiss.csail.mit.edu:/pub/scm/ @@ -47,9 +56,9 @@ Several times a year. [] What is the latest version? -The version as of this writing is slib-3b1. The latest documentation -is available online at: - http://swiss.csail.mit.edu/~jaffer/SLIB.html +The newest released version as of this writing is slib-3b5. The +documentation for the latest release is available online at: +http://people.csail.mit.edu/jaffer/SLIB.html [] Which version am I using? @@ -227,6 +236,7 @@ srfi-9: Defining Record Types srfi-11: Syntax for receiving multiple values srfi-23: Error reporting mechanism srfi-28: Basic Format Strings +srfi-39: Parameter objects srfi-47: Array srfi-59: Vicinity srfi-60: Integers as Bits @@ -234,3 +244,6 @@ srfi-61: A more general cond clause srfi-63: Homogeneous and Heterogeneous Arrays srfi-94: Type-Restricted Numerical Functions srfi-95: Sorting and Merging + +srfi-96 "SLIB Prerequisites" is the interface which Scheme +implementations provide in order to host SLIB. @@ -3,107 +3,52 @@ # # This code is in the public domain. -SHELL = /bin/sh -intro: - @echo - @echo "Welcome to SLIB. Read \"README\" and \"slib.info\" (or" - @echo "\"slib.texi\") to learn how to install and use SLIB." - @echo - -make slib.info - -VERSION = 3b1 -RELEASE = 1 - -rpm_prefix=$(HOME)/rpmbuild/ -prefix = /usr/local/ -exec_prefix = $(prefix) -# directory where `make install' will put executable. -bindir = $(exec_prefix)bin/ -libdir = $(exec_prefix)lib/ -libslibdir = $(libdir)slib/ -# directory where `make install' will put manual page. -man1dir = $(prefix)man/man1/ -infodir = $(prefix)info/ +# These are normally set in "config.status"; defaults are here so that +# "make" won't complain about target redefinitions. +snapdir=$(HOME)/pub/ +infodir=$(HOME)/info/ +htmldir=$(HOME)/public_html/ -PREVDOCS = prevdocs/ - -htmldir=../public_html/ +SHELL = /bin/sh +INSTALL = install +INSTALL_PROGRAM = ${INSTALL} +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_INFO = ginstall-info + +SCHEME = scm +CHPAT = $(HOME)/bin/chpat +MAKEDEV = $(MAKE) -f $(HOME)/makefile.dev +TEXI2HTML = /usr/local/bin/texi2html -split -verbose +TEXI2PDF = texi2pdf +RSYNC = rsync -av +Uploadee = csail RUNNABLE = scheme48 S48INIT = scheme48.init S48LIB = $(libdir)$(RUNNABLE)/ S48SLIB = $(S48LIB)slib/ -VM = scheme48vm IMAGE48 = slib.image -INSTALL_DATA = install -c -$(DESTDIR)$(S48LIB)slibcat: - touch $(DESTDIR)$(S48LIB)slibcat - -catalogs: - -if type scm; then scm -c "(require 'new-catalog)"; fi - -if type guile; then guile -l guile.init -c\ - "(use-modules (ice-9 slib)) (require 'new-catalog)"; fi - -if type umb-scheme; then SCHEME_INIT=umbscheme.init;export SCHEME_INIT;\ - echo "(require 'new-catalog)" | umb-scheme; fi - -if type mzscheme; then\ - SCHEME_LIBRARY_PATH=`pwd`/;export SCHEME_LIBRARY_PATH;\ - cp mkpltcat.scm `mzscheme -mf mzscheme.init -e '(begin(display(implementation-vicinity))(exit))'`mkimpcat.scm;\ - mzscheme -g -f mzscheme.init -e "(require 'new-catalog)" </dev/null; fi - -if type scheme48; then make install48; fi +intro: config.status + @echo + @echo "Welcome to SLIB. Read \"README\" and \"slib.info\" (or" + @echo "\"slib.texi\") to learn how to install and use SLIB." + @echo -MKNMDB = (require 'color-database) (make-slib-color-name-db) (slib:exit) -clrnamdb: clrnamdb.scm -clrnamdb.scm: mkclrnam.scm color.scm resenecolours.txt saturate.txt nbs-iscc.txt - if type scm; then scm -e"$(MKNMDB)";\ - elif type guile; then guile -l guile.init -c\ - "(use-modules (ice-9 slib)) $(MKNMDB)";\ - elif type slib48; then echo -e "$(MKNMDB)\n,exit" | slib48 -h 3000000;\ - elif type umb-scheme; then SCHEME_INIT=`pwd`/umbscheme.init;export SCHEME_INIT;\ - echo "$(MKNMDB)" | umb-scheme;\ - elif type mzscheme; then SCHEME_LIBRARY_PATH=`pwd`/;export SCHEME_LIBRARY_PATH;\ - echo "$(MKNMDB)" | mzscheme -f mzscheme.init;\ - fi +VERSION = 3b5 +RELEASE = 1 -$(DESTDIR)$(S48SLIB)strport.scm: - mkdir -p $(DESTDIR)$(S48SLIB) - echo ";;; strport.scm -*- scheme -*-">$(DESTDIR)$(S48SLIB)strport.scm - echo ";@">>$(DESTDIR)$(S48SLIB)strport.scm - echo "(define (call-with-output-string proc)">>$(DESTDIR)$(S48SLIB)strport.scm - echo " (let ((port (make-string-output-port)))">>$(DESTDIR)$(S48SLIB)strport.scm - echo " (proc port)">>$(DESTDIR)$(S48SLIB)strport.scm - echo " (string-output-port-output port)))">>$(DESTDIR)$(S48SLIB)strport.scm - echo "(define (call-with-input-string string proc)">>$(DESTDIR)$(S48SLIB)strport.scm - echo " (proc (make-string-input-port string)))">>$(DESTDIR)$(S48SLIB)strport.scm +# ./configure --distdir=${HOME}/dist/ --snapdir=${HOME}/pub/ --htmldir=${HOME}/public_html/ --pdfdir=${HOME}/public_html/ -$(DESTDIR)$(S48SLIB)record.scm: - mkdir -p $(DESTDIR)$(S48SLIB) - echo ";;; record.scm -*- scheme -*-">$(DESTDIR)$(S48SLIB)record.scm - echo ";; This code is in the public domain">>$(DESTDIR)$(S48SLIB)record.scm - echo ";@">>$(DESTDIR)$(S48SLIB)record.scm - echo "(define make-record-type make-record-type)">>$(DESTDIR)$(S48SLIB)record.scm - echo "(define record-constructor">>$(DESTDIR)$(S48SLIB)record.scm - echo " (let ((constructor record-constructor))">>$(DESTDIR)$(S48SLIB)record.scm - echo " (lambda (rt . fields)">>$(DESTDIR)$(S48SLIB)record.scm - echo " (constructor rt (if (pair? fields)">>$(DESTDIR)$(S48SLIB)record.scm - echo " (car fields)">>$(DESTDIR)$(S48SLIB)record.scm - echo " (record-type-field-names rt))))))">>$(DESTDIR)$(S48SLIB)record.scm - echo "(define record-predicate record-predicate)">>$(DESTDIR)$(S48SLIB)record.scm - echo "(define record-accessor record-accessor)">>$(DESTDIR)$(S48SLIB)record.scm - echo "(define record-modifier record-modifier)">>$(DESTDIR)$(S48SLIB)record.scm +config.status: + ./configure +Makefile: config.status +include config.status -slib48: $(IMAGE48) -$(IMAGE48): Makefile $(S48INIT) - S48_VERSION="`echo ,exit | $(RUNNABLE) | sed -n 's/Welcome to Scheme 48 //;s/ ([^)]*)[.]//;p;q'`";export S48_VERSION;\ - S48_VICINITY="$(DESTDIR)$(S48LIB)";export S48_VICINITY;\ - SCHEME_LIBRARY_PATH="`pwd`/";export SCHEME_LIBRARY_PATH;\ - $(RUNNABLE) < $(S48INIT) -install48: $(IMAGE48) $(DESTDIR)$(S48SLIB)strport.scm $(DESTDIR)$(S48SLIB)record.scm - $(INSTALL_DATA) $(IMAGE48) $(DESTDIR)$(S48LIB) - (echo '#! /bin/sh';\ - echo exec $(RUNNABLE) -i '$(DESTDIR)$(S48LIB)$(IMAGE48)' \"\$$\@\") \ - > $(DESTDIR)$(bindir)slib48 - chmod +x $(DESTDIR)$(bindir)slib48 +prevdocsdir = prevdocs/ +libslibdir = $(libdir)slib/ +windistdir = /c/Voluntocracy/dist/ +rpm_prefix = $(HOME)/rpmbuild/ ffiles = format.scm printf.scm genwrite.scm pp.scm \ ppfile.scm strcase.scm debug.scm trace.scm \ @@ -116,14 +61,16 @@ revfiles = sc4opt.scm sc4sc3.scm sc2.scm mularg.scm mulapply.scm \ afiles = charplot.scm root.scm cring.scm selfset.scm limit.scm \ timecore.scm psxtime.scm cltime.scm timezone.scm tzfile.scm \ math-real.scm -bfiles = fluidlet.scm object.scm recobj.scm yasyn.scm collect.scm collectx.scm +bfiles = fluidlet.scm fluid-let.scm object.scm recobj.scm yasyn.scm \ + collect.scm collectx.scm scfiles = r4rsyn.scm scmacro.scm synclo.scm synrul.scm synchk.scm \ repl.scm macwork.scm mwexpand.scm mwdenote.scm mwsynrul.scm scafiles = scainit.scm scaglob.scm scamacr.scm scaoutp.scm scaexpp.scm \ structure.scm -srfiles = srfi-2.scm srfi-8.scm srfi-9.scm srfi-11.scm srfi-23.scm srfi-61.scm -efiles = record.scm dynamic.scm process.scm hash.scm \ - wttree.scm wttest.scm sierpinski.scm soundex.scm simetrix.scm +srfiles = srfi-2.scm srfi-8.scm srfi-9.scm srfi-11.scm \ + srfi-23.scm srfi-39.scm srfi-61.scm +efiles = record.scm dynamic.scm process.scm hash.scm wttree.scm \ + wttree-test.scm sierpinski.scm soundex.scm simetrix.scm rfiles = rdms.scm alistab.scm paramlst.scm \ batch.scm crc.scm dbrowse.scm getopt.scm dbinterp.scm \ dbcom.scm dbsyn.scm @@ -140,7 +87,7 @@ txiscms =grapheps.scm glob.scm getparam.scm \ mkclrnam.scm color.scm subarray.scm dbutil.scm array.scm transact.scm\ arraymap.scm phil-spc.scm lineio.scm differ.scm cvs.scm tree.scm\ coerce.scm byte.scm bytenumb.scm matfile.scm tsort.scm manifest.scm\ - peanosfc.scm linterp.scm math-integer.scm + peanosfc.scm linterp.scm math-integer.scm rmdsff.scm txifiles =grapheps.txi glob.txi getparam.txi\ vet.txi top-refs.txi hashtab.txi chap.txi comparse.txi\ alist.txi ratize.txi modular.txi dirs.txi priorque.txi queue.txi\ @@ -151,242 +98,333 @@ txifiles =grapheps.txi glob.txi getparam.txi\ mkclrnam.txi color.txi subarray.txi dbutil.txi array.txi transact.txi\ arraymap.txi phil-spc.txi lineio.txi differ.txi cvs.txi tree.txi\ coerce.txi byte.txi bytenumb.txi matfile.txi tsort.txi manifest.txi\ - peanosfc.txi linterp.txi math-integer.txi + peanosfc.txi linterp.txi math-integer.txi rmdsff.txi #txifiles = `echo $(txiscms) | sed 's%.scm%.txi%g'` texifiles = schmooz.texi indexes.texi object.texi format.texi limit.texi \ fdl.texi -docfiles = ANNOUNCE README COPYING FAQ slib.1 slib.info slib.texi version.txi\ - ChangeLog $(texifiles) $(txifiles) +docfiles = ANNOUNCE README COPYING FAQ slib.1 slib.texi \ + $(texifiles) $(txifiles) mkfiles = Makefile require.scm Template.scm mklibcat.scm mkpltcat.scm \ - syncase.sh Bev2slib.scm slib.spec slib.sh grapheps.ps slib.nsi + syncase.sh Bev2slib.scm slib.spec slib.sh grapheps.ps slib.nsi \ + configure ifiles = bigloo.init chez.init elk.init macscheme.init mitscheme.init \ scheme2c.init scheme48.init gambit.init t3.init vscm.init \ scm.init scsh.init sisc.init pscheme.init STk.init kawa.init \ - RScheme.init mzscheme.init umbscheme.init guile.init jscheme.init + RScheme.init mzscheme.init umbscheme.init jscheme.init s7.init \ + guile.init guile.use guile-2.init tfiles = macrotst.scm dwindtst.scm formatst.scm sfiles = $(ffiles) $(lfiles) $(revfiles) $(afiles) $(scfiles) $(efiles) \ $(rfiles) colorspc.scm $(scafiles) $(txiscms) $(srfiles) -allfiles = $(docfiles) $(mkfiles) $(ifiles) $(sfiles) $(tfiles) $(bfiles) \ - slib.doc $(ciefiles) clrnamdb.scm SLIB.ico - -pinstall: slib.1 - mkdir -p $(DESTDIR)$(man1dir) - -cp slib.1 $(DESTDIR)$(man1dir) +allfiles = $(docfiles) $(mkfiles) $(ifiles) $(sfiles) $(tfiles) \ + $(bfiles) slib.doc $(ciefiles) clrnamdb.scm SLIB.ico ChangeLog \ + slib.info version.txi +libfiles = $(ifiles) $(sfiles) $(bfiles) $(mkfiles) $(ciefiles) clrnamdb.scm +tagfiles = $(docfiles) $(mkfiles) $(sfiles) $(bfiles) $(tfiles) $(ifiles) + +# $(DESTDIR)$(S48SLIB) isn't included in installdirs because +# Scheme48 may not be installed. +$(DESTDIR)$(S48SLIB): + mkdir -p $(DESTDIR)$(S48SLIB) -install: pinstall clrnamdb.scm +installdirs: + mkdir -p $(DESTDIR)$(mandir)man1/ mkdir -p $(DESTDIR)$(libslibdir) - -cp $(ifiles) $(sfiles) $(bfiles) $(mkfiles) clrnamdb.scm $(DESTDIR)$(libslibdir) mkdir -p $(DESTDIR)$(bindir) - echo '#! /bin/sh' > $(DESTDIR)$(bindir)slib - echo SCHEME_LIBRARY_PATH=$(DESTDIR)$(libslibdir) >> $(DESTDIR)$(bindir)slib - echo S48_VICINITY=$(DESTDIR)$(S48LIB) >> $(DESTDIR)$(bindir)slib - echo VERSION=$(VERSION) >> $(DESTDIR)$(bindir)slib - echo export SCHEME_LIBRARY_PATH S48_VICINITY >> $(DESTDIR)$(bindir)slib - cat slib.sh >> $(DESTDIR)$(bindir)slib - chmod +x $(DESTDIR)$(bindir)slib - -uninstall: - -(cd $(DESTDIR)$(libslibdir); rm $(ifiles) $(sfiles) $(bfiles) $(mkfiles) clrnamdb.scm) - -rm $(DESTDIR)$(bindir)slib - -rm $(DESTDIR)$(man1dir)slib.1 + mkdir -p $(DESTDIR)$(infodir) + mkdir -p $(DESTDIR)$(htmldir) + mkdir -p $(DESTDIR)$(pdfdir) + mkdir -p $(DESTDIR)$(dvidir) + +$(txifiles): slib.texi $(txiscms) schmooz.scm + $(SCHEME) -rschmooz -e'(schmooz "$<")' -slib.doc: slib.1 +slib.dvi: slib.texi version.txi $(txifiles) $(texifiles) + $(TEXI2DVI) -b -c $< +dvi: slib.dvi +xdvi: slib.dvi + xdvi $< +install-dvi: slib.dvi installdirs + $(INSTALL_DATA) $< $(DESTDIR)$(dvidir) + +slib.pdf: slib.texi version.txi $(txifiles) $(texifiles) + $(TEXI2PDF) -b -c $< +pdf: slib.pdf +xpdf: slib.pdf + xpdf $< +install-pdf: slib.pdf installdirs + $(INSTALL_DATA) $< $(DESTDIR)$(pdfdir) + +# slib_toc.html: slib.texi version.txi $(txifiles) $(texifiles) +# $(TEXI2HTML) $< +# html: slib_toc.html +# $(DESTDIR)$(htmldir)slib_toc.html: slib_toc.html Makefile installdirs +# -rm -f slib_stoc.html +# if [ -f $(prevdocsdir)slib_toc.html ]; \ +# then hitch $(prevdocsdir)slib_\*.html slib_\*.html \ +# $(DESTDIR)$(htmldir); \ +# else $(INSTALL_DATA) slib_*.html $(DESTDIR)$(htmldir);fi +# install-html: $(DESTDIR)$(htmldir)slib_toc.html + +html/slib: slib.texi version.txi $(txifiles) $(texifiles) + mkdir -p html + rm -rf html/slib + makeinfo --html $< -o html/slib + if type icoize>/dev/null; then icoize ../Logo/SCM.ico html/slib/*.html; fi +html: html/slib +$(DESTDIR)$(htmldir)slib: html/slib + -rm -rf $(DESTDIR)$(htmldir)slib + mkdir -p $(DESTDIR)$(htmldir)slib + $(INSTALL_DATA) html/slib/*.html $(DESTDIR)$(htmldir)slib +install-html: $(DESTDIR)$(htmldir)slib + +# Used by w32install +slib.html: slib.texi + $(MAKEINFO) --html --no-split --no-warn --force $< + +slib-$(VERSION).info: slib.texi version.txi $(txifiles) $(texifiles) + $(MAKEINFO) $< --no-warn --no-split -o slib-$(VERSION).info +slib.info: slib-$(VERSION).info + if [ -f $(prevdocsdir)slib.info ];\ + then infobar $(prevdocsdir)slib.info slib-$(VERSION).info \ + slib.info;\ + else cp $< $@;fi +$(DESTDIR)$(infodir)slib.info: slib.info installdirs + $(INSTALL_DATA) $< $@ + -rm $(DESTDIR)$(infodir)slib.info.gz + $(POST_INSTALL) # Post-install commands follow. + -$(INSTALL_INFO) $@ $(DESTDIR)$(infodir)dir +install-info: $(DESTDIR)$(infodir)slib.info +info: install-info +$(DESTDIR)$(infodir)slib.info.gz: $(DESTDIR)$(infodir)slib.info + gzip -f $< +install-infoz: $(DESTDIR)$(infodir)slib.info.gz +infoz: install-infoz + +slib.doc: slib.1 nroff -man $< | ul -tunknown >$@ +install-man: slib.1 installdirs + -$(INSTALL_DATA) $< $(DESTDIR)$(mandir)man1/ + +docs: $(DESTDIR)$(infodir)slib.info.gz \ + $(DESTDIR)$(htmldir)slib_toc.html slib.dvi \ + $(DESTDIR)$(pdfdir)slib.pdf \ + slib.doc + +MKNMDB = (require 'color-database) (make-slib-color-name-db) (slib:exit) +# this comment fixes emacs' colorizing + +clrnamdb: clrnamdb.scm +clrnamdb.scm: mkclrnam.scm color.scm resenecolours.txt saturate.txt nbs-iscc.txt + if type scm; then scm -e"$(MKNMDB)";\ + elif type guile; then guile -l guile.init -c\ + "(use-modules (ice-9 slib)) $(MKNMDB)";\ + elif type slib48; then echo -e "$(MKNMDB)\n,exit" | slib48 -h 3000000;\ + elif type umb-scheme; \ + then SCHEME_INIT=`pwd`/umbscheme.init;export SCHEME_INIT;\ + echo "$(MKNMDB)" | umb-scheme;\ + elif type mzscheme; \ + then SCHEME_LIBRARY_PATH=`pwd`/;export SCHEME_LIBRARY_PATH;\ + echo "$(MKNMDB)" | mzscheme -f mzscheme.init;\ + fi + +catalogs: + -if type scm; then scm -c "(require 'new-catalog)"; fi + -if type guile; then guile -l guile.init -c\ + "(use-modules (ice-9 slib)) (require 'new-catalog)"; fi + -if type umb-scheme; then\ + SCHEME_INIT=umbscheme.init;export SCHEME_INIT;\ + echo "(require 'new-catalog)" | umb-scheme; fi + -if type mzscheme; then\ + SCHEME_LIBRARY_PATH=`pwd`/;export SCHEME_LIBRARY_PATH;\ + cp mkpltcat.scm `mzscheme -mf mzscheme.init -e '(begin(display(implementation-vicinity))(exit))'`mkimpcat.scm;\ + mzscheme -g -f mzscheme.init -e "(require 'new-catalog)"</dev/null; fi + -if type scheme48; then $(MAKE) install48; fi -slib.html: slib.texi - makeinfo --html --no-split --no-warn --force slib.texi +$(DESTDIR)$(S48SLIB)strport.scm: $(DESTDIR)$(S48SLIB) + echo ";;; strport.scm -*- scheme -*-">$(DESTDIR)$(S48SLIB)strport.scm + echo ";@">>$(DESTDIR)$(S48SLIB)strport.scm + echo "(define (call-with-output-string proc)">>$(DESTDIR)$(S48SLIB)strport.scm + echo " (let ((port (make-string-output-port)))">>$(DESTDIR)$(S48SLIB)strport.scm + echo " (proc port)">>$(DESTDIR)$(S48SLIB)strport.scm + echo " (string-output-port-output port)))">>$(DESTDIR)$(S48SLIB)strport.scm + echo "(define (call-with-input-string string proc)">>$(DESTDIR)$(S48SLIB)strport.scm + echo " (proc (make-string-input-port string)))">>$(DESTDIR)$(S48SLIB)strport.scm + +$(DESTDIR)$(S48SLIB)record.scm: $(DESTDIR)$(S48SLIB) + echo ";;; record.scm -*- scheme -*-">$(DESTDIR)$(S48SLIB)record.scm + echo ";; This code is in the public domain">>$(DESTDIR)$(S48SLIB)record.scm + echo ";@">>$(DESTDIR)$(S48SLIB)record.scm + echo "(define make-record-type make-record-type)">>$(DESTDIR)$(S48SLIB)record.scm + echo "(define record-constructor">>$(DESTDIR)$(S48SLIB)record.scm + echo " (let ((constructor record-constructor))">>$(DESTDIR)$(S48SLIB)record.scm + echo " (lambda (rt . fields)">>$(DESTDIR)$(S48SLIB)record.scm + echo " (constructor rt (if (pair? fields)">>$(DESTDIR)$(S48SLIB)record.scm + echo " (car fields)">>$(DESTDIR)$(S48SLIB)record.scm + echo " (record-type-field-names rt))))))">>$(DESTDIR)$(S48SLIB)record.scm + echo "(define record-predicate record-predicate)">>$(DESTDIR)$(S48SLIB)record.scm + echo "(define record-accessor record-accessor)">>$(DESTDIR)$(S48SLIB)record.scm + echo "(define record-modifier record-modifier)">>$(DESTDIR)$(S48SLIB)record.scm + +slib48: $(IMAGE48) +$(IMAGE48): $(S48INIT) Makefile + S48_VERSION="`echo ,exit | $(RUNNABLE) |\ + sed -n 's/Welcome to Scheme 48 //;s/ ([^)]*)[.]//;p;q'`";\ + export S48_VERSION;\ + S48_VICINITY="$(DESTDIR)$(S48LIB)";export S48_VICINITY;\ + SCHEME_LIBRARY_PATH="`pwd`/";export SCHEME_LIBRARY_PATH;\ + $(RUNNABLE) < $< +install48: $(IMAGE48) $(DESTDIR)$(S48SLIB)strport.scm \ + $(DESTDIR)$(S48SLIB)record.scm + $(INSTALL_DATA) $(IMAGE48) $(DESTDIR)$(S48LIB) + (echo '#! /bin/sh';\ + echo exec $(RUNNABLE) -i '$(DESTDIR)$(S48LIB)$(IMAGE48)' \"\$$\@\") \ + > $(DESTDIR)$(bindir)slib48 + chmod +x $(DESTDIR)$(bindir)slib48 +uninstall48: + -rm $(DESTDIR)$(S48LIB)$(IMAGE48) + +install-lib: $(libfiles) installdirs + -$(INSTALL_DATA) $(libfiles) $(DESTDIR)$(libslibdir) + +install-script: slib.sh installdirs + echo '#! /bin/sh' > slib-script + echo SCHEME_LIBRARY_PATH=$(libslibdir) >> slib-script + echo S48_VICINITY=$(S48LIB) >> slib-script + echo VERSION=$(VERSION) >> slib-script + echo export SCHEME_LIBRARY_PATH S48_VICINITY>> slib-script + cat $< >> slib-script + $(INSTALL_PROGRAM) slib-script $(DESTDIR)$(bindir)slib + rm slib-script + +install: install-script install-lib install-infoz install-man + +uninstall: uninstall48 + $(PRE_UNINSTALL) # Pre-uninstall commands follow. + -$(INSTALL_INFO) --delete $(DESTDIR)$(infodir)slib.info \ + $(DESTDIR)$(infodir)dir + $(NORMAL_UNINSTALL) # Normal commands follow. + -rm $(DESTDIR)$(infodir)slib.info* + -rm $(DESTDIR)$(mandir)man1/slib.1 + -rm $(DESTDIR)$(bindir)slib + cd $(DESTDIR)$(libslibdir); rm $(libfiles) + $(POST_UNINSTALL) # Post-uninstall commands follow. + -rmdir $(DESTDIR)$(libslibdir) ## to build a windows installer ## make sure makeinfo and NSIS are available on the commandline -w32install: slib.html - makensis slib.nsi +w32install: slib.nsi slib.html + makensis $< #### Stuff for maintaining SLIB below #### ver = $(VERSION) -version.txi: Makefile - echo @set SLIBVERSION $(ver) > version.txi - echo @set SLIBDATE `date +"%B %Y"` >> version.txi -scheme = scm - -collect.sc: +collectx.scm: collect.scm macwork.scm echo "(require 'macros-that-work)" > collect.sc echo "(require 'pprint-file)" >> collect.sc echo "(require 'yasos)" >> collect.sc echo "(pprint-filter-file \"collect.scm\" macwork:expand \"collectx.scm\")" >> collect.sc echo "(slib:exit #t)" >> collect.sc + $(SCHEME) < collect.sc -collectx.scm: collect.scm macwork.scm collect.sc - $(scheme) < collect.sc - -$(txifiles): $(txiscms) schmooz.scm - $(scheme) -rschmooz -e'(schmooz "slib.texi")' - -dvi: slib.dvi -slib.dvi: version.txi slib.texi $(txifiles) $(texifiles) - texi2dvi -b -c slib.texi -xdvi: slib.dvi - xdvi -s 4 slib.dvi - -pdf: $(htmldir)slib.pdf -$(htmldir)slib.pdf: version.txi slib.texi $(txifiles) $(texifiles) -# dvipdf slib.dvi # doesn't have links! - texi2pdf -b -c slib.texi - mv slib.pdf $(htmldir) -xpdf: $(htmldir)slib.pdf - xpdf $(htmldir)slib.pdf - -TEXI2HTML = /usr/local/bin/texi2html -split -verbose -slib_toc.html: version.txi slib.texi $(txifiles) $(texifiles) - ${TEXI2HTML} slib.texi -html: $(htmldir)slib_toc.html -$(htmldir)slib_toc.html: slib_toc.html Makefile - -rm -f slib_stoc.html - if [ -f $(PREVDOCS)slib_toc.html ]; \ - then hitch $(PREVDOCS)slib_\*.html slib_\*.html $(htmldir); \ - else cp slib_*.html $(htmldir);fi - -slib-$(VERSION).info: version.txi slib.texi $(txifiles) $(texifiles) - makeinfo slib.texi --no-warn --no-split -o slib.info - mv slib.info slib-$(VERSION).info -slib.info: slib-$(VERSION).info - if [ -f $(PREVDOCS)slib.info ];\ - then infobar $(PREVDOCS)slib.info slib-$(VERSION).info slib.info;\ - else cp slib-$(VERSION).info slib.info;fi -info: installinfo -installinfo: $(DESTDIR)$(infodir)slib.info -$(DESTDIR)$(infodir)slib.info: slib.info - mkdir -p $(DESTDIR)$(infodir) - cp -p slib.info $(DESTDIR)$(infodir)slib.info - -install-info $(DESTDIR)$(infodir)slib.info $(DESTDIR)$(infodir)dir - -rm $(DESTDIR)$(infodir)slib.info.gz -infoz: installinfoz -installinfoz: $(DESTDIR)$(infodir)slib.info.gz -$(DESTDIR)$(infodir)slib.info.gz: $(DESTDIR)$(infodir)slib.info - gzip -f $(DESTDIR)$(infodir)slib.info - -docs: $(DESTDIR)$(infodir)slib.info.gz $(htmldir)slib_toc.html slib.dvi \ - $(htmldir)slib.pdf slib.doc - xdvi -s 4 slib.dvi - -makedev = make -f $(HOME)/makefile.dev -CHPAT=$(HOME)/bin/chpat -RSYNC=rsync -bav -UPLOADEE=swissnet_upload -dest = $(HOME)/dist/ -DOSCM = /c/Voluntocracy/dist/ - -temp/slib: $(allfiles) +temp/slib/: $(allfiles) -rm -rf temp - mkdir -p temp/slib - ln $(allfiles) temp/slib + mkdir -p temp/slib/ + ln $(allfiles) temp/slib/ -infotemp/slib: slib.info - -rm -rf infotemp - mkdir -p infotemp/slib - ln slib.info slib.info-* infotemp/slib #For change-barred HTML. -prevdocs: $(PREVDOCS)slib_toc.html $(PREVDOCS)slib.info -$(PREVDOCS)slib_toc.html: -$(PREVDOCS)slib.info: Makefile - cd $(PREVDOCS); unzip -ao $(dest)slib*.zip - rm $(PREVDOCS)slib/slib.info - cd $(PREVDOCS)slib; make slib.info; make slib_toc.html - cd $(PREVDOCS); mv -f slib/slib.info slib/*.html ./ - rm -rf $(PREVDOCS)slib +prevdocs: $(prevdocsdir)slib_toc.html $(prevdocsdir)slib.info +$(prevdocsdir)slib_toc.html: +$(prevdocsdir)slib.info: Makefile + cd $(prevdocsdir); unzip -ao $(distdir)slib*.zip + rm $(prevdocsdir)slib/slib.info + cd $(prevdocsdir)slib; $(MAKE) slib.info; $(MAKE) slib_toc.html + cd $(prevdocsdir); mv -f slib/slib.info slib/*.html ./ + rm -rf $(prevdocsdir)slib -rm -f slib-$(VERSION).info -distinfo: $(dest)slib.info.zip -$(dest)slib.info.zip: infotemp/slib - $(makedev) TEMP=infotemp/ DEST=$(dest) PROD=slib ver=.info zip - rm -rf infotemp - release: dist pdf tar.gz # rpm cvs tag -F slib-$(VERSION) cp ANNOUNCE $(htmldir)SLIB_ANNOUNCE.txt cp COPYING $(htmldir)SLIB_COPYING.txt cp FAQ $(htmldir)SLIB.FAQ $(RSYNC) $(htmldir)SLIB.html $(htmldir)SLIB_ANNOUNCE.txt \ - $(htmldir)SLIB_COPYING.txt $(UPLOADEE):public_html/ - $(RSYNC) $(dest)README $(dest)slib-$(VERSION).zip \ - $(dest)slib-$(VERSION).tar.gz \ - $(dest)slib-$(VERSION)-$(RELEASE).noarch.rpm \ - $(dest)slib-$(VERSION)-$(RELEASE).src.rpm $(UPLOADEE):dist/ -# upload $(dest)README $(dest)slib-$(VERSION).zip ftp.gnu.org:gnu/jacal/ - -upzip: $(HOME)/pub/slib.zip - $(RSYNC) $(HOME)/pub/slib.zip $(UPLOADEE):pub/ - -dist: $(dest)slib-$(VERSION).zip -$(dest)slib-$(VERSION).zip: temp/slib - $(makedev) DEST=$(dest) PROD=slib ver=-$(VERSION) zip - -tar.gz: $(dest)slib-$(VERSION).tar.gz -$(dest)slib-$(VERSION).tar.gz: temp/slib - $(makedev) DEST=$(dest) PROD=slib ver=-$(VERSION) tar.gz + $(htmldir)SLIB_COPYING.txt $(Uploadee):public_html/ + $(RSYNC) $(distdir)README $(distdir)slib-$(VERSION).zip \ + $(distdir)slib-$(VERSION).tar.gz \ + $(distdir)slib-$(VERSION)-$(RELEASE).noarch.rpm \ + $(distdir)slib-$(VERSION)-$(RELEASE).src.rpm $(Uploadee):dist/ +# upload $(distdir)README $(distdir)slib-$(VERSION).zip ftp.gnu.org:gnu/jacal/ + +upzip: $(snapdir)slib.zip + $(RSYNC) $(snapdir)slib.zip $(Uploadee):pub/ + +dist: $(distdir)slib-$(VERSION).zip +$(distdir)slib-$(VERSION).zip: temp/slib/ + $(MAKEDEV) DEST=$(distdir) PROD=slib ver=-$(VERSION) zip + +upgnu: $(distdir)slib-$(VERSION).tar.gz + cd $(distdir); gnupload --to ftp.gnu.org:slib slib-$(VERSION).tar.gz +tar.gz: $(distdir)slib-$(VERSION).tar.gz +$(distdir)slib-$(VERSION).tar.gz: temp/slib/ + $(MAKEDEV) DEST=$(distdir) PROD=slib ver=-$(VERSION) tar.gz rpm: pubzip -#$(dest)slib-$(VERSION)-$(RELEASE).noarch.rpm: $(dest)slib-$(VERSION).zip - cp $(HOME)/pub/slib.zip $(rpm_prefix)SOURCES/slib-$(VERSION).zip +#$(distdir)slib-$(VERSION)-$(RELEASE).noarch.rpm: $(distdir)slib-$(VERSION).zip + cp $(snapdir)slib.zip $(rpm_prefix)SOURCES/slib-$(VERSION).zip rpmbuild -ba slib.spec # --clean rm $(rpm_prefix)SOURCES/slib-$(VERSION).zip mv $(rpm_prefix)RPMS/noarch/slib-$(VERSION)-$(RELEASE).noarch.rpm \ - $(rpm_prefix)SRPMS/slib-$(VERSION)-$(RELEASE).src.rpm $(dest) + $(rpm_prefix)SRPMS/slib-$(VERSION)-$(RELEASE).src.rpm $(distdir) shar: slib.shar -slib.shar: temp/slib - $(makedev) PROD=slib shar +slib.shar: temp/slib/ + $(MAKEDEV) PROD=slib shar dclshar: slib.com com: slib.com -slib.com: temp/slib - $(makedev) PROD=slib com +slib.com: temp/slib/ + $(MAKEDEV) PROD=slib com zip: slib.zip -slib.zip: temp/slib - $(makedev) DEST=../ PROD=slib zip -doszip: $(DOSCM)slib-$(VERSION).zip -$(DOSCM)slib-$(VERSION).zip: temp/slib slib.html - $(makedev) DEST=$(DOSCM) PROD=slib ver=-$(VERSION) zip - -cd ..; zip -9ur $(DOSCM)slib-$(VERSION).zip slib/slib.html - zip -d $(DOSCM)slib-$(VERSION).zip slib/slib.info -pubzip: temp/slib - $(makedev) DEST=$(HOME)/pub/ PROD=slib zip +slib.zip: temp/slib/ + $(MAKEDEV) DEST=../ PROD=slib zip +doszip: $(windistdir)slib-$(VERSION).zip +$(windistdir)slib-$(VERSION).zip: temp/slib/ slib.html + $(MAKEDEV) DEST=$(windistdir) PROD=slib ver=-$(VERSION) zip + -cd ..; zip -9ur $(windistdir)slib-$(VERSION).zip slib/slib.html + zip -d $(windistdir)slib-$(VERSION).zip slib/slib.info +pubzip: temp/slib/ + $(MAKEDEV) DEST=$(snapdir) PROD=slib zip diffs: pubdiffs -pubdiffs: temp/slib - $(makedev) DEST=$(HOME)/pub/ PROD=slib pubdiffs -distdiffs: temp/slib - $(makedev) DEST=$(dest) PROD=slib ver=$(ver) distdiffs -announcediffs: temp/slib - $(makedev) DEST=$(dest) PROD=slib ver=-$(VERSION) announcediffs +pubdiffs: temp/slib/ + $(MAKEDEV) DEST=$(snapdir) PROD=slib pubdiffs +distdiffs: temp/slib/ + $(MAKEDEV) DEST=$(distdir) PROD=slib ver=$(ver) distdiffs +announcediffs: temp/slib/ + $(MAKEDEV) DEST=$(distdir) PROD=slib ver=-$(VERSION) announcediffs psdfiles=COPYING.psd README.psd cmuscheme.el comint.el instrum.scm pexpr.scm \ primitives.scm psd-slib.scm psd.el read.scm runtime.scm version.scm psdocfiles=article.bbl article.tex manual.bbl manual.tex quick-intro.tex -psdtemp/slib: +psdtemp/slib/: -rm -rf psdtemp mkdir -p psdtemp/slib/psd cd psd; ln $(psdfiles) ../psdtemp/slib/psd mkdir -p psdtemp/slib/psd/doc cd psd/doc; ln $(psdocfiles) ../../psdtemp/slib/psd/doc -psdist: $(dest)slib-psd.tar.gz -$(dest)slib-psd.tar.gz: psdtemp/slib - $(makedev) DEST=$(dest) PROD=slib ver=-psd tar.gz TEMP=psdtemp/ - -CITERS = FAQ README ANNOUNCE \ - ../dist/README \ - ../jacal/ANNOUNCE ../jacal/jacal.texi \ - ../scm/ANNOUNCE ../scm/scm.texi \ - ../wb/ANNOUNCE ../wb/README \ - ../synch/ANNOUNCE \ - $(DOSCM)unzipall.bat $(DOSCM)buildall \ - $(htmldir)JACAL.html \ - $(htmldir)README.html \ - $(htmldir)SCM.html \ - $(htmldir)SIMSYNCH.html \ +psdist: $(distdir)slib-psd.tar.gz +$(distdir)slib-psd.tar.gz: psdtemp/slib/ + $(MAKEDEV) DEST=$(distdir) PROD=slib ver=-psd tar.gz TEMP=psdtemp/ + +CITERS = FAQ README ANNOUNCE $(distdir)README ../jacal/ANNOUNCE \ + ../jacal/jacal.texi ../scm/ANNOUNCE ../scm/scm.texi \ + ../wb/ANNOUNCE ../wb/README ../synch/ANNOUNCE \ + $(windistdir)unzipall.bat $(windistdir)buildall \ + $(htmldir)JACAL.html $(htmldir)README.html $(htmldir)SCM.html \ + $(htmldir)SIMSYNCH.html $(htmldir)FreeSnell/FreeSnell.texi \ $(htmldir)FreeSnell/ANNOUNCE $(htmldir)FreeSnell/index.html CITES = require.scm Makefile slib.spec scheme48.init \ $(htmldir)SLIB.html slib.nsi ../scm/scm.nsi @@ -394,6 +432,8 @@ CITES = require.scm Makefile slib.spec scheme48.init \ new: $(CHPAT) slib-$(VERSION) slib-$(ver) $(CITERS) $(CHPAT) $(VERSION) $(ver) $(CITES) + echo @set SLIBVERSION $(ver) > version.txi + echo @set SLIBDATE `date +"%B %Y"` >> version.txi echo `date -I` \ Aubrey Jaffer \ \<`whoami`@`hostname`\>> change echo>> change echo \ \* require.scm \(*slib-version*\): Bumped from $(VERSION) to $(ver).>>change @@ -403,16 +443,13 @@ new: cvs commit -lm '(*slib-version*): Bumped from $(VERSION) to $(ver).' cvs tag -F slib-$(ver) -tagfiles = README version.txi slib.texi $(texifiles) \ - $(mkfiles) $(sfiles) $(bfiles) $(tfiles) $(ifiles) -# README and $(ifiles) cause semgentation faults in ETAGS for Emacs version 19. tags: $(tagfiles) etags $(tagfiles) rights: - $(scheme) -ladmin -e"(admin:check-all)" $(sfiles) $(tfiles) \ + $(SCHEME) -ladmin -e"(admin:check-all)" $(sfiles) $(tfiles) \ $(bfiles) $(ifiles) report: - $(scheme) -e"(slib:report #t)" + $(SCHEME) -e"(slib:report #t)" clean: -rm -f *~ *.bak *.orig *.rej core a.out *.o \#* -rm -rf *temp @@ -421,5 +458,5 @@ realclean: -rm -f *~ *.bak *.orig *.rej TAGS core a.out *.o \#* -rm -f slib.info* slib.?? slib.html -rm -rf *temp SLIB-*.exe -realempty: temp/slib +realempty: temp/slib/ -rm -f $(allfiles) @@ -1,10 +1,10 @@ -This directory contains the distribution of Scheme Library slib-3b1. +This directory contains the distribution of Scheme Library slib-3b5. Slib conforms to Revised^5 Report on the Algorithmic Language Scheme and the IEEE P1178 specification. Slib supports Unix and similar systems, VMS, and MS-DOS. The maintainer can be reached at agj @ alum.mit.edu. - http://swiss.csail.mit.edu/~jaffer/SLIB.html + http://people.csail.mit.edu/jaffer/SLIB.html MANIFEST @@ -32,9 +32,11 @@ The maintainer can be reached at agj @ alum.mit.edu. `sisc.init' is a configuration file for SISC. `t3.init' is a configuration file for T3.1 in Scheme mode. `STk.init' is a configuration file for STk. + `s7.init' is a configuration file for S7, part of Snd sound-editor. `umbscheme.init' is a configuration file for umb-scheme. `vscm.init' is a configuration file for VSCM. - `guile.init' is a configuration file for guile. + `guile-2.init' is a configuration file for Guile version 2.0 or later. + `guile.init' is a configuration file for older versions of Guile. `jscheme.init' is a configuration file for JScheme. `kawa.init' is a configuration file for Kawa. `mklibcat.scm' builds the *catalog* cache. @@ -156,7 +158,7 @@ The maintainer can be reached at agj @ alum.mit.edu. `collect.scm' is collection operators (like CL sequences). `priorque.scm' has code and documentation for priority queues. `wttree.scm' has weight-balanced trees. - `wttest.scm' tests weight-balanced trees. + `wttree-test.scm' new test suite. `process.scm' has multi-processing primitives. `array.scm' has multi-dimensional arrays. `subarray.scm' has subarray and accessory procedures. @@ -184,7 +186,8 @@ The maintainer can be reached at agj @ alum.mit.edu. `eval.scm' has eval with environments from R5RS. `dwindtst.scm' has routines for characterizing dynamic-wind. `dynamic.scm' has DYNAMIC data type [obsolete]. - `fluidlet.scm' has fluid-let syntax. + `fluidlet.scm' has fluid-let syntax (defmacro). + `fluid-let.scm' has fluid-let syntax. `structure.scm' has undocumented syntax-case macros. `byte.scm' has arrays of small integers. `bytenumb.scm' convert byte-arrays to integers; IEEE floating-point numbers. @@ -264,6 +267,7 @@ Jscheme JSCHEME_IMPLEMENTATION_PATH MIT-Scheme MITSCHEME_IMPLEMENTATION_PATH MzScheme MZSCHEME_IMPLEMENTATION_PATH RScheme RSCHEME_IMPLEMENTATION_PATH +S7 S7_IMPLEMENTATION_PATH STk STK_IMPLEMENTATION_PATH Vscm VSCM_IMPLEMENTATION_PATH @@ -348,8 +352,11 @@ above. kawa -f ${SCHEME_LIBRARY_PATH}kawa.init -- -- Implementation: Guile - Guile versions 1.6 and earlier link to an archaic SLIB version. In - RedHat or Fedora installations: + For Guile 1.8 or later, use: + guile -l ${SCHEME_LIBRARY_PATH}guile.init + + For prehistoric Guile, you may have to remove a prehistoric copy of + SLIB that was included with Guile: rm /usr/share/guile/slib ln -s ${SCHEME_LIBRARY_PATH} /usr/share/guile/slib @@ -361,10 +368,6 @@ above. `${SCHEME_LIBRARY_PATH}' is where SLIB gets installed. - Guile with SLIB can then be started thus: - - guile -l ${SCHEME_LIBRARY_PATH}guile.init - -- Implementation: Scheme48 To make a Scheme48 image for an installation under `<prefix>', @@ -439,4 +442,4 @@ as well by using, for example, `(provided? 'r3rs)' or `(require 'r3rs)'. The first chapter of the SLIB manual "The Library System" explains the mechanics of using SLIB modules. - http://swiss.csail.mit.edu/~jaffer/slib_1 + http://people.csail.mit.edu/jaffer/slib_1 diff --git a/RScheme.init b/RScheme.init Binary files differindex a9607f4..a9607f4 100644..100755 --- a/RScheme.init +++ b/RScheme.init diff --git a/Template.scm b/Template.scm index c61de29..c61de29 100644..100755 --- a/Template.scm +++ b/Template.scm diff --git a/alist.scm b/alist.scm index 4da3a34..4da3a34 100644..100755 --- a/alist.scm +++ b/alist.scm diff --git a/alist.txi b/alist.txi index 257724e..257724e 100644..100755 --- a/alist.txi +++ b/alist.txi diff --git a/alistab.scm b/alistab.scm index f8a5f70..f8a5f70 100644..100755 --- a/alistab.scm +++ b/alistab.scm diff --git a/array.scm b/array.scm index 4cf93b3..d0d3b22 100644..100755 --- a/array.scm +++ b/array.scm @@ -21,6 +21,7 @@ ;;@ftindex array (require 'record) +(require 'multiarg-apply) (define array:rtd (make-record-type "array" @@ -167,7 +168,8 @@ (let ((initializer (if (zero? (apply * pdims)) '() (list - (apply array-ref prototype + (apply array-ref + prototype (map (lambda (x) 0) pdims)))))) (cond ((and onedim? (string? prot)) (apply make-string (car dimensions) initializer)) diff --git a/array.txi b/array.txi index 7a2d85f..7a2d85f 100644..100755 --- a/array.txi +++ b/array.txi diff --git a/arraymap.scm b/arraymap.scm index bfac855..e34eab6 100644..100755 --- a/arraymap.scm +++ b/arraymap.scm @@ -18,6 +18,7 @@ ;each case. (require 'array) +(require 'multiarg-apply) ;;@code{(require 'array-for-each)} ;;@ftindex array-for-each @@ -36,7 +37,8 @@ (is (cons (+ -1 (car rdims)) inds) (cons (+ -1 i) inds))) ((negative? i)) - (apply array-set! ra0 + (apply array-set! + ra0 (apply proc (map (lambda (ra) (apply array-ref ra is)) ras)) is)) (let ((crdims (cdr rdims))) diff --git a/arraymap.txi b/arraymap.txi index ce082a6..ce082a6 100644..100755 --- a/arraymap.txi +++ b/arraymap.txi diff --git a/batch.scm b/batch.scm index 14117d0..b7090e5 100644..100755 --- a/batch.scm +++ b/batch.scm @@ -23,6 +23,7 @@ (require 'parameters) (require 'string-port) (require 'pretty-print) +(require 'multiarg-apply) (require 'common-list-functions) (require-if '(and bignum compiling) 'posix-time) @@ -107,7 +108,7 @@ (else (slib:error 'batch:command 'failed strings)))) ;@ (define (batch:run-script parms name . strings) - (case (batch:dialect parms strings) + (case (batch:dialect parms) ((vms) (batch:command parms (string-append "@" name) strings)) (else (batch:command parms name strings)))) @@ -348,6 +349,7 @@ (call-with-output-string (lambda (port) (batch:call-with-output-script + parms port (lambda (batch-port) (define new-parms (copy-tree pl)) diff --git a/bigloo.init b/bigloo.init index 54467bb..54467bb 100644..100755 --- a/bigloo.init +++ b/bigloo.init diff --git a/break.scm b/break.scm index d62eeb6..de768fc 100644..100755 --- a/break.scm +++ b/break.scm @@ -19,6 +19,7 @@ (require 'qp) (require 'alist) +(require 'multiarg-apply) ;;;; BREAKPOINTS @@ -18,6 +18,7 @@ ;each case. (require 'array) +(require 'multiarg-apply) ;;@code{(require 'byte)} ;;@ftindex byte diff --git a/bytenumb.scm b/bytenumb.scm index 053a433..4af40b6 100644..100755 --- a/bytenumb.scm +++ b/bytenumb.scm @@ -174,6 +174,7 @@ ;;(bytes->ieee-double (bytes 0 4 0 0 0 0 0 0)) @result{} 5.562684646268003e-309 ;;(bytes->ieee-double (bytes 0 0 0 0 0 0 0 1)) @result{} 4.0e-324 ;; +;;(bytes->ieee-double (list->bytes '(127 239 255 255 255 255 255 255))) 179.76931348623157e306 ;;(bytes->ieee-double (bytes #xFF #xF0 0 0 0 0 0 0)) @result{} -inf.0 ;;(bytes->ieee-double (bytes #x7F #xF0 0 0 0 0 0 0)) @result{} +inf.0 ;;(bytes->ieee-double (bytes #x7F #xF8 0 0 0 0 0 0)) @result{} 0/0 @@ -183,8 +184,7 @@ ;;Returns a 4-element byte-array encoding the IEEE single-precision ;;floating-point of @1. (define ieee-float->bytes - (let ((zero (or (string->number "0.0") 0)) - (exactify (if (provided? 'inexact) inexact->exact identity))) + (let ((exactify (if (provided? 'inexact) inexact->exact identity))) (lambda (flt) (define byts (make-bytes 4 0)) (define S (and (real? flt) (negative? (if (zero? flt) (/ flt) flt)))) @@ -241,8 +241,7 @@ ;;Returns a 8-element byte-array encoding the IEEE double-precision ;;floating-point of @1. (define ieee-double->bytes - (let ((zero (or (string->number "0.0") 0)) - (exactify (if (provided? 'inexact) inexact->exact identity))) + (let ((exactify (if (provided? 'inexact) inexact->exact identity))) (lambda (flt) (define byts (make-bytes 8 0)) (define S (and (real? flt) (negative? (if (zero? flt) (/ flt) flt)))) diff --git a/bytenumb.txi b/bytenumb.txi index d5fc680..ea222da 100644..100755 --- a/bytenumb.txi +++ b/bytenumb.txi @@ -87,6 +87,7 @@ value of @var{bytes} interpreted as a big-endian IEEE 8-byte (64-bit) number. (bytes->ieee-double (bytes 0 4 0 0 0 0 0 0)) @result{} 5.562684646268003e-309 (bytes->ieee-double (bytes 0 0 0 0 0 0 0 1)) @result{} 4.0e-324 +(bytes->ieee-double (list->bytes '(127 239 255 255 255 255 255 255))) 179.76931348623157e306 (bytes->ieee-double (bytes #xFF #xF0 0 0 0 0 0 0)) @result{} -inf.0 (bytes->ieee-double (bytes #x7F #xF0 0 0 0 0 0 0)) @result{} +inf.0 (bytes->ieee-double (bytes #x7F #xF8 0 0 0 0 0 0)) @result{} 0/0 diff --git a/charplot.scm b/charplot.scm index 31d0fea..71fdaea 100644..100755 --- a/charplot.scm +++ b/charplot.scm @@ -21,6 +21,7 @@ (require 'array) (require 'array-for-each) (require 'multiarg/and-) +(require 'multiarg-apply) ;;;@ These determine final graph size. (define charplot:dimensions #f) diff --git a/chez.init b/chez.init index dd923f9..cb85c4a 100644..100755 --- a/chez.init +++ b/chez.init @@ -22,7 +22,7 @@ ;;; (scheme-implementation-version) should return a string describing ;;; the version the scheme implementation loading this file. -(define (scheme-implementation-version) "6.0a") +(define (scheme-implementation-version) "8.4") ;;; (implementation-vicinity) should be defined to be the pathname of ;;; the directory where any auxillary files to your Scheme @@ -30,7 +30,7 @@ (define implementation-vicinity (let ((impl-path (or (getenv "CHEZ_IMPLEMENTATION_PATH") - "/usr/unsup/scheme/chez/"))) + "/usr/local/lib/chez/"))) (lambda () impl-path))) ;;; (library-vicinity) should be defined to be the pathname of the @@ -305,8 +305,8 @@ ;;; MOST-POSITIVE-FIXNUM is used in modular.scm ;; Chez's MOST-POSITIVE-FIXNUM is a thunk rather than a number. -(if (procedure? most-positive-fixnum) - (set! most-positive-fixnum (most-positive-fixnum))) +;; (if (procedure? most-positive-fixnum) +;; (set! most-positive-fixnum (most-positive-fixnum))) ;;; Return argument (define (identity x) x) diff --git a/cie1931.xyz b/cie1931.xyz index ce74214..ce74214 100644..100755 --- a/cie1931.xyz +++ b/cie1931.xyz diff --git a/cie1964.xyz b/cie1964.xyz index 89fa244..89fa244 100644..100755 --- a/cie1964.xyz +++ b/cie1964.xyz diff --git a/ciesia.dat b/ciesia.dat index 2bcff04..2bcff04 100644..100755 --- a/ciesia.dat +++ b/ciesia.dat diff --git a/ciesid65.dat b/ciesid65.dat index bc63299..bc63299 100644..100755 --- a/ciesid65.dat +++ b/ciesid65.dat diff --git a/clrnamdb.scm b/clrnamdb.scm index f95575f..f9ea288 100644..100755 --- a/clrnamdb.scm +++ b/clrnamdb.scm @@ -1,4 +1,4 @@ -;;; "/usr/local/lib/slib/clrnamdb.scm" SLIB 3a5 alist-table database -*-scheme-*- +;;; "/usr/local/lib/slib/clrnamdb.scm" SLIB 3b3 alist-table database -*-scheme-*- ( (10 @@ -1662,25 +1662,25 @@ (1 #t name #f string) ) (6 - ("red" "CIEXYZ:0.639974/0.219285/0.140741" 19) - ("purplishred" "CIEXYZ:0.292779/0.0595298/0.647691" 18) - ("redpurple" "CIEXYZ:0.224491/0.0281085/0.7474" 17) - ("reddishpurple" "CIEXYZ:0.195341/0.0146953/0.789964" 16) - ("purple" "CIEXYZ:0.180159/0.00770975/0.812132" 15) - ("bluishpurple" "CIEXYZ:0.174724/0.00520914/0.820067" 14) - ("purplishblue" "CIEXYZ:0.150985/0.0227402/0.826274" 13) - ("blue" "CIEXYZ:0.116102/0.0738583/0.81004" 12) - ("greenishblue" "CIEXYZ:0.0833989/0.156445/0.760156" 11) - ("bluegreen" "CIEXYZ:0.0234599/0.412703/0.563837" 10) - ("bluishgreen" "CIEXYZ:0.00816803/0.538423/0.453409" 9) - ("green" "CIEXYZ:0.0388518/0.812016/0.149132" 8) - ("yellowishgreen" "CIEXYZ:0.337396/0.658848/0.00375544" 7) - ("yellowgreen" "CIEXYZ:0.380466/0.617256/0.00227802" 6) - ("greenishyellow" "CIEXYZ:0.465098/0.5338/0.00110199" 5) - ("yellow" "CIEXYZ:0.505818/0.493217/0.000965024" 4) - ("yellowishorange" "CIEXYZ:0.531897/0.467256/0.000847751" 3) - ("orange" "CIEXYZ:0.602933/0.396497/0.000570581" 2) - ("reddishorange" "CIEXYZ:0.658471/0.341258/0.000271188" 1) + ("purplishred" "CIEXYZ:0.604612/0.205731/0.189657" 19) + ("redpurple" "CIEXYZ:0.479429/0.149503/0.371068" 18) + ("reddishpurple" "CIEXYZ:0.354247/0.0932736/0.552479" 17) + ("purple" "CIEXYZ:0.263205/0.0523799/0.684415" 16) + ("bluishpurple" "CIEXYZ:0.200614/0.0242655/0.77512" 15) + ("purplishblue" "CIEXYZ:0.14396/0.029703/0.826337" 14) + ("blue" "CIEXYZ:0.0995467/0.11196/0.788494" 13) + ("greenishblue" "CIEXYZ:0.0912562/0.132684/0.77606" 12) + ("bluegreen" "CIEXYZ:0.0687611/0.200711/0.730528" 11) + ("bluishgreen" "CIEXYZ:0.0453772/0.294952/0.659671" 10) + ("green" "CIEXYZ:0.0138702/0.750186/0.235943" 9) + ("yellowishgreen" "CIEXYZ:0.22962/0.754329/0.0160512" 8) + ("yellowgreen" "CIEXYZ:0.373102/0.624451/0.0024476" 7) + ("greenishyellow" "CIEXYZ:0.465098/0.5338/0.00110199" 6) + ("yellow" "CIEXYZ:0.499122/0.499899/0.000979355" 5) + ("yellowishorange" "CIEXYZ:0.531897/0.467256/0.000847751" 4) + ("orange" "CIEXYZ:0.586144/0.413257/0.000598302" 3) + ("reddishorange" "CIEXYZ:0.647123/0.3525/0.00037723" 2) + ("red" "CIEXYZ:0.735484/0.264516/0" 1) ) (5 (3 #f order #f ordinal) diff --git a/cltime.scm b/cltime.scm index c271da2..c271da2 100644..100755 --- a/cltime.scm +++ b/cltime.scm diff --git a/coerce.scm b/coerce.scm index 0842c9e..0842c9e 100644..100755 --- a/coerce.scm +++ b/coerce.scm diff --git a/coerce.txi b/coerce.txi index a039ded..a039ded 100644..100755 --- a/coerce.txi +++ b/coerce.txi diff --git a/collect.scm b/collect.scm index d4ccb6f..c987318 100644..100755 --- a/collect.scm +++ b/collect.scm @@ -131,7 +131,8 @@ (cond ((< count max+1) (set! <seed> - (apply <proc> <seed> (map (lambda (g) (g)) generators))) + (apply <proc> + (cons <seed> (map (lambda (g) (g)) generators)))) (loop (collect:add1 count))) (else <seed>)))))) diff --git a/collectx.scm b/collectx.scm index 5ca0ca5..02d4d06 100644..100755 --- a/collectx.scm +++ b/collectx.scm @@ -155,8 +155,8 @@ (cond ((< count!5 max+1!4) (set! <seed>!1 (apply <proc>!1 - <seed>!1 - (map (lambda (g!7) (g!7)) generators!4))) + (cons <seed>!1 + (map (lambda (g!7) (g!7)) generators!4)))) (loop!6 (collect:add1 count!5))) (else <seed>!1)))))))) diff --git a/color.scm b/color.scm index bf8a921..08b3ec2 100644..100755 --- a/color.scm +++ b/color.scm @@ -22,6 +22,7 @@ (require 'scanf) (require 'printf) (require 'string-case) +(require 'multiarg-apply) (define color:rtd (make-record-type "color" @@ -221,7 +222,7 @@ (case (color:encoding color) ((L*a*b*) (if (equal? (wp) (color:white-point color)) (append (color:coordinates color) '()) - (CIEXYZ->L*a*b* (L*a*b*->CIEXYZ color + (CIEXYZ->L*a*b* (L*a*b*->CIEXYZ (color:coordinates color) (color:white-point color)) (wp)))) ((L*u*v*) (CIEXYZ->L*a*b* (L*u*v*->CIEXYZ (color:coordinates color) @@ -585,19 +586,19 @@ (case (color:encoding color) ((CIEXYZ) (apply sprintf #f "CIEXYZ:%g/%g/%g" (color:coordinates color))) - ((L*a*b*) (apply sprintf #f "CIELab:%.4f/%.4f/%.4f" + ((L*a*b*) (apply sprintf #f "CIELab:%.2f/%.2f/%.2f" (if (equal? CIEXYZ:D65 (color:white-point color)) (color:coordinates color) (CIEXYZ->L*a*b* (L*a*b*->CIEXYZ (color:coordinates color) (color:white-point color)))))) - ((L*u*v*) (apply sprintf #f "CIELuv:%.4f/%.4f/%.4f" + ((L*u*v*) (apply sprintf #f "CIELuv:%.2f/%.2f/%.2f" (if (equal? CIEXYZ:D65 (color:white-point color)) (color:coordinates color) (CIEXYZ->L*u*v* (L*u*v*->CIEXYZ (color:coordinates color) (color:white-point color)))))) - ((L*C*h) (apply sprintf #f "CIELCh:%.4f/%.4f/%.4f" + ((L*C*h) (apply sprintf #f "CIELCh:%.2f/%.2f/%.2f" (if (equal? CIEXYZ:D65 (color:white-point color)) (color:coordinates color) (L*a*b*->L*C*h @@ -655,9 +656,9 @@ (apply color->L*a*b* color2 white-point))) ;@ (define (CIE:DE*94 color1 color2 . parametric-factors) - (apply L*C*h:DE*94 - (color->L*C*h color1) - (color->L*C*h color2) + (apply L*a*b*:DE*94 + (color->L*a*b* color1) + (color->L*a*b* color2) parametric-factors)) ;@ (define (CMC:DE* color1 color2 . parametric-factors) diff --git a/color.txi b/color.txi index 101bc7b..0fa2dde 100644..100755 --- a/color.txi +++ b/color.txi @@ -108,7 +108,8 @@ then @code{l*a*b*->color} returns the color specified by @var{L*a*b*}; otherwise Returns the L*a*b* color composed of @var{L*}, @var{a*}, @var{b*} with @var{white-point}. -@defunx color:l*a*b* L* a* b* +@end defun +@defun color:l*a*b* L* a* b* Returns the L*a*b* color composed of @var{L*}, @var{a*}, @var{b*}. If the coordinates do not encode a valid L*a*b* color, then an error is signaled. @end defun @@ -118,7 +119,8 @@ do not encode a valid L*a*b* color, then an error is signaled. Returns the list of 3 numbers encoding @var{color} in L*a*b* with @var{white-point}. -@defunx color->l*a*b* color +@end defun +@defun color->l*a*b* color Returns the list of 3 numbers encoding @var{color} in L*a*b*. @end defun @@ -139,7 +141,8 @@ then @code{l*u*v*->color} returns the color specified by @var{L*u*v*}; otherwise Returns the L*u*v* color composed of @var{L*}, @var{u*}, @var{v*} with @var{white-point}. -@defunx color:l*u*v* L* u* v* +@end defun +@defun color:l*u*v* L* u* v* Returns the L*u*v* color composed of @var{L*}, @var{u*}, @var{v*}. If the coordinates do not encode a valid L*u*v* color, then an error is signaled. @end defun @@ -149,7 +152,8 @@ do not encode a valid L*u*v* color, then an error is signaled. Returns the list of 3 numbers encoding @var{color} in L*u*v* with @var{white-point}. -@defunx color->l*u*v* color +@end defun +@defun color->l*u*v* color Returns the list of 3 numbers encoding @var{color} in L*u*v*. @end defun @@ -207,7 +211,8 @@ then @code{l*c*h->color} returns the color specified by @var{L*C*h}; otherwise r Returns the L*C*h color composed of @var{L*}, @var{C*}, @var{h} with @var{white-point}. -@defunx color:l*c*h L* C* h +@end defun +@defun color:l*c*h L* C* h Returns the L*C*h color composed of @var{L*}, @var{C*}, @var{h}. If the coordinates do not encode a valid L*C*h color, then an error is signaled. @end defun @@ -217,7 +222,8 @@ do not encode a valid L*C*h color, then an error is signaled. Returns the list of 3 numbers encoding @var{color} in L*C*h with @var{white-point}. -@defunx color->l*c*h color +@end defun +@defun color->l*c*h color Returns the list of 3 numbers encoding @var{color} in L*C*h. @end defun @@ -327,10 +333,12 @@ specified by @var{rgb}; otherwise returns #f. Returns the e-sRGB10 color composed of integers @var{r}, @var{g}, @var{b}. -@defunx color:e-srgb 12 r g b +@end defun +@defun color:e-srgb 12 r g b Returns the e-sRGB12 color composed of integers @var{r}, @var{g}, @var{b}. -@defunx color:e-srgb 16 r g b +@end defun +@defun color:e-srgb 16 r g b Returns the e-sRGB16 color composed of integers @var{r}, @var{g}, @var{b}. If the coordinates do not encode a valid e-sRGB color, then an error is signaled. diff --git a/colornam.scm b/colornam.scm index e8e8812..e8e8812 100644..100755 --- a/colornam.scm +++ b/colornam.scm diff --git a/colornam.txi b/colornam.txi index bc70632..c4ef7a6 100644..100755 --- a/colornam.txi +++ b/colornam.txi @@ -58,7 +58,8 @@ record; and #f otherwise. @var{name} if it exists; #f otherwise. -@defunx color-dictionary name rdb +@end defun +@defun color-dictionary name rdb @var{rdb} must be an open relational database or a string naming a relational database file; and the symbol @var{name} a table therein. @code{color-dictionary} returns the diff --git a/colorspc.scm b/colorspc.scm index 723a197..4a17065 100644..100755 --- a/colorspc.scm +++ b/colorspc.scm @@ -300,16 +300,24 @@ (slib:error 'parametric-factors 'not 'number? obj))) ans)) ans) -;@ -(define (L*C*h:DE*94 lch1 lch2 . parametric-factors) - (define C* (sqrt (* (cadr lch1) (cadr lch2)))) ;Geometric mean - (sqrt (apply + (map / - (map (lambda (x) (* x x)) (map - lch1 lch2)) - (list 1 ; S_l - (+ 1 (* .045 C*)) ; S_c - (+ 1 (* .015 C*))) ; S_h - (or (color:process-params parametric-factors) - '(1 1 1)))))) +;;; http://www.brucelindbloom.com/index.html?Eqn_DeltaE_CIE94.html +;@ +(define (L*a*b*:DE*94 lab1 lab2 . parametric-factors) + (define (square x) (* x x)) + (let ((C1 (sqrt (apply + (map square (cdr lab1))))) + (C2 (sqrt (apply + (map square (cdr lab2)))))) + (define dC^2 (square (- C1 C2))) + (sqrt (apply + (map / + (list (square (- (car lab1) (car lab2))) + dC^2 + (- (apply + (map square + (map - (cdr lab1) (cdr lab2)))) + dC^2)) + (list 1 ; S_l + (+ 1 (* .045 C1)) ; S_c + (+ 1 (* .015 C1))) ; S_h + (or (color:process-params parametric-factors) + '(1 1 1))))))) ;;; CMC-DE is designed only for small color-differences. But try to do ;;; something reasonable for large differences. Use bisector (h*) of @@ -463,8 +471,8 @@ (let* ((wlf (inexact->exact (floor wl))) (res (- wl wlf))) (define (interpolate vect idx res) - (+ (* res (vector-ref vect idx)) - (* (- 1 res) (vector-ref vect (+ 1 idx))))) + (+ (* (- 1 res) (vector-ref vect idx)) + (* res (vector-ref vect (+ 1 idx))))) (list (interpolate cie:x-bar wlf res) (interpolate cie:y-bar wlf res) (interpolate cie:z-bar wlf res))) diff --git a/comlist.scm b/comlist.scm index 3ca909f..e51b3f2 100644..100755 --- a/comlist.scm +++ b/comlist.scm @@ -21,6 +21,8 @@ ;;; Some of these functions may be already defined in your Scheme. ;;; Comment out those definitions for functions which are already defined. +(require 'multiarg-apply) + ;;;; LIST FUNCTIONS FROM COMMON LISP ;;; Some tail-recursive optimizations made by diff --git a/comparse.scm b/comparse.scm index 3dacf50..3dacf50 100644..100755 --- a/comparse.scm +++ b/comparse.scm diff --git a/comparse.txi b/comparse.txi index 0026f94..0026f94 100644..100755 --- a/comparse.txi +++ b/comparse.txi diff --git a/configure b/configure new file mode 100755 index 0000000..ebd9bc8 --- /dev/null +++ b/configure @@ -0,0 +1,377 @@ +#! /bin/sh +# This is the configure script for Voluntocracy software projects, +# hosted at "http://people.csail.mit.edu/jaffer". Parts are taken +# from a configure script generated by GNU Autoconf 2.63. +# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +# +# I place the rest in the public domain. +# Author: Aubrey Jaffer (2010) + +# The "config.status" produced by this script differs from GNU +# conventions in that the value of every *dir variable has a trailing +# slash (/). + +# Extract the PACKAGE_NAME, PACKAGE_TARNAME, and PACKAGE_VERSION from +# "version.txi", which is built by the project Makefile. +if test ! -f version.txi; then + make version.txi +fi +version_txi=`cat version.txi | sed 1q` +mywd=`pwd` + +PACKAGE_NAME=`expr "X$version_txi" : 'X@set \([A-Z]*\)VERSION .*' | tr '[A-Z]' '[a-z]'` +PACKAGE_TARNAME=`expr "X$mywd" : '.*/\([A-Za-z]*\)'` +if echo "$PACKAGE_TARNAME" | grep -iq "$PACKAGE_NAME"; then + if ! echo "$PACKAGE_NAME" | grep -iq "$PACKAGE_TARNAME"; then + PACKAGE_TARNAME=$PACKAGE_NAME + fi +fi +PACKAGE_VERSION=`expr "X$version_txi" : '.*VERSION \([0-9a-z]*\)'` +PACKAGE_STRING="$PACKAGE_TARNAME $PACKAGE_VERSION" +PACKAGE_BUGREPORT="$PACKAGE_TARNAME-discuss@gnu.org" + +CONFIG_STATUS="config.status" +ac_default_prefix=/usr/local/ +ac_init_version=false +srcdir=`pwd` +silent= +no_create= + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +prefix=$ac_default_prefix +exec_prefix='${prefix}' +bindir='${exec_prefix}bin/' +sbindir='${exec_prefix}sbin/' +libexecdir='${exec_prefix}libexec/' +datarootdir='${prefix}share/' +datadir='${datarootdir}' +sysconfdir='${prefix}etc/' +sharedstatedir='${prefix}com/' +localstatedir='${prefix}var/' +includedir='${prefix}include/' +oldincludedir='/usr/include/' +docdir='${datarootdir}doc/${PACKAGE_TARNAME}/' +infodir='${datarootdir}info/' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}lib/' +localedir='${datarootdir}locale/' +mandir='${datarootdir}man/' +snapdir='${srcdir}' +distdir='${srcdir}' + +ac_subst_vars='PACKAGE_NAME +PACKAGE_TARNAME +PACKAGE_VERSION +PACKAGE_STRING +PACKAGE_BUGREPORT +srcdir +prefix +exec_prefix +bindir +sbindir +libexecdir +datarootdir +datadir +sysconfdir +sharedstatedir +localstatedir +includedir +oldincludedir +docdir +infodir +htmldir +dvidir +pdfdir +psdir +libdir +localedir +mandir +distdir +snapdir' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + # Handling of the options. + -version | --version | -V) + ac_init_version=: ;; + + -bindir | --bindir) + ac_prev=bindir ;; + -bindir=* | --bindir=*) + bindir=$ac_optarg ;; + + -datadir | --datadir) + ac_prev=datadir ;; + -datadir=* | --datadir=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=*) + datarootdir=$ac_optarg ;; + + -distdir | --distdir) + ac_prev=distdir ;; + -distdir=* | --distdir=*) + distdir=$ac_optarg ;; + + -docdir | --docdir) + ac_prev=docdir ;; + -docdir=* | --docdir=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=*) + dvidir=$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | -exec_prefix) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | -exec_prefix=*) + exec_prefix=$ac_optarg ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + + -htmldir | --htmldir) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir) + ac_prev=includedir ;; + -includedir=* | --includedir=*) + includedir=$ac_optarg ;; + + -infodir | --infodir) + ac_prev=infodir ;; + -infodir=* | --infodir=*) + infodir=$ac_optarg ;; + + -libdir | --libdir) + ac_prev=libdir ;; + -libdir=* | --libdir=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir) + ac_prev=localedir ;; + -localedir=* | --localedir=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir) + ac_prev=mandir ;; + -mandir=* | --mandir=*) + mandir=$ac_optarg ;; + + -no-create | --no-create | -n) + no_create=yes ;; + + -oldincludedir | --oldincludedir) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix) + ac_prev=prefix ;; + -prefix=* | --prefix=*) + prefix=$ac_optarg ;; + + -pdfdir | --pdfdir) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir) + ac_prev=psdir ;; + -psdir=* | --psdir=*) + psdir=$ac_optarg ;; + + -snapdir | --snapdir) + ac_prev=snapdir ;; + -snapdir=* | --snapdir=*) + snapdir=$ac_optarg ;; + + -q | -quiet | --quiet | --q | -silent | --silent) + silent=yes ;; + + -sbindir | --sbindir) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=*) + sharedstatedir=$ac_optarg ;; + + -srcdir | --srcdir) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=*) + sysconfdir=$ac_optarg ;; + + *) { echo "error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } ;; + esac + shift +done + +# Now take action based on given options. + +if test "$ac_init_help" = "long"; then + + cat <<_ACEOF +\`configure' configures $PACKAGE_STRING installation. + +Usage: $0 [OPTION]... + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + -V, --version display version information and exit + -q, --quiet, --silent do not print configuration + -n, --no-create do not create output file + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/$PACKAGE_TARNAME] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] + + --snapdir=DIR development snapshot destination [configure dir] + --distdir=DIR release distribution destination [configure dir] +_ACEOF + +exit +fi + +if $ac_init_version; then + echo "$PACKAGE_NAME configure $PACKAGE_VERSION" + exit +fi + +# Check all directory arguments for consistency. +for ac_var in srcdir exec_prefix prefix bindir sbindir libexecdir \ + datarootdir datadir sysconfdir sharedstatedir localstatedir \ + includedir oldincludedir docdir infodir htmldir dvidir pdfdir \ + psdir libdir localedir mandir snapdir distdir +do + eval ac_val=\$$ac_var + # Assure trailing slashes. + case $ac_val in + *[}/] ) ;; + * ) + ac_val="$ac_val""/" + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + * ) + case $ac_var in + *prefix | *srcdir | *snapdir | *distdir) continue;; + esac;; + esac + { echo "error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } +done + +if test "$no_create" != yes; then + echo "#! /bin/cat +# Generated by configure for $PACKAGE_NAME $PACKAGE_VERSION. +# This file ($CONFIG_STATUS) is included by the ($PACKAGE_TARNAME) Makefile. +" > $CONFIG_STATUS + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + echo "$ac_var=$ac_val" >> $CONFIG_STATUS + done + chmod +x $CONFIG_STATUS + if test "$silent" != yes; then cat $CONFIG_STATUS; fi +else + if test "$silent" != yes; then + echo "This is the $CONFIG_STATUS file which would have been created: +# Generated by configure for $PACKAGE_NAME $PACKAGE_VERSION. +# This file is included by the Makefile. +" + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + echo "$ac_var=$ac_val" + done + fi +fi diff --git a/cring.scm b/cring.scm index 6f33027..6f33027 100644..100755 --- a/cring.scm +++ b/cring.scm diff --git a/daylight.scm b/daylight.scm index 9151f99..9151f99 100644..100755 --- a/daylight.scm +++ b/daylight.scm diff --git a/daylight.txi b/daylight.txi index 2d921d2..2d921d2 100644..100755 --- a/daylight.txi +++ b/daylight.txi diff --git a/db2html.scm b/db2html.scm index 9b4709f..92da4eb 100644..100755 --- a/db2html.scm +++ b/db2html.scm @@ -24,6 +24,7 @@ (require 'databases) (require 'string-case) (require 'string-search) +(require 'multiarg-apply) (require 'common-list-functions) (require-if 'compiling 'pretty-print) (require-if 'compiling 'database-commands) diff --git a/db2html.txi b/db2html.txi index 6366f87..6366f87 100644..100755 --- a/db2html.txi +++ b/db2html.txi diff --git a/dbcom.scm b/dbcom.scm index 428e3db..4bd6352 100644..100755 --- a/dbcom.scm +++ b/dbcom.scm @@ -19,6 +19,7 @@ (require 'common-list-functions) ;for position (require 'relational-database) +(require 'multiarg-apply) (require 'databases) ;@ (define (wrap-command-interface rdb) diff --git a/dbinterp.scm b/dbinterp.scm index 3444fbb..3444fbb 100644..100755 --- a/dbinterp.scm +++ b/dbinterp.scm diff --git a/dbrowse.scm b/dbrowse.scm index 9401c6d..e56fc9b 100644..100755 --- a/dbrowse.scm +++ b/dbrowse.scm @@ -89,4 +89,4 @@ (newline) ((or (table 'for-each-row-in-order) (table 'for-each-row)) (lambda (row) - (apply printf form row))))) + (apply printf (cons form row)))))) diff --git a/dbsyn.scm b/dbsyn.scm index f807642..84d4c7b 100644..100755 --- a/dbsyn.scm +++ b/dbsyn.scm @@ -46,25 +46,25 @@ database) ; define-table ((within-database database - (define-table (name primary columns) row ...) - rest ...) + (define-table (name primary columns) row ...) + rest ...) (begin (define-tables database '(name primary columns (row ...))) (within-database database rest ...))) ; define-command ((within-database database - (define-command template arg-1 arg-2 ...) - rest ...) + (define-command template arg-1 arg-2 ...) + rest ...) (begin (define-*commands* database '(template arg-1 arg-2 ...)) (within-database database rest ...))) ; ((within-database database - (command arg-1 ...) - rest ...) + (command arg-1 ...) + rest ...) (begin (cond ((let ((p (database '*macro*))) (and p (slib:eval (p 'command)))) => (lambda (proc) (slib:eval - (apply proc database '(arg-1 ...))))) + (apply proc (cons database '(arg-1 ...)))))) (else ((database 'command) arg-1 ...))) (within-database database rest ...))))) diff --git a/dbutil.scm b/dbutil.scm index 7df51ce..f29f119 100644..100755 --- a/dbutil.scm +++ b/dbutil.scm @@ -313,14 +313,12 @@ ((not (procedure? rdb)) (slib:warn 'close-database 'not 'procedure? rdb) #f) - ((not certificate) - (and dbs (set! dbs (mdbm:remove-entry dbs entry))) - #t) (else (let* ((filename (rdb 'filename)) (dbclose (rdb 'close-database)) (ret (and dbclose (dbclose)))) - (if (not (file-unlock! filename certificate)) + (if (and certificate + (not (file-unlock! filename certificate))) (slib:warn 'file-unlock! filename certificate 'failed)) (cond ((not dbclose) (slib:warn 'database? rdb)) ((not entry)) diff --git a/dbutil.txi b/dbutil.txi index f7af3af..02d058a 100644..100755 --- a/dbutil.txi +++ b/dbutil.txi @@ -87,7 +87,8 @@ Returns an open relational database associated with @var{rdb}. The database will be opened with base-table type @var{base-table-type}). -@defunx open-database rdb +@end defun +@defun open-database rdb Returns an open relational database associated with @var{rdb}. @code{open-database} will attempt to deduce the correct base-table-type. @end defun diff --git a/debug.scm b/debug.scm index 73acc0b..73acc0b 100644..100755 --- a/debug.scm +++ b/debug.scm diff --git a/defmacex.scm b/defmacex.scm index 2b2cf88..2b2cf88 100644..100755 --- a/defmacex.scm +++ b/defmacex.scm diff --git a/determ.scm b/determ.scm index be7e00f..cb545e8 100644..100755 --- a/determ.scm +++ b/determ.scm @@ -18,6 +18,7 @@ ;each case. (require 'array) +(require 'multiarg-apply) ;;@code{(require 'determinant)} ;;@ftindex determinant diff --git a/determ.txi b/determ.txi index c230046..4c37346 100644..100755 --- a/determ.txi +++ b/determ.txi @@ -54,10 +54,12 @@ Returns the element-wise difference of matricies @var{m1} and @var{m2}. Returns the product of matrices @var{m1} and @var{m2}. -@defunx matrix:product m1 z +@end defun +@defun matrix:product m1 z Returns matrix @var{m1} times scalar @var{z}. -@defunx matrix:product z m1 +@end defun +@defun matrix:product z m1 Returns matrix @var{m1} times scalar @var{z}. @end defun @@ -30,6 +30,7 @@ (require 'array) (require 'logical) (require 'subarray) +(require 'multiarg-apply) ;;@code{(require 'dft)} or ;;@code{(require 'Fourier-transform)} diff --git a/differ.scm b/differ.scm index bd363d4..bd363d4 100644..100755 --- a/differ.scm +++ b/differ.scm diff --git a/differ.txi b/differ.txi index 247b3fe..247b3fe 100644..100755 --- a/differ.txi +++ b/differ.txi @@ -96,3 +96,20 @@ (do ((filename (read-line port) (read-line port))) ((or (eof-object? filename) (equal? "" filename))) (and (selector filename) (proc filename))))))))) + +;;@body +;;@2 is a pathname whose last component is a (wildcard) pattern +;;(@pxref{Filenames, , , slib, SLIB}). +;;@1 must be a procedure taking one argument. +;;@samp{directory*-for-each} applies @var{proc} to the (string) name of +;;each file in the current directory. The dynamic order in which @var{proc} is +;;applied to the filenames is unspecified. The value returned by +;;@samp{directory*-for-each} is unspecified. +(define (directory*-for-each proc path-glob) + (define dir (pathname->vicinity path-glob)) + (let ((glob (substring path-glob + (string-length dir) + (string-length path-glob)))) + (directory-for-each proc + (if (equal? "" dir) "." dir) + glob))) @@ -28,12 +28,14 @@ applied to the filenames is unspecified. The value returned by @samp{directory-for-each} is unspecified. -@defunx directory-for-each proc directory pred +@end defun +@defun directory-for-each proc directory pred Applies @var{proc} only to those filenames for which the procedure @var{pred} returns a non-false value. -@defunx directory-for-each proc directory match +@end defun +@defun directory-for-each proc directory match Applies @var{proc} only to those filenames for which @code{(filename:match?? @var{match})} would return a non-false value (@pxref{Filenames, , , slib, SLIB}). @@ -47,3 +49,15 @@ Applies @var{proc} only to those filenames for which @end example @end defun + +@defun directory*-for-each proc path-glob + +@var{path-glob} is a pathname whose last component is a (wildcard) pattern +(@pxref{Filenames, , , slib, SLIB}). +@var{proc} must be a procedure taking one argument. +@samp{directory*-for-each} applies @var{proc} to the (string) name of +each file in the current directory. The dynamic order in which @var{proc} is +applied to the filenames is unspecified. The value returned by +@samp{directory*-for-each} is unspecified. +@end defun + diff --git a/dwindtst.scm b/dwindtst.scm index 94b5827..94b5827 100644..100755 --- a/dwindtst.scm +++ b/dwindtst.scm diff --git a/dynamic.scm b/dynamic.scm index 3bdd037..9c30e7e 100644..100755 --- a/dynamic.scm +++ b/dynamic.scm @@ -9,7 +9,7 @@ (define dynamic-environment-rtd (make-record-type "dynamic environment" '(dynamic value parent))) (define make-dynamic-environment - (record-constructor dynamic-environment-rtd)) + (record-constructor dynamic-environment-rtd '(dynamic value parent))) (define dynamic-environment:dynamic (record-accessor dynamic-environment-rtd 'dynamic)) (define dynamic-environment:value @@ -28,7 +28,7 @@ (define dynamic-rtd (make-record-type "dynamic" '())) ;@ (define make-dynamic - (let ((dynamic-constructor (record-constructor dynamic-rtd))) + (let ((dynamic-constructor (record-constructor dynamic-rtd '()))) (lambda (obj) (let ((dynamic (dynamic-constructor))) (extend-current-dynamic-environment dynamic obj) diff --git a/dynwind.scm b/dynwind.scm index a6a80ab..a6a80ab 100644..100755 --- a/dynwind.scm +++ b/dynwind.scm diff --git a/factor.scm b/factor.scm index c445004..a008fb2 100644..100755 --- a/factor.scm +++ b/factor.scm @@ -78,7 +78,7 @@ (= (gcd a n) 1) (= (modulo (prime:jacobi-symbol a n) n) (modular:expt n a (quotient (- n 1) 2))))) - (if (positive? i) #f #t)))) + (not (positive? i))))) ;;; prime:products are products of small primes. ;;; was (comlist:notevery (lambda (prd) (= 1 (gcd n prd))) comps)) diff --git a/factor.txi b/factor.txi index 90569ea..90569ea 100644..100755 --- a/factor.txi +++ b/factor.txi @@ -1,12 +1,12 @@ @c The GNU Free Documentation License. -@center Version 1.2, November 2002 +@center Version 1.3, 3 November 2008 @c This file is intended to be included within another document, @c hence no sectioning command or @node. @display -Copyright @copyright{} 2000,2001,2002 Free Software Foundation, Inc. -51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA +Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. +@uref{http://fsf.org/} Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -111,6 +111,9 @@ formats which do not have any title page as such, ``Title Page'' means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text. +The ``publisher'' means any person or entity that distributes copies +of the Document to the public. + A section ``Entitled XYZ'' means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a @@ -379,13 +382,30 @@ title. @item TERMINATION -You may not copy, modify, sublicense, or distribute the Document except -as expressly provided for under this License. Any other attempt to -copy, modify, sublicense or distribute the Document is void, and will -automatically terminate your rights under this License. However, -parties who have received copies, or rights, from you under this -License will not have their licenses terminated so long as such -parties remain in full compliance. +You may not copy, modify, sublicense, or distribute the Document +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense, or distribute it is void, and +will automatically terminate your rights under this License. + +However, if you cease all violation of this License, then your license +from a particular copyright holder is reinstated (a) provisionally, +unless and until the copyright holder explicitly and finally +terminates your license, and (b) permanently, if the copyright holder +fails to notify you of the violation by some reasonable means prior to +60 days after the cessation. + +Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + +Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, receipt of a copy of some or all of the same material does +not give you any rights to use it. @item FUTURE REVISIONS OF THIS LICENSE @@ -403,7 +423,42 @@ following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not -as a draft) by the Free Software Foundation. +as a draft) by the Free Software Foundation. If the Document +specifies that a proxy can decide which future versions of this +License can be used, that proxy's public statement of acceptance of a +version permanently authorizes you to choose that version for the +Document. + +@item +RELICENSING + +``Massive Multiauthor Collaboration Site'' (or ``MMC Site'') means any +World Wide Web server that publishes copyrightable works and also +provides prominent facilities for anybody to edit those works. A +public wiki that anybody can edit is an example of such a server. A +``Massive Multiauthor Collaboration'' (or ``MMC'') contained in the +site means any set of copyrightable works thus published on the MMC +site. + +``CC-BY-SA'' means the Creative Commons Attribution-Share Alike 3.0 +license published by Creative Commons Corporation, a not-for-profit +corporation with a principal place of business in San Francisco, +California, as well as future copyleft versions of that license +published by that same organization. + +``Incorporate'' means to publish or republish a Document, in whole or +in part, as part of another Document. + +An MMC is ``eligible for relicensing'' if it is licensed under this +License, and if all works that were first published under this License +somewhere other than this MMC, and subsequently incorporated in whole +or in part into the MMC, (1) had no cover texts or invariant sections, +and (2) were thus incorporated prior to November 1, 2008. + +The operator of an MMC Site may republish an MMC contained in the site +under CC-BY-SA on the same site at any time before August 1, 2009, +provided the MMC is eligible for relicensing. + @end enumerate @page @@ -417,7 +472,7 @@ license notices just after the title page: @group Copyright (C) @var{year} @var{your name}. Permission is granted to copy, distribute and/or modify this document - under the terms of the GNU Free Documentation License, Version 1.2 + under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU @@ -448,3 +503,4 @@ to permit their use in free software. @c Local Variables: @c ispell-local-pdict: "ispell-dict" @c End: + diff --git a/fluid-let.scm b/fluid-let.scm new file mode 100755 index 0000000..88720d6 --- /dev/null +++ b/fluid-let.scm @@ -0,0 +1,39 @@ +; "fluidlet.scm", FLUID-LET for Scheme +; Copyright (c) 1998, Radey Shouman <radey_shouman@splashtech.com> +; +;Permission to copy this software, to redistribute it, and to use it +;for any purpose is granted, subject to the following restrictions and +;understandings. +; +;1. Any copy made of this software must include this copyright notice +;in full. +; +;2. I have made no warrantee or representation that the operation of +;this software will be error-free, and I am under no obligation to +;provide any services, by way of maintenance, update, or otherwise. +; +;3. In conjunction with products arising from the use of this +;material, there shall be no use of my name in any advertising, +;promotional, or sales literature without prior written consent in +;each case. + +(require 'dynamic-wind) +(require 'macro) + +(define-syntax fluid-let + (syntax-rules () + ((_ ((?name ?val) ...) . ?body) + (fluid-let "make-temps" + ((?name ?val) ...) () () + ((?name ?val) ...) . ?body)) + ((_ "make-temps" (?bind1 . ?binds) ?olds ?news . ?rest) + (fluid-let "make-temps" + ?binds + (old-tmp . ?olds) + (new-tmp . ?news) . ?rest)) + ((_ "make-temps" () (?old ...) (?new ...) ((?name ?val) ...) . ?body) + (let ((?new ?val) ... (?old #f) ...) + (dynamic-wind + (lambda () (set! ?old ?name) ... (set! ?name ?new) ...) + (lambda () . ?body) + (lambda () (set! ?new ?name) ... (set! ?name ?old) ...)))))) diff --git a/fluidlet.scm b/fluidlet.scm index 3b862c1..3b862c1 100644..100755 --- a/fluidlet.scm +++ b/fluidlet.scm diff --git a/format.scm b/format.scm index 19c0dc5..19c0dc5 100644..100755 --- a/format.scm +++ b/format.scm diff --git a/format.texi b/format.texi index 34d5e0a..e662331 100644..100755 --- a/format.texi +++ b/format.texi @@ -30,11 +30,8 @@ error port. Characters are output as if the string were output by the @code{display} function with the exception of those prefixed by a tilde (~). For a detailed description of the @var{format-string} syntax please consult a Common LISP format reference manual. For a test suite -to verify this format implementation load @file{formatst.scm}. Please -send bug reports to @code{lutzeb@@cs.tu-berlin.de}. - -Note: @code{format} is not reentrant, i.e. only one @code{format}-call -may be executed at a time. +to verify this format implementation load @file{formatst.scm}. +@c Please send bug reports to @code{lutzeb@@cs.tu-berlin.de}. @end defun diff --git a/formatst.scm b/formatst.scm index 28d656a..28d656a 100644..100755 --- a/formatst.scm +++ b/formatst.scm diff --git a/gambit.init b/gambit.init index dce1a07..d96ab96 100644..100755 --- a/gambit.init +++ b/gambit.init @@ -9,6 +9,7 @@ ;;; Relative pathnames for Slib in MacGambit ;;; Hacked yet again for Gambit v2.4, Jan 1997, by Mike Pope ;;; Updated for Gambit v3.0, 2001-01 AGJ. +;;; Major update for Gambit-C 4.0b12. 2005-01 AGJ. ;;; gsi should be invoked with -:s option to Ignore case when reading ;;; symbols (per R5RS). diff --git a/genwrite.scm b/genwrite.scm index 4f9105f..6d9b569 100644..100755 --- a/genwrite.scm +++ b/genwrite.scm @@ -18,12 +18,11 @@ (cadr l)) (define (read-macro-prefix l) - (let ((head (car l)) (tail (cdr l))) - (case head - ((quote) "'") - ((quasiquote) "`") - ((unquote) ",") - ((unquote-splicing) ",@")))) + (case (car l) + ((quote) "'") + ((quasiquote) "`") + ((unquote) ",") + ((unquote-splicing) ",@"))) (define (out str col) (and col (output str) (+ col (string-length str)))) @@ -32,8 +31,8 @@ (define (wr-expr expr col) (if (read-macro? expr) - (wr (read-macro-body expr) (out (read-macro-prefix expr) col)) - (wr-lst expr col))) + (wr (read-macro-body expr) (out (read-macro-prefix expr) col)) + (wr-lst expr col))) (define (wr-lst l col) (if (pair? l) @@ -54,27 +53,27 @@ ((symbol? obj) (out (symbol->string obj) col)) ((procedure? obj) (out "#[procedure]" col)) ((string? obj) (if display? - (out obj col) - (let loop ((i 0) (j 0) (col (out "\"" col))) - (if (and col (< j (string-length obj))) - (let ((c (string-ref obj j))) - (if (or (char=? c #\\) - (char=? c #\")) - (loop j - (+ j 1) - (out "\\" - (out (substring obj i j) - col))) - (loop i (+ j 1) col))) - (out "\"" - (out (substring obj i j) col)))))) + (out obj col) + (let loop ((i 0) (j 0) (col (out "\"" col))) + (if (and col (< j (string-length obj))) + (let ((c (string-ref obj j))) + (if (or (char=? c #\\) + (char=? c #\")) + (loop j + (+ j 1) + (out "\\" + (out (substring obj i j) + col))) + (loop i (+ j 1) col))) + (out "\"" + (out (substring obj i j) col)))))) ((char? obj) (if display? - (out (make-string 1 obj) col) - (out (case obj - ((#\space) "space") - ((#\newline) "newline") - (else (make-string 1 obj))) - (out "#\\" col)))) + (out (make-string 1 obj) col) + (out (case obj + ((#\space) "space") + ((#\newline) "newline") + (else (make-string 1 obj))) + (out "#\\" col)))) ((input-port? obj) (out "#[input-port]" col)) ((output-port? obj) (out "#[output-port]" col)) ((eof-object? obj) (out "#[eof-object]" col)) @@ -84,61 +83,57 @@ (define (spaces n col) (if (> n 0) - (if (> n 7) - (spaces (- n 8) (out " " col)) - (out (substring " " 0 n) col)) - col)) + (if (> n 7) + (spaces (- n 8) (out " " col)) + (out (substring " " 0 n) col)) + col)) (define (indent to col) (and col (if (< to col) - (and (out genwrite:newline-str col) (spaces to 0)) - (spaces (- to col) col)))) + (and (out genwrite:newline-str col) (spaces to 0)) + (spaces (- to col) col)))) (define (pr obj col extra pp-pair) (if (or (pair? obj) (vector? obj)) ; may have to split on multiple lines - (let ((result '()) - (left (min (+ (- (- width col) extra) 1) max-expr-width))) - (generic-write obj display? #f - (lambda (str) - (set! result (cons str result)) - (set! left (- left (string-length str))) - (> left 0))) - (if (> left 0) ; all can be printed on one line - (out (reverse-string-append result) col) - (if (pair? obj) - (pp-pair obj col extra) - (pp-list (vector->list obj) (out "#" col) extra pp-expr)))) - (wr obj col))) + (let ((result '()) + (left (min (+ (- (- width col) extra) 1) max-expr-width))) + (generic-write obj display? #f + (lambda (str) + (set! result (cons str result)) + (set! left (- left (string-length str))) + (> left 0))) + (if (> left 0) ; all can be printed on one line + (out (reverse-string-append result) col) + (if (pair? obj) + (pp-pair obj col extra) + (pp-list (vector->list obj) (out "#" col) extra pp-expr)))) + (wr obj col))) (define (pp-expr expr col extra) (if (read-macro? expr) - (pr (read-macro-body expr) - (out (read-macro-prefix expr) col) - extra - pp-expr) - (let ((head (car expr))) - (if (symbol? head) - (let ((proc (style head))) - (if proc - (proc expr col extra) - (if (> (string-length (symbol->string head)) - max-call-head-width) - (pp-general expr col extra #f #f #f pp-expr) - (pp-call expr col extra pp-expr)))) - (pp-list expr col extra pp-expr))))) - - ; (head item1 - ; item2 - ; item3) + (pr (read-macro-body expr) + (out (read-macro-prefix expr) col) + extra + pp-expr) + (let ((head (car expr))) + (if (symbol? head) + (let ((proc (style head))) + (if proc + (proc expr col extra) + (if (> (string-length (symbol->string head)) + max-call-head-width) + (pp-general expr col extra #f #f #f pp-expr) + (pp-call expr col extra pp-expr)))) + (pp-list expr col extra pp-expr))))) + + ; (head item1 item2 item3) (define (pp-call expr col extra pp-item) (let ((col* (wr (car expr) (out "(" col)))) (and col (pp-down (cdr expr) col* (+ col* 1) extra pp-item)))) - ; (item1 - ; item2 - ; item3) + ; (item1 item2 item3) (define (pp-list l col extra pp-item) (let ((col (out "(" col))) (pp-down l col col extra pp-item))) @@ -164,19 +159,19 @@ (define (tail1 rest col1 col2 col3) (if (and pp-1 (pair? rest)) - (let* ((val1 (car rest)) - (rest (cdr rest)) - (extra (if (null? rest) (+ extra 1) 0))) - (tail2 rest col1 (pr val1 (indent col3 col2) extra pp-1) col3)) - (tail2 rest col1 col2 col3))) + (let* ((val1 (car rest)) + (rest (cdr rest)) + (extra (if (null? rest) (+ extra 1) 0))) + (tail2 rest col1 (pr val1 (indent col3 col2) extra pp-1) col3)) + (tail2 rest col1 col2 col3))) (define (tail2 rest col1 col2 col3) (if (and pp-2 (pair? rest)) - (let* ((val1 (car rest)) - (rest (cdr rest)) - (extra (if (null? rest) (+ extra 1) 0))) - (tail3 rest col1 (pr val1 (indent col3 col2) extra pp-2))) - (tail3 rest col1 col2))) + (let* ((val1 (car rest)) + (rest (cdr rest)) + (extra (if (null? rest) (+ extra 1) 0))) + (tail3 rest col1 (pr val1 (indent col3 col2) extra pp-2))) + (tail3 rest col1 col2))) (define (tail3 rest col1 col2) (pp-down rest col2 col1 extra pp-3)) @@ -185,11 +180,11 @@ (rest (cdr expr)) (col* (wr head (out "(" col)))) (if (and named? (pair? rest)) - (let* ((name (car rest)) - (rest (cdr rest)) - (col** (wr name (out " " col*)))) - (tail1 rest (+ col indent-general) col** (+ col** 1))) - (tail1 rest (+ col indent-general) col* (+ col* 1))))) + (let* ((name (car rest)) + (rest (cdr rest)) + (col** (wr name (out " " col*)))) + (tail1 rest (+ col indent-general) col** (+ col** 1))) + (tail1 rest (+ col indent-general) col* (+ col* 1))))) (define (pp-expr-list l col extra) (pp-list l col extra pp-expr)) @@ -220,7 +215,7 @@ (define (pp-DO expr col extra) (pp-general expr col extra #f pp-expr-list pp-expr-list pp-expr)) - ; define formatting style (change these to suit your style) +;;; define formatting style (change these to suit your style) (define indent-general 2) @@ -243,10 +238,10 @@ (pr obj col 0 pp-expr)) (if width - (out genwrite:newline-str (pp obj 0)) - (wr obj 0))) + (out genwrite:newline-str (pp obj 0)) + (wr obj 0))) -; (reverse-string-append l) = (apply string-append (reverse l)) +;;; (reverse-string-append l) = (apply string-append (reverse l)) ;@ (define (reverse-string-append l) diff --git a/getopt.scm b/getopt.scm index 49a8ebe..49a8ebe 100644..100755 --- a/getopt.scm +++ b/getopt.scm diff --git a/getparam.scm b/getparam.scm index 21d7d39..3c8cb93 100644..100755 --- a/getparam.scm +++ b/getparam.scm @@ -20,6 +20,7 @@ (require 'getopt) (require 'coerce) (require 'parameters) +(require 'multiarg-apply) (require 'rev4-optional-procedures) ; string-copy (require-if 'compiling 'printf) (require-if 'compiling 'common-list-functions) diff --git a/getparam.txi b/getparam.txi index 58acbaf..58acbaf 100644..100755 --- a/getparam.txi +++ b/getparam.txi @@ -94,7 +94,8 @@ deleted automatically and the value(s) yielded by the @var{proc} is(are) returned. @var{k} may be ommited, in which case it defaults to @code{1}. -@defunx call-with-tmpnam proc suffix1 @dots{} +@end defun +@defun call-with-tmpnam proc suffix1 @dots{} Calls @var{proc} with strings returned by successive calls to @code{tmpnam}, each with the corresponding @var{suffix} string appended. If @var{proc} returns, then any files named by the arguments to @var{proc} are diff --git a/grapheps.ps b/grapheps.ps index 4d41fd9..1f59e65 100644..100755 --- a/grapheps.ps +++ b/grapheps.ps @@ -1,7 +1,27 @@ +% "graph-eps" library for creating PostScript graphs +% http://people.csail.mit.edu/jaffer/Docupage/grapheps +% Copyright (C) 1991, 2001, 2005, 2006, 2009, 2010, 2011 Aubrey Jaffer +% +% Permission to copy this software, to modify it, to redistribute it, +% to distribute modified versions, and to use it for any purpose is +% granted, subject to the following restrictions and understandings. +% +% 1. Any copy made of this software must include this copyright notice +% in full. +% +% 2. I have made no warranty or representation that the operation of +% this software will be error-free, and I am under no obligation to +% provide any services, by way of maintenance, update, or otherwise. +% +% 3. In conjunction with products arising from the use of this +% material, there shall be no use of my name in any advertising, +% promotional, or sales literature without prior written consent in +% each case. + /plotdict 100 dict def plotdict begin -% Get dimensions the preamble left on the stack. +% Get dimensions 4 array astore /whole-page exch def % Definitions so that internal assignments are bound before setting. @@ -50,9 +70,48 @@ plotdict begin /STP3 0 def /STP2 0 def /SCL 0 def +/Y0 0 def +/NAME-ENCODING 0 def +/ENCODING 0 def +/NAME 0 def /graphrect 0 def /plotrect 0 def +% ( TITLE ) ( SUBTITLE ) +/title-top +{ dup stringwidth pop -2 div plotrect 0 get plotrect 2 get 2 div add add + plotrect 1 get plotrect 3 get add pointsize .4 mul add moveto show + dup stringwidth pop -2 div plotrect 0 get plotrect 2 get 2 div add add + plotrect 1 get plotrect 3 get add pointsize 1.4 mul add moveto show +} bind def + +% ( TITLE ) ( SUBTITLE ) +/title-bottom +{ dup stringwidth pop -2 div plotrect 0 get plotrect 2 get 2 div add add + plotrect 1 get pointsize -2 mul add moveto show + dup stringwidth pop -2 div plotrect 0 get plotrect 2 get 2 div add add + plotrect 1 get pointsize -1 mul add moveto show +} bind def + +% Plots column K against column J of given two-dimensional ARRAY. +% The arguments are: +% [ ARRAY J K ] J and K are column-indexes into ARRAY +% [ PREAMBLE RENDER POSTAMBLE ] Plotting procedures: +% PREAMBLE - Executed once before plotting row +% RENDER - Called with each pair of coordinates to plot +% POSTAMBLE - Called once after plotting row (often does stroke) +/plot-column +{ /GPROCS exch def aload pop /YDX exch def /XDX exch def /DATA exch def + /GD glyphsize def + /GR GD .5 mul def + gsave + /ROW DATA 0 get def ROW XDX get ROW YDX get gtrans moveto + GPROCS 0 get exec % preamble + /PROC GPROCS 1 get def DATA {dup XDX get exch YDX get gtrans PROC} forall + GPROCS 2 get exec stroke % postamble + grestore +} bind def + % Here are the procedure-arrays for passing as the third argument to % plot-column. Plot-column moves to the first coordinate before % calls to the first procedure. Thus both line and scatter graphs are @@ -73,11 +132,17 @@ plotdict begin {lineto} {currentpoint pop topedge lineto closepath fill}] bind def % Render lines from x-axis to points -/impulse [{} {moveto XRNG 0 get 0 gtrans exch pop - currentpoint pop exch lineto} {}] bind def -/bargraph [{} {exch GR sub exch dup - XRNG 0 get 0 gtrans exch pop % y=0 - exch sub GD exch rectstroke} {}] bind def +/impulse [{} {2 copy moveto pop Y0 lineto} {}] bind def +/bargraph + [{} + {2 copy pop GR sub Y0 + 4 2 roll Y0 sub exch pop GD exch rectstroke} + {}] bind def +/barfill + [{} + {2 copy pop GR sub Y0 + 4 2 roll Y0 sub exch pop GD exch rectfill} + {}] bind def % Solid round dot. /disc [{GD setlinewidth 1 setlinecap} @@ -121,41 +186,66 @@ plotdict begin {}] bind def /circle [{stroke} {GR 0 360 arc stroke} {}] bind def -% ( TITLE ) ( SUBTITLE ) -/title-top -{ dup stringwidth pop -2 div plotrect 0 get plotrect 2 get 2 div add add - plotrect 1 get plotrect 3 get add pointsize .4 mul add moveto show - dup stringwidth pop -2 div plotrect 0 get plotrect 2 get 2 div add add - plotrect 1 get plotrect 3 get add pointsize 1.4 mul add moveto show -} bind def - -% ( TITLE ) ( SUBTITLE ) -/title-bottom -{ dup stringwidth pop -2 div plotrect 0 get plotrect 2 get 2 div add add - plotrect 1 get pointsize -2 mul add moveto show - dup stringwidth pop -2 div plotrect 0 get plotrect 2 get 2 div add add - plotrect 1 get pointsize -1 mul add moveto show -} bind def - -% Plots column K against column J of given two-dimensional ARRAY. +% Puts text in column-L at column-K vs column-J % The arguments are: -% [ ARRAY J K ] J and K are column-indexes into ARRAY +% [ ARRAY J K L ] J, K, and L are column-indexes into ARRAY % [ PREAMBLE RENDER POSTAMBLE ] Plotting procedures: % PREAMBLE - Executed once before plotting row -% RENDER - Called with each pair of coordinates to plot +% RENDER - Called with each pair of coordinates and text % POSTAMBLE - Called once after plotting row (often does stroke) -/plot-column -{ /GPROCS exch def aload pop /YDX exch def /XDX exch def /DATA exch def +/plot-text-column +{ /GPROCS exch def aload pop + /TDX exch def /YDX exch def /XDX exch def /DATA exch def /GD glyphsize def /GR GD .5 mul def gsave /ROW DATA 0 get def ROW XDX get ROW YDX get gtrans moveto GPROCS 0 get exec % preamble - /PROC GPROCS 1 get def DATA {dup XDX get exch YDX get gtrans PROC} forall + /PROC GPROCS 1 get def + DATA + {/row exch def row XDX get row YDX get gtrans row TDX get PROC} forall GPROCS 2 get exec stroke % postamble grestore } bind def +% Here are the procedure-arrays for passing as the third argument to +% plot-text-column. Plot-text-column moves to the first coordinate +% before calls to the first procedure. + +% GD and GR are the graphic-glyph diameter and radius. +% DIAG and DIAG2, used in /cross are diagonal and twice diagonal. +% gtrans maps x, y coordinates on the stack to 72dpi page coordinates. + +/above [{} + {/TXT exch def + exch TXT stringwidth pop -2 div add exch pointsize 0.1 mul GR add add moveto + TXT show} + {}] bind def + +/center [{} + {/TXT exch def + exch TXT stringwidth pop -2 div add exch pointsize -0.35 mul add moveto + TXT show} + {}] bind def + +/below [{} + {/TXT exch def + exch TXT stringwidth pop -2 div add exch pointsize 0.7 mul GR add sub moveto + TXT show} + {}] bind def + +/left [{} + {/TXT exch def + exch TXT stringwidth pop GR add sub exch pointsize -0.35 mul add moveto + TXT show} + {}] bind def + +/right [{} + {/TXT exch def + exch GR add exch pointsize -0.35 mul add moveto + TXT show} + {}] bind def + /partition-page { /YPARTS exch def /XPARTS exch def /WPAGE exch def /XWID WPAGE 2 get XPARTS div def /YHIT WPAGE 3 get YPARTS div def @@ -168,6 +258,11 @@ plotdict begin } repeat } bind def +/squelch-.0 % x +{ + dup dup cvi eq {cvi} if +} bind def + /fudge3 % SCL STP3 STP2 { /STP2 exch def /STP3 exch def /SCL exch def @@ -191,17 +286,18 @@ plotdict begin graphrect 1 get PLOT-bmargin add graphrect 2 get PLOT-lmargin sub PLOT-rmargin sub graphrect 3 get PLOT-bmargin sub PLOT-tmargin sub ] def - /XOFF XRNG 0 get def /YOFF YRNG 0 get def /XSCL plotrect 2 get XRNG aload pop exch sub div def /YSCL plotrect 3 get YRNG aload pop exch sub div def - /XOFF XOFF plotrect 0 get XSCL div sub def - /YOFF YOFF plotrect 1 get YSCL div sub def + /XOFF XRNG 0 get plotrect 0 get XSCL div sub def + /YOFF YRNG 0 get plotrect 1 get YSCL div sub def /YTSCL plotrect 3 get YRNG aload pop exch sub abs find-tick-scale def - /YSTEP YTSCL 0 get 6 8 fudge3 5 mul yuntrans YSCL sign mul def + /YSTEP YTSCL 0 get 6 8 fudge3 5 mul yunttrans YSCL sign mul def /XTSCL plotrect 2 get XRNG aload pop exch sub abs find-tick-scale def - /XSTEP XTSCL 0 get 12 10 fudge3 5 mul xuntrans XSCL sign mul def + /XSTEP XTSCL 0 get 12 10 fudge3 5 mul xunttrans XSCL sign mul def /YSTEPH YSTEP 2 div def /XSTEPH XSTEP 2 div def +% /Y0 0 YOFF sub YSCL mul def + /Y0 YRNG 0 get YOFF sub YSCL mul def } bind def % gtrans is the utility routine mapping data coordinates to view space. @@ -209,10 +305,8 @@ plotdict begin /gtrans {exch XOFF sub XSCL mul exch YOFF sub YSCL mul} bind def %/guntrans {exch XSCL div XOFF add exch YSCL div YOFF add} bind def -% /ytrans {YTSCL aload pop div mul} bind def -% /xtrans {XTSCL aload pop div mul} bind def -/yuntrans {YTSCL aload pop exch div mul} bind def -/xuntrans {XTSCL aload pop exch div mul} bind def +/yunttrans {YTSCL aload pop exch div mul} bind def +/xunttrans {XTSCL aload pop exch div mul} bind def /sign {dup 0 lt {pop -1} {0 gt {1} {0} ifelse} ifelse} bind def @@ -290,7 +384,7 @@ bind def YRNG 0 get YSTEP div ceiling YSTEP mul YSTEP YRNG 1 get { /YDX exch def 0 YDX gtrans /Y-COORD exch def pop X-COORD Y-COORD moveto XWID 0 rlineto stroke - /TXT YDX 20 string cvs def + /TXT YDX squelch-.0 20 string cvs def X-COORD XWID 0 gt {TXT stringwidth pop sub ( ) stringwidth pop sub Y-COORD pointsize .3 mul sub moveto} @@ -312,7 +406,7 @@ bind def XRNG 0 get XSTEP div ceiling XSTEP mul XSTEP XRNG 1 get { dup 0 gtrans pop /X-COORD exch def X-COORD Y-COORD moveto 0 YHIT rlineto stroke - /TXT exch 10 string cvs def + /TXT exch squelch-.0 10 string cvs def X-COORD TXT stringwidth pop 2.0 div sub Y-COORD YHIT 0 gt {pointsize sub} {pointsize .3 mul add} ifelse moveto TXT show @@ -348,6 +442,19 @@ bind def /gpush {gsave /gstack [ gstack pointsize glyphsize ] def} bind def /gpop {/gstack gstack aload pop /glyphsize exch def /pointsize exch def def grestore} bind def +/combine-font-encoding % NAME ENCODING NAME-ENCODING +{ + /NAME-ENCODING exch def + /ENCODING exch def + findfont + dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding ENCODING def + currentdict + end + NAME-ENCODING exch definefont pop +} bind def + % Default parameters % The legend-templates are strings used to reserve horizontal space @@ -364,4 +471,5 @@ bind def /Helvetica pointsize selectfont gsave +% End of "graph-eps" diff --git a/grapheps.scm b/grapheps.scm index 857829c..7f7a465 100644..100755 --- a/grapheps.scm +++ b/grapheps.scm @@ -1,5 +1,5 @@ ;;;; "grapheps.scm", Create PostScript Graphs -;;; Copyright (C) 2003 Aubrey Jaffer +;;; Copyright (C) 2003, 2004, 2005, 2006, 2008, 2010, 2011 Aubrey Jaffer ; ;Permission to copy this software, to modify it, to redistribute it, ;to distribute modified versions, and to use it for any purpose is @@ -30,7 +30,7 @@ ;;@noindent ;;This is a graphing package creating encapsulated-PostScript files. ;;Its motivations and design choice are described in -;;@url{http://swiss.csail.mit.edu/~jaffer/Docupage/grapheps} +;;@url{http://people.csail.mit.edu/jaffer/Docupage/grapheps} ;; ;;@noindent ;;A dataset to be plotted is taken from a 2-dimensional array. @@ -53,6 +53,22 @@ (else arg))) args))) +(define (data->ps . args) + (apply string-append + (map (lambda (arg) + (cond ((number? arg) (number->string arg)) + ((symbol? arg) (string-append "/" (symbol->string arg))) + ((string? arg) (string-append "(" arg ")")) + ((or (vector? arg) (list? arg)) + (string-append + "[ " + (apply string-append + (map (lambda (x) (data->ps x " ")) + (if (vector? arg) (vector->list arg) arg))) + "]")) + (else arg))) + args))) + ;;; Capture for %%Title (define *plot-title* #f) @@ -120,7 +136,8 @@ (cond ((zero? idx) (write-line "]" oprt) (display " [" oprt))) - (display (scheme->ps " " elt) oprt) + (display " " oprt) + (display (data->ps elt) oprt) (set! idx (modulo (+ 1 idx) row-length))) array) (write-line "]" oprt) @@ -258,6 +275,35 @@ ;;Hollow circle ;;@end table +;;@body +;;Plots text in @4 of @1 at x coordinate in @2 of @1 and y coordinate +;;@3 of @1. The symbol @5 specifies the offset of the text from the +;;specified coordinates. +(define (plot-text-column array x-column y-column t-column proc3s) + (set! array (import-array array)) + (scheme->ps "[ " array " " x-column " " y-column " " t-column " ] " proc3s + " plot-text-column")) + +;;@noindent +;;The offsets available are: +;; +;;@table @code +;;@item above +;;Draws the text centered above at the point. +;;@item center +;;Draws the text centered at the point. +;;@item below +;;Draws the text centered below the point. +;;@item left +;;Draws the text to the left of the point. +;;@item right +;;Draws the text to the right of the point. +;;@end table +;; +;;All the offsets other than @code{center} are calculated to keep the +;;text clear of a glyph drawn at the same coordinates. If you need +;;more or less clearance, use @code{set-glyphsize}. + ;;@node Graphics Context, Rectangles, Drawing the Graph, PostScript Graphing ;;@subsubsection Graphics Context @@ -294,14 +340,28 @@ (append (map num->str (color->sRGB clr)) '(setrgbcolor)))) (else ""))) -;;@body +;;@args font height +;;@args font encoding height ;;@1 should be a (case-sensitive) string naming a PostScript font. -;;@2 should be a positive real number. +;;@var{height} should be a positive real number. +;;@var{encoding} should name a PostScript encoding such as +;;@samp{ISOLatin1Encoding}. ;; -;;@0 Changes the current PostScript font to @1 with height equal to -;;@2. The default font is Helvetica (12pt). -(define (set-font name fontheight) - (scheme->ps "/fontsize " fontheight " def /" name " fontsize selectfont")) +;;@0 Changes the current PostScript font to @1 with the @var{encoding} +;;encoding, and height equal to @var{height}. The default font is +;;@samp{Helvetica} (12pt). The default encoding is +;;@samp{StandardEncoding}. +(define (set-font name arg2 . args) + (define fontheight (if (null? args) arg2 (car args))) + (define encoding (and (not (null? args)) arg2)) + (scheme->ps + (if (null? args) + "" + (string-append " /" name " " encoding " /" name "-" encoding + " combine-font-encoding")) + " /fontsize " fontheight " def /" + (if encoding (string-append name "-" encoding) name) + " fontsize selectfont")) ;;@noindent ;;The base set of PostScript fonts is: @@ -314,6 +374,14 @@ ;;@end multitable ;;@noindent +;;The base set of PostScript encodings is: +;; +;;@multitable @columnfractions .33 .33 .33 +;;@item StandardEncoding @tab ISOLatin1Encoding @tab ExpertEncoding +;;@item ExpertSubsetEncoding @tab SymbolEncoding +;;@end multitable + +;;@noindent ;;Line parameters do no affect fonts; they do effect glyphs. ;;@body @@ -527,12 +595,12 @@ ;;over the range @2 to @3. If the optional integer argument @4 is ;;supplied, it specifies the number of points to evaluate @1 at. ;; -;;@defunx x1 x2 npts func1 func2 ... +;;@args x1 x2 npts func1 func2 ... ;;Creates and displays an encapsulated PostScript graph of the ;;one-argument functions @var{func1}, @var{func2}, ... over the range ;;@var{x1} to @var{x2} at @var{npts} points. ;; -;;@defunx plot coords x-label y-label +;;@args coords x-label y-label ;;@var{coords} is a list or vector of coordinates, lists of x and y ;;coordinates. @var{x-label} and @var{y-label} are strings with which ;;to label the x and y axes. @@ -540,11 +608,11 @@ (call-with-tmpnam (lambda (tmp) (cond ((procedure? (car args)) - (apply graph:plot-function tmp args)) + (apply graph:plot-function (cons tmp args))) ((or (array? (car args)) (and (pair? (car args)) (pair? (caar args)))) - (apply graph:plot tmp args)) + (apply graph:plot (cons tmp args))) (else (let ((dats (apply functions->array args))) (graph:plot tmp dats "" "")))) (system (string-append "gv '" tmp "'"))) diff --git a/grapheps.txi b/grapheps.txi index a889dd0..6e975ec 100644..100755 --- a/grapheps.txi +++ b/grapheps.txi @@ -3,7 +3,7 @@ @noindent This is a graphing package creating encapsulated-PostScript files. Its motivations and design choice are described in -@url{http://swiss.csail.mit.edu/~jaffer/Docupage/grapheps} +@url{http://people.csail.mit.edu/jaffer/Docupage/grapheps} @noindent A dataset to be plotted is taken from a 2-dimensional array. @@ -154,6 +154,34 @@ Five sided polygon Hollow circle @end table + +@defun plot-text-column array x-column y-column t-column proc3s + +Plots text in @var{t-column} of @var{array} at x coordinate in @var{x-column} of @var{array} and y coordinate +@var{y-column} of @var{array}. The symbol @var{proc3s} specifies the offset of the text from the +specified coordinates. +@end defun + +@noindent +The offsets available are: + +@table @code +@item above +Draws the text centered above at the point. +@item center +Draws the text centered at the point. +@item below +Draws the text centered below the point. +@item left +Draws the text to the left of the point. +@item right +Draws the text to the right of the point. +@end table + +All the offsets other than @code{center} are calculated to keep the +text clear of a glyph drawn at the same coordinates. If you need +more or less clearance, use @code{set-glyphsize}. + @node Graphics Context, Rectangles, Drawing the Graph, PostScript Graphing @subsubsection Graphics Context @@ -175,13 +203,19 @@ grey value between black (0) and white (100). @end defun -@defun set-font name fontheight +@defun set-font font height + -@var{name} should be a (case-sensitive) string naming a PostScript font. -@var{fontheight} should be a positive real number. +@defunx set-font font encoding height +@var{font} should be a (case-sensitive) string naming a PostScript font. +@var{height} should be a positive real number. +@var{encoding} should name a PostScript encoding such as +@samp{ISOLatin1Encoding}. -@code{set-font} Changes the current PostScript font to @var{name} with height equal to -@var{fontheight}. The default font is Helvetica (12pt). +@code{set-font} Changes the current PostScript font to @var{font} with the @var{encoding} +encoding, and height equal to @var{height}. The default font is +@samp{Helvetica} (12pt). The default encoding is +@samp{StandardEncoding}. @end defun @noindent @@ -195,6 +229,14 @@ The base set of PostScript fonts is: @end multitable @noindent +The base set of PostScript encodings is: + +@multitable @columnfractions .33 .33 .33 +@item StandardEncoding @tab ISOLatin1Encoding @tab ExpertEncoding +@item ExpertSubsetEncoding @tab SymbolEncoding +@end multitable + +@noindent Line parameters do no affect fonts; they do effect glyphs. @@ -210,10 +252,12 @@ glyphsize for readable glyphs. Lines are drawn @var{j}-on @var{k}-off. -@defunx set-linedash j +@end defun +@defun set-linedash j Lines are drawn @var{j}-on @var{j}-off. -@defunx set-linedash +@end defun +@defun set-linedash Turns off dashing. @end defun @@ -391,12 +435,16 @@ encapsulated PostScript graph of the function of one argument @var{func} over the range @var{x1} to @var{x2}. If the optional integer argument @var{npts} is supplied, it specifies the number of points to evaluate @var{func} at. -@defunx x1 x2 npts func1 func2 ... + +@end defun +@defun plot x1 x2 npts func1 func2 @dots{} Creates and displays an encapsulated PostScript graph of the one-argument functions @var{func1}, @var{func2}, ... over the range @var{x1} to @var{x2} at @var{npts} points. -@defunx plot coords x-label y-label + +@end defun +@defun plot coords x-label y-label @var{coords} is a list or vector of coordinates, lists of x and y coordinates. @var{x-label} and @var{y-label} are strings with which to label the x and y axes. diff --git a/guile-2.init b/guile-2.init new file mode 100755 index 0000000..566ca0d --- /dev/null +++ b/guile-2.init @@ -0,0 +1,714 @@ +;"guile.init" Configuration file for SLIB for Guile -*-scheme-*- +;;; Author: Aubrey Jaffer +;;; Author: Andy Wingo +;;; +;;; This code is in the public domain. + +(cond-expand + (guile-2) + (else + (error "Guile 2.0 or later is required."))) + +(define-module (ice-9 slib) + #:use-module ((ice-9 popen) #:select (open-input-pipe close-pipe)) + #:use-module ((ice-9 rdelim) #:select (read-line read-line! write-line)) + #:re-export (read-line read-line! write-line) + #:export (<=? + <? + =? + >=? + >? + A:bool + A:fixN16b + A:fixN32b + A:fixN64b + A:fixN8b + A:fixZ16b + A:fixZ32b + A:fixZ64b + A:fixZ8b + A:floC128b + A:floC16b + A:floC32b + A:floC64b + A:floR128b + A:floR128d + A:floR16b + A:floR32b + A:floR32d + A:floR64b + A:floR64d + a:bool + a:fixn16b + a:fixn32b + a:fixn64b + a:fixn8b + a:fixz16b + a:fixz32b + a:fixz64b + a:fixz8b + a:floc128b + a:floc16b + a:floc32b + a:floc64b + a:flor128b + a:flor128d + a:flor16b + a:flor32b + a:flor32d + a:flor64b + a:flor64d + any-bits-set? + arithmetic-shift + array-indexes + array-null? + array:copy! + ;; ac32 + ;; ac64 + ;; ar32 + ;; ar64 + ;; as16 + ;; as32 + ;; as64 + ;; as8 + ;; at1 + ;; au16 + ;; au32 + ;; au64 + ;; au8 + bit-field + bit-reverse + bit-set? + bitwise-and + bitwise-if + bitwise-ior + bitwise-merge + bitwise-not + bitwise-xor + booleans->integer + browse-url + call-with-open-ports + copy-bit + copy-bit-field + create-array + ;;define + defmacro:eval + defmacro:expand* + defmacro:load + ;;delete-file + difftime + ;;file-position + first-set-bit + gentemp + home-vicinity + implementation-vicinity + integer->list + library-vicinity + list->array + list->integer + log2-binary-factors + logical:ash + logical:bit-extract + logical:integer-expt + logical:integer-length + ;;logical:ipow-by-squaring + logical:logand + logical:logcount + logical:logior + logical:lognot + logical:logxor + macro:eval + macro:load + make-array + make-exchanger + make-random-state + ;;make-uniform-wrapper + make-vicinity + ;; nil + offset-time + ;;open-file + output-port-height + output-port-width + pathname->vicinity + program-vicinity + random:chunk + reverse-bit-field + rotate-bit-field + scheme-implementation-home-page + scheme-implementation-type + scheme-implementation-version + ;; slib-module + slib:error + slib:eval + slib:eval-load + slib:exit + ;; slib:features + slib:form-feed + slib:load + slib:load-compiled + slib:load-source + slib:tab + slib:warn + software-type + sub-vicinity + ;;system + system->line + ;; t + user-vicinity + vector->array + ;; vicinity:suffix? + ;; with-load-pathname + ) + #:replace (file-position + system + open-file + delete-file + char-code-limit + scheme-file-suffix + gentemp + make-array + list->array + provide + provided?)) + +(define slib-module (current-module)) + +(module-export-all! (current-module)) + +;;; (software-type) should be set to the generic operating system type. +;;; UNIX, VMS, MACOS, AMIGA and MS-DOS are supported. +(define (software-type) 'unix) + +;;; (scheme-implementation-type) should return the name of the scheme +;;; implementation loading this file. +(define (scheme-implementation-type) 'guile) + +;;; (scheme-implementation-home-page) should return a (string) URI +;;; (Uniform Resource Identifier) for this scheme implementation's home +;;; page; or false if there isn't one. +(define (scheme-implementation-home-page) + "http://www.gnu.org/software/guile/") + +;;; (scheme-implementation-version) should return a string describing +;;; the version the scheme implementation loading this file. +(define scheme-implementation-version version) + +;;; (implementation-vicinity) should be defined to be the pathname of +;;; the directory where any auxillary files to your Scheme +;;; implementation reside. +(define implementation-vicinity + (cond ((getenv "GUILE_IMPLEMENTATION_PATH") + => (lambda (path) (lambda () path))) + (else %site-dir))) + +;;; (library-vicinity) should be defined to be the pathname of the +;;; directory where files of Scheme library functions reside. +(define library-vicinity + (let ((library-path + (or (getenv "SCHEME_LIBRARY_PATH") + (string-append (canonicalize-path (dirname (current-filename))) + "/") + ;; A fallback; normally shouldn't be reached. + "/usr/share/slib/"))) + (lambda () library-path))) + +;;; (home-vicinity) should return the vicinity of the user's HOME +;;; directory, the directory which typically contains files which +;;; customize a computer environment for a user. +(define (home-vicinity) + (let ((home (or (getenv "HOME") + (false-if-exception + (passwd:dir (getpwnam (cuserid))))))) + (and home + (if (eqv? #\/ (string-ref home (+ -1 (string-length home)))) + home + (string-append home "/"))))) +;@ +(define (user-vicinity) + "") +;@ +(define vicinity:suffix? + (case (software-type) + ((ms-dos windows) + (lambda (chr) (memv chr '(#\/ #\\)))) + (else + (lambda (chr) (eqv? chr #\/))))) +;@ +(define (pathname->vicinity pathname) + (let loop ((i (- (string-length pathname) 1))) + (cond ((negative? i) "") + ((vicinity:suffix? (string-ref pathname i)) + (substring pathname 0 (+ i 1))) + (else (loop (- i 1)))))) +;@ +(define program-vicinity + (make-parameter (getcwd) pathname->vicinity)) +;@ +(define sub-vicinity + (let ((*vicinity-suffix* + (case (software-type) + ((ms-dos windows atarist os/2) "\\") + ((unix coherent plan9 amiga) "/")))) + (lambda (vic name) + (string-append vic name *vicinity-suffix*)))) +;@ +(define (make-vicinity <pathname>) <pathname>) +;@ +(define (with-load-pathname path thunk) + (parameterize ((program-vicinity path)) + (thunk))) + +;;@ SLIB:FEATURES is a list of symbols naming the (SLIB) features +;;; initially supported by this implementation. +(define slib:features + '(source ;can load scheme source files + ;(SLIB:LOAD-SOURCE "filename") + compiled ;can load compiled files + ;(SLIB:LOAD-COMPILED "filename") + vicinity + srfi-59 + srfi-96 + + ;; Scheme report features + ;; R5RS-compliant implementations should provide all 9 features. + + r5rs ;conforms to + eval ;R5RS two-argument eval + values ;R5RS multiple values + dynamic-wind ;R5RS dynamic-wind + macro ;R5RS high level macros + delay ;has DELAY and FORCE + multiarg-apply ;APPLY can take more than 2 args. + char-ready? + rev4-optional-procedures ;LIST-TAIL, STRING-COPY, + ;STRING-FILL!, and VECTOR-FILL! + + ;; These four features are optional in both R4RS and R5RS + + multiarg/and- ;/ and - can take more than 2 args. + rationalize +;;; transcript ;TRANSCRIPT-ON and TRANSCRIPT-OFF + with-file ;has WITH-INPUT-FROM-FILE and + ;WITH-OUTPUT-TO-FILE + +;;; r4rs ;conforms to + +;;; ieee-p1178 ;conforms to + +;;; r3rs ;conforms to + + rev2-procedures ;SUBSTRING-MOVE-LEFT!, + ;SUBSTRING-MOVE-RIGHT!, + ;SUBSTRING-FILL!, + ;STRING-NULL?, APPEND!, 1+, + ;-1+, <?, <=?, =?, >?, >=? +;;; object-hash ;has OBJECT-HASH + hash ;HASH, HASHV, HASHQ + + full-continuation ;can return multiple times + ieee-floating-point ;conforms to IEEE Standard 754-1985 + ;IEEE Standard for Binary + ;Floating-Point Arithmetic. + + ;; Other common features + + srfi-0 ;srfi-0, COND-EXPAND finds all srfi-* +;;; sicp ;runs code from Structure and + ;Interpretation of Computer + ;Programs by Abelson and Sussman. + defmacro ;has Common Lisp DEFMACRO +;;; record ;has user defined data structures + string-port ;has CALL-WITH-INPUT-STRING and + ;CALL-WITH-OUTPUT-STRING + line-i/o +;;; sort +;;; pretty-print +;;; object->string +;;; format ;Common-lisp output formatting +;;; trace ;has macros: TRACE and UNTRACE +;;; compiler ;has (COMPILER) +;;; ed ;(ED) is editor + system ;posix (system <string>) + getenv ;posix (getenv <string>) + program-arguments ;returns list of strings (argv) + current-time ;returns time in seconds since 1/1/1970 + + ;; Implementation Specific features + + logical + random ;Random numbers + + array + array-for-each + )) + +;;@ (FILE-POSITION <port> . <k>) +(define* (file-position port #:optional k) + (if k + (seek port k SEEK_SET) + (ftell port))) + +;;; (OUTPUT-PORT-WIDTH <port>) +(define (output-port-width . arg) 79) + +;;; (OUTPUT-PORT-HEIGHT <port>) +(define (output-port-height . arg) 24) + +;; If the program is killed by a signal, /bin/sh normally gives an +;; exit code of 128+signum. If /bin/sh itself is killed by a signal +;; then we do the same 128+signum here. +;; +;; "status:stop-sig" shouldn't arise here, since system shouldn't be +;; calling waitpid with WUNTRACED, but allow for it anyway, just in +;; case. +(define (system str) + (define st ((@ (guile) system) str)) + (or (status:exit-val st) + (+ 128 (or (status:term-sig st) + (status:stop-sig st))))) + +;;; for line-i/o +(define* (system->line command #:optional tmp) + ;; TMP is the name of a temporary file, and is unused because we use + ;; pipes. + (let ((ipip (open-input-pipe command))) + (define line (read-line ipip)) + (let ((status (close-pipe ipip))) + (and (or (eqv? 0 (status:exit-val status)) + (status:term-sig status) + (status:stop-sig status)) + (if (eof-object? line) "" line))))) + +(define (delete-file filename) + (false-if-exception + ((@ (guile) delete-file) filename))) + +(define (make-exchanger obj) + (lambda (rep) (let ((old obj)) (set! obj rep) old))) +(define (open-file filename modes) + ((@ (guile) open-file) + filename + (if (symbol? modes) + (symbol->string modes) + modes))) +;; This has to be done after the definition so that the original +;; binding will still be visible during the definition. +(if (string>=? (scheme-implementation-version) "1.8") + (module-replace! (current-module) '(open-file))) + +(define (call-with-open-ports . ports) + (define proc (car ports)) + (cond ((procedure? proc) (set! ports (cdr ports))) + (else (set! ports (reverse ports)) + (set! proc (car ports)) + (set! ports (reverse (cdr ports))))) + (let ((ans (apply proc ports))) + (for-each close-port ports) + ans)) + +;; Nothing special to do for this, so straight from +;; Template.scm. Maybe "sensible-browser" for a debian +;; system would be worth trying too (and would be good on a +;; tty). +(define (browse-url url) + (define (try cmd end) (zero? (system (string-append cmd url end)))) + (or (try "netscape-remote -remote 'openURL(" ")'") + (try "netscape -remote 'openURL(" ")'") + (try "netscape '" "'&") + (try "netscape '" "'"))) + +;;; "rationalize" adjunct procedures. +;;(define (find-ratio x e) +;; (let ((rat (rationalize x e))) +;; (list (numerator rat) (denominator rat)))) +;;(define (find-ratio-between x y) +;; (find-ratio (/ (+ x y) 2) (/ (- x y) 2))) + +;;; CHAR-CODE-LIMIT is one greater than the largest integer which can +;;; be returned by CHAR->INTEGER. +(define char-code-limit (+ 1 #x10ffff)) + +;;; SLIB:EVAL is single argument eval using the top-level (user) environment. +(define (slib:eval expression) + (eval expression (interaction-environment))) + +;;; Define SLIB:EXIT to be the implementation procedure to exit or +;;; return if exiting not supported. +(define slib:exit quit) + +;@ +(define scheme-file-suffix + (lambda () ".scm")) + +(define (slib:load <pathname>) + (save-module-excursion + (lambda () + (set-current-module slib-module) + (load (string-append <pathname> (scheme-file-suffix)))))) + +;;;(SLIB:LOAD-SOURCE "foo") should load "foo.scm" or with whatever +;;;suffix all the module files in SLIB have. See feature 'SOURCE. +(define slib:load-source slib:load) + +;;; (SLIB:LOAD-COMPILED "foo") should load the file that was produced +;;; by compiling "foo.scm" if this implementation can compile files. +;;; See feature 'COMPILED. +(define slib:load-compiled slib:load) + +(define defmacro:eval slib:eval) +(define defmacro:load slib:load) + +(define (defmacro:expand* x) + (require 'defmacroexpand) + (defmacro:expand* x)) + +;@ +(define gentemp + (let ((*gensym-counter* -1)) + (lambda () + (set! *gensym-counter* (+ *gensym-counter* 1)) + (string->symbol + (string-append "slib:G" (number->string *gensym-counter*)))))) + +;;; If your implementation provides R4RS macros: +(define macro:eval slib:eval) +(define macro:load slib:load-source) + +(define slib:warn warn) +(define slib:error error) + +;;; define these as appropriate for your system. +(define slib:tab #\tab) +(define slib:form-feed #\page) + +;;; {Time} +(define difftime -) +(define offset-time +) + +;;; Early version of 'logical is built-in +(define (copy-bit index to bool) + (if bool + (logior to (arithmetic-shift 1 index)) + (logand to (lognot (arithmetic-shift 1 index))))) +(define (bit-field n start end) + (logand (- (expt 2 (- end start)) 1) + (arithmetic-shift n (- start)))) +(define (bitwise-if mask n0 n1) + (logior (logand mask n0) + (logand (lognot mask) n1))) +(define (copy-bit-field to from start end) + (bitwise-if (arithmetic-shift (lognot (ash -1 (- end start))) start) + (arithmetic-shift from start) + to)) +(define (rotate-bit-field n count start end) + (define width (- end start)) + (set! count (modulo count width)) + (let ((mask (lognot (ash -1 width)))) + (define azn (logand mask (arithmetic-shift n (- start)))) + (logior (arithmetic-shift + (logior (logand mask (arithmetic-shift azn count)) + (arithmetic-shift azn (- count width))) + start) + (logand (lognot (ash mask start)) n)))) +(define (log2-binary-factors n) + (+ -1 (integer-length (logand n (- n))))) +(define (bit-reverse k n) + (do ((m (if (negative? n) (lognot n) n) (arithmetic-shift m -1)) + (k (+ -1 k) (+ -1 k)) + (rvs 0 (logior (arithmetic-shift rvs 1) (logand 1 m)))) + ((negative? k) (if (negative? n) (lognot rvs) rvs)))) +(define (reverse-bit-field n start end) + (define width (- end start)) + (let ((mask (lognot (ash -1 width)))) + (define zn (logand mask (arithmetic-shift n (- start)))) + (logior (arithmetic-shift (bit-reverse width zn) start) + (logand (lognot (ash mask start)) n)))) + +(define* (integer->list k len) + (if len + (do ((idx (+ -1 len) (+ -1 idx)) + (k k (arithmetic-shift k -1)) + (lst '() (cons (odd? k) lst))) + ((negative? idx) lst)) + (do ((k k (arithmetic-shift k -1)) + (lst '() (cons (odd? k) lst))) + ((<= k 0) lst)))) +(define (list->integer bools) + (do ((bs bools (cdr bs)) + (acc 0 (+ acc acc (if (car bs) 1 0)))) + ((null? bs) acc))) +(define (booleans->integer . bools) + (list->integer bools)) + +;;;; SRFI-60 aliases +(define arithmetic-shift ash) +(define bitwise-ior logior) +(define bitwise-xor logxor) +(define bitwise-and logand) +(define bitwise-not lognot) +;;(define bit-count logcount) +(define bit-set? logbit?) +(define any-bits-set? logtest) +(define first-set-bit log2-binary-factors) +(define bitwise-merge bitwise-if) + +;;; array-for-each +(define (array-indexes ra) + (let ((ra0 (apply make-array '#() (array-shape ra)))) + (array-index-map! ra0 list) + ra0)) +(define (array:copy! dest source) + (array-map! dest identity source)) +;; DIMENSIONS->UNIFORM-ARRAY and list->uniform-array in Guile-1.6.4 +;; cannot make empty arrays. +(define make-array + (lambda (prot . args) + (dimensions->uniform-array args (array-prototype prot) + (apply array-ref prot + (map car (array-shape prot)))))) + +(define (list->array rank proto lst) + (define dimensions + (do ((shp '() (cons (length row) shp)) + (row lst (car lst)) + (rnk (+ -1 rank) (+ -1 rnk))) + ((negative? rnk) (reverse shp)))) + (let ((nra (apply make-array proto dimensions))) + (define (l2ra dims idxs row) + (cond ((null? dims) + (apply array-set! nra row (reverse idxs))) + ((if (not (eqv? (car dims) (length row))) + (slib:error 'list->array + 'non-rectangular 'array dims dimensions)) + (do ((idx 0 (+ 1 idx)) + (row row (cdr row))) + ((>= idx (car dims))) + (l2ra (cdr dims) (cons idx idxs) (car row)))))) + (l2ra dimensions '() lst) + nra)) + +(define (vector->array vect prototype . dimensions) + (define vdx (vector-length vect)) + (if (not (eqv? vdx (apply * dimensions))) + (slib:error 'vector->array vdx '<> (cons '* dimensions))) + (let ((ra (apply make-array prototype dimensions))) + (define (v2ra dims idxs) + (cond ((null? dims) + (set! vdx (+ -1 vdx)) + (apply array-set! ra (vector-ref vect vdx) (reverse idxs))) + (else + (do ((idx (+ -1 (car dims)) (+ -1 idx))) + ((negative? idx) vect) + (v2ra (cdr dims) (cons idx idxs)))))) + (v2ra dimensions '()) + ra)) +(define (array->vector ra) + (define dims (array-dimensions ra)) + (let* ((vdx (apply * dims)) + (vect (make-vector vdx))) + (define (ra2v dims idxs) + (if (null? dims) + (let ((val (apply array-ref ra (reverse idxs)))) + (set! vdx (+ -1 vdx)) + (vector-set! vect vdx val)) + (do ((idx (+ -1 (car dims)) (+ -1 idx))) + ((negative? idx) vect) + (ra2v (cdr dims) (cons idx idxs))))) + (ra2v dims '()) + vect)) + +(define create-array make-array) +(define (make-uniform-wrapper prot) + (if (string? prot) (set! prot (string->number prot))) + (if prot + (lambda opt + (if (null? opt) + (list->uniform-array 1 prot (list prot)) + (list->uniform-array 0 prot (car opt)))) + vector)) +(define ac64 (make-uniform-wrapper "+i")) +(define ac32 ac64) +(define ar64 (make-uniform-wrapper "1/3")) +(define ar32 (make-uniform-wrapper "1.")) +(define as64 vector) +(define as32 (make-uniform-wrapper -32)) +(define as16 as32) +(define as8 as32) +(define au64 vector) +(define au32 (make-uniform-wrapper 32)) +(define au16 au32) +(define au8 au32) +(define at1 (make-uniform-wrapper #t)) + +;;; New SRFI-58 names +;; flonums +(define A:floC128b ac64) +(define A:floC64b ac64) +(define A:floC32b ac32) +(define A:floC16b ac32) +(define A:floR128b ar64) +(define A:floR64b ar64) +(define A:floR32b ar32) +(define A:floR16b ar32) +;; decimal flonums +(define A:floR128d ar64) +(define A:floR64d ar64) +(define A:floR32d ar32) +;; fixnums +(define A:fixZ64b as64) +(define A:fixZ32b as32) +(define A:fixZ16b as16) +(define A:fixZ8b as8) +(define A:fixN64b au64) +(define A:fixN32b au32) +(define A:fixN16b au16) +(define A:fixN8b au8) +(define A:bool at1) + +;;; And case-insensitive versions +;; flonums +(define a:floc128b ac64) +(define a:floc64b ac64) +(define a:floc32b ac32) +(define a:floc16b ac32) +(define a:flor128b ar64) +(define a:flor64b ar64) +(define a:flor32b ar32) +(define a:flor16b ar32) +;; decimal flonums +(define a:flor128d ar64) +(define a:flor64d ar64) +(define a:flor32d ar32) +;; fixnums +(define a:fixz64b as64) +(define a:fixz32b as32) +(define a:fixz16b as16) +(define a:fixz8b as8) +(define a:fixn64b au64) +(define a:fixn32b au32) +(define a:fixn16b au16) +(define a:fixn8b au8) +(define a:bool at1) + +;;; {Random numbers} +(define (make-random-state . args) + (let ((seed (if (null? args) *random-state* (car args)))) + (cond ((string? seed)) + ((number? seed) (set! seed (number->string seed))) + (else (let () + (require 'object->string) + (set! seed (object->limited-string seed 50))))) + (seed->random-state seed))) +(define (random:chunk sta) (random 256 sta)) + +(define t #t) +(define nil #f) + +;;; rev2-procedures +(define <? <) +(define <=? <=) +(define =? =) +(define >? >) +(define >=? >=) + +(slib:load (in-vicinity (library-vicinity) "require")) diff --git a/guile.init b/guile.init index 1b59833..a728e33 100644..100755 --- a/guile.init +++ b/guile.init @@ -3,8 +3,166 @@ ;;; ;;; This code is in the public domain. -(if (not (and (string<=? "1.6" (version)) (string<? (version) "1.8.3"))) - (define-module (ice-9 slib))) ; :no-backtrace +(cond-expand + (guile-2 + (include "guile-2.init")) + (else + +(cond + ((and (string<=? "1.6" (version)) (string<? (version) "1.8.3"))) + ((string>=? (version) "1.8.6") + (define-module (ice-9 slib) + :export + ( + <=? + <? + =? + >=? + >? + A:bool + A:fixN16b + A:fixN32b + A:fixN64b + A:fixN8b + A:fixZ16b + A:fixZ32b + A:fixZ64b + A:fixZ8b + A:floC128b + A:floC16b + A:floC32b + A:floC64b + A:floR128b + A:floR128d + A:floR16b + A:floR32b + A:floR32d + A:floR64b + A:floR64d + a:bool + a:fixn16b + a:fixn32b + a:fixn64b + a:fixn8b + a:fixz16b + a:fixz32b + a:fixz64b + a:fixz8b + a:floc128b + a:floc16b + a:floc32b + a:floc64b + a:flor128b + a:flor128d + a:flor16b + a:flor32b + a:flor32d + a:flor64b + a:flor64d + any-bits-set? + arithmetic-shift + array-indexes + array-null? + array:copy! + ;; ac32 + ;; ac64 + ;; ar32 + ;; ar64 + ;; as16 + ;; as32 + ;; as64 + ;; as8 + ;; at1 + ;; au16 + ;; au32 + ;; au64 + ;; au8 + bit-field + bit-reverse + bit-set? + bitwise-and + bitwise-if + bitwise-ior + bitwise-merge + bitwise-not + bitwise-xor + booleans->integer + browse-url + call-with-open-ports + copy-bit + copy-bit-field + create-array + ;;define + defmacro:eval + defmacro:expand* + defmacro:load + ;;delete-file + difftime + ;;file-position + first-set-bit + gentemp + home-vicinity + implementation-vicinity + integer->list + library-vicinity + list->array + list->integer + log2-binary-factors + logical:ash + logical:bit-extract + logical:integer-expt + logical:integer-length + ;;logical:ipow-by-squaring + logical:logand + logical:logcount + logical:logior + logical:lognot + logical:logxor + macro:eval + macro:load + make-array + make-exchanger + make-random-state + ;;make-uniform-wrapper + make-vicinity + ;; nil + offset-time + ;;open-file + output-port-height + output-port-width + pathname->vicinity + program-vicinity + random:chunk + reverse-bit-field + rotate-bit-field + scheme-implementation-home-page + scheme-implementation-type + scheme-implementation-version + ;; slib-module + slib:error + slib:eval + slib:eval-load + slib:exit + ;; slib:features + slib:form-feed + slib:load + slib:load-compiled + slib:load-source + slib:tab + slib:warn + software-type + sub-vicinity + ;;system + system->line + ;; t + user-vicinity + vector->array + ;; vicinity:suffix? + ;; with-load-pathname + ) + :no-backtrace)) + (else + (define-module (ice-9 slib)))) (define slib-module (current-module)) (define base:define define) @@ -14,10 +172,10 @@ (cons (if (= 1 (length env)) 'define-public 'base:define) (cdr exp))))) ;;; Hack to make syncase macros work in the slib module -(if (nested-ref the-root-module '(app modules ice-9 syncase)) - (set-object-property! (module-local-variable (current-module) 'define) - '*sc-expander* - '(define))) + (if (nested-ref the-root-module '(app modules ice-9 syncase)) + (set-object-property! (module-local-variable (current-module) 'define) + '*sc-expander* + '(define))) ;;; (software-type) should be set to the generic operating system type. ;;; UNIX, VMS, MACOS, AMIGA and MS-DOS are supported. @@ -49,11 +207,14 @@ ;; (vic (substring path 0 (- (string-length path) 11)))) ;; (lambda () vic))) ;; -;;; Rob Browning says %site-dir exists since Guile-1.6 +;;; Rob Browning says %site-dir exists since Guile-1.6. But Thomas +;;; Bushnell points out that %site-dir mashes the slibcat for all +;;; versions together. %library-dir (also since Guile-1.6) is the +;;; versioned directory. (define implementation-vicinity (cond ((and (defined? 'getenv) (getenv "GUILE_IMPLEMENTATION_PATH")) => (lambda (path) (lambda () path))) - (else %site-dir))) + (else %library-dir))) ;;; (library-vicinity) should be defined to be the pathname of the ;;; directory where files of Scheme library functions reside. @@ -63,13 +224,12 @@ ;; Use this getenv if your implementation supports it. (and (defined? 'getenv) (getenv "SCHEME_LIBRARY_PATH")) ;; Rob Browning sent this; I'm not sure its a good idea. - ;; See if we can find slib/guile.init (cf. implementation-vicinity). - (let ((path (%search-load-path "slib/guile.init"))) - (and path (substring path 0 (- (string-length path) 10)))) + ;; See if we can find slib/guile.init (cf. implementation-vicinity). + (let ((path (%search-load-path "slib/guile.init"))) + (and path (substring path 0 (- (string-length path) 10)))) ;; Use this path if your scheme does not support GETENV ;; or if SCHEME_LIBRARY_PATH is not set. - "/usr/lib/slib/" - (in-vicinity (implementation-vicinity) "slib/")))) + "/usr/share/slib/"))) (lambda () library-path))) ;;; (home-vicinity) should return the vicinity of the user's HOME @@ -214,7 +374,7 @@ ;; Other common features -;;; srfi-0 ;srfi-0, COND-EXPAND finds all srfi-* + srfi-0 ;srfi-0, COND-EXPAND finds all srfi-* ;;; sicp ;runs code from Structure and ;Interpretation of Computer ;Programs by Abelson and Sussman. @@ -271,12 +431,12 @@ ;; calling waitpid with WUNTRACED, but allow for it anyway, just in ;; case. (define system - (let ((guile-core-system system)) - (lambda (str) - (define st (guile-core-system str)) - (or (status:exit-val st) - (+ 128 (or (status:term-sig st) - (status:stop-sig st))))))) + (let ((guile-core-system system)) + (lambda (str) + (define st (guile-core-system str)) + (or (status:exit-val st) + (+ 128 (or (status:term-sig st) + (status:stop-sig st))))))) ;; This has to be done after the definition so that the original ;; binding will still be visible during the definition. (if (string>=? (scheme-implementation-version) "1.8") @@ -343,17 +503,16 @@ (for-each close-port ports) ans)) -(if (not (defined? 'browse-url)) - ;; Nothing special to do for this, so straight from - ;; Template.scm. Maybe "sensible-browser" for a debian - ;; system would be worth trying too (and would be good on a - ;; tty). - (define (browse-url url) +;; Nothing special to do for this, so straight from +;; Template.scm. Maybe "sensible-browser" for a debian +;; system would be worth trying too (and would be good on a +;; tty). +(define (browse-url url) (define (try cmd end) (zero? (system (string-append cmd url end)))) (or (try "netscape-remote -remote 'openURL(" ")'") (try "netscape -remote 'openURL(" ")'") (try "netscape '" "'&") - (try "netscape '" "'")))) + (try "netscape '" "'"))) ;;; "rationalize" adjunct procedures. ;;(define (find-ratio x e) @@ -365,8 +524,13 @@ ;;; CHAR-CODE-LIMIT is one greater than the largest integer which can ;;; be returned by CHAR->INTEGER. ;; In Guile-1.8.0: (string>? (string #\000) (string #\200)) ==> #t -(if (string=? (version) "1.8.0") - (define char-code-limit 128)) +(define char-code-limit + (if (string=? (version) "1.8.0") + 128 + char-code-limit)) +(if (string>=? (scheme-implementation-version) "1.8") + (module-replace! (current-module) '(char-code-limit))) + ;;; MOST-POSITIVE-FIXNUM is used in modular.scm ;;(define most-positive-fixnum #x0FFFFFFF) @@ -383,49 +547,54 @@ ;;; return if exiting not supported. (define slib:exit quit) -(cond ((string>=? (scheme-implementation-version) "1.8") - (define (slib:load-helper loader) - (lambda (name) - (save-module-excursion - (lambda () - (set-current-module slib-module) - (let ((errinfo (catch 'system-error - (lambda () (loader name) #f) - (lambda args args)))) - (if (and errinfo - (catch 'system-error - (lambda () (loader (string-append name ".scm")) #f) - (lambda args args))) - (apply throw errinfo))))))) - (define slib:load (slib:load-helper load)) - (define slib:load-from-path (slib:load-helper load-from-path)) - ) - (else - ;;Here for backward compatability - (define scheme-file-suffix - (let ((suffix (case (software-type) - ((nosve) "_scm") - (else ".scm")))) - (lambda () suffix))) - - (define (guile:wrap-case-insensitive proc) - (lambda args - (save-module-excursion - (lambda () - (set-current-module slib-module) - (let ((old (read-options))) - (dynamic-wind - (lambda () (read-enable 'case-insensitive)) - (lambda () (apply proc args)) - (lambda () (read-options old)))))))) - - (define read (guile:wrap-case-insensitive read)) - - (define slib:load - (let ((load-file (guile:wrap-case-insensitive load))) +;; for (string>=? (scheme-implementation-version) "1.8") +(define (slib:load-helper loader) + (lambda (name) + (save-module-excursion + (lambda () + (set-current-module slib-module) + (let ((errinfo (catch 'system-error + (lambda () (loader name) #f) + (lambda args args)))) + (if (and errinfo + (catch 'system-error + (lambda () (loader (string-append name ".scm")) #f) + (lambda args args))) + (apply throw errinfo))))))) + +;; for (string<? (scheme-implementation-version) "1.8") +(define (guile:wrap-case-insensitive proc) + (lambda args + (save-module-excursion + (lambda () + (set-current-module slib-module) + (let ((old (read-options))) + (dynamic-wind + (lambda () (read-enable 'case-insensitive)) + (lambda () (apply proc args)) + (lambda () (read-options old)))))))) +;;Here for backward compatability +(define scheme-file-suffix + (if (string>=? (scheme-implementation-version) "1.8") + scheme-file-suffix + (let ((suffix (case (software-type) + ((nosve) "_scm") + (else ".scm")))) + (lambda () suffix)))) +(define read + (if (string>=? (scheme-implementation-version) "1.8") + read + (guile:wrap-case-insensitive read))) +(if (string>=? (scheme-implementation-version) "1.8") + (module-replace! (current-module) '(scheme-file-suffix read))) + +(define slib:load + (if (string>=? (scheme-implementation-version) "1.8") + (slib:load-helper load) + (let ((load-file (guile:wrap-case-insensitive load))) (lambda (<pathname>) - (load-file (string-append <pathname> (scheme-file-suffix)))))) - )) + (load-file (string-append <pathname> (scheme-file-suffix))))))) +;;(define slib:load-from-path (slib:load-helper load-from-path)) ;;;(SLIB:LOAD-SOURCE "foo") should load "foo.scm" or with whatever ;;;suffix all the module files in SLIB have. See feature 'SOURCE. @@ -557,6 +726,58 @@ (if (string>=? (scheme-implementation-version) "1.8") (module-replace! (current-module) '(make-array))) +(define (list->array rank proto lst) + (define dimensions + (do ((shp '() (cons (length row) shp)) + (row lst (car lst)) + (rnk (+ -1 rank) (+ -1 rnk))) + ((negative? rnk) (reverse shp)))) + (let ((nra (apply make-array proto dimensions))) + (define (l2ra dims idxs row) + (cond ((null? dims) + (apply array-set! nra row (reverse idxs))) + ((if (not (eqv? (car dims) (length row))) + (slib:error 'list->array + 'non-rectangular 'array dims dimensions)) + (do ((idx 0 (+ 1 idx)) + (row row (cdr row))) + ((>= idx (car dims))) + (l2ra (cdr dims) (cons idx idxs) (car row)))))) + (l2ra dimensions '() lst) + nra)) +(if (string>=? (scheme-implementation-version) "1.8") + (module-replace! (current-module) '(list->array))) + +(define (vector->array vect prototype . dimensions) + (define vdx (vector-length vect)) + (if (not (eqv? vdx (apply * dimensions))) + (slib:error 'vector->array vdx '<> (cons '* dimensions))) + (let ((ra (apply make-array prototype dimensions))) + (define (v2ra dims idxs) + (cond ((null? dims) + (set! vdx (+ -1 vdx)) + (apply array-set! ra (vector-ref vect vdx) (reverse idxs))) + (else + (do ((idx (+ -1 (car dims)) (+ -1 idx))) + ((negative? idx) vect) + (v2ra (cdr dims) (cons idx idxs)))))) + (v2ra dimensions '()) + ra)) +(define (array->vector ra) + (define dims (array-dimensions ra)) + (let* ((vdx (apply * dims)) + (vect (make-vector vdx))) + (define (ra2v dims idxs) + (if (null? dims) + (let ((val (apply array-ref ra (reverse idxs)))) + (set! vdx (+ -1 vdx)) + (vector-set! vect vdx val)) + (do ((idx (+ -1 (car dims)) (+ -1 idx))) + ((negative? idx) vect) + (ra2v (cdr dims) (cons idx idxs))))) + (ra2v dims '()) + vect)) + (define create-array make-array) (define (make-uniform-wrapper prot) (if (string? prot) (set! prot (string->number prot))) @@ -642,20 +863,21 @@ (require 'object->string) (set! seed (object->limited-string seed 50))))) (seed->random-state seed))) -(if (not (defined? 'random:chunk)) - (define (random:chunk sta) (random 256 sta))) +(define (random:chunk sta) (random 256 sta)) ;;; workaround for Guile 1.6.7 bug -(cond ((or (array? 'guile) (array? '(1 6 7))) - (define array? - (let ((old-array? array?)) - (lambda (obj) - (and (old-array? obj) - (not (or (list? obj) - (symbol? obj) - (record? obj))))))) - (if (string>=? (scheme-implementation-version) "1.8") - (module-replace! (current-module) '(array?))))) +(define array? + (if (or (array? 'guile) (array? '(1 6 7))) + (let ((old-array? array?)) + (lambda (obj) + (and (old-array? obj) + (not (or (list? obj) + (symbol? obj) + (record? obj)))))) + array?)) +(if (string>=? (scheme-implementation-version) "1.8") + (module-replace! (current-module) '(array?))) + ;;; Support for older versions of Scheme. Not enough code for its own file. ;;(define (last-pair l) (if (pair? (cdr l)) (last-pair (cdr l)) l)) @@ -670,7 +892,9 @@ (define >? >) (define >=? >=) +(slib:load (in-vicinity (library-vicinity) "require")) + (if (string>=? (scheme-implementation-version) "1.8") (module-replace! (current-module) '(provide provided?))) -(slib:load (in-vicinity (library-vicinity) "require")) +)) ;; end of cond-expand clause for Guile < 2.0 diff --git a/guile.use b/guile.use new file mode 100755 index 0000000..d788ed1 --- /dev/null +++ b/guile.use @@ -0,0 +1,2 @@ +;"guile.use" Configuration file for SLIB for GUILE -*-scheme-*- +(use-modules (ice-9 slib)) diff --git a/hashtab.scm b/hashtab.scm index a42e473..a42e473 100644..100755 --- a/hashtab.scm +++ b/hashtab.scm diff --git a/hashtab.txi b/hashtab.txi index 572b452..572b452 100644..100755 --- a/hashtab.txi +++ b/hashtab.txi diff --git a/html4each.scm b/html4each.scm index f115616..bfb1972 100644..100755 --- a/html4each.scm +++ b/html4each.scm @@ -201,15 +201,17 @@ ;;@body ;;@1 is a hypertext markup string. ;; -;;If @1 is a (hypertext) comment, then @0 returns #f. -;;Otherwise @0 returns the hypertext element symbol (created by -;;@code{string-ci->symbol}) consed onto an association list of the -;;attribute name-symbols and values. Each value is a number or -;;string; or #t if the name had no value assigned within the markup. +;;If @1 is a (hypertext) comment or DTD, then @0 returns #f. +;;Otherwise @0 returns the hypertext element string consed onto an +;;association list of the attribute name-symbols and values. If the +;;tag ends with "/>", then "/" is appended to the hypertext element +;;string. The name-symbols are created by @code{string-ci->symbol}. +;;Each value is a string; or #t if the name had no value +;;assigned within the markup. (define (htm-fields htm) (require 'string-case) (and - (not (and (> (string-length htm) 4) (equal? "<!--" (substring htm 0 4)))) + (not (and (> (string-length htm) 3) (equal? "<!" (substring htm 0 2)))) (call-with-input-string htm (lambda (port) (define element #f) @@ -221,11 +223,24 @@ (define junk #f) (define value #t) (cond - ((eof-object? chr) (slib:warn 'htm-fields 'missing '> htm) - (reverse fields)) + ((eof-object? chr) + (cond ((and element + (eqv? (string-ref element + (+ -1 (string-length element))) + #\>)) + (cons (substring element 0 (+ -1 (string-length element))) + fields)) + (else + (slib:warn 'htm-fields 'missing '> htm) + (if element + (cons element (reverse fields)) + (reverse fields))))) ((eqv? #\> chr) (cons element (reverse fields))) + ((eqv? #\/ chr) + (set! element (string-append element (string (read-char port)))) + (loop (peek-char port))) ((char-whitespace? chr) (read-char port) (loop (peek-char port))) - ((case (fscanf port "%[a-zA-Z0-9]%[=]%[-.a-zA-Z0-9]" + ((case (fscanf port "%[-a-zA-Z0-9:] %[=] %[-.a-zA-Z0-9]" name junk value) ((3 1) #t) ((2) @@ -242,11 +257,8 @@ (else #f))) (else #f))) (else #f)) - (set! fields (cons (cons (string-ci->symbol name) - (if (string? value) - (or (string->number value) value) - value)) - fields)) + (set! fields (cons (cons (string-ci->symbol name) value) + fields)) (loop (peek-char port))) (else (slib:warn 'htm-fields 'bad 'field htm) (reverse fields)))))))) diff --git a/html4each.txi b/html4each.txi index 0c47227..6dbdb6a 100644..100755 --- a/html4each.txi +++ b/html4each.txi @@ -64,10 +64,12 @@ not found within the first (approximately) @var{limit} words. @var{htm} is a hypertext markup string. -If @var{htm} is a (hypertext) comment, then @code{htm-fields} returns #f. -Otherwise @code{htm-fields} returns the hypertext element symbol (created by -@code{string-ci->symbol}) consed onto an association list of the -attribute name-symbols and values. Each value is a number or -string; or #t if the name had no value assigned within the markup. +If @var{htm} is a (hypertext) comment or DTD, then @code{htm-fields} returns #f. +Otherwise @code{htm-fields} returns the hypertext element string consed onto an +association list of the attribute name-symbols and values. If the +tag ends with "/>", then "/" is appended to the hypertext element +string. The name-symbols are created by @code{string-ci->symbol}. +Each value is a string; or #t if the name had no value +assigned within the markup. @end defun diff --git a/htmlform.scm b/htmlform.scm index 143eccc..90d45cf 100644..100755 --- a/htmlform.scm +++ b/htmlform.scm @@ -23,6 +23,7 @@ (require 'object->string) (require 'string-search) (require 'databases) +(require 'multiarg-apply) (require 'common-list-functions) ;;;;@code{(require 'html-form)} @@ -102,7 +103,7 @@ (sprintf #f "<HTML>\\n") (sprintf #f "%s" (html:comment "HTML by SLIB" - "http://swiss.csail.mit.edu/~jaffer/SLIB")) + "http://people.csail.mit.edu/jaffer/SLIB")) (sprintf #f " <HEAD>\\n <TITLE>%s</TITLE>\\n %s\\n </HEAD>\\n" (html:plain title) (apply string-append args)) (if (and backlink (substring-ci? "<H1>" backlink)) diff --git a/htmlform.txi b/htmlform.txi index 77704ff..77704ff 100644..100755 --- a/htmlform.txi +++ b/htmlform.txi diff --git a/http-cgi.scm b/http-cgi.scm index bc328cf..a6fd493 100644..100755 --- a/http-cgi.scm +++ b/http-cgi.scm @@ -125,7 +125,7 @@ *http:byline* (sprintf #f - "<A HREF=http://swiss.csail.mit.edu/~jaffer/SLIB.html>SLIB</A> %s server" + "<A HREF=http://people.csail.mit.edu/jaffer/SLIB.html>SLIB</A> %s server" (if (getenv "SERVER_PROTOCOL") "CGI/1.0" "HTTP/1.0")))) (string-append (http:status-line status-code reason-phrase) (http:content @@ -157,9 +157,13 @@ ;;and @var{header-alist}. Otherwise, @0 calls @1 with the ;;@var{request-line}, #f, and @var{header-alist}. ;; -;;If @1 returns a string, it is sent to @3. If @1 returns a list, -;;then an error page with number 525 and strings from the list. If @1 -;;returns #f, then a @samp{Bad Request} (400) page is sent to @3. +;;If @1 returns a string, it is sent to @3. If @1 returns a list +;;whose first element is an integer, then an error page with the +;;status integer which is the first element of the list and strings +;;from the list. If @1 returns a list whose first element isn't an +;;number, then an error page with the status code 500 and strings from +;;the list. If @1 returns #f, then a @samp{Bad Request} (400) page is +;;sent to @3. ;; ;;Otherwise, @0 replies (to @3) with appropriate HTML describing the ;;problem. @@ -185,7 +189,7 @@ ((and (pair? reply) (list? reply)) (if (number? (car reply)) (apply http:error-page reply) - (apply http:error-page 525 reply))) + (apply http:error-page (cons 500 reply)))) (else (http:error-page 500 "Internal Server Error"))))) ((not query-string) (http:error-page 400 "Bad Request" (html:plain request-line))) @@ -325,12 +329,15 @@ ;;Otherwise, @0 calls @1 with the @var{request-line}, #f, and ;;@var{header-alist}. ;; -;;If @1 returns a string, it is sent to @code{(current-input-port)}. -;;If @1 returns a list, then an error page with number 525 and strings -;;from the list. If @1 returns #f, then a @samp{Bad Request} (400) -;;page is sent to @code{(current-input-port)}. +;;If @1 returns a string, it is sent to @code{(current-ouput-port)}. +;;If @1 returns a list whose first element is an integer, then an +;;error page with the status integer which is the first element of the +;;list and strings from the list. If @1 returns a list whose first +;;element isn't an number, then an error page with the status code 500 +;;and strings from the list. If @1 returns #f, then a @samp{Bad +;;Request} (400) page is sent to @code{(current-ouput-port)}. ;; -;;Otherwise, @0 replies (to @code{(current-input-port)}) with +;;Otherwise, @0 replies (to @code{(current-output-port)}) with ;;appropriate HTML describing the problem. (define (cgi:serve-query serve-proc) (let* ((script-name (getenv "SCRIPT_NAME")) diff --git a/http-cgi.txi b/http-cgi.txi index 0e57933..2d6b38f 100644..100755 --- a/http-cgi.txi +++ b/http-cgi.txi @@ -48,9 +48,13 @@ query is a valid @samp{"POST"} or @samp{"GET"} query, then @code{http:serve-quer and @var{header-alist}. Otherwise, @code{http:serve-query} calls @var{serve-proc} with the @var{request-line}, #f, and @var{header-alist}. -If @var{serve-proc} returns a string, it is sent to @var{output-port}. If @var{serve-proc} returns a list, -then an error page with number 525 and strings from the list. If @var{serve-proc} -returns #f, then a @samp{Bad Request} (400) page is sent to @var{output-port}. +If @var{serve-proc} returns a string, it is sent to @var{output-port}. If @var{serve-proc} returns a list +whose first element is an integer, then an error page with the +status integer which is the first element of the list and strings +from the list. If @var{serve-proc} returns a list whose first element isn't an +number, then an error page with the status code 500 and strings from +the list. If @var{serve-proc} returns #f, then a @samp{Bad Request} (400) page is +sent to @var{output-port}. Otherwise, @code{http:serve-query} replies (to @var{output-port}) with appropriate HTML describing the problem. @@ -89,12 +93,15 @@ or @samp{"GET"} query, then @code{cgi:serve-query} calls @var{serve-proc} with t Otherwise, @code{cgi:serve-query} calls @var{serve-proc} with the @var{request-line}, #f, and @var{header-alist}. -If @var{serve-proc} returns a string, it is sent to @code{(current-input-port)}. -If @var{serve-proc} returns a list, then an error page with number 525 and strings -from the list. If @var{serve-proc} returns #f, then a @samp{Bad Request} (400) -page is sent to @code{(current-input-port)}. +If @var{serve-proc} returns a string, it is sent to @code{(current-ouput-port)}. +If @var{serve-proc} returns a list whose first element is an integer, then an +error page with the status integer which is the first element of the +list and strings from the list. If @var{serve-proc} returns a list whose first +element isn't an number, then an error page with the status code 500 +and strings from the list. If @var{serve-proc} returns #f, then a @samp{Bad +Request} (400) page is sent to @code{(current-ouput-port)}. -Otherwise, @code{cgi:serve-query} replies (to @code{(current-input-port)}) with +Otherwise, @code{cgi:serve-query} replies (to @code{(current-output-port)}) with appropriate HTML describing the problem. @end defun diff --git a/indexes.texi b/indexes.texi index f6d6992..f6d6992 100644..100755 --- a/indexes.texi +++ b/indexes.texi diff --git a/jscheme.init b/jscheme.init index 9a0f0e6..9a0f0e6 100644..100755 --- a/jscheme.init +++ b/jscheme.init diff --git a/kawa.init b/kawa.init index 373a17b..dde1051 100644..100755 --- a/kawa.init +++ b/kawa.init @@ -19,7 +19,7 @@ ;;@ (scheme-implementation-version) should return a string describing ;;; the version the scheme implementation loading this file. -(define scheme-implementation-version scheme-implementation-version) +(define scheme-implementation-version kawa.Version:getVersion) ;;@ (implementation-vicinity) should be defined to be the pathname of ;;; the directory where any auxillary files to your Scheme diff --git a/limit.scm b/limit.scm index 8c67e8f..2b29ddf 100644..100755 --- a/limit.scm +++ b/limit.scm @@ -19,6 +19,12 @@ ;;@code{(require 'limit)} +(require-if 'compiling 'root) + +(define (finite? val) + (and (not (= val (+ 1 val val))) + (= val val))) + (define (inv-root f1 f2 f3 prec) (define f1^2 (* f1 f1)) (define f2^2 (* f2 f2)) diff --git a/limit.texi b/limit.texi index ee1f416..ee1f416 100644..100755 --- a/limit.texi +++ b/limit.texi diff --git a/lineio.scm b/lineio.scm index 2b18cf2..c70ff6e 100644..100755 --- a/lineio.scm +++ b/lineio.scm @@ -66,7 +66,7 @@ ;;which case it defaults to the value returned by ;;@code{current-input-port}. (define (write-line str . port) - (apply display str port) + (apply display (cons str port)) (apply newline port)) ;;@args command tmp diff --git a/lineio.txi b/lineio.txi index 9fbe92f..9fbe92f 100644..100755 --- a/lineio.txi +++ b/lineio.txi diff --git a/linterp.scm b/linterp.scm index 5be2b36..8b5df7a 100644..100755 --- a/linterp.scm +++ b/linterp.scm @@ -22,6 +22,7 @@ (require 'array) (require 'subarray) (require 'array-for-each) +(require 'multiarg-apply) ;;@args ra x1 ... xj ;; @@ -86,5 +87,6 @@ (array-dimensions ra2))) (array-index-map! ra1 (lambda idxs - (apply interpolate-array-ref ra2 + (apply interpolate-array-ref + ra2 (map * scales idxs))))) diff --git a/linterp.txi b/linterp.txi index 14861f6..14861f6 100644..100755 --- a/linterp.txi +++ b/linterp.txi diff --git a/logical.scm b/logical.scm index 71e73b9..ce7b459 100644..100755 --- a/logical.scm +++ b/logical.scm @@ -207,6 +207,7 @@ (logand (lognot (ash mask start)) n)))) ;@ (define (integer->list k . len) + (if (negative? k) (slib:error 'integer->list 'negative? k)) (if (null? len) (do ((k k (arithmetic-shift k -1)) (lst '() (cons (odd? k) lst))) diff --git a/macrotst.scm b/macrotst.scm index b5b5046..b5b5046 100644..100755 --- a/macrotst.scm +++ b/macrotst.scm diff --git a/macscheme.init b/macscheme.init index 7846135..7846135 100644..100755 --- a/macscheme.init +++ b/macscheme.init diff --git a/macwork.scm b/macwork.scm index 2a6a93d..2a6a93d 100644..100755 --- a/macwork.scm +++ b/macwork.scm diff --git a/manifest.scm b/manifest.scm index aa15e6e..aa15e6e 100644..100755 --- a/manifest.scm +++ b/manifest.scm diff --git a/manifest.txi b/manifest.txi index daa776d..daa776d 100644..100755 --- a/manifest.txi +++ b/manifest.txi diff --git a/matfile.scm b/matfile.scm index 49c603b..49c603b 100644..100755 --- a/matfile.scm +++ b/matfile.scm diff --git a/matfile.txi b/matfile.txi index a4f2e53..a4f2e53 100644..100755 --- a/matfile.txi +++ b/matfile.txi diff --git a/math-integer.scm b/math-integer.scm index 1ce70f8..2a1572a 100644..100755 --- a/math-integer.scm +++ b/math-integer.scm @@ -1,5 +1,5 @@ ; "math-integer.scm": mathematical functions restricted to exact integers -; Copyright (C) 2006 Aubrey Jaffer +; Copyright (C) 2006, 2013 Aubrey Jaffer ; ;Permission to copy this software, to modify it, to redistribute it, ;to distribute modified versions, and to use it for any purpose is @@ -95,8 +95,24 @@ (not (zero? n2))) (proc n1 n2) (slib:error name n1 n2)))) -;;@body +;;@args n1 n2 +;;@defunx remainder n1 n2 +;;@defunx modulo n1 n2 ;;are redefined so that they accept only exact-integer arguments. (define quotient (must-be-exact-integer2 'quotient quotient)) (define remainder (must-be-exact-integer2 'remainder remainder)) (define modulo (must-be-exact-integer2 'modulo modulo)) + +;;@args n1 n2 +;;Returns the quotient of @1 and @2 rounded toward even. +;; +;;@example +;;(quotient 3 2) @result{} 1 +;;(round-quotient 3 2) @result{} 2 +;;@end example +(define (round-quotient num den) + (define quo (quotient num den)) + (define rem (remainder num den)) + (if ((if (even? quo) > >=) (abs (* 2 rem)) (abs den)) + (+ quo (if (eq? (negative? num) (negative? den)) 1 -1)) + quo)) diff --git a/math-integer.txi b/math-integer.txi index b626a33..9999fb3 100644..100755 --- a/math-integer.txi +++ b/math-integer.txi @@ -30,9 +30,21 @@ is less than or equal to @var{k}; otherwise signals an error. @end defun -@defvar quotient -@defvarx remainder -@defvarx modulo +@defun quotient n1 n2 +@defunx remainder n1 n2 +@defunx modulo n1 n2 are redefined so that they accept only exact-integer arguments. -@end defvar +@end defun + + +@defun round-quotient n1 n2 + +Returns the quotient of @var{n1} and @var{n2} rounded toward even. + +@example +(quotient 3 2) @result{} 1 +(round-quotient 3 2) @result{} 2 +@end example +@end defun + diff --git a/math-real.scm b/math-real.scm index 06971d2..d0b6e76 100644..100755 --- a/math-real.scm +++ b/math-real.scm @@ -17,6 +17,8 @@ ;promotional, or sales literature without prior written consent in ;each case. +(require 'multiarg-apply) ; used in REAL-TAN + ;@ (define (quo x1 x2) (truncate (/ x1 x2))) (define (rem x1 x2) (- x1 (* x2 (quo x1 x2)))) diff --git a/minimize.scm b/minimize.scm index e28568a..e28568a 100644..100755 --- a/minimize.scm +++ b/minimize.scm diff --git a/minimize.txi b/minimize.txi index 3e1a8a6..3e1a8a6 100644..100755 --- a/minimize.txi +++ b/minimize.txi diff --git a/mitscheme.init b/mitscheme.init index fdf1c95..8e07241 100644..100755 --- a/mitscheme.init +++ b/mitscheme.init @@ -198,7 +198,7 @@ ;;; sicp ;runs code from Structure and ;Interpretation of Computer ;Programs by Abelson and Sussman. - defmacro ;has Common Lisp DEFMACRO +;;; defmacro ;has Common Lisp DEFMACRO record ;has user defined data structures string-port ;has CALL-WITH-INPUT-STRING and ;CALL-WITH-OUTPUT-STRING @@ -222,13 +222,21 @@ Xwindows )) +(define system run-shell-command) +(define (print-call-stack port) #f) + ; **** MIT Scheme has SORT, but SORT! accepts only vectors. (define sort! sort) (define mit-scheme-has-r4rs-macros? (mit-scheme-release>= 7 7)) +(define mit-scheme-supports-defmacro? + (and mit-scheme-has-r4rs-macros? + (not (mit-scheme-release>= 9 0)))) (if mit-scheme-has-r4rs-macros? (set! slib:features (cons 'macro slib:features))) +(if mit-scheme-supports-defmacro? + (set! slib:features (cons 'defmacro slib:features))) (if (get-subsystem-version-string "6.001") ;; Runs code from "Structure and Interpretation of Computer @@ -336,78 +344,81 @@ (define *macros* '(defmacro)) (define (defmacro? m) (and (memq m *macros*) #t)) -(if mit-scheme-has-r4rs-macros? - (environment-define-macro user-initial-environment 'defmacro - (non-hygienic-macro-transformer->expander - (lambda arguments - (let ((name (car arguments))) - `(begin - (set! *macros* (cons ',name *macros*)) - (environment-define-macro user-initial-environment ',name - (non-hygienic-macro-transformer->expander - (lambda ,@(cdr arguments)) - user-initial-environment))))) - user-initial-environment)) - (syntax-table-define system-global-syntax-table 'defmacro - (macro defmacargs - (let ((macname (car defmacargs)) (macargs (cadr defmacargs)) - (macbdy (cddr defmacargs))) - `(begin - (set! *macros* (cons ',macname *macros*)) - (syntax-table-define system-global-syntax-table ',macname - (macro ,macargs ,@macbdy))))))) +(if mit-scheme-supports-defmacro? + (if mit-scheme-has-r4rs-macros? + (environment-define-macro + user-initial-environment 'defmacro + (non-hygienic-macro-transformer->expander + (lambda arguments + (let ((name (car arguments))) + `(begin + (set! *macros* (cons ',name *macros*)) + (environment-define-macro user-initial-environment ',name + (non-hygienic-macro-transformer->expander + (lambda ,@(cdr arguments)) + user-initial-environment))))) + user-initial-environment)) + (syntax-table-define system-global-syntax-table 'defmacro + (macro defmacargs + (let ((macname (car defmacargs)) (macargs (cadr defmacargs)) + (macbdy (cddr defmacargs))) + `(begin + (set! *macros* (cons ',macname *macros*)) + (syntax-table-define system-global-syntax-table ',macname + (macro ,macargs ,@macbdy)))))))) (define macroexpand-1) (define macroexpand) -(let ((finish - (lambda (get-transformer apply-transformer) - (set! macroexpand-1 +(if mit-scheme-supports-defmacro? + (let ((finish + (lambda (get-transformer apply-transformer) + (set! macroexpand-1 + (lambda (form) + (let ((transformer (get-transformer form))) + (if transformer + (apply-transformer transformer form) + form)))) + (set! macroexpand + (lambda (form) + (let ((transformer (get-transformer form))) + (if transformer + (macroexpand (apply-transformer transformer form)) + form))))))) + (if mit-scheme-has-r4rs-macros? + (let ((e (->environment '(runtime syntactic-closures)))) + (let ((strip-keyword-value-item (access strip-keyword-value-item e)) + (expander-item/expander (access expander-item/expander e)) + (expander-item/environment (access expander-item/environment e))) + (finish (lambda (form) - (let ((transformer (get-transformer form))) - (if transformer - (apply-transformer transformer form) - form)))) - (set! macroexpand - (lambda (form) - (let ((transformer (get-transformer form))) - (if transformer - (macroexpand (apply-transformer transformer form)) - form))))))) - (if mit-scheme-has-r4rs-macros? - (let ((e (->environment '(runtime syntactic-closures)))) - (let ((strip-keyword-value-item (access strip-keyword-value-item e)) - (expander-item/expander (access expander-item/expander e)) - (expander-item/environment (access expander-item/environment e))) + (and (pair? form) + (let ((a (car form))) + (and (symbol? a) + (defmacro? a) + (environment-lookup-macro user-initial-environment + a))))) + (lambda (item form) + (let ((item (strip-keyword-value-item item))) + ((expander-item/expander item) + form + user-initial-environment + (expander-item/environment item))))))) (finish (lambda (form) (and (pair? form) (let ((a (car form))) (and (symbol? a) (defmacro? a) - (environment-lookup-macro user-initial-environment - a))))) - (lambda (item form) - (let ((item (strip-keyword-value-item item))) - ((expander-item/expander item) - form - user-initial-environment - (expander-item/environment item))))))) - (finish - (lambda (form) - (and (pair? form) - (let ((a (car form))) - (and (symbol? a) - (defmacro? a) - (syntax-table-ref system-global-syntax-table a))))) - (apply-transformer - (lambda (transformer form) - (apply transformer (cdr form))))))) + (syntax-table-ref system-global-syntax-table a))))) + (apply-transformer + (lambda (transformer form) + (apply transformer (cdr form)))))))) (define gentemp generate-uninterned-symbol) (define defmacro:eval slib:eval) (define defmacro:load load) -(if mit-scheme-has-r4rs-macros? +(if mit-scheme-supports-defmacro? (begin (environment-define (the-environment) 'macro:eval slib:eval) (environment-define (the-environment) 'macro:load load))) diff --git a/mkclrnam.scm b/mkclrnam.scm index 341f6eb..14b49ae 100644..100755 --- a/mkclrnam.scm +++ b/mkclrnam.scm @@ -1,5 +1,5 @@ ;;; "mkclrnam.scm" create color name databases -;Copyright 2001, 2002, 2003, 2007 Aubrey Jaffer +;Copyright 2001, 2002, 2003, 2007, 2008 Aubrey Jaffer ; ;Permission to copy this software, to modify it, to redistribute it, ;to distribute modified versions, and to use it for any purpose is @@ -17,6 +17,7 @@ ;promotional, or sales literature without prior written consent in ;each case. +(require 'multiarg-apply) (require 'string-search) (require 'line-i/o) (require 'scanf) @@ -153,6 +154,13 @@ (color-name:canonicalize name))) (else #f))) (lambda (line) + (case (sscanf line "bang %d %d %d %d %[a-zA-Z0-9, ]%s" + r g b ri name junk) + ((5) (set! method-id 'm5b) + (list (check-match line (color:sRGB r g b)) + (color-name:canonicalize name))) + (else #f))) + (lambda (line) (case (sscanf line " %[- a-zA-Z.] %d %d %d %s" name r g b junk) ((4) (set! method-id 'm4b) @@ -174,12 +182,26 @@ (color-name:canonicalize name))) (else #f))) (lambda (line) - (case (sscanf line " %[a-zA-Z0-9_] #%x%6x%s" name rgbx junk) + (case (sscanf line " %[a-zA-Z()] %e %e %e %s" + name ri gi bi junk) + ((4) (set! method-id 'm4e) + (list (check-match line (color:L*a*b* ri gi bi)) + (color-name:canonicalize + (string-downcase! (StudlyCapsExpand name " "))))) + (else #f))) + (lambda (line) + (case (sscanf line " %[a-zA-Z0-9_] #%6x%s" name rgbx junk) ((2) (set! method-id 'm2a) (list (check-match line (xrgb->color rgbx)) (color-name:canonicalize name))) (else #f))) (lambda (line) + (case (sscanf line "[\"%6x\", \"%[^\"]\"], %s" rgbx name junk) + ((2) (set! method-id 'js) + (list (check-match line (xrgb->color rgbx)) + (color-name:canonicalize name))) + (else #f))) + (lambda (line) (case (sscanf line "%[- a-zA-Z']=#%6x<br>" name rgbx) ((2) (set! method-id 'm2b) (let ((idx (substring? "rgb" name))) @@ -188,12 +210,42 @@ (color-name:canonicalize (substring name 0 idx)))))) (else #f))) (lambda (line) + (case (sscanf line "%[ a-zA-Z/'] #%6x" name rgbx) + ((2) (set! method-id 'm2d) + (list (check-match line (xrgb->color rgbx)) + (color-name:canonicalize name))) + (else #f))) + (lambda (line) (case (sscanf line "\" %[^\"]\" %s" name junk) ((2) (set! method-id 'm2c) (let ((clr (string->color junk))) (and clr (list (check-match line clr) (color-name:canonicalize name))))) - (else #f))))) + (else #f))) + (lambda (line) + (case (sscanf line "%[a-z0-9 ]\t%[A-Z]:%[./0-9] %s" + name r rgbx junk) + ((3) (set! method-id 'm3x) + (list (check-match line (string->color + (string-append r ":" rgbx))) + (color-name:canonicalize name))) + (else #f))) + (lambda (line) + ;; FED-STD-595C - read only the first + (case (sscanf line "%5[0-9] %[A-Z]:%f/%f/%f" + name ri r g b) + ((5) (set! method-id 'm5x) + (cond ((string-ci=? "CIEXYZ" ri) + (list (check-match line (color:CIEXYZ (/ r 100) + (/ g 100) + (/ b 100))) + (color-name:canonicalize name))) + ((string-ci=? "CIELAB" ri) + (list (check-match line (color:L*A*B* r g b)) + (color-name:canonicalize name))) + (else #f))) + (else #f))) + )) ans)) (define (numbered-gray? str) (define idx #f) @@ -231,7 +283,7 @@ ;;This section has detailed the procedures for creating and loading ;;color dictionaries. So where are the dictionaries to load? ;; -;;@uref{http://swiss.csail.mit.edu/~jaffer/Color/Dictionaries.html} +;;@uref{http://people.csail.mit.edu/jaffer/Color/Dictionaries.html} ;; ;;@noindent ;;Describes and evaluates several color-name dictionaries on the web. @@ -260,13 +312,13 @@ (file->color-dictionary filename name cndb) (url->color-dictionary url name cndb))) lst)) - '(("http://swiss.csail.mit.edu/~jaffer/Color/saturate.txt" + '(("http://people.csail.mit.edu/jaffer/Color/saturate.txt" "saturate.txt" saturate) - ("http://swiss.csail.mit.edu/~jaffer/Color/resenecolours.txt" + ("http://people.csail.mit.edu/jaffer/Color/resenecolours.txt" "resenecolours.txt" resene) - ("http://swiss.csail.mit.edu/~jaffer/Color/nbs-iscc.txt" + ("http://people.csail.mit.edu/jaffer/Color/nbs-iscc.txt" "nbs-iscc.txt" nbs-iscc))) (close-database cndb)) diff --git a/mkclrnam.txi b/mkclrnam.txi index f2a0c14..9427ea4 100644..100755 --- a/mkclrnam.txi +++ b/mkclrnam.txi @@ -33,7 +33,7 @@ string @var{url} using the @dfn{wget} program; then calls This section has detailed the procedures for creating and loading color dictionaries. So where are the dictionaries to load? -@uref{http://swiss.csail.mit.edu/~jaffer/Color/Dictionaries.html} +@uref{http://people.csail.mit.edu/jaffer/Color/Dictionaries.html} @noindent Describes and evaluates several color-name dictionaries on the web. diff --git a/mklibcat.scm b/mklibcat.scm index ae7e98e..ab711d2 100644..100755 --- a/mklibcat.scm +++ b/mklibcat.scm @@ -48,193 +48,198 @@ "jfilter"))) (catalog:resolve (library-vicinity) - '( - ;; null is the start of SLIB associations. - (null source "null") - (aggregate source "null") - (r2rs aggregate rev3-procedures rev2-procedures) - (r3rs aggregate rev3-procedures) - (r4rs aggregate rev4-optional-procedures) - (r5rs aggregate values macro eval) - (rev4-optional-procedures source "sc4opt") - (rev3-procedures source "null") - (rev2-procedures source "sc2") - (multiarg/and- source "mularg") - (multiarg-apply source "mulapply") - (rationalize source "ratize") - (transcript source "trnscrpt") - (with-file source "withfile") - (dynamic-wind source "dynwind") - (dynamic source "dynamic") - (fluid-let defmacro "fluidlet") - (alist source "alist") - (hash source "hash") - (sierpinski source "sierpinski") - (hilbert-fill source "phil-spc") - (peano-fill source "peanosfc") - (soundex source "soundex") - (hash-table source "hashtab") - (logical source "logical") - (random source "random") - (random-inexact source "randinex") - (modular source "modular") - (factor source "factor") - (primes factor) - (limit source "limit") - (eps-graph source "grapheps") - (charplot source "charplot") - (sort source "sort") - (srfi-95 sort) - (tsort topological-sort) - (topological-sort source "tsort") - (common-list-functions source "comlist") - (tree source "tree") - (coerce source "coerce") - (format source "format") - (generic-write source "genwrite") - (pretty-print source "pp") - (pprint-file source "ppfile") - (object->string source "obj2str") - (string-case source "strcase") - (line-i/o source "lineio") - (string-port source "strport") - (getopt source "getopt") - (qp source "qp") - (eval source "eval") - (record source "record") - (synchk source "synchk") - (defmacroexpand source "defmacex") + (cons + (if (provided? 'defmacro) + '(fluid-let defmacro "fluidlet") + '(fluid-let macro "fluidlet")) + '( + ;; null is the start of SLIB associations. + (null source "null") + (aggregate source "null") + (r2rs aggregate rev3-procedures rev2-procedures) + (r3rs aggregate rev3-procedures) + (r4rs aggregate rev4-optional-procedures) + (r5rs aggregate values macro eval) + (rev4-optional-procedures source "sc4opt") + (rev3-procedures source "null") + (rev2-procedures source "sc2") + (multiarg/and- source "mularg") + (multiarg-apply source "mulapply") + (rationalize source "ratize") + (transcript source "trnscrpt") + (with-file source "withfile") + (dynamic-wind source "dynwind") + (dynamic source "dynamic") + (alist source "alist") + (hash source "hash") + (sierpinski source "sierpinski") + (hilbert-fill source "phil-spc") + (peano-fill source "peanosfc") + (space-filling source "rmdsff") + (soundex source "soundex") + (hash-table source "hashtab") + (logical source "logical") + (random source "random") + (random-inexact source "randinex") + (modular source "modular") + (factor source "factor") + (primes factor) + (limit source "limit") + (eps-graph source "grapheps") + (charplot source "charplot") + (sort source "sort") + (srfi-95 sort) + (tsort topological-sort) + (topological-sort source "tsort") + (common-list-functions source "comlist") + (tree source "tree") + (coerce source "coerce") + (format source "format") + (generic-write source "genwrite") + (pretty-print source "pp") + (pprint-file source "ppfile") + (object->string source "obj2str") + (string-case source "strcase") + (line-i/o source "lineio") + (string-port source "strport") + (getopt source "getopt") + (qp source "qp") + (eval source "eval") + (record source "record") + (synchk source "synchk") + (defmacroexpand source "defmacex") - (printf source "printf") - (scanf defmacro "scanf") - (stdio-ports source "stdio") - (stdio aggregate scanf printf stdio-ports) + (printf source "printf") + (scanf defmacro "scanf") + (stdio-ports source "stdio") + (stdio aggregate scanf printf stdio-ports) - (break defmacro "break") - (trace defmacro "trace") - (debugf source "debug") - (debug aggregate trace break debugf) + (break defmacro "break") + (trace defmacro "trace") + (debugf source "debug") + (debug aggregate trace break debugf) - (delay promise) - (promise macro "promise") + (delay promise) + (promise macro "promise") - (macro-by-example defmacro "mbe") + (macro-by-example defmacro "mbe") - (syntax-case source "scainit") - (syntactic-closures source "scmacro") - (macros-that-work source "macwork") - (macro macro-by-example) - (object source "object") - (yasos macro "yasyn") - (oop yasos) - (collect source "collectx") - (structure syntax-case "structure") - (values source "values") - (queue source "queue") - (priority-queue source "priorque") - (array source "array") - (subarray source "subarray") - (array-for-each source "arraymap") - (array-interpolate source "linterp") - (repl source "repl") - (process source "process") - (chapter-order source "chap") - (posix-time source "psxtime") - (common-lisp-time source "cltime") - (time-core source "timecore") - (time-zone defmacro "timezone") - (relational-database source "rdms") - (databases source "dbutil") - (database-utilities databases) - (database-commands source "dbcom") - (database-browse source "dbrowse") - (database-interpolate source "dbinterp") - (within-database macro "dbsyn") - (html-form source "htmlform") - (alist-table source "alistab") - (parameters source "paramlst") - (getopt-parameters source "getparam") - (read-command source "comparse") - (batch source "batch") - (glob source "glob") - (filename glob) - (crc source "crc") - (dft source "dft") - (fft dft) - (Fourier-transform dft) - (wt-tree source "wttree") - (string-search source "strsrch") - (root source "root") - (minimize source "minimize") - (precedence-parse defmacro "prec") - (parse precedence-parse) - (commutative-ring source "cring") - (self-set source "selfset") - (determinant source "determ") - (byte source "byte") - (byte-number source "bytenumb") - (tzfile source "tzfile") - (schmooz source "schmooz") - (transact defmacro "transact") - (net-clients transact) - (db->html source "db2html") - (http defmacro "http-cgi") - (cgi http) - (uri defmacro "uri") - (uniform-resource-identifier uri) - (pnm source "pnm") - (metric-units source "simetrix") - (diff source "differ") - (solid source "solid") - (vrml97 solid) - (vrml vrml97) - (color defmacro "color") - (color-space source "colorspc") - (cie color-space) - (color-names source "colornam") - (color-database defmacro "mkclrnam") - (resene color-names "clrnamdb.scm") - (saturate color-names "clrnamdb.scm") - (nbs-iscc color-names "clrnamdb.scm") - (daylight source "daylight") - (matfile source "matfile") - (mat-file matfile) - (spectral-tristimulus-values color-space) - (cie1964 spectral-tristimulus-values "cie1964.xyz") - (cie1931 spectral-tristimulus-values "cie1931.xyz") - (ciexyz cie1931) - (cvs defmacro "cvs") - (html-for-each defmacro "html4each") - (directory source "dirs") - (ncbi-dna defmacro "ncbi-dna") - (manifest source "manifest") - (top-refs source "top-refs") - (vet source "vet") - (srfi srfi-0) - (srfi-0 defmacro "srfi") - (srfi-1 source "srfi-1") - (and-let* srfi-2) - (srfi-2 defmacro "srfi-2") - (receive srfi-8) - (srfi-8 macro "srfi-8") - (define-record-type srfi-9) - (srfi-9 macro "srfi-9") - (let-values srfi-11) - (srfi-11 macro "srfi-11") - (srfi-28 format) - (srfi-47 array) - (srfi-63 array) - (srfi-60 logical) - (guarded-cond-clause srfi-61) - (srfi-61 macro "srfi-61") - (srfi-23 source "srfi-23") - (math-integer source "math-integer") - (math-real source "math-real") - (srfi-94 aggregate math-integer math-real) - (ssax xml-parse) - (xml-parse source "xml-parse") - (new-catalog source "mklibcat") - )))) + (syntax-case source "scainit") + (syntactic-closures source "scmacro") + (macros-that-work source "macwork") + (macro macro-by-example) + (object source "object") + (yasos macro "yasyn") + (oop yasos) + (collect macro "collectx") + (structure syntax-case "structure") + (values source "values") + (queue source "queue") + (priority-queue source "priorque") + (array source "array") + (subarray source "subarray") + (array-for-each source "arraymap") + (array-interpolate source "linterp") + (repl source "repl") + (process source "process") + (chapter-order source "chap") + (posix-time source "psxtime") + (common-lisp-time source "cltime") + (time-core source "timecore") + (time-zone defmacro "timezone") + (relational-database source "rdms") + (databases source "dbutil") + (database-utilities databases) + (database-commands source "dbcom") + (database-browse source "dbrowse") + (database-interpolate source "dbinterp") + (within-database macro "dbsyn") + (html-form source "htmlform") + (alist-table source "alistab") + (parameters source "paramlst") + (getopt-parameters source "getparam") + (read-command source "comparse") + (batch source "batch") + (glob source "glob") + (filename glob) + (crc source "crc") + (dft source "dft") + (fft dft) + (Fourier-transform dft) + (wt-tree source "wttree") + (string-search source "strsrch") + (root source "root") + (minimize source "minimize") + (precedence-parse source "prec") + (parse precedence-parse) + (commutative-ring source "cring") + (self-set source "selfset") + (determinant source "determ") + (byte source "byte") + (byte-number source "bytenumb") + (tzfile source "tzfile") + (schmooz source "schmooz") + (transact defmacro "transact") + (net-clients transact) + (db->html source "db2html") + (http defmacro "http-cgi") + (cgi http) + (uri defmacro "uri") + (uniform-resource-identifier uri) + (pnm source "pnm") + (metric-units source "simetrix") + (diff source "differ") + (solid source "solid") + (vrml97 solid) + (vrml vrml97) + (color defmacro "color") + (color-space source "colorspc") + (cie color-space) + (color-names source "colornam") + (color-database defmacro "mkclrnam") + (resene color-names "clrnamdb.scm") + (saturate color-names "clrnamdb.scm") + (nbs-iscc color-names "clrnamdb.scm") + (daylight source "daylight") + (matfile source "matfile") + (mat-file matfile) + (spectral-tristimulus-values color-space) + (cie1964 spectral-tristimulus-values "cie1964.xyz") + (cie1931 spectral-tristimulus-values "cie1931.xyz") + (ciexyz cie1931) + (cvs defmacro "cvs") + (html-for-each defmacro "html4each") + (directory source "dirs") + (ncbi-dna defmacro "ncbi-dna") + (manifest source "manifest") + (top-refs source "top-refs") + (vet source "vet") + (srfi srfi-0) + (srfi-0 defmacro "srfi") + (srfi-1 source "srfi-1") + (and-let* srfi-2) + (srfi-2 defmacro "srfi-2") + (receive srfi-8) + (srfi-8 macro "srfi-8") + (define-record-type srfi-9) + (srfi-9 macro "srfi-9") + (let-values srfi-11) + (srfi-11 macro "srfi-11") + (srfi-28 format) + (srfi-39 macro "srfi-39") + (srfi-47 array) + (srfi-63 array) + (srfi-60 logical) + (guarded-cond-clause srfi-61) + (srfi-61 macro "srfi-61") + (srfi-23 source "srfi-23") + (math-integer source "math-integer") + (math-real source "math-real") + (srfi-94 aggregate math-integer math-real) + (ssax xml-parse) + (xml-parse source "xml-parse") + (new-catalog source "mklibcat") + ))))) (let* ((req (in-vicinity (library-vicinity) (string-append "require" (scheme-file-suffix))))) (write* (cons '*slib-version* (or (slib:version req) *slib-version*)))) diff --git a/mkpltcat.scm b/mkpltcat.scm index 80d4414..80d4414 100644..100755 --- a/mkpltcat.scm +++ b/mkpltcat.scm diff --git a/modular.scm b/modular.scm index 78c78bb..78c78bb 100644..100755 --- a/modular.scm +++ b/modular.scm diff --git a/modular.txi b/modular.txi index 666f52a..666f52a 100644..100755 --- a/modular.txi +++ b/modular.txi diff --git a/mulapply.scm b/mulapply.scm index 6c58959..6c58959 100644..100755 --- a/mulapply.scm +++ b/mulapply.scm diff --git a/mularg.scm b/mularg.scm index e1bc5af..e1bc5af 100644..100755 --- a/mularg.scm +++ b/mularg.scm diff --git a/mwdenote.scm b/mwdenote.scm index f7db72b..f7db72b 100644..100755 --- a/mwdenote.scm +++ b/mwdenote.scm diff --git a/mwexpand.scm b/mwexpand.scm index 719b899..c4823eb 100644..100755 --- a/mwexpand.scm +++ b/mwexpand.scm @@ -243,9 +243,10 @@ (cons mw:begin1 body))) (let* ((alist (mw:rename-vars '(quote lambda set!))) (env (mw:syntax-alias env alist mw:standard-syntax-environment)) - (new-quote (cdr (assq 'quote alist))) + ;;(new-quote (cdr (assq 'quote alist))) (new-lambda (cdr (assq 'lambda alist))) - (new-set! (cdr (assq 'set! alist)))) + ;;(new-set! (cdr (assq 'set! alist))) + ) (define (desugar-definition def) (if (> (mw:safe-length def) 2) (cond ((pair? (cadr def)) diff --git a/mwsynrul.scm b/mwsynrul.scm index 0ced293..0ced293 100644..100755 --- a/mwsynrul.scm +++ b/mwsynrul.scm diff --git a/mzscheme.init b/mzscheme.init index db6b3b9..db6b3b9 100644..100755 --- a/mzscheme.init +++ b/mzscheme.init diff --git a/nbs-iscc.txt b/nbs-iscc.txt index a02368e..a02368e 100644..100755 --- a/nbs-iscc.txt +++ b/nbs-iscc.txt diff --git a/ncbi-dna.scm b/ncbi-dna.scm index d5fc5ca..8419221 100644..100755 --- a/ncbi-dna.scm +++ b/ncbi-dna.scm @@ -22,6 +22,7 @@ (require 'string-case) (require 'string-search) (require 'array-for-each) +(require 'multiarg-apply) (require-if 'compiling 'printf) ;used by cDNA:report-base-count ;;@code{(require 'ncbi-dma)} diff --git a/ncbi-dna.txi b/ncbi-dna.txi index de64ea2..de64ea2 100644..100755 --- a/ncbi-dna.txi +++ b/ncbi-dna.txi diff --git a/obj2str.scm b/obj2str.scm index 7c77ef0..7c77ef0 100644..100755 --- a/obj2str.scm +++ b/obj2str.scm diff --git a/obj2str.txi b/obj2str.txi index 9b19f46..9b19f46 100644..100755 --- a/obj2str.txi +++ b/obj2str.txi diff --git a/object.scm b/object.scm index 298baad..7edee52 100644..100755 --- a/object.scm +++ b/object.scm @@ -75,9 +75,7 @@ (define generic-predicate (lambda (obj) (if (object? obj) - (if ((vector-ref obj 1) generic-predicate) - #t - #f) + (and ((vector-ref obj 1) generic-predicate) #t) #f))) generic-predicate) ;@ diff --git a/object.texi b/object.texi index 123417b..123417b 100644..100755 --- a/object.texi +++ b/object.texi diff --git a/paramlst.scm b/paramlst.scm index 65fcf01..65fcf01 100644..100755 --- a/paramlst.scm +++ b/paramlst.scm diff --git a/peanosfc.scm b/peanosfc.scm index 82b136e..82b136e 100644..100755 --- a/peanosfc.scm +++ b/peanosfc.scm diff --git a/peanosfc.txi b/peanosfc.txi index 5550ebb..5550ebb 100644..100755 --- a/peanosfc.txi +++ b/peanosfc.txi diff --git a/phil-spc.scm b/phil-spc.scm index ec0bc0f..dfc962e 100644..100755 --- a/phil-spc.scm +++ b/phil-spc.scm @@ -136,8 +136,9 @@ ;;@defun integer->gray-code k ;;Converts @var{k} to a Gray code of the same @code{integer-length} as ;;@var{k}. +;;@end defun ;; -;;@defunx gray-code->integer k +;;@defun gray-code->integer k ;;Converts the Gray code @var{k} to an integer of the same ;;@code{integer-length} as @var{k}. ;; diff --git a/phil-spc.txi b/phil-spc.txi index 62b1bae..46d80d1 100644..100755 --- a/phil-spc.txi +++ b/phil-spc.txi @@ -41,7 +41,8 @@ non-negative integer @var{scalar}. The lists returned by @code{integer->hilbert 0 and 1 will differ in the first element. -@defunx integer->hilbert-coordinates scalar rank k +@end defun +@defun integer->hilbert-coordinates scalar rank k @var{scalar} must be a nonnegative integer of no more than @code{@var{rank}*@var{k}} bits. @@ -80,8 +81,9 @@ of Hilbert space-filling curves. @defun integer->gray-code k Converts @var{k} to a Gray code of the same @code{integer-length} as @var{k}. +@end defun -@defunx gray-code->integer k +@defun gray-code->integer k Converts the Gray code @var{k} to an integer of the same @code{integer-length} as @var{k}. @@ -23,6 +23,7 @@ (require 'line-i/o) (require 'logical) (require 'byte) +(require 'multiarg-apply) ;;@code{(require 'pnm)} ;;@ftindex pnm @@ -50,7 +50,8 @@ Reads the @dfn{portable bitmap graphics} file named by @var{path} into @var{path}. @var{array} is returned. -@defunx pnm:image-file->array path +@end defun +@defun pnm:image-file->array path @code{pnm:image-file->array} creates and returns an array with the @dfn{portable bitmap graphics} file named by @var{path} read into it. diff --git a/ppfile.scm b/ppfile.scm index 6c419dd..6c419dd 100644..100755 --- a/ppfile.scm +++ b/ppfile.scm @@ -46,39 +46,25 @@ ; MACSYMA Reference Manual, Version Ten, ; Laboratory for Computer Science, MIT, 1983 -(require 'fluid-let) (require 'string-search) (require 'string-port) (require 'delay) +(require 'multiarg-apply) -(define *syn-rules* #f) ;Dynamically bound -(define *prec:port* #f) ;Dynamically bound ;@ (define *syn-defs* #f) -;; keeps track of input column so we can generate useful error displays. -(define tok:column 0) -(define (tok:peek-char) (peek-char *prec:port*)) -(define (tok:read-char) - (let ((c (read-char *prec:port*))) - (if (or (eqv? c #\newline) (eof-object? c)) - (set! tok:column 0) - (set! tok:column (+ 1 tok:column))) +(define (tok:peek-char dyn) (peek-char (cadr dyn))) +(define (tok:read-char dyn) + (let ((c (read-char (cadr dyn)))) + (set-car! (cddddr dyn) + (if (or (eqv? c #\newline) (eof-object? c)) + 0 + (+ 1 (car (cddddr dyn))))) c)) -;@ -(define (tok:bump-column pos . ports) - ((lambda (thunk) - (cond ((null? ports) (thunk)) - (else (fluid-let ((*prec:port* (car ports)) - (prec:token #f)) - (thunk))))) - (lambda () - (cond ((eqv? #\newline (tok:peek-char)) - (tok:read-char))) ;to do newline - (set! tok:column (+ tok:column pos))))) - -(define (prec:warn . msgs) - (do ((j (+ -1 tok:column) (+ -8 j))) + +(define (prec:warn dyn . msgs) + (do ((j (+ -1 (car (cddddr dyn))) (+ -8 j))) ((> 8 j) (do ((i j (+ -1 i))) ((>= 0 i) @@ -102,38 +88,40 @@ ;@ (define (tok:char-group group chars chars-proc) (map (lambda (token) -;;; (let ((oldlexrec (tok:lookup *syn-defs* token))) -;;; (cond ((or (not oldlexrec) (eqv? (tok:cc oldlexrec) group))) -;;; (else (math:warn 'cc-of token 'redefined-to- group)))) +;;; (let ((oldlexrec (tok:lookup *syn-defs* token))) +;;; (cond ((or (not oldlexrec) (eqv? (tok:cc oldlexrec) group))) +;;; (else (math:warn 'cc-of token 'redefined-to- group)))) (cons token (tok:make-rec group chars-proc))) (cond ((string? chars) (string->list chars)) ((char? chars) (list chars)) (else chars)))) -(define (tokenize) - (let* ((char (tok:read-char)) - (rec (tok:lookup *syn-rules* char)) +(define (tokenize dyn) + (let* ((char (tok:read-char dyn)) + (rec (tok:lookup (car dyn) char)) (proc (and rec (tok:cc rec))) (clist (list char))) (cond ((not proc) char) ((procedure? proc) - (do ((cl clist (begin (set-cdr! cl (list (tok:read-char))) (cdr cl)))) - ((proc (tok:peek-char)) - ((or (tok:sfp rec) list->string) clist)))) - ((eqv? 0 proc) (tokenize)) + (do ((cl clist (begin (set-cdr! cl (list (tok:read-char dyn))) (cdr cl)))) + ((proc (tok:peek-char dyn)) + ((or (tok:sfp rec) (lambda (dyn l) (list->string l))) + dyn + clist)))) + ((eqv? 0 proc) (tokenize dyn)) (else - (do ((cl clist (begin (set-cdr! cl (list (tok:read-char))) (cdr cl)))) - ((not (let* ((prec (tok:lookup *syn-rules* (tok:peek-char))) + (do ((cl clist (begin (set-cdr! cl (list (tok:read-char dyn))) (cdr cl)))) + ((not (let* ((prec (tok:lookup (car dyn) (tok:peek-char dyn))) (cclass (and prec (tok:cc prec)))) (or (eqv? cclass proc) (eqv? cclass (+ -1 proc))))) - ((tok:sfp rec) clist))))))) + ((tok:sfp rec) dyn clist))))))) ;;; PREC:NUD is the null denotation (function and arguments to call when no -;;; unclaimed tokens). +;;; unclaimed tokens). ;;; PREC:LED is the left denotation (function and arguments to call when -;;; unclaimed token is on left). +;;; unclaimed token is on left). ;;; PREC:LBP is the left binding power of this LED. It is the first ;;; argument position of PREC:LED @@ -180,10 +168,7 @@ (if (pair? toks) toks (list toks)))) ;;; Produce dynamically augmented grammars. -(define (prec:process-binds binds rules) - (if (and #f (not (null? binds)) (eq? #t (car binds))) - (cdr binds) - (append binds rules))) +(define prec:process-binds append) ;;(define (prec:replace-rules) some-sort-of-magic-cookie) @@ -198,74 +183,76 @@ (define (prec:nofix tk sop . binds) (prec:make-nud tk prec:parse-nofix sop (apply append binds))) -(define (prec:parse-nofix self sop binds) - (set! *syn-rules* (prec:process-binds binds *syn-rules*)) - (prec:call-or-list (or sop (prec:symbolfy self)))) +(define (prec:parse-nofix dyn self sop binds) + (let ((dyn (cons (prec:process-binds binds (car dyn)) (cdr dyn)))) + (prec:call-or-list (or sop (prec:symbolfy self))))) ;@ (define (prec:prefix tk sop bp . binds) (prec:make-nud tk prec:parse-prefix sop bp (apply append binds))) -(define (prec:parse-prefix self sop bp binds) - (fluid-let ((*syn-rules* (prec:process-binds binds *syn-rules*))) - (prec:call-or-list (or sop (prec:symbolfy self)) (prec:parse1 bp)))) +(define (prec:parse-prefix dyn self sop bp binds) + (let ((dyn (cons (prec:process-binds binds (car dyn)) (cdr dyn)))) + (prec:call-or-list (or sop (prec:symbolfy self)) (prec:parse1 dyn bp)))) ;@ (define (prec:infix tk sop lbp bp . binds) (prec:make-led tk lbp prec:parse-infix sop bp (apply append binds))) -(define (prec:parse-infix left self lbp sop bp binds) - (fluid-let ((*syn-rules* (prec:process-binds binds *syn-rules*))) - (prec:call-or-list (or sop (prec:symbolfy self)) left (prec:parse1 bp)))) +(define (prec:parse-infix dyn left self lbp sop bp binds) + (let ((dyn (cons (prec:process-binds binds (car dyn)) (cdr dyn)))) + (prec:call-or-list (or sop (prec:symbolfy self)) left (prec:parse1 dyn bp)))) ;@ (define (prec:nary tk sop bp) (prec:make-led tk bp prec:parse-nary sop bp)) -(define (prec:parse-nary left self lbp sop bp) +(define (prec:parse-nary dyn left self lbp sop bp) (prec:apply-or-cons (or sop (prec:symbolfy self)) - (cons left (prec:parse-list self bp)))) + (cons left (prec:parse-list dyn self bp)))) ;@ (define (prec:postfix tk sop lbp . binds) (prec:make-led tk lbp prec:parse-postfix sop (apply append binds))) -(define (prec:parse-postfix left self lbp sop binds) - (set! *syn-rules* (prec:process-binds binds *syn-rules*)) - (prec:call-or-list (or sop (prec:symbolfy self)) left)) +(define (prec:parse-postfix dyn left self lbp sop binds) + (let ((dyn (cons (prec:process-binds binds (car dyn)) (cdr dyn)))) + (prec:call-or-list (or sop (prec:symbolfy self)) left))) ;@ (define (prec:prestfix tk sop bp . binds) (prec:make-nud tk prec:parse-rest sop bp (apply append binds))) -(define (prec:parse-rest self sop bp binds) - (fluid-let ((*syn-rules* (prec:process-binds binds *syn-rules*))) - (prec:apply-or-cons (or sop (prec:symbolfy self)) (prec:parse-list #f bp)))) +(define (prec:parse-rest dyn self sop bp binds) + (let ((dyn (cons (prec:process-binds binds (car dyn)) (cdr dyn)))) + (prec:apply-or-cons (or sop (prec:symbolfy self)) (prec:parse-list dyn #f bp)))) ;@ (define (prec:commentfix tk stp match . binds) (append (prec:make-nud tk prec:parse-nudcomment stp match (apply append binds)) (prec:make-led tk 220 prec:parse-ledcomment stp match (apply append binds)))) -(define (prec:parse-nudcomment self stp match binds) - (fluid-let ((*syn-rules* (prec:process-binds binds *syn-rules*))) - (tok:read-through-comment stp match) - (prec:advance) - (cond ((prec:delim? (force prec:token)) #f) - (else (prec:parse1 prec:bp))))) -(define (prec:parse-ledcomment left lbp self stp match binds) - (fluid-let ((*syn-rules* (prec:process-binds binds *syn-rules*))) - (tok:read-through-comment stp match) - (prec:advance) +(define (prec:parse-nudcomment dyn self stp match binds) + (let ((dyn (cons (prec:process-binds binds (car dyn)) (cdr dyn)))) + (tok:read-through-comment dyn stp match) + (prec:advance dyn) + (cond ((prec:delim? dyn (force (caddr dyn))) #f) + (else (prec:parse1 dyn (cadddr dyn)))))) + +(define (prec:parse-ledcomment dyn left lbp self stp match binds) + (let ((dyn (cons (prec:process-binds binds (car dyn)) (cdr dyn)))) + (tok:read-through-comment dyn stp match) + (prec:advance dyn) left)) -(define (tok:read-through-comment stp match) + +(define (tok:read-through-comment dyn stp match) (set! match (if (char? match) (string match) (prec:de-symbolfy match))) (cond ((procedure? stp) (let* ((len #f) (str (call-with-output-string - (lambda (sp) - (set! len (find-string-from-port? - match *prec:port* - (lambda (c) (display c sp) #f))))))) + (lambda (sp) + (set! len (find-string-from-port? + match (cadr dyn) + (lambda (c) (display c sp) #f))))))) (stp (and len (substring str 0 (- len (string-length match))))))) - (else (find-string-from-port? match *prec:port*)))) + (else (find-string-from-port? match (cadr dyn))))) ;@ (define (prec:matchfix tk sop sep match . binds) (define sep-lbp 0) @@ -273,26 +260,25 @@ sop sep-lbp sep match (apply append (prec:delim match) binds))) -(define (prec:parse-matchfix self sop sep-lbp sep match binds) - (fluid-let ((*syn-rules* (prec:process-binds binds *syn-rules*))) - (cond (sop (prec:apply-or-cons - sop (prec:parse-delimited sep sep-lbp match))) - ((equal? (force prec:token) match) - (prec:warn 'expression-missing) - (prec:advance) +(define (prec:parse-matchfix dyn self sop sep-lbp sep match binds) + (let ((dyn (cons (prec:process-binds binds (car dyn)) (cdr dyn)))) + (cond (sop (prec:apply-or-cons sop (prec:parse-delimited dyn sep sep-lbp match))) + ((equal? (force (caddr dyn)) match) + (prec:warn dyn 'expression-missing) + (prec:advance dyn) '?) - (else (let ((ans (prec:parse1 0))) ;just parenthesized expression - (cond ((equal? (force prec:token) match) - (prec:advance)) - ((prec:delim? (force prec:token)) - (prec:warn 'mismatched-delimiter (force prec:token) + (else (let ((ans (prec:parse1 dyn 0))) ;just parenthesized expression + (cond ((equal? (force (caddr dyn)) match) + (prec:advance dyn)) + ((prec:delim? dyn (force (caddr dyn))) + (prec:warn dyn 'mismatched-delimiter (force (caddr dyn)) 'not match) - (prec:advance)) - (else (prec:warn 'delimiter-expected--ignoring-rest - (force prec:token) 'expected match + (prec:advance dyn)) + (else (prec:warn dyn 'delimiter-expected--ignoring-rest + (force (caddr dyn)) 'expected match 'or-delimiter) - (do () ((prec:delim? (force prec:token))) - (prec:parse1 0)))) + (do () ((prec:delim? dyn (force (caddr dyn)))) + (prec:parse1 dyn 0)))) ans))))) ;@ (define (prec:inmatchfix tk sop sep match lbp . binds) @@ -301,115 +287,115 @@ sop sep-lbp sep match (apply append (prec:delim match) binds))) -(define (prec:parse-inmatchfix left self lbp sop sep-lbp sep match binds) - (fluid-let ((*syn-rules* (prec:process-binds binds *syn-rules*))) - (prec:apply-or-cons - sop (cons left (prec:parse-delimited sep sep-lbp match))))) +(define (prec:parse-inmatchfix dyn left self lbp sop sep-lbp sep match binds) + (let ((dyn (cons (prec:process-binds binds (car dyn)) (cdr dyn)))) + (prec:apply-or-cons sop (cons left (prec:parse-delimited dyn sep sep-lbp match))))) ;;;; Here is the code which actually parses. -(define prec:bp #f) ;dynamically bound -(define prec:token #f) -(define (prec:advance) - (set! prec:token (delay (tokenize)))) -(define (prec:advance-return-last) - (let ((last (and prec:token (force prec:token)))) - (prec:advance) +(define (prec:advance dyn) + (set-car! (cddr dyn) (delay (tokenize dyn)))) +(define (prec:advance-return-last dyn) + (let ((last (and (caddr dyn) (force (caddr dyn))))) + (prec:advance dyn) last)) -(define (prec:nudcall self) - (let ((pob (prec:nudf *syn-rules* self))) +(define (prec:nudcall dyn self) + (let ((pob (prec:nudf (car dyn) self))) (cond (pob (let ((proc (car pob))) - (cond ((procedure? proc) (apply proc self (cdr pob))) + (cond ((procedure? proc) (apply proc dyn self (cdr pob))) (proc (cons proc (cdr pob))) (else '?)))) - ((char? self) (prec:warn 'extra-separator) - (prec:advance) - (prec:nudcall (force prec:token))) + ((char? self) (prec:warn dyn 'extra-separator) + (prec:advance dyn) + (prec:nudcall dyn (force (caddr dyn)))) ((string? self) (string->symbol self)) (else self)))) -(define (prec:ledcall left self) - (let* ((pob (prec:ledf *syn-rules* self))) - (apply (cadr pob) left self (cdr pob)))) +(define (prec:ledcall dyn left self) + (let* ((pob (prec:ledf (car dyn) self))) + (apply (cadr pob) dyn left self (cdr pob)))) ;;; PREC:PARSE1 is the heart. -(define (prec:parse1 bp) - (fluid-let ((prec:bp bp)) - (do ((left (prec:nudcall (prec:advance-return-last)) - (prec:ledcall left (prec:advance-return-last)))) - ((or (>= bp 200) ;to avoid unneccesary lookahead - (>= bp (or (prec:lbp *syn-rules* (force prec:token)) 0)) - (not left)) - left)))) - -(define (prec:delim? token) - (or (eof-object? token) (<= (or (prec:lbp *syn-rules* token) 220) 0))) - -(define (prec:parse-list sep bp) - (cond ((prec:delim? (force prec:token)) - (prec:warn 'expression-missing) +(define (prec:parse1 dyn bp) + (do ((left (prec:nudcall dyn (prec:advance-return-last dyn)) + (prec:ledcall dyn left (prec:advance-return-last dyn)))) + ((or (>= bp 200) ;to avoid unneccesary lookahead + (>= bp (or (prec:lbp (car dyn) (force (caddr dyn))) 0)) + (not left)) + left))) + +(define (prec:delim? dyn token) + (or (eof-object? token) (<= (or (prec:lbp (car dyn) token) 220) 0))) + +(define (prec:parse-list dyn sep bp) + (cond ((prec:delim? dyn (force (caddr dyn))) + (prec:warn dyn 'expression-missing) '(?)) (else - (let ((f (prec:parse1 bp))) - (cons f (cond ((equal? (force prec:token) sep) - (prec:advance) - (cond ((equal? (force prec:token) sep) - (prec:warn 'expression-missing) - (prec:advance) - (cons '? (prec:parse-list sep bp))) - ((prec:delim? (force prec:token)) - (prec:warn 'expression-missing) + (let ((f (prec:parse1 dyn bp))) + (cons f (cond ((equal? (force (caddr dyn)) sep) + (prec:advance dyn) + (cond ((equal? (force (caddr dyn)) sep) + (prec:warn dyn 'expression-missing) + (prec:advance dyn) + (cons '? (prec:parse-list dyn sep bp))) + ((prec:delim? dyn (force (caddr dyn))) + (prec:warn dyn 'expression-missing) '(?)) - (else (prec:parse-list sep bp)))) - ((prec:delim? (force prec:token)) '()) - ((not sep) (prec:parse-list sep bp)) - ((prec:delim? sep) (prec:warn 'separator-missing) - (prec:parse-list sep bp)) + (else (prec:parse-list dyn sep bp)))) + ((prec:delim? dyn (force (caddr dyn))) '()) + ((not sep) (prec:parse-list dyn sep bp)) + ((prec:delim? dyn sep) (prec:warn dyn 'separator-missing) + (prec:parse-list dyn sep bp)) (else '()))))))) -(define (prec:parse-delimited sep bp delim) - (cond ((equal? (force prec:token) sep) - (prec:warn 'expression-missing) - (prec:advance) - (cons '? (prec:parse-delimited sep bp delim))) - ((prec:delim? (force prec:token)) - (if (not (equal? (force prec:token) delim)) - (prec:warn 'mismatched-delimiter (force prec:token) +(define (prec:parse-delimited dyn sep bp delim) + (cond ((equal? (force (caddr dyn)) sep) + (prec:warn dyn 'expression-missing) + (prec:advance dyn) + (cons '? (prec:parse-delimited dyn sep bp delim))) + ((prec:delim? dyn (force (caddr dyn))) + (if (not (equal? (force (caddr dyn)) delim)) + (prec:warn dyn 'mismatched-delimiter (force (caddr dyn)) 'expected delim)) - (if (not sep) (prec:warn 'expression-missing)) - (prec:advance) + (if (not sep) (prec:warn dyn 'expression-missing)) + (prec:advance dyn) (if sep '() '(?))) - (else (let ((ans (prec:parse-list sep bp))) - (cond ((equal? (force prec:token) delim)) - ((prec:delim? (force prec:token)) - (prec:warn 'mismatched-delimiter (force prec:token) + (else (let ((ans (prec:parse-list dyn sep bp))) + (cond ((equal? (force (caddr dyn)) delim)) + ((prec:delim? dyn (force (caddr dyn))) + (prec:warn dyn 'mismatched-delimiter (force (caddr dyn)) 'expecting delim)) - (else (prec:warn 'delimiter-expected--ignoring-rest - (force prec:token) '...) - (do () ((prec:delim? (force prec:token))) - (prec:parse1 bp)))) - (prec:advance) + (else (prec:warn dyn 'delimiter-expected--ignoring-rest + (force (caddr dyn)) '...) + (do () ((prec:delim? dyn (force (caddr dyn)))) + (prec:parse1 dyn bp)))) + (prec:advance dyn) ans)))) ;@ -(define (prec:parse grammar delim . port) +(define (prec:parse grammar delim column . ports) + (define port (if (null? ports) (current-input-port) (car ports))) (set! delim (prec:de-symbolfy delim)) - (fluid-let ((*syn-rules* (append (prec:delim delim) grammar)) - (*prec:port* (if (null? port) (current-input-port) (car port))) - (prec:token prec:token)) - (prec:advance) ; setup prec:token with first token - (cond ((eof-object? (force prec:token)) (force prec:token)) - ((equal? (force prec:token) delim) #f) + (let ((dyn (list (append (prec:delim delim) grammar) + port + #f + 0 + column))) + (prec:advance dyn) ; setup prec:token with first token + (cond ((eof-object? (force (caddr dyn))) (force (caddr dyn))) + ((equal? (force (caddr dyn)) delim) #f) (else - (let ((ans (prec:parse1 0))) - (cond ((eof-object? (force prec:token))) - ((equal? (force prec:token) delim)) - (else (prec:warn 'delimiter-expected--ignoring-rest - (force prec:token) 'not delim) - (do () ((or (equal? (force prec:token) delim) - (eof-object? (force prec:token)))) - (prec:advance)))) + (let ((ans (prec:parse1 dyn 0))) + (cond ((eof-object? (force (caddr dyn)))) + ((equal? (force (caddr dyn)) delim)) + (else (prec:warn dyn + 'delimiter-expected--ignoring-rest + (force (caddr dyn)) 'not delim) + (do () ((or (equal? (force (caddr dyn)) delim) + (eof-object? (force (caddr dyn))))) + (prec:advance dyn)))) ans))))) ;@ (define tok:decimal-digits "0123456789") @@ -424,7 +410,7 @@ ;;;;The parse tables. ;;; Definitions accumulate in top-level variable *SYN-DEFS*. -(set! *syn-defs* '()) ;Make sure *SYN-DEFS* is empty. +(set! *syn-defs* '()) ;Make sure *SYN-DEFS* is empty. ;;; Ignore Whitespace characters. (prec:define-grammar (tok:char-group 0 tok:whitespaces #f)) diff --git a/printf.scm b/printf.scm index a85471f..6e51027 100644..100755 --- a/printf.scm +++ b/printf.scm @@ -18,6 +18,7 @@ ;each case. (require 'string-case) +(require 'multiarg-apply) (require-if 'compiling 'generic-write) ;; Determine the case of digits > 9. We assume this to be constant. diff --git a/priorque.scm b/priorque.scm index 9f1591f..e5fea53 100644..100755 --- a/priorque.scm +++ b/priorque.scm @@ -93,7 +93,7 @@ ;;Returns a binary heap suitable which can be used for priority queue ;;operations. (define make-heap - (let ((cstr (record-constructor heap:rtd))) + (let ((cstr (record-constructor heap:rtd '(array size heap<?)))) (lambda (pred<?) (cstr (make-vector 4) 0 pred<?)))) diff --git a/priorque.txi b/priorque.txi index 9306a89..9306a89 100644..100755 --- a/priorque.txi +++ b/priorque.txi diff --git a/process.scm b/process.scm index d691aa6..d691aa6 100644..100755 --- a/process.scm +++ b/process.scm diff --git a/promise.scm b/promise.scm index 44ffea1..44ffea1 100644..100755 --- a/promise.scm +++ b/promise.scm diff --git a/pscheme.init b/pscheme.init index 49c98a3..49c98a3 100644..100755 --- a/pscheme.init +++ b/pscheme.init diff --git a/psxtime.scm b/psxtime.scm index fed0707..3589c36 100644..100755 --- a/psxtime.scm +++ b/psxtime.scm @@ -19,6 +19,7 @@ ;;; No, it doesn't do leap seconds. +(require 'multiarg-apply) (require 'time-core) (require-if 'compiling 'time-zone) ;@ @@ -103,7 +103,9 @@ (display #\") ((lambda (ans) (display #\") ans) (+ 2 (qp-string obj (- room 2))))) - ((symbol? obj) (qp-string (symbol->string obj) room)) + ((symbol? obj) + (display obj) + (string-length (symbol->string obj))) ((input-port? obj) (display "#[input]") 8) ((output-port? obj) (display "#[output]") 9) ((procedure? obj) (display "#[proc]") 7) @@ -132,8 +134,7 @@ (lambda objs (cond ((not *qp-width*) - (for-each (lambda (x) (write x) (display #\space)) objs) - (newline)) + (for-each (lambda (x) (write x) (display #\space)) objs)) ((= 0 *qp-width*) (for-each (lambda (x) (if (procedure? x) (display "#[proc]") (write x)) diff --git a/queue.scm b/queue.scm index 820894f..d9bb0e9 100644..100755 --- a/queue.scm +++ b/queue.scm @@ -22,7 +22,7 @@ ;;@args ;;Returns a new, empty queue. (define make-queue - (let ((construct-queue (record-constructor queue:record-type))) + (let ((construct-queue (record-constructor queue:record-type '(first-pair last-pair)))) (lambda () (construct-queue '() '())))) diff --git a/queue.txi b/queue.txi index efa6411..efa6411 100644..100755 --- a/queue.txi +++ b/queue.txi diff --git a/r4rsyn.scm b/r4rsyn.scm index 9af71c8..9af71c8 100644..100755 --- a/r4rsyn.scm +++ b/r4rsyn.scm diff --git a/randinex.scm b/randinex.scm index 717b306..ec2350a 100644..100755 --- a/randinex.scm +++ b/randinex.scm @@ -24,6 +24,7 @@ (require 'random) (require 'inexact) +(require 'multiarg-apply) ;;@code{(require 'random-inexact)} ;;@ftindex random-inexact diff --git a/randinex.txi b/randinex.txi index 88dff74..88dff74 100644..100755 --- a/randinex.txi +++ b/randinex.txi diff --git a/random.scm b/random.scm index f4b2abb..f4b2abb 100644..100755 --- a/random.scm +++ b/random.scm diff --git a/random.txi b/random.txi index 3e53905..f19c714 100644..100755 --- a/random.txi +++ b/random.txi @@ -34,7 +34,8 @@ as a random-number state object in another implementation. Returns a new copy of argument @var{state}. -@defunx copy-random-state +@end defun +@defun copy-random-state Returns a new copy of @code{*random-state*}. @end defun diff --git a/ratize.scm b/ratize.scm index 35a9ded..35a9ded 100644..100755 --- a/ratize.scm +++ b/ratize.scm diff --git a/ratize.txi b/ratize.txi index 9f6d25a..9f6d25a 100644..100755 --- a/ratize.txi +++ b/ratize.txi diff --git a/recobj.scm b/recobj.scm index a634423..a634423 100644..100755 --- a/recobj.scm +++ b/recobj.scm diff --git a/record.scm b/record.scm index a94bc50..a94bc50 100644..100755 --- a/record.scm +++ b/record.scm diff --git a/require.scm b/require.scm index a659019..67b4369 100644 --- a/require.scm +++ b/require.scm @@ -17,7 +17,7 @@ ;promotional, or sales literature without prior written consent in ;each case. ;@ -(define *slib-version* "3b1") +(define *slib-version* "3b5") ;;;; MODULES ;@ @@ -228,10 +228,11 @@ (newline)) ;@ (define (slib:report . args) - (define rpt (lambda () (slib:report-version) (slib:report-locations))) - (cond ((null? args) (rpt)) + (define rpt (lambda () (slib:report-version) (slib:report-locations #t))) + (cond ((null? args) + (slib:report-version) (slib:report-locations)) ((not (string? (car args))) - (slib:report-version) (slib:report-locations #t)) + (rpt)) ((slib:provided? 'transcript) (transcript-on (car args)) (rpt) diff --git a/resenecolours.txt b/resenecolours.txt index df2f391..df2f391 100644..100755 --- a/resenecolours.txt +++ b/resenecolours.txt diff --git a/rmdsff.scm b/rmdsff.scm new file mode 100644 index 0000000..b9ee7eb --- /dev/null +++ b/rmdsff.scm @@ -0,0 +1,317 @@ +;;;; "rmdsff.scm" Space-filling functions and their inverses. +;;; Copyright (C) 2013, 2014 Aubrey Jaffer +; +;Permission to copy this software, to modify it, to redistribute it, +;to distribute modified versions, and to use it for any purpose is +;granted, subject to the following restrictions and understandings. +; +;1. Any copy made of this software must include this copyright notice +;in full. +; +;2. I have made no warranty or representation that the operation of +;this software will be error-free, and I am under no obligation to +;provide any services, by way of maintenance, update, or otherwise. +; +;3. In conjunction with products arising from the use of this +;material, there shall be no use of my name in any advertising, +;promotional, or sales literature without prior written consent in +;each case. + +(require 'array) + +;;@code{(require 'space-filling)} +;;@ftindex space-filling + +;;@ The algorithms and cell properties are described in +;;@url{http://people.csail.mit.edu/jaffer/Geometry/RMDSFF.pdf} + +;;; A cell is an object encapsulating the information about a +;;; Hamiltonian path on a rectangular grid of side^rank nodes. +;;; Here are the accessors for a cell: +(define cell-type caar) +(define cell-side cadar) +(define cell-rank caddar) +(define (cell-index cell crds) (apply array-ref (cadadr cell) crds)) +(define (cell-coords cell t) (vector-ref (caadr cell) t)) +(define (cell-entry cell t) (vector-ref (caddr cell) t)) +(define (cell-exit cell t) (vector-ref (cadddr cell) t)) +(define (cell-rotation cell t) (vector-ref (cadddr (cdr cell)) t)) + +;;@args type rank side precession +;;@args type rank side +;;@args type rank +;; +;;@1 must be the symbol @code{diagonal}, @code{adjacent}, or +;;@code{centered}. @2 must be an integer larger than 1. @3, if +;;present, must be an even integer larger than 1 if @1 is +;;@code{adjacent} or an odd integer larger than 2 otherwise; @3 +;;defaults to the smallest value. @4, if present, must be an integer +;;between 0 and @3^@2-1; it is relevant only when @1 is +;;@code{diagonal} or @code{centered}. +;; +;;@args Hamiltonian-path-vector precession +;;@args Hamiltonian-path-vector +;; +;;@1 must be a vector of @var{side}^@var{rank} lists of @var{rank} of +;;integers encoding the coordinate positions of a Hamiltonian path on +;;the @var{rank}-dimensional grid of points starting and ending on +;;corners of the grid. The starting corner must be the origin +;;(all-zero coordinates). If the side-length is even, then the ending +;;corner must be non-zero in only one coordinate; otherwise, the +;;ending corner must be the furthest diagonally opposite corner from +;;the origin. +;; +;;@code{make-cell} returns a data object suitable for passing as the +;;first argument to @code{integer->coordinates} or +;;@code{coordinates->integer}. +(define (make-cell arg1 . args) + (define (make-serpentine-path rank s) + (let loop ((path '(())) (rnk (+ -1 rank))) + (if (negative? rnk) path + (loop (let iloop ((seq '()) (sc (+ -1 s))) + (if (negative? sc) + seq + (iloop (append (map (lambda (coords) (cons sc coords)) + (if (odd? sc) (reverse path) path)) + seq) + (+ -1 sc)))) + (+ -1 rnk))))) + (if (list? arg1) (set! arg1 (list->vector arg1))) + (cond + ((> (length args) 3) + (slib:error 'make-cell 'extra 'arguments 'not 'handled args)) + ((vector? arg1) + (let ((path arg1) + (precession (and (not (null? args)) (car args)))) + (define frst (vector-ref path 0)) + (define len (vector-length path)) + (define s-1 (apply max (apply append (vector->list path)))) + (let* ((len-1 (+ -1 len)) + (last (vector-ref path len-1)) + (d (length frst))) + ;; returns index of first non-zero in LST + (define (first-non-zero lst) + (define pos (lambda (n lst) + (cond ((zero? (car lst)) (pos (+ 1 n) (cdr lst))) + (else n)))) + (pos 0 lst)) + ;; returns the traversal direction of the sub-path. + (define (U_e N t) + (if (= t len-1) + (map - (vector-ref path t) (vector-ref path (- t 1))) + (let ((dH_i+1 (map - (vector-ref path (+ t 1)) (vector-ref path t)))) + (define dotpr (apply + (map * N dH_i+1))) + (define csum (apply + dH_i+1)) + (if (or (and (zero? dotpr) (= 1 csum)) (= dotpr csum -1)) + dH_i+1 + (map - (vector-ref path t) (vector-ref path (- t 1))) + )))) + (define (flip-direction dir cdir) + (map (lambda (px c) (modulo (+ px c) 2)) dir cdir)) + (define (path-diag? path) + (define prev frst) + (for-each (lambda (lst) + (if (not (= d (length lst))) + (slib:error 'non-uniform 'ranks frst lst))) + (vector->list path)) + (for-each (lambda (cs) + (if (not (= 1 (apply + (map abs (map - prev cs))))) + (slib:error 'bad 'step prev cs)) + (set! prev cs)) + (cdr (vector->list path))) + (cond ((not (zero? (apply + frst))) (slib:error 'strange 'start frst)) + ((not (= d (length last))) (slib:error 'non-uniform 'lengths path)) + ((apply = s-1 last) #t) + ((and (= s-1 (apply + last))) #f) + (else (slib:error 'strange 'net-travel frst last)))) + (define diag? (path-diag? path)) + (define entries (make-vector len (vector-ref path 0))) + (define exits (make-vector + len (if diag? + (map (lambda (c) (quotient c s-1)) last) + (vector-ref path 1)))) + (define rotations (make-vector len 0)) + (define ipath (apply make-array + (A:fixZ32b -1) + (vector->list (make-vector d (+ 1 s-1))))) + (define ord 0) + (for-each (lambda (coords) + (apply array-set! ipath ord coords) + (set! ord (+ 1 ord))) + (vector->list path)) + (let lp ((t 1) + (prev-X (if diag? + (map (lambda (c) 1) (vector-ref entries 0)) + (vector-ref path 1)))) + (cond ((> t len-1) + (if (not (equal? (vector-ref exits len-1) + (map (lambda (c) (quotient c s-1)) last))) + (slib:warn (list (if diag? 'diagonal 'adjacent) + (+ 1 s-1) d precession) + 'bad 'last 'exit + (vector-ref exits len-1) 'should 'be + (map (lambda (c) (quotient c s-1)) last))) + (let ((ord 0) + (h (first-non-zero last))) + (for-each + (lambda (coords) + (vector-set! rotations + ord + (modulo + (cond ((not diag?) + (- h (first-non-zero + (map - + (vector-ref exits ord) + (vector-ref entries ord))))) + (precession (+ precession ord)) + (else 0)) + d)) + (set! ord (+ 1 ord))) + (vector->list path))) + (list (list (if diag? 'diagonal 'adjacent) + (+ 1 s-1) + d + precession) + (list path ipath) + entries + exits + rotations + )) + (else + (let ((N (flip-direction + prev-X + (map - (vector-ref path t) + (vector-ref path (- t 1)))))) + (define X (if diag? + (map (lambda (tn) (- 1 tn)) N) + (flip-direction N (U_e N t)))) + (vector-set! entries t N) + (vector-set! exits t X) + (lp (+ 1 t) X)))))))) + ((< (car args) 2) + (slib:error 'make-cell 'rank 'too 'small (car args))) + (else + (case arg1 + ((center centered) + (let ((cell (make-cell (make-serpentine-path + (car args) + (if (null? (cdr args)) 3 (cadr args))) + (if (= 3 (length args)) (caddr args) #f)))) + (if (not (eq? 'diagonal (cell-type cell))) + (slib:error 'make-cell 'centered 'must 'be 'diagonal (car cell))) + (set-car! (car cell) 'centered) + cell)) + ((diagonal opposite) + (make-cell (make-serpentine-path + (car args) + (if (null? (cdr args)) 3 (cadr args))) + (if (= 3 (length args)) (caddr args) #f))) + ((adjacent) + (make-cell (make-serpentine-path + (car args) + (if (null? (cdr args)) 2 (cadr args))) + (if (= 3 (length args)) (caddr args) #f))) + (else + (slib:error 'make-cell 'unknown 'cell 'type arg1)))))) + +;;@ Hilbert, Peano, and centered Peano cells are generated +;;respectively by: +;;@example +;;(make-cell 'adjacent @var{rank} 2) ; Hilbert +;;(make-cell 'diagonal @var{rank} 3) ; Peano +;;(make-cell 'centered @var{rank} 3) ; centered Peano +;;@end example + +;; Positive k rotates left +(define (rotate-list lst k) + (define len (length lst)) + (cond ((<= len 1) lst) + (else + (set! k (modulo k len)) + (if (zero? k) + lst + (let ((ans (list (car lst)))) + (do ((ls (cdr lst) (cdr ls)) + (tail ans (cdr tail)) + (k (+ -1 k) (+ -1 k))) + ((<= k 0) + (append ls ans)) + (set-cdr! tail (list (car ls))))))))) + +;;@ In the conversion procedures, if the cell is @code{diagonal} or +;;@code{adjacent}, then the coordinates and scalar must be nonnegative +;;integers. If @code{centered}, then the integers can be negative. + +;;@body +;;@0 converts the integer @2 to a list of coordinates according to @1. +(define (integer->coordinates cell u) + (define umag (case (cell-type cell) + ((centered) (* (abs u) 2)) + (else u))) + (define d (cell-rank cell)) + (define s (cell-side cell)) + (let* ((s^d (expt s d)) + (s^d^2 (expt s^d d))) + (define (align V t sde) + (map (lambda (Vj Nj) (if (zero? Nj) Vj (- sde Vj))) + (rotate-list V (cell-rotation cell t)) + (cell-entry cell t))) + (define (rec u m w) + (if (positive? w) + (let ((t (quotient u m))) + (map + + (map (lambda (y) (* y w)) (cell-coords cell t)) + (align (rec (modulo u m) (quotient m s^d) (quotient w s)) + t + (- w 1)))) + (cell-coords cell 0))) + (do ((uscl 1 (* uscl s^d^2)) + (cscl 1 (* cscl s^d))) + ((> uscl umag) + (case (cell-type cell) + ((centered) + (let ((cscl/2 (quotient cscl 2))) + (map (lambda (c) (- c cscl/2)) + (rec (+ u (quotient uscl 2)) + (quotient uscl s^d) + (quotient cscl s))))) + (else (rec u (quotient uscl s^d) (quotient cscl s)))))))) + +;;@body +;;@0 converts the list of coordinates @2 to an integer according to @1. +(define (coordinates->integer cell V) + (define maxc (case (cell-type cell) + ((centered) (* 2 (apply max (map abs V)))) + (else (apply max V)))) + (define d (cell-rank cell)) + (define s (cell-side cell)) + (let* ((s^d (expt s d)) + (s^d^2 (expt s^d d))) + (define (align^-1 V t sde) + (rotate-list (map (lambda (Vj Nj) (if (zero? Nj) Vj (- sde Vj))) + V + (cell-entry cell t)) + (- (cell-rotation cell t)))) + (define (rec u V w) + (if (positive? w) + (let ((dig (cell-index cell (map (lambda (c) (quotient c w)) V)))) + (rec (+ dig (* s^d u)) + (align^-1 (map (lambda (cx) (modulo cx w)) V) + dig + (- w 1)) + (quotient w s))) + u)) + (do ((uscl 1 (* uscl s^d^2)) + (cscl 1 (* cscl s^d))) + ((> cscl maxc) + (case (cell-type cell) + ((centered) + (let ((cscl/2 (quotient cscl 2))) + (- (rec 0 + (map (lambda (c) (+ c cscl/2)) V) + (quotient cscl s)) + (quotient uscl 2)))) + (else (rec 0 V (quotient cscl s)))))))) + +;;@var{coordinates->integer} and @var{integer->coordinates} are +;;inverse functions when passed the same @var{cell} argument. diff --git a/rmdsff.txi b/rmdsff.txi new file mode 100644 index 0000000..9f008e6 --- /dev/null +++ b/rmdsff.txi @@ -0,0 +1,68 @@ +@code{(require 'space-filling)} +@ftindex space-filling + +The algorithms and cell properties are described in +@url{http://people.csail.mit.edu/jaffer/Geometry/RMDSFF.pdf} + + +@defun make-cell type rank side precession + + +@defunx make-cell type rank side + +@defunx make-cell type rank + +@var{type} must be the symbol @code{diagonal}, @code{adjacent}, or +@code{centered}. @var{rank} must be an integer larger than 1. @var{side}, if +present, must be an even integer larger than 1 if @var{type} is +@code{adjacent} or an odd integer larger than 2 otherwise; @var{side} +defaults to the smallest value. @var{precession}, if present, must be an integer +between 0 and @var{side}^@var{rank}-1; it is relevant only when @var{type} is +@code{diagonal} or @code{centered}. + + +@end defun +@defun make-cell Hamiltonian-path-vector precession + +@defunx make-cell Hamiltonian-path-vector + +@var{type} must be a vector of @var{side}^@var{rank} lists of @var{rank} of +integers encoding the coordinate positions of a Hamiltonian path on +the @var{rank}-dimensional grid of points starting and ending on +corners of the grid. The starting corner must be the origin +(all-zero coordinates). If the side-length is even, then the ending +corner must be non-zero in only one coordinate; otherwise, the +ending corner must be the furthest diagonally opposite corner from +the origin. + +@code{make-cell} returns a data object suitable for passing as the +first argument to @code{integer->coordinates} or +@code{coordinates->integer}. +@end defun + +Hilbert, Peano, and centered Peano cells are generated +respectively by: +@example +(make-cell 'adjacent @var{rank} 2) ; Hilbert +(make-cell 'diagonal @var{rank} 3) ; Peano +(make-cell 'centered @var{rank} 3) ; centered Peano +@end example + +In the conversion procedures, if the cell is @code{diagonal} or +@code{adjacent}, then the coordinates and scalar must be nonnegative +integers. If @code{centered}, then the integers can be negative. + + +@defun integer->coordinates cell u + +@code{integer->coordinates} converts the integer @var{u} to a list of coordinates according to @var{cell}. +@end defun + + +@defun coordinates->integer cell v + +@code{coordinates->integer} converts the list of coordinates @var{v} to an integer according to @var{cell}. +@end defun + +@var{coordinates->integer} and @var{integer->coordinates} are +inverse functions when passed the same @var{cell} argument. @@ -207,10 +207,8 @@ (bracket-iter x1 f1 #f x0 f0 #f count)) ((= f0 f1) #f) (else - (let* ((xnew (+ x0 (* (- (/ f0 (- f1 f0))) (- x1 x0)))) - (fnew (f xnew)) - (fmax (max (abs f1) (abs fnew)))) - (secant-iter x1 f1 xnew fnew (+ count 1))))))))))) + (let ((xnew (+ x0 (* (- (/ f0 (- f1 f0))) (- x1 x0))))) + (secant-iter x1 f1 xnew (f xnew) (+ count 1))))))))))) ;@ (define (secant:find-root f x0 x1 prec) (secant:find-root-1 f x0 x1 prec #f)) @@ -0,0 +1,417 @@ +;;; "s7.init" Initialization for SLIB for S7 -*-scheme-*- +;;; Author: Aubrey Jaffer +;;; +;;; This code is in the public domain. + +;;; S7 is embedded in Snd or Sndlib; +;;; It does not exist as a stand-alone program. + +;;@ (software-type) should be set to the generic operating system type. +;;; unix, vms, macos, amiga and ms-dos are supported. +(define (software-type) 'unix) + +;;@ (scheme-implementation-type) should return the name of the scheme +;;; implementation loading this file. +(define (scheme-implementation-type) 's7) + +;;@ (scheme-implementation-home-page) should return a (string) URI +;;; (Uniform Resource Identifier) for this scheme implementation's home +;;; page; or false if there isn't one. +(define (scheme-implementation-home-page) + "http://ccrma.stanford.edu/software/snd/") + +;;@ (scheme-implementation-version) should return a string describing +;;; the version the scheme implementation loading this file. +(define scheme-implementation-version s7-version) + +;;@ (implementation-vicinity) should be defined to be the pathname of +;;; the directory where any auxillary files to your Scheme +;;; implementation reside. +(define implementation-vicinity + (let ((impl-path + (or (getenv "S7_IMPLEMENTATION_PATH") + (case (software-type) + ((unix) "/usr/local/share/snd/") + ((vms) "scheme$src:") + ((ms-dos) "C:\\Program Files\\snd\\") + (else ""))))) + (lambda () impl-path))) + +;;@ (library-vicinity) should be defined to be the pathname of the +;;; directory where files of Scheme library functions reside. +(define library-vicinity + (let ((library-path + (or + ;; Use this getenv if your implementation supports it. + (getenv "SCHEME_LIBRARY_PATH") + ;; Use this path if your scheme does not support GETENV + ;; or if SCHEME_LIBRARY_PATH is not set. + (case (software-type) + ((unix) "/usr/local/lib/slib/") + ((vms) "lib$scheme:") + ((ms-dos) "C:\\Program Files\\slib\\") + (else ""))))) + (lambda () library-path))) + +;;@ (home-vicinity) should return the vicinity of the user's HOME +;;; directory, the directory which typically contains files which +;;; customize a computer environment for a user. +(define (home-vicinity) + (let ((home (getenv "HOME"))) + (and home + (case (software-type) + ((unix coherent ms-dos) ;V7 unix has a / on HOME + (if (eqv? #\/ (string-ref home (+ -1 (string-length home)))) + home + (string-append home "/"))) + (else home))))) + +;@ +(define in-vicinity string-append) + +;@ +(define (user-vicinity) + (case (software-type) + ((vms) "[.]") + (else ""))) + +(define *load-pathname* #f) ; *load-path* is a list of dirs in s7 + +;@ +(define vicinity:suffix? + (let ((suffi + (case (software-type) + ((amiga) '(#\: #\/)) + ((macos thinkc) '(#\:)) + ((ms-dos windows atarist os/2) '(#\\ #\/)) + ((nosve) '(#\: #\.)) + ((unix coherent plan9) '(#\/)) + ((vms) '(#\: #\])) + (else + (slib:warn "require.scm" 'unknown 'software-type (software-type)) + "/")))) + (lambda (chr) (and (memv chr suffi) #t)))) +;@ +(define (pathname->vicinity pathname) + (let loop ((i (- (string-length pathname) 1))) + (cond ((negative? i) "") + ((vicinity:suffix? (string-ref pathname i)) + (substring pathname 0 (+ i 1))) + (else (loop (- i 1)))))) +(define (program-vicinity) + (if *load-pathname* + (pathname->vicinity *load-pathname*) + (slib:error 'program-vicinity " called; use slib:load to load"))) +;@ +(define sub-vicinity + (case (software-type) + ((vms) (lambda (vic name) + (let ((l (string-length vic))) + (if (or (zero? (string-length vic)) + (not (char=? #\] (string-ref vic (- l 1))))) + (string-append vic "[" name "]") + (string-append (substring vic 0 (- l 1)) + "." name "]"))))) + (else (let ((*vicinity-suffix* + (case (software-type) + ((nosve) ".") + ((macos thinkc) ":") + ((ms-dos windows atarist os/2) "\\") + ((unix coherent plan9 amiga) "/")))) + (lambda (vic name) + (string-append vic name *vicinity-suffix*)))))) +;@ +(define (make-vicinity <pathname>) <pathname>) +;@ +(define with-load-pathname + (let ((exchange + (lambda (new) + (let ((old *load-pathname*)) + (set! *load-pathname* new) + old)))) + (lambda (path thunk) + (let ((old #f)) + (dynamic-wind + (lambda () (set! old (exchange path))) + thunk + (lambda () (exchange old))))))) + +;;@ SLIB:FEATURES is a list of symbols naming the (SLIB) features +;;; initially supported by this implementation. +(define slib:features + '( + source ;can load scheme source files + ;(SLIB:LOAD-SOURCE "filename") +;;; compiled ;can load compiled files + ;(SLIB:LOAD-COMPILED "filename") + vicinity + srfi-59 + srfi-96 + + ;; Scheme report features + ;; R5RS-compliant implementations should provide all 9 features. + +;;; r5rs ;conforms to + eval ;R5RS two-argument eval + values ;R5RS multiple values + dynamic-wind ;R5RS dynamic-wind + macro ;R5RS high level macros + +;;; delay ;has DELAY and FORCE +;;; "delay" is named "make-promise" in s7 + + multiarg-apply ;APPLY can take more than 2 args. + char-ready? + rev4-optional-procedures ;LIST-TAIL, STRING-COPY, + ;STRING-FILL!, and VECTOR-FILL! + + ;; These four features are optional in both R4RS and R5RS + + multiarg/and- ;/ and - can take more than 2 args. + rationalize +;;; transcript ;TRANSCRIPT-ON and TRANSCRIPT-OFF + with-file ;has WITH-INPUT-FROM-FILE and + ;WITH-OUTPUT-TO-FILE + +;;; r4rs ;conforms to + +;;; ieee-p1178 ;conforms to +;;; I don't know what ieee-p1178 is + +;;; r3rs ;conforms to +;;; I don't know what this means + +;;; rev2-procedures ;SUBSTRING-MOVE-LEFT!, + ;SUBSTRING-MOVE-RIGHT!, + ;SUBSTRING-FILL!, + ;STRING-NULL?, APPEND!, 1+, + ;-1+, <?, <=?, =?, >?, >=? +;;; object-hash ;has OBJECT-HASH + + full-continuation ;can return multiple times +;;; ieee-floating-point ;conforms to IEEE Standard 754-1985 + ;IEEE Standard for Binary + ;Floating-Point Arithmetic. +;;; if this means all the NaN and inf stuff, then s7 does not conform + + ;; Other common features + +;;; srfi-0 ;srfi-0, COND-EXPAND finds all srfi-* +;;; sicp ;runs code from Structure and + ;Interpretation of Computer + ;Programs by Abelson and Sussman. +;;; ?? never tried to run it + + defmacro ;has Common Lisp DEFMACRO +;;; syntax-case ;has syncase:eval and syncase:load +;;; record ;has user defined data structures + string-port ;has CALL-WITH-INPUT-STRING and + ;CALL-WITH-OUTPUT-STRING +;;; sort +;;; s7 has sort! but not merge etc + +;;; pretty-print + object->string + format ;Common-lisp output formatting +;;; trace ;has macros: TRACE and UNTRACE +;;; s7 does have these functions, but not "print-call-stack" + +;;; compiler ;has (COMPILER) +;;; ed ;(ED) is editor + system ;posix (system <string>) + getenv ;posix (getenv <string>) +;;; program-arguments ;returns list of strings (argv) +;;; current-time ;returns time in seconds since 1/1/1970 + + ;; Implementation Specific features + random + + )) + +;;@ (FILE-POSITION <port> . <k>) +(define (file-position . args) #f) + +;;@ (OUTPUT-PORT-WIDTH <port>) +(define (output-port-width . arg) 79) + +;;@ (OUTPUT-PORT-HEIGHT <port>) +(define (output-port-height . arg) 24) + +;;@ (CURRENT-ERROR-PORT) +(define current-error-port + (let ((port (current-output-port))) + (lambda () port))) + +;;@ (TMPNAM) makes a temporary file name. +(define tmpnam (let ((cntr 100)) + (lambda () (set! cntr (+ 1 cntr)) + (string-append "slib_" (number->string cntr))))) + +;;@ (FILE-EXISTS? <string>) +;(define (file-exists? f) #f) + +;;@ (DELETE-FILE <string>) +;(define (delete-file f) #f) + +;;@ FORCE-OUTPUT flushes any pending output on optional arg output port +;;; use this definition if your system doesn't have such a procedure. +(define (force-output . arg) #t) + +;;; CALL-WITH-INPUT-STRING and CALL-WITH-OUTPUT-STRING are the string +;;; port versions of CALL-WITH-*PUT-FILE. + +;;@ "rationalize" adjunct procedures. +;;(define (find-ratio x e) +;; (let ((rat (rationalize x e))) +;; (list (numerator rat) (denominator rat)))) +;;(define (find-ratio-between x y) +;; (find-ratio (/ (+ x y) 2) (/ (- x y) 2))) + +;;@ CHAR-CODE-LIMIT is one greater than the largest integer which can +;;; be returned by CHAR->INTEGER. +(define char-code-limit 256) + +;;@ MOST-POSITIVE-FIXNUM is used in modular.scm +;;(define most-positive-fixnum #x0FFFFFFF) + +;;@ Return argument +(define (identity x) x) + +;;@ SLIB:EVAL is single argument eval using the top-level (user) environment. +(define slib:eval eval) + +(define *defmacros* + (list (cons 'defmacro + (lambda (name parms . body) + `(set! *defmacros* (cons (cons ',name (lambda ,parms ,@body)) + *defmacros*)))))) +;@ +(define (defmacro? m) (and (assq m *defmacros*) #t)) +;@ +(define (macroexpand-1 e) + (if (pair? e) + (let ((a (car e))) + (cond ((symbol? a) (set! a (assq a *defmacros*)) + (if a (apply (cdr a) (cdr e)) e)) + (else e))) + e)) +;@ +(define (macroexpand e) + (if (pair? e) + (let ((a (car e))) + (cond ((symbol? a) + (set! a (assq a *defmacros*)) + (if a (macroexpand (apply (cdr a) (cdr e))) e)) + (else e))) + e)) +;@ +(define gentemp + (let ((*gensym-counter* -1)) + (lambda () + (set! *gensym-counter* (+ *gensym-counter* 1)) + (string->symbol + (string-append "slib:G" (number->string *gensym-counter*)))))) + +(define base:eval slib:eval) +;@ +(define (defmacro:eval x) (base:eval (defmacro:expand* x))) + +(define (defmacro:expand* x) + (slib:require 'defmacroexpand) (apply defmacro:expand* x '())) +;@ +(define (defmacro:load <pathname>) + (slib:eval-load <pathname> defmacro:eval)) +;@ +(define slib:warn + (lambda args + (let ((cep (current-error-port))) + (if (provided? 'trace) (print-call-stack cep)) + (display "Warn: " cep) + (for-each (lambda (x) (display #\space cep) (write x cep)) args) + (newline cep)))) + +;;@ define an error procedure for the library +(define slib:error + (let ((error error)) + (lambda args + (if (provided? 'trace) (print-call-stack (current-error-port))) + (apply error args)))) +;@ +(define (make-exchanger obj) + (lambda (rep) (let ((old obj)) (set! obj rep) old))) +(define (open-file filename modes) + (case modes + ((r rb) (open-input-file filename)) + ((w wb) (open-output-file filename)) + (else (slib:error 'open-file 'mode? modes)))) +(define (port? obj) (or (input-port? obj) (output-port? obj))) +(define (call-with-open-ports . ports) + (define proc (car ports)) + (cond ((procedure? proc) (set! ports (cdr ports))) + (else (set! ports (reverse ports)) + (set! proc (car ports)) + (set! ports (reverse (cdr ports))))) + (let ((ans (apply proc ports))) + (for-each close-port ports) + ans)) +(define (close-port port) + (cond ((input-port? port) + (close-input-port port) + (if (output-port? port) (close-output-port port))) + ((output-port? port) (close-output-port port)) + (else (slib:error 'close-port 'port? port)))) +;@ +(define (browse-url url) + (define (try cmd end) (zero? (system (string-append cmd url end)))) + (or (try "netscape-remote -remote 'openURL(" ")'") + (try "netscape -remote 'openURL(" ")'") + (try "netscape '" "'&") + (try "netscape '" "'"))) + +;;@ define these as appropriate for your system. +(define slib:tab (integer->char 9)) +(define slib:form-feed (integer->char 12)) + +;;@ Support for older versions of Scheme. Not enough code for its own file. +(define (last-pair l) (if (pair? (cdr l)) (last-pair (cdr l)) l)) +(define t #t) +(define nil #f) + +;;@ Define these if your implementation's syntax can support it and if +;;; they are not already defined. +(define (1+ n) (+ n 1)) +(define (-1+ n) (+ n -1)) +(define 1- -1+) + +;;@ Define SLIB:EXIT to be the implementation procedure to exit or +;;; return if exiting not supported. +(define slib:exit quit) + +;;@ Here for backward compatability +(define scheme-file-suffix + (let ((suffix (case (software-type) + ((nosve) "_scm") + (else ".scm")))) + (lambda () suffix))) + +;;@ (SLIB:LOAD-SOURCE "foo") should load "foo.scm" or with whatever +;;; suffix all the module files in SLIB have. See feature 'SOURCE. +(define (slib:load-source f) (load (string-append f ".scm"))) + +;;@ (SLIB:LOAD-COMPILED "foo") should load the file that was produced +;;; by compiling "foo.scm" if this implementation can compile files. +;;; See feature 'COMPILED. +(define slib:load-compiled load) + +;;@ At this point SLIB:LOAD must be able to load SLIB files. +(define slib:load slib:load-source) + +;;; If your implementation provides R4RS macros: +(define macro:eval slib:eval) +(define macro:load slib:load-source) + +;;; If your implementation provides syntax-case macros: +;;(define syncase:eval slib:eval) +;;(define syncase:load slib:load-source) + +(slib:load (in-vicinity (library-vicinity) "require")) diff --git a/saturate.txt b/saturate.txt index 4d73f79..6b03cdb 100644..100755 --- a/saturate.txt +++ b/saturate.txt @@ -1,5 +1,5 @@ ;"saturate.txt" Saturated-Colors Dictionary. -;Copyright 2002 Aubrey Jaffer +;Copyright 2002, 2010 Aubrey Jaffer ; ;Permission to copy this dictionary, to modify it, to redistribute it, ;to distribute modified versions, and to use it for any purpose is @@ -19,22 +19,24 @@ ;Saturated colors from "Approximate Colors on CIE Chromaticity Diagram" ;Francis S. Hill, "Computer Graphics" Macmillan, 1990, pg. 572 -"reddish orange" CIEXYZ:0.658471/0.341258/0.000271188 -"orange" CIEXYZ:0.602933/0.396497/0.000570581 -"yellowish orange" CIEXYZ:0.531897/0.467256/0.000847751 -"yellow" CIEXYZ:0.505818/0.493217/0.000965024 -"greenish yellow" CIEXYZ:0.465098/0.5338/0.00110199 -"yellow green" CIEXYZ:0.380466/0.617256/0.00227802 -"yellowish green" CIEXYZ:0.337396/0.658848/0.00375544 -"green" CIEXYZ:0.0388518/0.812016/0.149132 -"bluish green" CIEXYZ:0.00816803/0.538423/0.453409 -"blue green" CIEXYZ:0.0234599/0.412703/0.563837 -"greenish blue" CIEXYZ:0.0833989/0.156445/0.760156 -"blue" CIEXYZ:0.116102/0.0738583/0.81004 -"purplish blue" CIEXYZ:0.150985/0.0227402/0.826274 -"bluish purple" CIEXYZ:0.174724/0.00520914/0.820067 -"purple" CIEXYZ:0.180159/0.00770975/0.812132 -"reddish purple" CIEXYZ:0.195341/0.0146953/0.789964 -"red purple" CIEXYZ:0.224491/0.0281085/0.7474 -"purplish red" CIEXYZ:0.292779/0.0595298/0.647691 -"red" CIEXYZ:0.639974/0.219285/0.140741 +XCMS_COLORDB_START 0.1 +red CIEXYZ:0.735484/0.264516/0 +reddish orange CIEXYZ:0.647123/0.3525/0.00037723 +orange CIEXYZ:0.586144/0.413257/0.000598302 +yellowish orange CIEXYZ:0.531897/0.467256/0.000847751 +yellow CIEXYZ:0.499122/0.499899/0.000979355 +greenish yellow CIEXYZ:0.465098/0.5338/0.00110199 +yellow green CIEXYZ:0.373102/0.624451/0.0024476 +yellowish green CIEXYZ:0.22962/0.754329/0.0160512 +green CIEXYZ:0.0138702/0.750186/0.235943 +bluish green CIEXYZ:0.0453772/0.294952/0.659671 +blue green CIEXYZ:0.0687611/0.200711/0.730528 +greenish blue CIEXYZ:0.0912562/0.132684/0.77606 +blue CIEXYZ:0.0995467/0.11196/0.788494 +purplish blue CIEXYZ:0.14396/0.029703/0.826337 +bluish purple CIEXYZ:0.200614/0.0242655/0.77512 +purple CIEXYZ:0.263205/0.0523799/0.684415 +reddish purple CIEXYZ:0.354247/0.0932736/0.552479 +red purple CIEXYZ:0.479429/0.149503/0.371068 +purplish red CIEXYZ:0.604612/0.205731/0.189657 +XCMS_COLORDB_END diff --git a/sc4opt.scm b/sc4opt.scm index e3a7819..e3a7819 100644..100755 --- a/sc4opt.scm +++ b/sc4opt.scm diff --git a/sc4sc3.scm b/sc4sc3.scm index 1fa54b5..1fa54b5 100644..100755 --- a/sc4sc3.scm +++ b/sc4sc3.scm diff --git a/scaexpp.scm b/scaexpp.scm index aa058a6..aa058a6 100644..100755 --- a/scaexpp.scm +++ b/scaexpp.scm diff --git a/scaglob.scm b/scaglob.scm index 32a027c..32a027c 100644..100755 --- a/scaglob.scm +++ b/scaglob.scm diff --git a/scainit.scm b/scainit.scm index dd779e9..dd779e9 100644..100755 --- a/scainit.scm +++ b/scainit.scm diff --git a/scamacr.scm b/scamacr.scm index 9f7300a..9f7300a 100644..100755 --- a/scamacr.scm +++ b/scamacr.scm diff --git a/scanf.scm b/scanf.scm index a79595f..7604fb4 100644..100755 --- a/scanf.scm +++ b/scanf.scm @@ -1,5 +1,5 @@ ;;;;"scanf.scm" implemenation of formatted input -;Copyright (C) 1996, 1997, 2003 Aubrey Jaffer +;Copyright (C) 1996, 1997, 2003, 2010 Aubrey Jaffer ; ;Permission to copy this software, to modify it, to redistribute it, ;to distribute modified versions, and to use it for any purpose is @@ -23,6 +23,7 @@ ;;; functions starting from the POSIX man pages. (require 'string-port) +(require 'multiarg-apply) (require 'rev2-procedures) (require 'rev4-optional-procedures) @@ -314,6 +315,7 @@ (else (case (car sexp) ((vector-ref) `(lambda (,v) (vector-set! ,@(cdr sexp) ,v) #t)) + ((array-ref) `(lambda (,v) (array-set! ,(cadr sexp) ,v ,@(cddr sexp)) #t)) ((substring) `(lambda (,v) (substring-move-left! ,v 0 (min (string-length ,v) diff --git a/scaoutp.scm b/scaoutp.scm index b9730ca..b9730ca 100644..100755 --- a/scaoutp.scm +++ b/scaoutp.scm diff --git a/scheme2c.init b/scheme2c.init index 4f98f81..4f98f81 100644..100755 --- a/scheme2c.init +++ b/scheme2c.init diff --git a/scheme48.init b/scheme48.init index 4c67a10..e561712 100644 --- a/scheme48.init +++ b/scheme48.init @@ -549,7 +549,7 @@ ,collect ,batch off -,dump slib.image "(slib 3b1)" +,dump slib.image "(slib 3b5)" ;;; Put Scheme48-specific code into catalog (call-with-output-file (in-vicinity (implementation-vicinity) "implcat") diff --git a/schmooz.scm b/schmooz.scm index 39785f3..55103b9 100644..100755 --- a/schmooz.scm +++ b/schmooz.scm @@ -306,22 +306,32 @@ #\!)) '("deffn {Procedure}" "deffnx {Procedure}" "deffn") '("defun" "defunx" "defun")))))) + (define in-body? #f) (out-header args (car ops)) (let loop ((xdefs xdefs)) (cond ((pair? xdefs) (out-header (car xdefs) (cadr ops)) (loop (cdr xdefs))))) (for-each (lambda (subl) + ;;(print 'in-body? in-body? 'subl subl) (out 0 (car subl)) (for-each (lambda (l) (case (car l) ((@dfn) (out-cindex (cadr l))) ((@args) - (out-header - (cons (car args) (cdr l)) - (cadr ops))))) - (cdr subl))) + (cond + (in-body? + (out 0 "@end " (caddr ops)) + (set! in-body? #f) + (out-header (cons (car args) (cdr l)) + (car ops))) + (else + (out-header (cons (car args) (cdr l)) + (cadr ops))))))) + (cdr subl)) + (if (not (equal? "" (car subl))) + (set! in-body? #t))) (map (lambda (bl) (substitute-macs bl mac-list)) body)) @@ -344,9 +354,7 @@ (else (report "bad macro" l)))) (cdr subl))) - (map (lambda (bl) - (substitute-macs bl mac-list)) - body)) + (map (lambda (bl) (substitute-macs bl mac-list)) body)) (out 0 "@end defvar") (out 0))) diff --git a/schmooz.texi b/schmooz.texi index fc307e2..d54dfac 100644..100755 --- a/schmooz.texi +++ b/schmooz.texi @@ -17,8 +17,9 @@ existing file containing Scheme source code. @code{schmooz} extracts top-level comments containing schmooz commands from @var{filename}.scm and writes the converted Texinfo source to a file named @var{filename}.txi. +@end deffn -@deffnx Procedure schmooz filename@r{.texi} @dots{} +@deffn Procedure schmooz filename@r{.texi} @dots{} @deffnx Procedure schmooz filename@r{.tex} @dots{} @deffnx Procedure schmooz filename@r{.txi} @dots{} @var{Filename} should be a string naming an existing file containing diff --git a/scmacro.scm b/scmacro.scm index debc38a..debc38a 100644..100755 --- a/scmacro.scm +++ b/scmacro.scm diff --git a/scsh.init b/scsh.init index 80fd56e..80fd56e 100644..100755 --- a/scsh.init +++ b/scsh.init diff --git a/selfset.scm b/selfset.scm index 1d22b91..1d22b91 100644..100755 --- a/selfset.scm +++ b/selfset.scm diff --git a/sierpinski.scm b/sierpinski.scm index 1096bd5..1096bd5 100644..100755 --- a/sierpinski.scm +++ b/sierpinski.scm diff --git a/simetrix.scm b/simetrix.scm index e066daf..5d4a93a 100644..100755 --- a/simetrix.scm +++ b/simetrix.scm @@ -19,7 +19,7 @@ ;; Implements "Representation of numerical values and SI units in ;; character strings for information interchanges" -;; http://swiss.csail.mit.edu/~jaffer/MIXF +;; http://people.csail.mit.edu/jaffer/MIXF (require 'precedence-parse) (require 'string-port) @@ -196,7 +196,7 @@ (define (SI:expand-equivalence str) (call-with-input-string str (lambda (sport) - (define result (prec:parse SI:grammar 'EOS sport)) + (define result (prec:parse SI:grammar 'EOS 0 sport)) (cond ((eof-object? result) (list (cons 1 0))) ((symbol? result) (SI:expand-unit result)) (else result))))) @@ -226,16 +226,17 @@ ;;; Definitions accumulate in top-level variable *SYN-DEFS*. ;;(trace-all (in-vicinity (program-vicinity) "simetrix.scm")) +(define (list2string dyn lst) (list->string lst)) ;;; Character classes -(prec:define-grammar (tok:char-group 70 #\^ list->string)) -(prec:define-grammar (tok:char-group 49 #\. list->string)) -(prec:define-grammar (tok:char-group 50 #\/ list->string)) -(prec:define-grammar (tok:char-group 51 #\- list->string)) +(prec:define-grammar (tok:char-group 70 #\^ list2string)) +(prec:define-grammar (tok:char-group 49 #\. list2string)) +(prec:define-grammar (tok:char-group 50 #\/ list2string)) +(prec:define-grammar (tok:char-group 51 #\- list2string)) (prec:define-grammar (tok:char-group 40 tok:decimal-digits - (lambda (l) (string->number (list->string l))))) + (lambda (dyn l) (string->number (list->string l))))) (prec:define-grammar (tok:char-group 44 (string-append tok:upper-case tok:lower-case "@_") - list->string)) + list2string)) (prec:define-grammar (prec:prefix '- SI:minus 130)) (prec:define-grammar (prec:infix "." SI:dot 120 120)) diff --git a/sisc.init b/sisc.init index 630136b..862f25e 100644..100755 --- a/sisc.init +++ b/sisc.init @@ -345,8 +345,8 @@ (define macro:load slib:load-source) ;;; If your implementation provides syntax-case macros: -;;(define syncase:eval slib:eval) -;;(define syncase:load slib:load-source) +(define syncase:eval slib:eval) +(define syncase:load slib:load-source) ;@ (define gentemp gensym) @@ -1,11 +1,11 @@ .\" dummy line -.TH SLIB "Dec 20 2007" +.TH SLIB 1 "Feb 1 2007" .UC 4 .SH NAME SLIB \- Scheme Library .SH SYNOPSIS .B slib -[ scheme | scm | gsi | mzscheme | guile | scheme48 | larceny | scmlit | elk | sisc | kawa ] +[ scheme | scm | gsi | gosh | guile | scheme48 | larceny | scmlit | elk | sisc | kawa | mzscheme ] .br .sp 0.3 .SH DESCRIPTION @@ -1,4 +1,4 @@ -SLIB(Dec 20 2007) SLIB(Dec 20 2007) +SLIB(1) SLIB(1) @@ -6,13 +6,13 @@ NAME SLIB - Scheme Library SYNOPSIS - slib [ scheme | scm | gsi | mzscheme | guile | scheme48 | larceny | - scmlit | elk | sisc | kawa ] + slib [ scheme | scm | gsi | gosh | guile | scheme48 | larceny | scmlit + | elk | sisc | kawa | mzscheme ] DESCRIPTION "SLIB" is a portable library for the programming language "Scheme". It provides a platform independent framework for using "packages" of - Scheme procedures and syntax. As distributed, SLIB contains many use- + Scheme procedures and syntax. As distributed, SLIB contains many use‐ ful packages. Its catalog can be transparently extended to accomodate packages specific to a site, implementation, user, or directory. @@ -45,4 +45,4 @@ SEE ALSO -4th Berkeley Distribution SLIB(Dec 20 2007) +4th Berkeley Distribution Feb 1 2007 SLIB(1) diff --git a/slib.info b/slib.info index d4c570a..e43aa09 100644..100755 --- a/slib.info +++ b/slib.info @@ -1,14 +1,14 @@ -This is slib.info, produced by makeinfo version 4.8 from slib.texi. +This is slib-3b5.info, produced by makeinfo version 4.13 from slib.texi. | -This manual is for SLIB (version 3b1, February 2008), the portable | -Scheme library. +This manual is for SLIB (version 3b5, January 2015), the portable | +Scheme library. | Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. | +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, - Version 1.2 or any later version published by the Free Software + Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License." @@ -19,20 +19,20 @@ START-INFO-DIR-ENTRY END-INFO-DIR-ENTRY -File: slib.info, Node: Top, Next: The Library System, Prev: (dir), Up: (dir) - +File: slib-3b5.info, Node: Top, Next: The Library System, Prev: (dir), Up: (dir) + | SLIB **** -This manual is for SLIB (version 3b1, February 2008), the portable | -Scheme library. +This manual is for SLIB (version 3b5, January 2015), the portable | +Scheme library. | Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. | +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, - Version 1.2 or any later version published by the Free Software + Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License." @@ -50,8 +50,8 @@ Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, * Index:: -File: slib.info, Node: The Library System, Next: Universal SLIB Procedures, Prev: Top, Up: Top - +File: slib-3b5.info, Node: The Library System, Next: Universal SLIB Procedures, Prev: Top, Up: Top + | 1 The Library System ******************** @@ -72,8 +72,8 @@ implementation, user, or directory. * Compiling Scheme:: -File: slib.info, Node: Feature, Next: Require, Prev: The Library System, Up: The Library System - +File: slib-3b5.info, Node: Feature, Next: Require, Prev: The Library System, Up: The Library System + | 1.1 Feature =========== @@ -139,13 +139,14 @@ The generalization of `provided?' for arbitrary features and catalog is (1) scheme-implementation-type is the name symbol of the running Scheme implementation (RScheme, |STk|, Bigloo, chez, Elk, gambit, -guile, JScheme, kawa, MacScheme, MITScheme, Pocket-Scheme, Scheme48, -Scheme->C, Scheme48, Scsh, SISC, T, umb-scheme, or Vscm). Dependence on -scheme-implementation-type is almost always the wrong way to do things. +gauche, guile, JScheme, kawa, MacScheme, MITScheme, Pocket-Scheme, S7, | +Scheme48, Scheme->C, Scheme48, Scsh, SISC, T, umb-scheme, or Vscm). | +Dependence on scheme-implementation-type is almost always the wrong way | +to do things. | -File: slib.info, Node: Require, Next: Library Catalogs, Prev: Feature, Up: The Library System - +File: slib-3b5.info, Node: Require, Next: Library Catalogs, Prev: Feature, Up: The Library System + | 1.2 Require =========== @@ -157,7 +158,7 @@ files introducing procedures and syntax denoted by those features. will supply those features. The pathname can be either a string or a pair. If pathname is a pair then the first element should be a macro feature symbol, `source', `compiled', or one of the other - cases described in *Note Library Catalogs::. The cdr of the + cases described in *note Library Catalogs::. The cdr of the pathname should be either a string or a list. At the beginning of each section of this manual, there is a line like @@ -203,11 +204,11 @@ The catalog can also be queried using `slib:in-catalog?'. Returns a `CDR' of the catalog entry if one was found for the symbol FEATURE in the alist `*catalog*' (and transitively through any symbol aliases encountered). Otherwise, returns `#f'. The - format of catalog entries is explained in *Note Library Catalogs::. + format of catalog entries is explained in *note Library Catalogs::. -File: slib.info, Node: Library Catalogs, Next: Catalog Creation, Prev: Require, Up: The Library System - +File: slib-3b5.info, Node: Library Catalogs, Next: Catalog Creation, Prev: Require, Up: The Library System + | 1.3 Library Catalogs ==================== @@ -254,8 +255,8 @@ implementation. `macro:load's the Scheme source file <path>. -File: slib.info, Node: Catalog Creation, Next: Catalog Vicinities, Prev: Library Catalogs, Up: The Library System - +File: slib-3b5.info, Node: Catalog Creation, Next: Catalog Vicinities, Prev: Library Catalogs, Up: The Library System + | 1.4 Catalog Creation ==================== @@ -269,7 +270,9 @@ catalog: * additional packages of interest to this site. * packages specifically for the variety of Scheme which this session - is running. + is running. This catalog, if it exists, is the file `implcat' in + `implementation-invicinity', which is created by loading + `mkimpcat.scm' in `implementation-invicinity' if it exists. * packages this user wants to always have available. This catalog is the file `homecat' in the user's "HOME" directory. @@ -313,8 +316,8 @@ to be reloaded the next time the catalog is queried. will be loaded afresh. -File: slib.info, Node: Catalog Vicinities, Next: Compiling Scheme, Prev: Catalog Creation, Up: The Library System - +File: slib-3b5.info, Node: Catalog Vicinities, Next: Compiling Scheme, Prev: Catalog Creation, Up: The Library System + | 1.5 Catalog Vicinities ====================== @@ -391,8 +394,8 @@ registering its catalog associations: `catalog:read'. -File: slib.info, Node: Compiling Scheme, Prev: Catalog Vicinities, Up: The Library System - +File: slib-3b5.info, Node: Compiling Scheme, Prev: Catalog Vicinities, Up: The Library System + | 1.6 Compiling Scheme ==================== @@ -414,8 +417,8 @@ conventions. * Module Analysis:: -File: slib.info, Node: Module Conventions, Next: Module Manifests, Prev: Compiling Scheme, Up: Compiling Scheme - +File: slib-3b5.info, Node: Module Conventions, Next: Module Manifests, Prev: Compiling Scheme, Up: Compiling Scheme + | 1.6.1 Module Conventions ------------------------ @@ -461,8 +464,8 @@ loading modules until they are needed. While this reduces startup latency for interpreters, it can produce headaches for compilers. -File: slib.info, Node: Module Manifests, Next: Module Semantics, Prev: Module Conventions, Up: Compiling Scheme - +File: slib-3b5.info, Node: Module Manifests, Next: Module Semantics, Prev: Module Conventions, Up: Compiling Scheme + | 1.6.2 Module Manifests ---------------------- @@ -593,8 +596,8 @@ lists to report: sprintf printf fprintf stderr stdout stdin) -File: slib.info, Node: Module Semantics, Next: Top-level Variable References, Prev: Module Manifests, Up: Compiling Scheme - +File: slib-3b5.info, Node: Module Semantics, Next: Top-level Variable References, Prev: Module Manifests, Up: Compiling Scheme + | 1.6.3 Module Semantics ---------------------- @@ -627,14 +630,14 @@ using `feature-eval' (*note feature-eval: Feature.). The simplest way to compile these constructs may be to treat `provided?' as a macro. -File: slib.info, Node: Top-level Variable References, Next: Module Analysis, Prev: Module Semantics, Up: Compiling Scheme - +File: slib-3b5.info, Node: Top-level Variable References, Next: Module Analysis, Prev: Module Semantics, Up: Compiling Scheme + | 1.6.4 Top-level Variable References ----------------------------------- `(require 'top-refs)' -These procedures complement those in *Note Module Manifests:: by +These procedures complement those in *note Module Manifests:: by finding the top-level variable references in Scheme source code. They work by traversing expressions and definitions, keeping track of bindings encountered. It is certainly possible to foil these @@ -683,8 +686,8 @@ in the info file. This command excerpts the SLIB index into info -f slib2d6.info -n "Index" -o slib-index.info -File: slib.info, Node: Module Analysis, Prev: Top-level Variable References, Up: Compiling Scheme - +File: slib-3b5.info, Node: Module Analysis, Prev: Top-level Variable References, Up: Compiling Scheme + | 1.6.5 Module Analysis --------------------- @@ -721,8 +724,8 @@ File: slib.info, Node: Module Analysis, Prev: Top-level Variable References, prospective SLIB modules. -File: slib.info, Node: Universal SLIB Procedures, Next: Scheme Syntax Extension Packages, Prev: The Library System, Up: Top - +File: slib-3b5.info, Node: Universal SLIB Procedures, Next: Scheme Syntax Extension Packages, Prev: The Library System, Up: Top + | 2 Universal SLIB Procedures *************************** @@ -738,8 +741,8 @@ implementations as part of the `*.init' files or by `require.scm'. * Miscellany:: -File: slib.info, Node: Vicinity, Next: Configuration, Prev: Universal SLIB Procedures, Up: Universal SLIB Procedures - +File: slib-3b5.info, Node: Vicinity, Next: Configuration, Prev: Universal SLIB Procedures, Up: Universal SLIB Procedures + | 2.1 Vicinity ============ @@ -823,8 +826,8 @@ a vicinity is a string. the value returned by THUNK. -File: slib.info, Node: Configuration, Next: Input/Output, Prev: Vicinity, Up: Universal SLIB Procedures - +File: slib-3b5.info, Node: Configuration, Next: Input/Output, Prev: Vicinity, Up: Universal SLIB Procedures + | 2.2 Configuration ================= @@ -862,7 +865,7 @@ implementations. implementation and the name of the operating system. An unspecified value is returned. - (slib:report-version) => slib "3b1" on scm "5b1" on unix | + (slib:report-version) => slib "3b5" on scm "5b1" on unix | -- Function: slib:report Displays the information of `(slib:report-version)' followed by @@ -873,11 +876,11 @@ implementations. provides a more verbose listing. -- Function: slib:report filename - Writes the report to file `filename'. + Writes the verbose report to file `filename'. (slib:report) => - slib "3b1" on scm "5b1" on unix | + slib "3b5" on scm "5b1" on unix | (implementation-vicinity) is "/usr/local/lib/scm/" (library-vicinity) is "/usr/local/lib/slib/" (scheme-file-suffix) is ".scm" @@ -901,8 +904,8 @@ implementations. ... -File: slib.info, Node: Input/Output, Next: System, Prev: Configuration, Up: Universal SLIB Procedures - +File: slib-3b5.info, Node: Input/Output, Next: System, Prev: Configuration, Up: Universal SLIB Procedures + | 2.3 Input/Output ================ @@ -990,7 +993,7 @@ These procedures are provided by all implementations. -- Function: file-position port k PORT must be open to a file. `file-position' sets the current position in PORT which will next be read or written. If - successful, `#f' is returned; otherwise `file-position' returns + successful, `#t' is returned; otherwise `file-position' returns `#f'. -- Function: output-port-width @@ -1006,8 +1009,8 @@ These procedures are provided by all implementations. determined 24 is returned. -File: slib.info, Node: System, Next: Miscellany, Prev: Input/Output, Up: Universal SLIB Procedures - +File: slib-3b5.info, Node: System, Next: Miscellany, Prev: Input/Output, Up: Universal SLIB Procedures + | 2.4 System ========== @@ -1036,7 +1039,7 @@ These procedures are provided by all implementations. -- Procedure: slib:eval obj `eval' returns the value of OBJ evaluated in the current top level - environment. *Note Eval:: provides a more general evaluation + environment. *note Eval:: provides a more general evaluation facility. -- Procedure: slib:eval-load filename eval @@ -1044,7 +1047,8 @@ These procedures are provided by all implementations. the Scheme source code expressions and definitions are read from the file and EVAL called with them sequentially. The `slib:eval-load' procedure does not affect the values returned by - `current-input-port' and `current-output-port'. + `current-input-port', `current-error-port', and + `current-output-port'. -- Procedure: slib:warn arg1 arg2 ... Outputs a warning message containing the arguments. @@ -1078,8 +1082,8 @@ These procedures are provided by all implementations. when the browser exits; otherwise (if no browser) it returns `#f'. -File: slib.info, Node: Miscellany, Prev: System, Up: Universal SLIB Procedures - +File: slib-3b5.info, Node: Miscellany, Prev: System, Up: Universal SLIB Procedures + | 2.5 Miscellany ============== @@ -1149,8 +1153,8 @@ implementations. == (cons 2 '()) -File: slib.info, Node: Scheme Syntax Extension Packages, Next: Textual Conversion Packages, Prev: Universal SLIB Procedures, Up: Top - +File: slib-3b5.info, Node: Scheme Syntax Extension Packages, Next: Textual Conversion Packages, Prev: Universal SLIB Procedures, Up: Top + | 3 Scheme Syntax Extension Packages ********************************** @@ -1169,14 +1173,15 @@ Syntax extensions (macros) included with SLIB. * Define-Structure:: 'structure * Define-Record-Type:: 'define-record-type, 'srfi-9 * Fluid-Let:: 'fluid-let +* Parameter Objects:: 'srfi-39 * Binding to multiple values:: 'receive, 'srfi-8 * Guarded LET* special form:: 'and-let*, 'srfi-2 * Guarded COND Clause:: 'guarded-cond-clause, 'srfi-61 * Yasos:: 'yasos, 'oop, 'collect -File: slib.info, Node: Defmacro, Next: R4RS Macros, Prev: Scheme Syntax Extension Packages, Up: Scheme Syntax Extension Packages - +File: slib-3b5.info, Node: Defmacro, Next: R4RS Macros, Prev: Scheme Syntax Extension Packages, Up: Scheme Syntax Extension Packages + | 3.1 Defmacro ============ @@ -1197,8 +1202,9 @@ Defmacros are supported by all implementations. the `defmacro:load' procedure reads Scheme source code expressions and definitions from the file and evaluates them sequentially. These source code expressions and definitions may contain defmacro - definitions. The `macro:load' procedure does not affect the values - returned by `current-input-port' and `current-output-port'. + definitions. The `defmacro:load' procedure does not affect the + values returned by `current-input-port', `current-error-port', and + `current-output-port'. -- Function: defmacro? sym Returns `#t' if SYM has been defined by `defmacro', `#f' otherwise. @@ -1229,8 +1235,8 @@ Defmacros are supported by all implementations. E. -File: slib.info, Node: R4RS Macros, Next: Macro by Example, Prev: Defmacro, Up: Scheme Syntax Extension Packages - +File: slib-3b5.info, Node: R4RS Macros, Next: Macro by Example, Prev: Defmacro, Up: Scheme Syntax Extension Packages + | 3.2 R4RS Macros =============== @@ -1252,15 +1258,16 @@ interface: -- Procedure: macro:load filename FILENAME should be a string. If filename names an existing file, - the `macro:load' procedure reads Scheme source code expressions and - definitions from the file and evaluates them sequentially. These - source code expressions and definitions may contain macro + the `macro:load' procedure reads Scheme source code expressions + and definitions from the file and evaluates them sequentially. + These source code expressions and definitions may contain macro definitions. The `macro:load' procedure does not affect the - values returned by `current-input-port' and `current-output-port'. + values returned by `current-input-port', `current-error-port', and + `current-output-port'. -File: slib.info, Node: Macro by Example, Next: Macros That Work, Prev: R4RS Macros, Up: Scheme Syntax Extension Packages - +File: slib-3b5.info, Node: Macro by Example, Next: Macros That Work, Prev: R4RS Macros, Up: Scheme Syntax Extension Packages + | 3.3 Macro by Example ==================== @@ -1293,7 +1300,7 @@ disaster unless you're using system-function names as local variables with unintuitive bindings that the macro can't use. However, if you must have the full `r4rs' macro functionality, look to the more featureful (but also more expensive) versions of syntax-rules available -in slib *Note Macros That Work::, *Note Syntactic Closures::, and *Note +in slib *note Macros That Work::, *note Syntactic Closures::, and *note Syntax-Case Macros::. -- Macro: define-syntax keyword transformer-spec @@ -1334,8 +1341,8 @@ Syntax-Case Macros::. variable or literal identifier. -File: slib.info, Node: Macros That Work, Next: Syntactic Closures, Prev: Macro by Example, Up: Scheme Syntax Extension Packages - +File: slib-3b5.info, Node: Macros That Work, Next: Syntactic Closures, Prev: Macro by Example, Up: Scheme Syntax Extension Packages + | 3.4 Macros That Work ==================== @@ -1359,11 +1366,12 @@ expression types. -- Procedure: macro:load filename -- Procedure: macwork:load filename FILENAME should be a string. If filename names an existing file, - the `macro:load' procedure reads Scheme source code expressions and - definitions from the file and evaluates them sequentially. These - source code expressions and definitions may contain macro + the `macro:load' procedure reads Scheme source code expressions + and definitions from the file and evaluates them sequentially. + These source code expressions and definitions may contain macro definitions. The `macro:load' procedure does not affect the - values returned by `current-input-port' and `current-output-port'. + values returned by `current-input-port', `current-error-port', and + `current-output-port'. References: @@ -1517,8 +1525,8 @@ variables or inserted identifiers, then the big chunk will be copied unnecessarily. That shouldn't matter very often. -File: slib.info, Node: Syntactic Closures, Next: Syntax-Case Macros, Prev: Macros That Work, Up: Scheme Syntax Extension Packages - +File: slib-3b5.info, Node: Syntactic Closures, Next: Syntax-Case Macros, Prev: Macros That Work, Up: Scheme Syntax Extension Packages + | 3.5 Syntactic Closures ====================== @@ -1538,11 +1546,12 @@ File: slib.info, Node: Syntactic Closures, Next: Syntax-Case Macros, Prev: Ma -- Procedure: macro:load filename -- Procedure: synclo:load filename FILENAME should be a string. If filename names an existing file, - the `macro:load' procedure reads Scheme source code expressions and - definitions from the file and evaluates them sequentially. These - source code expressions and definitions may contain macro + the `macro:load' procedure reads Scheme source code expressions + and definitions from the file and evaluates them sequentially. + These source code expressions and definitions may contain macro definitions. The `macro:load' procedure does not affect the - values returned by `current-input-port' and `current-output-port'. + values returned by `current-input-port', `current-error-port', and + `current-output-port'. 3.5.1 Syntactic Closure Macro Facility -------------------------------------- @@ -1925,8 +1934,8 @@ Alan Bawden (who prefers to call them "synthetic names"). Much of this proposal is derived from an earlier proposal by Alan Bawden. -File: slib.info, Node: Syntax-Case Macros, Next: Define-Structure, Prev: Syntactic Closures, Up: Scheme Syntax Extension Packages - +File: slib-3b5.info, Node: Syntax-Case Macros, Next: Define-Structure, Prev: Syntactic Closures, Up: Scheme Syntax Extension Packages + | 3.6 Syntax-Case Macros ====================== @@ -1946,11 +1955,12 @@ File: slib.info, Node: Syntax-Case Macros, Next: Define-Structure, Prev: Synt -- Procedure: macro:load filename -- Procedure: syncase:load filename FILENAME should be a string. If filename names an existing file, - the `macro:load' procedure reads Scheme source code expressions and - definitions from the file and evaluates them sequentially. These - source code expressions and definitions may contain macro + the `macro:load' procedure reads Scheme source code expressions + and definitions from the file and evaluates them sequentially. + These source code expressions and definitions may contain macro definitions. The `macro:load' procedure does not affect the - values returned by `current-input-port' and `current-output-port'. + values returned by `current-input-port', `current-error-port', and + `current-output-port'. This is version 2.1 of `syntax-case', the low-level macro facility proposed and implemented by Robert Hieb and R. Kent Dybvig. @@ -2028,17 +2038,17 @@ if there is some incompatibility that is not flagged as such. (dyb @ iuvax.cs.indiana.edu). -File: slib.info, Node: Define-Structure, Next: Define-Record-Type, Prev: Syntax-Case Macros, Up: Scheme Syntax Extension Packages - +File: slib-3b5.info, Node: Define-Structure, Next: Define-Record-Type, Prev: Syntax-Case Macros, Up: Scheme Syntax Extension Packages + | 3.7 Define-Structure ==================== `(require 'structure)' Included with the `syntax-case' files was `structure.scm' which defines -a macro `define-structure'. Here is its documentation from Gambit 4.0: +a macro `define-structure'. Here is its documentation from Gambit-4.0: | - -- special form: define-structure NAME FIELD... + -- special form: define-structure (NAME FIELD...) | Record data types similar to Pascal records and C `struct' types can be defined using the `define-structure' special form. The identifier NAME specifies the name of the new data type. The @@ -2067,7 +2077,11 @@ a macro `define-structure'. Here is its documentation from Gambit 4.0: For example: - > (define-structure point x y color) + > (require 'syntax-case) | + > (require 'repl) | + > (repl:top-level macro:eval) | + > (require 'structure) | + > (define-structure (point x y color)) | > (define p (make-point 3 5 'red)) > p #<point #3 x: 3 y: 5 color: red> @@ -2081,8 +2095,8 @@ a macro `define-structure'. Here is its documentation from Gambit 4.0: -File: slib.info, Node: Define-Record-Type, Next: Fluid-Let, Prev: Define-Structure, Up: Scheme Syntax Extension Packages - +File: slib-3b5.info, Node: Define-Record-Type, Next: Fluid-Let, Prev: Define-Structure, Up: Scheme Syntax Extension Packages + | 3.8 Define-Record-Type ====================== @@ -2100,13 +2114,17 @@ File: slib.info, Node: Define-Record-Type, Next: Fluid-Let, Prev: Define-Stru module. -File: slib.info, Node: Fluid-Let, Next: Binding to multiple values, Prev: Define-Record-Type, Up: Scheme Syntax Extension Packages - +File: slib-3b5.info, Node: Fluid-Let, Next: Parameter Objects, Prev: Define-Record-Type, Up: Scheme Syntax Extension Packages + | 3.9 Fluid-Let ============= `(require 'fluid-let)' + _Note:_ `fluid-let' is not thread-safe. It is better to use *note | + Parameter Objects:: (srfi-39) or *note Dynamic Data Type::, both of | + which will be made thread-safe in the future. | + | -- Syntax: fluid-let `(BINDINGS ...)' FORMS... (fluid-let ((VARIABLE INIT) ...) @@ -2125,9 +2143,19 @@ each INIT to the binding (determined by the rules of lexical scoping) of its corresponding VARIABLE. -File: slib.info, Node: Binding to multiple values, Next: Guarded LET* special form, Prev: Fluid-Let, Up: Scheme Syntax Extension Packages - -3.10 Binding to multiple values +File: slib-3b5.info, Node: Parameter Objects, Next: Binding to multiple values, Prev: Fluid-Let, Up: Scheme Syntax Extension Packages + | +3.10 Parameter Objects | +====================== | + | +`(require 'srfi-39)' | + | + `http://srfi.schemers.org/srfi-39/srfi-39.html' | + | + +File: slib-3b5.info, Node: Binding to multiple values, Next: Guarded LET* special form, Prev: Parameter Objects, Up: Scheme Syntax Extension Packages + | +3.11 Binding to multiple values | =============================== `(require 'receive)' or `(require 'srfi-8)' @@ -2142,9 +2170,9 @@ File: slib.info, Node: Binding to multiple values, Next: Guarded LET* special `http://srfi.schemers.org/srfi-11/srfi-11.html' -File: slib.info, Node: Guarded LET* special form, Next: Guarded COND Clause, Prev: Binding to multiple values, Up: Scheme Syntax Extension Packages - -3.11 Guarded LET* special form +File: slib-3b5.info, Node: Guarded LET* special form, Next: Guarded COND Clause, Prev: Binding to multiple values, Up: Scheme Syntax Extension Packages + | +3.12 Guarded LET* special form | ============================== `(require 'and-let*)' or `(require 'srfi-2)' @@ -2153,9 +2181,9 @@ File: slib.info, Node: Guarded LET* special form, Next: Guarded COND Clause, `http://srfi.schemers.org/srfi-2/srfi-2.html' -File: slib.info, Node: Guarded COND Clause, Next: Yasos, Prev: Guarded LET* special form, Up: Scheme Syntax Extension Packages - -3.12 Guarded COND Clause +File: slib-3b5.info, Node: Guarded COND Clause, Next: Yasos, Prev: Guarded LET* special form, Up: Scheme Syntax Extension Packages + | +3.13 Guarded COND Clause | ======================== `(require 'guarded-cond-clause)' or `(require 'srfi-61)' @@ -2203,9 +2231,9 @@ list of all the characters it produces until the end. (call-with-input-string "foo" port->char-list) ==> (#\f #\o #\o) -File: slib.info, Node: Yasos, Prev: Guarded COND Clause, Up: Scheme Syntax Extension Packages - -3.13 Yasos +File: slib-3b5.info, Node: Yasos, Prev: Guarded COND Clause, Up: Scheme Syntax Extension Packages + | +3.14 Yasos | ========== `(require 'oop)' or `(require 'yasos)' @@ -2217,8 +2245,10 @@ on LISP and Functional Programming, July 1988 [ACM #552880]. Another reference is: - Ken Dickey. Scheming with Objects `AI Expert' Volume 7, Number 10 -(October 1992), pp. 24-33. + Ken Dickey. | +Scheming with Objects | +`AI Expert' Volume 7, Number 10 (October 1992), pp. 24-33. | +`ftp://ftp.cs.indiana.edu/pub/scheme-repository/doc/pubs/swob.txt' | * Menu: @@ -2228,9 +2258,9 @@ on LISP and Functional Programming, July 1988 [ACM #552880]. * Yasos examples:: Usage of Yasos and setters. -File: slib.info, Node: Yasos terms, Next: Yasos interface, Prev: Yasos, Up: Yasos - -3.13.1 Terms +File: slib-3b5.info, Node: Yasos terms, Next: Yasos interface, Prev: Yasos, Up: Yasos + | +3.14.1 Terms | ------------ "Object" @@ -2259,9 +2289,9 @@ _Disclaimer:_ reasonable). See the L&FP paper for some suggestions. -File: slib.info, Node: Yasos interface, Next: Setters, Prev: Yasos terms, Up: Yasos - -3.13.2 Interface +File: slib-3b5.info, Node: Yasos interface, Next: Setters, Prev: Yasos terms, Up: Yasos + | +3.14.2 Interface | ---------------- -- Syntax: define-operation `('opname self arg ...`)' DEFAULT-BODY @@ -2276,7 +2306,7 @@ File: slib.info, Node: Yasos interface, Next: Setters, Prev: Yasos terms, Up -- Syntax: object `((NAME SELF ARG ...) BODY)' ... Returns an object (an instance of the object system) with - operations. Invoking `(NAME OBJECT ARG ...' executes the BODY of + operations. Invoking `(NAME OBJECT ARG ...)' executes the BODY of | the OBJECT with SELF bound to OBJECT and with argument(s) ARG.... -- Syntax: object-with-ancestors `(('ancestor1 init1`)' ...`)' @@ -2305,9 +2335,9 @@ File: slib.info, Node: Yasos interface, Next: Setters, Prev: Yasos terms, Up (*note Collections::) may override the default in an obvious way. -File: slib.info, Node: Setters, Next: Yasos examples, Prev: Yasos interface, Up: Yasos - -3.13.3 Setters +File: slib-3b5.info, Node: Setters, Next: Yasos examples, Prev: Yasos interface, Up: Yasos + | +3.14.3 Setters | -------------- "Setters" implement "generalized locations" for objects associated with @@ -2363,9 +2393,9 @@ through `setf'. return value is unspecified. -File: slib.info, Node: Yasos examples, Prev: Setters, Up: Yasos - -3.13.4 Examples +File: slib-3b5.info, Node: Yasos examples, Prev: Setters, Up: Yasos + | +3.14.4 Examples | --------------- ;;; These definitions for PRINT and SIZE are @@ -2463,8 +2493,8 @@ File: slib.info, Node: Yasos examples, Prev: Setters, Up: Yasos => 2 -File: slib.info, Node: Textual Conversion Packages, Next: Mathematical Packages, Prev: Scheme Syntax Extension Packages, Up: Top - +File: slib-3b5.info, Node: Textual Conversion Packages, Next: Mathematical Packages, Prev: Scheme Syntax Extension Packages, Up: Top + | 4 Textual Conversion Packages ***************************** @@ -2486,8 +2516,8 @@ File: slib.info, Node: Textual Conversion Packages, Next: Mathematical Package * Schmooz:: Documentation markup for Scheme programs -File: slib.info, Node: Precedence Parsing, Next: Format, Prev: Textual Conversion Packages, Up: Textual Conversion Packages - +File: slib-3b5.info, Node: Precedence Parsing, Next: Format, Prev: Textual Conversion Packages, Up: Textual Conversion Packages + | 4.1 Precedence Parsing ====================== @@ -2514,8 +2544,8 @@ This package implements: * Grammar Rule Definition:: -File: slib.info, Node: Precedence Parsing Overview, Next: Rule Types, Prev: Precedence Parsing, Up: Precedence Parsing - +File: slib-3b5.info, Node: Precedence Parsing Overview, Next: Rule Types, Prev: Precedence Parsing, Up: Precedence Parsing + | 4.1.1 Precedence Parsing Overview --------------------------------- @@ -2549,7 +2579,7 @@ A syntax tree is not built unless the rules explicitly do so. The call graph of grammar rules effectively instantiate the sytnax tree. The JACAL symbolic math system -(`http://swiss.csail.mit.edu/~jaffer/JACAL') uses precedence-parse. +(`http://people.csail.mit.edu/jaffer/JACAL') uses precedence-parse. Its grammar definitions in the file `jacal/English.scm' can serve as examples of use. @@ -2559,13 +2589,13 @@ examples of use. file) with a non-trivial grammar utilizing all constructs. -File: slib.info, Node: Rule Types, Next: Ruleset Definition and Use, Prev: Precedence Parsing Overview, Up: Precedence Parsing - +File: slib-3b5.info, Node: Rule Types, Next: Ruleset Definition and Use, Prev: Precedence Parsing Overview, Up: Precedence Parsing + | 4.1.2 Rule Types ---------------- Here are the higher-level syntax types and an example of each. -Precedence considerations are omitted for clarity. See *Note Grammar +Precedence considerations are omitted for clarity. See *note Grammar Rule Definition:: for full details. -- Grammar: nofix bye exit @@ -2609,8 +2639,8 @@ Rule Definition:: for full details. delimits the extent of the restfix operator `set'. -File: slib.info, Node: Ruleset Definition and Use, Next: Token definition, Prev: Rule Types, Up: Precedence Parsing - +File: slib-3b5.info, Node: Ruleset Definition and Use, Next: Token definition, Prev: Rule Types, Up: Precedence Parsing + | 4.1.3 Ruleset Definition and Use -------------------------------- @@ -2640,8 +2670,8 @@ variable (for use when calling `prec:parse'). (define my-ruleset *syn-defs*) - -- Function: prec:parse ruleset delim - -- Function: prec:parse ruleset delim port + -- Function: prec:parse ruleset delim column + -- Function: prec:parse ruleset delim column port The RULESET argument must be a list of rules as constructed by `prec:define-grammar' and extracted from *SYN-DEFS*. @@ -2657,6 +2687,10 @@ variable (for use when calling `prec:parse'). first character past the end of the external representation of the object. + For the purpose of reporting problems in error messages, this + package keeps track of the "current column". Its initial value is + passed as the third argument to `prec:parse'. + If an end of file is encountered in the input before any characters are found that can begin an object, then an end of file object is returned. If a delimiter (such as DELIM) is found @@ -2668,8 +2702,8 @@ variable (for use when calling `prec:parse'). from a closed port. -File: slib.info, Node: Token definition, Next: Nud and Led Definition, Prev: Ruleset Definition and Use, Up: Precedence Parsing - +File: slib-3b5.info, Node: Token definition, Next: Nud and Led Definition, Prev: Ruleset Definition and Use, Up: Precedence Parsing + | 4.1.4 Token definition ---------------------- @@ -2722,17 +2756,9 @@ The following convenient constants are provided for use with Is the string consisting of all characters between 0 and 255 for which `char-whitespace?' returns true. -For the purpose of reporting problems in error messages, this package -keeps track of the "current column". When the column does not simply -track input characters, `tok:bump-column' can be used to adjust the -current-column. - - -- Function: tok:bump-column pos port - Adds POS to the current-column for input-port PORT. - -File: slib.info, Node: Nud and Led Definition, Next: Grammar Rule Definition, Prev: Token definition, Up: Precedence Parsing - +File: slib-3b5.info, Node: Nud and Led Definition, Next: Grammar Rule Definition, Prev: Token definition, Up: Precedence Parsing + | 4.1.5 Nud and Led Definition ---------------------------- @@ -2789,13 +2815,13 @@ If no LED has been defined for a token, and LEFT is set, the parser issues a warning. -File: slib.info, Node: Grammar Rule Definition, Prev: Nud and Led Definition, Up: Precedence Parsing - +File: slib-3b5.info, Node: Grammar Rule Definition, Prev: Nud and Led Definition, Up: Precedence Parsing + | 4.1.6 Grammar Rule Definition ----------------------------- Here are procedures for defining rules for the syntax types introduced -in *Note Precedence Parsing Overview::. +in *note Precedence Parsing Overview::. For the rule-defining procedures that follow, the variable TK may be a character, string, or symbol, or a list composed of characters, @@ -2961,8 +2987,8 @@ will both match token strings; i.e. tokens resulting from token groups. ... are forgotten. -File: slib.info, Node: Format, Next: Standard Formatted I/O, Prev: Precedence Parsing, Up: Textual Conversion Packages - +File: slib-3b5.info, Node: Format, Next: Standard Formatted I/O, Prev: Precedence Parsing, Up: Textual Conversion Packages + | 4.2 Format (version 3.1) ======================== @@ -2974,8 +3000,8 @@ File: slib.info, Node: Format, Next: Standard Formatted I/O, Prev: Precedence * Format Specification:: -File: slib.info, Node: Format Interface, Next: Format Specification, Prev: Format, Up: Format - +File: slib-3b5.info, Node: Format Interface, Next: Format Specification, Prev: Format, Up: Format + | 4.2.1 Format Interface ---------------------- @@ -3003,15 +3029,11 @@ File: slib.info, Node: Format Interface, Next: Format Specification, Prev: Fo tilde (~). For a detailed description of the FORMAT-STRING syntax please consult a Common LISP format reference manual. For a test suite to verify this format implementation load `formatst.scm'. - Please send bug reports to `lutzeb@cs.tu-berlin.de'. - - Note: `format' is not reentrant, i.e. only one `format'-call may - be executed at a time. -File: slib.info, Node: Format Specification, Prev: Format Interface, Up: Format - +File: slib-3b5.info, Node: Format Specification, Prev: Format Interface, Up: Format + | 4.2.2 Format Specification (Format version 3.1) ----------------------------------------------- @@ -3438,8 +3460,8 @@ Scheme->C 01nov91: because it requires other components provided by SLIB. -File: slib.info, Node: Standard Formatted I/O, Next: Programs and Arguments, Prev: Format, Up: Textual Conversion Packages - +File: slib-3b5.info, Node: Standard Formatted I/O, Next: Programs and Arguments, Prev: Format, Up: Textual Conversion Packages + | 4.3 Standard Formatted I/O ========================== @@ -3465,8 +3487,8 @@ File: slib.info, Node: Standard Formatted I/O, Next: Programs and Arguments, Defined to be `(current-error-port)'. -File: slib.info, Node: Standard Formatted Output, Next: Standard Formatted Input, Prev: Standard Formatted I/O, Up: Standard Formatted I/O - +File: slib-3b5.info, Node: Standard Formatted Output, Next: Standard Formatted Input, Prev: Standard Formatted I/O, Up: Standard Formatted I/O + | 4.3.2 Standard Formatted Output ------------------------------- @@ -3577,8 +3599,8 @@ File: slib.info, Node: Standard Formatted Output, Next: Standard Formatted Inp For the `%f', `%e', and `%E' conversions, the precision specifies how many digits follow the decimal-point character. - The default precision is `6'. If the precision is - explicitly `0', the decimal point character is suppressed. + The default precision is `6'. If the precision is explicitly + `0', the decimal point character is suppressed. For the `%g' and `%G' conversions, the precision specifies how many significant digits to print. Significant digits are the @@ -3602,8 +3624,7 @@ File: slib.info, Node: Standard Formatted Output, Next: Standard Formatted Inp * A character that specifies the conversion to be applied. -4.3.2.1 Exact Conversions -......................... + Exact Conversions | `b', `B' Print an integer as an unsigned binary number. @@ -3626,8 +3647,7 @@ File: slib.info, Node: Standard Formatted Output, Next: Standard Formatted Inp prints using the digits `0123456789abcdef'. `%X' prints using the digits `0123456789ABCDEF'. -4.3.2.2 Inexact Conversions -........................... + Inexact Conversions | `f' Print a floating-point number in fixed-point notation. @@ -3651,8 +3671,7 @@ File: slib.info, Node: Standard Formatted Output, Next: Standard Formatted Inp dot between number and prefix, `%k' does not. -4.3.2.3 Other Conversions -......................... + Other Conversions | `c' Print a single character. The `-' flag is the only one which @@ -3680,8 +3699,8 @@ File: slib.info, Node: Standard Formatted Output, Next: Standard Formatted Inp modifiers with `%%'. -File: slib.info, Node: Standard Formatted Input, Prev: Standard Formatted Output, Up: Standard Formatted I/O - +File: slib-3b5.info, Node: Standard Formatted Input, Prev: Standard Formatted Output, Up: Standard Formatted I/O + | 4.3.3 Standard Formatted Input ------------------------------ @@ -3839,8 +3858,8 @@ File: slib.info, Node: Standard Formatted Input, Prev: Standard Formatted Outp offending character is left unread in the input stream. -File: slib.info, Node: Programs and Arguments, Next: HTML, Prev: Standard Formatted I/O, Up: Textual Conversion Packages - +File: slib-3b5.info, Node: Programs and Arguments, Next: HTML, Prev: Standard Formatted I/O, Up: Textual Conversion Packages + | 4.4 Program and Arguments ========================= @@ -3854,8 +3873,8 @@ File: slib.info, Node: Programs and Arguments, Next: HTML, Prev: Standard For * Batch:: 'batch -File: slib.info, Node: Getopt, Next: Command Line, Prev: Programs and Arguments, Up: Programs and Arguments - +File: slib-3b5.info, Node: Getopt, Next: Command Line, Prev: Programs and Arguments, Up: Programs and Arguments + | 4.4.1 Getopt ------------ @@ -3952,9 +3971,9 @@ replaced them with a global variable: Example: #! /usr/local/bin/scm - (require 'program-arguments) | + (require 'program-arguments) (require 'getopt) - (define argv (program-arguments)) | + (define argv (program-arguments)) (define opts ":a:b:cd") (let loop ((opt (getopt (length argv) argv opts))) @@ -4011,8 +4030,8 @@ replaced them with a global variable: 5 #f "35234.342" -File: slib.info, Node: Command Line, Next: Parameter lists, Prev: Getopt, Up: Programs and Arguments - +File: slib-3b5.info, Node: Command Line, Next: Parameter lists, Prev: Getopt, Up: Programs and Arguments + | 4.4.3 Command Line ------------------ @@ -4085,8 +4104,8 @@ File: slib.info, Node: Command Line, Next: Parameter lists, Prev: Getopt, Up returned. -File: slib.info, Node: Parameter lists, Next: Getopt Parameter lists, Prev: Command Line, Up: Programs and Arguments - +File: slib-3b5.info, Node: Parameter lists, Next: Getopt Parameter lists, Prev: Command Line, Up: Programs and Arguments + | 4.4.4 Parameter lists --------------------- @@ -4181,8 +4200,8 @@ of `arities' can be: argument position the corresponding parameter should appear. -File: slib.info, Node: Getopt Parameter lists, Next: Filenames, Prev: Parameter lists, Up: Programs and Arguments - +File: slib-3b5.info, Node: Getopt Parameter lists, Next: Filenames, Prev: Parameter lists, Up: Programs and Arguments + | 4.4.5 Getopt Parameter lists ---------------------------- @@ -4267,12 +4286,12 @@ the options (and argument strings DESC ...) are printed to ERROR: getopt->parameter-list "unrecognized option" "-?" -File: slib.info, Node: Filenames, Next: Batch, Prev: Getopt Parameter lists, Up: Programs and Arguments - +File: slib-3b5.info, Node: Filenames, Next: Batch, Prev: Getopt Parameter lists, Up: Programs and Arguments + | 4.4.6 Filenames --------------- -`(require 'filename)' | +`(require 'filename)' -- Function: filename:match?? pattern -- Function: filename:match-ci?? pattern @@ -4347,6 +4366,7 @@ File: slib.info, Node: Filenames, Next: Batch, Prev: Getopt Parameter lists, yielded by the PROC is(are) returned. K may be ommited, in which case it defaults to `1'. + -- Function: call-with-tmpnam proc suffix1 ... Calls PROC with strings returned by successive calls to `tmpnam', each with the corresponding SUFFIX string appended. If PROC @@ -4355,8 +4375,8 @@ File: slib.info, Node: Filenames, Next: Batch, Prev: Getopt Parameter lists, returned. -File: slib.info, Node: Batch, Prev: Filenames, Up: Programs and Arguments - +File: slib-3b5.info, Node: Batch, Prev: Filenames, Up: Programs and Arguments + | 4.4.7 Batch ----------- @@ -4501,7 +4521,7 @@ Here is an example of the use of most of batch's procedures: (require 'databases) (require 'parameters) (require 'batch) - (require 'filename) | + (require 'filename) (define batch (create-database #f 'alist-table)) (batch:initialize! batch) @@ -4565,8 +4585,8 @@ When run, `my-batch' prints: hello world -File: slib.info, Node: HTML, Next: HTML Tables, Prev: Programs and Arguments, Up: Textual Conversion Packages - +File: slib-3b5.info, Node: HTML, Next: HTML Tables, Prev: Programs and Arguments, Up: Textual Conversion Packages + | 4.5 HTML ======== @@ -4745,8 +4765,8 @@ File: slib.info, Node: HTML, Next: HTML Tables, Prev: Programs and Arguments, port))) -File: slib.info, Node: HTML Tables, Next: HTTP and CGI, Prev: HTML, Up: Textual Conversion Packages - +File: slib-3b5.info, Node: HTML Tables, Next: HTTP and CGI, Prev: HTML, Up: Textual Conversion Packages + | 4.7 HTML Tables =============== @@ -4908,8 +4928,8 @@ performed. created. -File: slib.info, Node: HTTP and CGI, Next: Parsing HTML, Prev: HTML Tables, Up: Textual Conversion Packages - +File: slib-3b5.info, Node: HTTP and CGI, Next: Parsing HTML, Prev: HTML Tables, Up: Textual Conversion Packages + | 4.8 HTTP and CGI ================ @@ -4950,9 +4970,12 @@ File: slib.info, Node: HTTP and CGI, Next: Parsing HTML, Prev: HTML Tables, with the REQUEST-LINE, #f, and HEADER-ALIST. If SERVE-PROC returns a string, it is sent to OUTPUT-PORT. If - SERVE-PROC returns a list, then an error page with number 525 and - strings from the list. If SERVE-PROC returns #f, then a `Bad - Request' (400) page is sent to OUTPUT-PORT. + SERVE-PROC returns a list whose first element is an integer, then | + an error page with the status integer which is the first element | + of the list and strings from the list. If SERVE-PROC returns a | + list whose first element isn't an number, then an error page with | + the status code 500 and strings from the list. If SERVE-PROC | + returns #f, then a `Bad Request' (400) page is sent to OUTPUT-PORT. | Otherwise, `http:serve-query' replies (to OUTPUT-PORT) with appropriate HTML describing the problem. @@ -4984,12 +5007,15 @@ File: slib.info, Node: HTTP and CGI, Next: Parsing HTML, Prev: HTML Tables, HEADER-ALIST. If SERVE-PROC returns a string, it is sent to - `(current-input-port)'. If SERVE-PROC returns a list, then an - error page with number 525 and strings from the list. If - SERVE-PROC returns #f, then a `Bad Request' (400) page is sent to - `(current-input-port)'. - - Otherwise, `cgi:serve-query' replies (to `(current-input-port)') + `(current-ouput-port)'. If SERVE-PROC returns a list whose first | + element is an integer, then an error page with the status integer | + which is the first element of the list and strings from the list. | + If SERVE-PROC returns a list whose first element isn't an number, | + then an error page with the status code 500 and strings from the | + list. If SERVE-PROC returns #f, then a `Bad Request' (400) page | + is sent to `(current-ouput-port)'. | + + Otherwise, `cgi:serve-query' replies (to `(current-output-port)') | with appropriate HTML describing the problem. -- Function: make-query-alist-command-server rdb command-table @@ -5007,8 +5033,8 @@ File: slib.info, Node: HTTP and CGI, Next: Parsing HTML, Prev: HTML Tables, arguments described in its table. -File: slib.info, Node: Parsing HTML, Next: URI, Prev: HTTP and CGI, Up: Textual Conversion Packages - +File: slib-3b5.info, Node: Parsing HTML, Next: URI, Prev: HTTP and CGI, Up: Textual Conversion Packages + | 4.9 Parsing HTML ================ @@ -5066,16 +5092,17 @@ File: slib.info, Node: Parsing HTML, Next: URI, Prev: HTTP and CGI, Up: Text -- Function: htm-fields htm HTM is a hypertext markup string. - If HTM is a (hypertext) comment, then `htm-fields' returns #f. - Otherwise `htm-fields' returns the hypertext element symbol - (created by `string-ci->symbol') consed onto an association list - of the attribute name-symbols and values. Each value is a number - or string; or #t if the name had no value assigned within the - markup. + If HTM is a (hypertext) comment or DTD, then `htm-fields' returns + #f. Otherwise `htm-fields' returns the hypertext element string + consed onto an association list of the attribute name-symbols and + values. If the tag ends with "/>", then "/" is appended to the + hypertext element string. The name-symbols are created by + `string-ci->symbol'. Each value is a string; or #t if the name + had no value assigned within the markup. -File: slib.info, Node: URI, Next: Parsing XML, Prev: Parsing HTML, Up: Textual Conversion Packages - +File: slib-3b5.info, Node: URI, Next: Parsing XML, Prev: Parsing HTML, Up: Textual Conversion Packages + | 4.10 URI ======== @@ -5204,8 +5231,8 @@ purpose. 3. remote-directory -File: slib.info, Node: Parsing XML, Next: Printing Scheme, Prev: URI, Up: Textual Conversion Packages - +File: slib-3b5.info, Node: Parsing XML, Next: Printing Scheme, Prev: URI, Up: Textual Conversion Packages + | 4.11 Parsing XML ================ @@ -5291,6 +5318,7 @@ implements an inclusion rather than delimiting semantics. which is not a member of the set. This character is left on the stream. All the read characters are returned in a string. + -- Function: ssax:next-token-of pred port Reads characters from the PORT for which PRED (a procedure of one argument) returns non-#f. The reading stops at the first @@ -6015,8 +6043,8 @@ a SAX or a DOM model. first character after the root element. -File: slib.info, Node: Printing Scheme, Next: Time and Date, Prev: Parsing XML, Up: Textual Conversion Packages - +File: slib-3b5.info, Node: Printing Scheme, Next: Time and Date, Prev: Parsing XML, Up: Textual Conversion Packages + | 4.12 Printing Scheme ==================== @@ -6027,8 +6055,8 @@ File: slib.info, Node: Printing Scheme, Next: Time and Date, Prev: Parsing XM * Pretty-Print:: 'pretty-print, 'pprint-file -File: slib.info, Node: Generic-Write, Next: Object-To-String, Prev: Printing Scheme, Up: Printing Scheme - +File: slib-3b5.info, Node: Generic-Write, Next: Object-To-String, Prev: Printing Scheme, Up: Printing Scheme + | 4.12.1 Generic-Write -------------------- @@ -6070,8 +6098,8 @@ printing, output to a string and truncated output. (lambda (s) (for-each write-char (string->list s)) #t) -File: slib.info, Node: Object-To-String, Next: Pretty-Print, Prev: Generic-Write, Up: Printing Scheme - +File: slib-3b5.info, Node: Object-To-String, Next: Pretty-Print, Prev: Generic-Write, Up: Printing Scheme + | 4.12.2 Object-To-String ----------------------- @@ -6085,8 +6113,8 @@ File: slib.info, Node: Object-To-String, Next: Pretty-Print, Prev: Generic-Wr most LIMIT. -File: slib.info, Node: Pretty-Print, Prev: Object-To-String, Up: Printing Scheme - +File: slib-3b5.info, Node: Pretty-Print, Prev: Object-To-String, Up: Printing Scheme + | 4.12.3 Pretty-Print ------------------- @@ -6164,8 +6192,8 @@ File: slib.info, Node: Pretty-Print, Prev: Object-To-String, Up: Printing Sch Whitepsace and comments (introduced by `;') which are not part of scheme expressions are reproduced in the output. This procedure - does not affect the values returned by `current-input-port' and - `current-output-port'. + does not affect the values returned by `current-input-port', + `current-error-port', and `current-output-port'. `pprint-filter-file' can be used to pre-compile macro-expansion and thus can reduce loading time. The following will write into @@ -6176,8 +6204,8 @@ thus can reduce loading time. The following will write into (pprint-filter-file "code.scm" defmacro:expand* "exp-code.scm") -File: slib.info, Node: Time and Date, Next: NCBI-DNA, Prev: Printing Scheme, Up: Textual Conversion Packages - +File: slib-3b5.info, Node: Time and Date, Next: NCBI-DNA, Prev: Printing Scheme, Up: Textual Conversion Packages + | 4.13 Time and Date ================== @@ -6197,7 +6225,7 @@ Scheme datatypes. -- Function: current-time Returns the time since 00:00:00 GMT, January 1, 1970, measured in seconds. Note that the reference time is different from the - reference time for `get-universal-time' in *Note Common-Lisp + reference time for `get-universal-time' in *note Common-Lisp Time::. -- Function: difftime caltime1 caltime0 @@ -6209,8 +6237,8 @@ Scheme datatypes. seconds `(+ caltime offset)'. -File: slib.info, Node: Time Zone, Next: Posix Time, Prev: Time and Date, Up: Time and Date - +File: slib-3b5.info, Node: Time Zone, Next: Posix Time, Prev: Time and Date, Up: Time and Date + | 4.13.1 Time Zone ---------------- @@ -6336,8 +6364,8 @@ compatability. Because of shared state they are not thread-safe. for the Daylight Savings timezone. -File: slib.info, Node: Posix Time, Next: Common-Lisp Time, Prev: Time Zone, Up: Time and Date - +File: slib-3b5.info, Node: Posix Time, Next: Common-Lisp Time, Prev: Time Zone, Up: Time and Date + | 4.13.2 Posix Time ----------------- @@ -6408,8 +6436,8 @@ File: slib.info, Node: Posix Time, Next: Common-Lisp Time, Prev: Time Zone, CALTIME))', and `(asctime (localtime CALTIME TZ))', respectively. -File: slib.info, Node: Common-Lisp Time, Next: Time Infrastructure, Prev: Posix Time, Up: Time and Date - +File: slib-3b5.info, Node: Common-Lisp Time, Next: Time Infrastructure, Prev: Posix Time, Up: Time and Date + | 4.13.3 Common-Lisp Time ----------------------- @@ -6458,8 +6486,8 @@ File: slib.info, Node: Common-Lisp Time, Next: Time Infrastructure, Prev: Pos match the arguments to `encode-universal-time'. -File: slib.info, Node: Time Infrastructure, Prev: Common-Lisp Time, Up: Time and Date - +File: slib-3b5.info, Node: Time Infrastructure, Prev: Common-Lisp Time, Up: Time and Date + | 4.13.4 Time Infrastructure -------------------------- @@ -6474,8 +6502,8 @@ File: slib.info, Node: Time Infrastructure, Prev: Common-Lisp Time, Up: Time -- Function: tzfile:read path -File: slib.info, Node: NCBI-DNA, Next: Schmooz, Prev: Time and Date, Up: Textual Conversion Packages - +File: slib-3b5.info, Node: NCBI-DNA, Next: Schmooz, Prev: Time and Date, Up: Textual Conversion Packages + | 4.14 NCBI-DNA ============= @@ -6517,8 +6545,8 @@ sequence with the `BASE COUNT' line preceding the sequence from NCBI. Prints the counts of `a', `c', `g', and `t' occurrencing in CDNA. -File: slib.info, Node: Schmooz, Prev: NCBI-DNA, Up: Textual Conversion Packages - +File: slib-3b5.info, Node: Schmooz, Prev: NCBI-DNA, Up: Textual Conversion Packages + | 4.15 Schmooz ============ @@ -6616,8 +6644,8 @@ expansion. This feature is intended to make it easy to include Texinfo directives in schmooz comments. -File: slib.info, Node: Mathematical Packages, Next: Database Packages, Prev: Textual Conversion Packages, Up: Top - +File: slib-3b5.info, Node: Mathematical Packages, Next: Database Packages, Prev: Textual Conversion Packages, Up: Top + | 5 Mathematical Packages *********************** @@ -6641,8 +6669,8 @@ File: slib.info, Node: Mathematical Packages, Next: Database Packages, Prev: * Matrix Algebra:: 'determinant -File: slib.info, Node: Bit-Twiddling, Next: Modular Arithmetic, Prev: Mathematical Packages, Up: Mathematical Packages - +File: slib-3b5.info, Node: Bit-Twiddling, Next: Modular Arithmetic, Prev: Mathematical Packages, Up: Mathematical Packages + | 5.1 Bit-Twiddling ================= @@ -6867,23 +6895,22 @@ Alan Bawden came up with the succinct invariant. -- Function: integer->list k len -- Function: integer->list k `integer->list' returns a list of LEN booleans corresponding to - each bit of the given integer. #t is coded for each 1; #f for 0. - The LEN argument defaults to `(integer-length K)'. + each bit of the non-negative integer K. #t is coded for each 1; | + #f for 0. The LEN argument defaults to `(integer-length K)'. | -- Function: list->integer list `list->integer' returns an integer formed from the booleans in the list LIST, which must be a list of booleans. A 1 bit is coded for each #t; a 0 bit for #f. - `integer->list' and `list->integer' are inverses so far as - `equal?' is concerned. + (list->integer (integer->list K)) => K | -- Function: booleans->integer bool1 ... Returns the integer coded by the BOOL1 ... arguments. -File: slib.info, Node: Modular Arithmetic, Next: Irrational Integer Functions, Prev: Bit-Twiddling, Up: Mathematical Packages - +File: slib-3b5.info, Node: Modular Arithmetic, Next: Irrational Integer Functions, Prev: Bit-Twiddling, Up: Mathematical Packages + | 5.2 Modular Arithmetic ====================== @@ -6951,8 +6978,8 @@ If all the arguments are fixnums the computation will use only fixnums. Returns (N2 ^ N3) mod MODULUS. -File: slib.info, Node: Irrational Integer Functions, Next: Irrational Real Functions, Prev: Modular Arithmetic, Up: Mathematical Packages - +File: slib-3b5.info, Node: Irrational Integer Functions, Next: Irrational Real Functions, Prev: Modular Arithmetic, Up: Mathematical Packages + | 5.3 Irrational Integer Functions ================================ @@ -6976,14 +7003,20 @@ File: slib.info, Node: Irrational Integer Functions, Next: Irrational Real Fun For non-negative integer K returns the largest integer whose square is less than or equal to K; otherwise signals an error. - -- Variable: quotient - -- Variable: remainder - -- Variable: modulo + -- Function: quotient n1 n2 | + -- Function: remainder n1 n2 | + -- Function: modulo n1 n2 | are redefined so that they accept only exact-integer arguments. + -- Function: round-quotient n1 n2 | + Returns the quotient of N1 and N2 rounded toward even. | + | + (quotient 3 2) => 1 | + (round-quotient 3 2) => 2 | + | -File: slib.info, Node: Irrational Real Functions, Next: Prime Numbers, Prev: Irrational Integer Functions, Up: Mathematical Packages - +File: slib-3b5.info, Node: Irrational Real Functions, Next: Prime Numbers, Prev: Irrational Integer Functions, Up: Mathematical Packages + | 5.4 Irrational Real Functions ============================= @@ -6993,16 +7026,16 @@ File: slib.info, Node: Irrational Real Functions, Next: Prime Numbers, Prev: to load into an integer-only implementation; those functions will be defined to #f. - -- Function: real-exp X - -- Function: real-ln X - -- Function: real-log Y X - -- Function: real-sin X - -- Function: real-cos X - -- Function: real-tan X - -- Function: real-asin X - -- Function: real-acos X - -- Function: real-atan X - -- Function: atan Y X + -- Function: real-exp x | + -- Function: real-ln x | + -- Function: real-log y x | + -- Function: real-sin x | + -- Function: real-cos x | + -- Function: real-tan x | + -- Function: real-asin x | + -- Function: real-acos x | + -- Function: real-atan x | + -- Function: atan y x | These procedures are part of every implementation that supports general real numbers; they compute the usual transcendental functions. `real-ln' computes the natural logarithm of X; @@ -7012,7 +7045,7 @@ defined to #f. procedures signal an error. - -- Function: real-sqrt X + -- Function: real-sqrt x | For non-negative real X the result will be its positive square root; otherwise an error will be signaled. @@ -7093,8 +7126,8 @@ defined to #f. -File: slib.info, Node: Prime Numbers, Next: Random Numbers, Prev: Irrational Real Functions, Up: Mathematical Packages - +File: slib-3b5.info, Node: Prime Numbers, Next: Random Numbers, Prev: Irrational Real Functions, Up: Mathematical Packages + | 5.5 Prime Numbers ================= @@ -7138,8 +7171,8 @@ the Solovay-Strassen primality test. See `(sort! (factor K) <)'. -File: slib.info, Node: Random Numbers, Next: Discrete Fourier Transform, Prev: Prime Numbers, Up: Mathematical Packages - +File: slib-3b5.info, Node: Random Numbers, Next: Discrete Fourier Transform, Prev: Prime Numbers, Up: Mathematical Packages + | 5.6 Random Numbers ================== @@ -7147,7 +7180,8 @@ A pseudo-random number generator is only as good as the tests it passes. George Marsaglia of Florida State University developed a battery of tests named "DIEHARD" (`http://stat.fsu.edu/~geo/diehard.html'). `diehard.c' has a bug which the patch -`http://swiss.csail.mit.edu/ftpdir/users/jaffer/diehard.c.pat' corrects. +`http://groups.csail.mit.edu/mac/ftpdir/users/jaffer/diehard.c.pat' +corrects. SLIB's PRNG generates 8 bits at a time. With the degenerate seed `0', the numbers generated pass DIEHARD; but when bits are combined @@ -7160,8 +7194,8 @@ from sequential bytes, tests fail. With the seed * Inexact Random Numbers:: 'random-inexact -File: slib.info, Node: Exact Random Numbers, Next: Inexact Random Numbers, Prev: Random Numbers, Up: Random Numbers - +File: slib-3b5.info, Node: Exact Random Numbers, Next: Inexact Random Numbers, Prev: Random Numbers, Up: Random Numbers + | 5.6.1 Exact Random Numbers -------------------------- @@ -7190,6 +7224,7 @@ File: slib.info, Node: Exact Random Numbers, Next: Inexact Random Numbers, Pr -- Function: copy-random-state state Returns a new copy of argument STATE. + -- Function: copy-random-state Returns a new copy of `*random-state*'. @@ -7212,8 +7247,8 @@ File: slib.info, Node: Exact Random Numbers, Next: Inexact Random Numbers, Pr `*random-state*' is used as the seed. -File: slib.info, Node: Inexact Random Numbers, Prev: Exact Random Numbers, Up: Random Numbers - +File: slib-3b5.info, Node: Inexact Random Numbers, Prev: Exact Random Numbers, Up: Random Numbers + | 5.6.2 Inexact Random Numbers ---------------------------- @@ -7258,8 +7293,8 @@ File: slib.info, Node: Inexact Random Numbers, Prev: Exact Random Numbers, Up squares of the numbers is returned. -File: slib.info, Node: Discrete Fourier Transform, Next: Cyclic Checksum, Prev: Random Numbers, Up: Mathematical Packages - +File: slib-3b5.info, Node: Discrete Fourier Transform, Next: Cyclic Checksum, Prev: Random Numbers, Up: Mathematical Packages + | 5.7 Discrete Fourier Transform ============================== @@ -7324,8 +7359,8 @@ best method for decimating each dimension. 1.0 -61.23031769111886e-18+1.0i -1.0 61.23031769111886e-18-1.0i) -File: slib.info, Node: Cyclic Checksum, Next: Graphing, Prev: Discrete Fourier Transform, Up: Mathematical Packages - +File: slib-3b5.info, Node: Cyclic Checksum, Next: Graphing, Prev: Discrete Fourier Transform, Up: Mathematical Packages + | 5.8 Cyclic Checksum =================== @@ -7365,6 +7400,7 @@ lengths: `http://www.ece.cmu.edu/~koopman/roses/dsn04/koopman04_crc_poly_embedded.pdf' + There is even some controversy over the polynomials themselves. -- Constant: crc-32-polynomial @@ -7512,8 +7548,8 @@ checksum of the bytes in STR, can be defined as follows: -File: slib.info, Node: Graphing, Next: Solid Modeling, Prev: Cyclic Checksum, Up: Mathematical Packages - +File: slib-3b5.info, Node: Graphing, Next: Solid Modeling, Prev: Cyclic Checksum, Up: Mathematical Packages + | 5.9 Graphing ============ @@ -7523,8 +7559,8 @@ File: slib.info, Node: Graphing, Next: Solid Modeling, Prev: Cyclic Checksum, * PostScript Graphing:: -File: slib.info, Node: Character Plotting, Next: PostScript Graphing, Prev: Graphing, Up: Graphing - +File: slib-3b5.info, Node: Character Plotting, Next: PostScript Graphing, Prev: Graphing, Up: Graphing + | 5.9.1 Character Plotting ------------------------ @@ -7636,8 +7672,8 @@ File: slib.info, Node: Character Plotting, Next: PostScript Graphing, Prev: G normal -0.025 0 0.025 0.05 -File: slib.info, Node: PostScript Graphing, Prev: Character Plotting, Up: Graphing - +File: slib-3b5.info, Node: PostScript Graphing, Prev: Character Plotting, Up: Graphing + | 5.9.2 PostScript Graphing ------------------------- @@ -7645,7 +7681,7 @@ File: slib.info, Node: PostScript Graphing, Prev: Character Plotting, Up: Gra This is a graphing package creating encapsulated-PostScript files. Its motivations and design choice are described in -`http://swiss.csail.mit.edu/~jaffer/Docupage/grapheps' +`http://people.csail.mit.edu/jaffer/Docupage/grapheps' A dataset to be plotted is taken from a 2-dimensional array. Corresponding coordinates are in rows. Coordinates from any pair of @@ -7687,8 +7723,8 @@ first ELT argument to the last. * Example Graph:: -File: slib.info, Node: Column Ranges, Next: Drawing the Graph, Prev: PostScript Graphing, Up: PostScript Graphing - +File: slib-3b5.info, Node: Column Ranges, Next: Drawing the Graph, Prev: PostScript Graphing, Up: PostScript Graphing + | 5.9.2.1 Column Ranges ..................... @@ -7728,8 +7764,8 @@ can be given explicity or computed in PostScript by `column-range'. legends, etc. -File: slib.info, Node: Drawing the Graph, Next: Graphics Context, Prev: Column Ranges, Up: PostScript Graphing - +File: slib-3b5.info, Node: Drawing the Graph, Next: Graphics Context, Prev: Column Ranges, Up: PostScript Graphing + | 5.9.2.2 Drawing the Graph ......................... @@ -7785,9 +7821,35 @@ The glyphs and drawing styles available are: `circle' Hollow circle + -- Function: plot-text-column array x-column y-column t-column proc3s | + Plots text in T-COLUMN of ARRAY at x coordinate in X-COLUMN of | + ARRAY and y coordinate Y-COLUMN of ARRAY. The symbol PROC3S | + specifies the offset of the text from the specified coordinates. | + | +The offsets available are: | + | +`above' | + Draws the text centered above at the point. | + | +`center' | + Draws the text centered at the point. | + | +`below' | + Draws the text centered below the point. | + | +`left' | + Draws the text to the left of the point. | + | +`right' | + Draws the text to the right of the point. | + | + All the offsets other than `center' are calculated to keep the text | +clear of a glyph drawn at the same coordinates. If you need more or | +less clearance, use `set-glyphsize'. | + | -File: slib.info, Node: Graphics Context, Next: Rectangles, Prev: Drawing the Graph, Up: PostScript Graphing - +File: slib-3b5.info, Node: Graphics Context, Next: Rectangles, Prev: Drawing the Graph, Up: PostScript Graphing + | 5.9.2.3 Graphics Context ........................ @@ -7802,12 +7864,15 @@ File: slib.info, Node: Graphics Context, Next: Rectangles, Prev: Drawing the `set-color' sets the PostScript color to the color of the given string, or a grey value between black (0) and white (100). - -- Function: set-font name fontheight - NAME should be a (case-sensitive) string naming a PostScript font. - FONTHEIGHT should be a positive real number. + -- Function: set-font font height | + -- Function: set-font font encoding height | + FONT should be a (case-sensitive) string naming a PostScript font. | + HEIGHT should be a positive real number. ENCODING should name a | + PostScript encoding such as `ISOLatin1Encoding'. | - `set-font' Changes the current PostScript font to NAME with height - equal to FONTHEIGHT. The default font is Helvetica (12pt). + `set-font' Changes the current PostScript font to FONT with the | + ENCODING encoding, and height equal to HEIGHT. The default font is | + `Helvetica' (12pt). The default encoding is `StandardEncoding'. | The base set of PostScript fonts is: @@ -7816,6 +7881,11 @@ Helvetica Helvetica-Oblique Helvetica-Bold Helvetica-BoldOblique Courier Courier-Oblique Courier-Bold Courier-BoldOblique Symbol +The base set of PostScript encodings is: | + | +StandardEncoding ISOLatin1Encoding ExpertEncoding | +ExpertSubsetEncoding SymbolEncoding | + | Line parameters do no affect fonts; they do effect glyphs. -- Function: set-linewidth w @@ -7826,9 +7896,11 @@ Line parameters do no affect fonts; they do effect glyphs. -- Function: set-linedash j k Lines are drawn J-on K-off. + -- Function: set-linedash j Lines are drawn J-on J-off. + -- Function: set-linedash Turns off dashing. @@ -7839,8 +7911,8 @@ Line parameters do no affect fonts; they do effect glyphs. The effects of `clip-to-rect' are also part of the graphic context. -File: slib.info, Node: Rectangles, Next: Legending, Prev: Graphics Context, Up: PostScript Graphing - +File: slib-3b5.info, Node: Rectangles, Next: Legending, Prev: Graphics Context, Up: PostScript Graphing + | 5.9.2.4 Rectangles .................. @@ -7879,8 +7951,8 @@ elements are the width and height of the rectangle. the extent of `clip-to-rect'. -File: slib.info, Node: Legending, Next: Legacy Plotting, Prev: Rectangles, Up: PostScript Graphing - +File: slib-3b5.info, Node: Legending, Next: Legacy Plotting, Prev: Rectangles, Up: PostScript Graphing + | 5.9.2.5 Legending ................. @@ -7940,8 +8012,8 @@ File: slib.info, Node: Legending, Next: Legacy Plotting, Prev: Rectangles, U horizontal ruler. -File: slib.info, Node: Legacy Plotting, Next: Example Graph, Prev: Legending, Up: PostScript Graphing - +File: slib-3b5.info, Node: Legacy Plotting, Next: Example Graph, Prev: Legending, Up: PostScript Graphing + | 5.9.2.6 Legacy Plotting ....................... @@ -7956,19 +8028,21 @@ File: slib.info, Node: Legacy Plotting, Next: Example Graph, Prev: Legending, range X1 to X2. If the optional integer argument NPTS is supplied, it specifies the number of points to evaluate FUNC at. - -- Function: x1 x2 npts func1 func2 ... + | + -- Function: plot x1 x2 npts func1 func2 ... | Creates and displays an encapsulated PostScript graph of the one-argument functions FUNC1, FUNC2, ... over the range X1 to X2 at NPTS points. + -- Function: plot coords x-label y-label COORDS is a list or vector of coordinates, lists of x and y coordinates. X-LABEL and Y-LABEL are strings with which to label the x and y axes. -File: slib.info, Node: Example Graph, Prev: Legacy Plotting, Up: PostScript Graphing - +File: slib-3b5.info, Node: Example Graph, Prev: Legacy Plotting, Up: PostScript Graphing + | 5.9.2.7 Example Graph ..................... @@ -8069,14 +8143,14 @@ scales. (system "gv solarad.eps") -File: slib.info, Node: Solid Modeling, Next: Color, Prev: Graphing, Up: Mathematical Packages - +File: slib-3b5.info, Node: Solid Modeling, Next: Color, Prev: Graphing, Up: Mathematical Packages + | 5.10 Solid Modeling =================== `(require 'solid)' -`http://swiss.csail.mit.edu/~jaffer/Solid/#Example' gives an example +`http://people.csail.mit.edu/jaffer/Solid/#Example' gives an example use of this package. -- Function: vrml node ... @@ -8105,7 +8179,7 @@ at the viewpoint: enclosing the virtual world. -- Function: scene:sphere colors angles - COLORS is a list of color objects. Each may be of type *Note + COLORS is a list of color objects. Each may be of type *note color: Color Data-Type, a 24-bit sRGB integer, or a list of 3 numbers between 0.0 and 1.0. @@ -8181,7 +8255,7 @@ sources to reach the desired strength. -- Function: light:ambient color Ambient light shines on all surfaces with which it is grouped. - COLOR is a an object of type *Note color: Color Data-Type, a + COLOR is a an object of type *note color: Color Data-Type, a 24-bit sRGB integer, or a list of 3 numbers between 0.0 and 1.0. If COLOR is #f, then the default color will be used. INTENSITY is a real non-negative number defaulting to `1'. @@ -8195,7 +8269,7 @@ sources to reach the desired strength. Directional light shines parallel rays with uniform intensity on all objects with which it is grouped. - COLOR is a an object of type *Note color: Color Data-Type, a + COLOR is a an object of type *note color: Color Data-Type, a 24-bit sRGB integer, or a list of 3 numbers between 0.0 and 1.0. If COLOR is #f, then the default color will be used. @@ -8232,7 +8306,7 @@ sources to reach the desired strength. Point light radiates from LOCATION, intensity decreasing with distance, towards all objects with which it is grouped. - COLOR is a an object of type *Note color: Color Data-Type, a + COLOR is a an object of type *note color: Color Data-Type, a 24-bit sRGB integer, or a list of 3 numbers between 0.0 and 1.0. If COLOR is #f, then the default color will be used. INTENSITY is a real non-negative number defaulting to `1'. BEAM is a structure @@ -8259,7 +8333,7 @@ sources to reach the desired strength. Cartesian vector specifying the direction to the light source. The default direction is upwards; thus its light will shine down. - COLOR is a an object of type *Note color: Color Data-Type, a + COLOR is a an object of type *note color: Color Data-Type, a 24-bit sRGB integer, or a list of 3 numbers between 0.0 and 1.0. If COLOR is #f, then the default color will be used. @@ -8366,7 +8440,7 @@ Object Primitives If present, APPEARANCE determines the surface properties of the returned object. If present, COLORRAY must be an array of objects - of type *Note color: Color Data-Type, 24-bit sRGB integers or + of type *note color: Color Data-Type, 24-bit sRGB integers or lists of 3 numbers between 0.0 and 1.0. If COLORRAY's dimensions match HEIGHT, then each element of @@ -8405,7 +8479,7 @@ Surface Attributes Returns an "appearance", the optical properties of the objects with which it is associated. AMBIENTINTENSITY, SHININESS, and TRANSPARENCY must be numbers between 0 and 1. DIFFUSECOLOR, - SPECULARCOLOR, and EMISSIVECOLOR are objects of type *Note color: + SPECULARCOLOR, and EMISSIVECOLOR are objects of type *note color: Color Data-Type, 24-bit sRGB integers or lists of 3 numbers between 0.0 and 1.0. If a color argument is omitted or #f, then the default color will be used. @@ -8484,6 +8558,7 @@ Aggregating Objects CENTER must be a list or vector of three numbers. Returns an upward pointing metallic arrow centered at CENTER. + -- Function: solid:arrow Returns an upward pointing metallic arrow centered at the origin. @@ -8505,12 +8580,12 @@ Spatial Transformations the axis AXIS. -File: slib.info, Node: Color, Next: Root Finding, Prev: Solid Modeling, Up: Mathematical Packages - +File: slib-3b5.info, Node: Color, Next: Root Finding, Prev: Solid Modeling, Up: Mathematical Packages + | 5.11 Color ========== -`http://swiss.csail.mit.edu/~jaffer/Color' +`http://people.csail.mit.edu/jaffer/Color' The goals of this package are to provide methods to specify, compute, and transform colors in a core set of additive color spaces. The color @@ -8528,8 +8603,8 @@ encountered in practice and the literature. * Daylight:: Sunlight and sky colors -File: slib.info, Node: Color Data-Type, Next: Color Spaces, Prev: Color, Up: Color - +File: slib-3b5.info, Node: Color Data-Type, Next: Color Spaces, Prev: Color, Up: Color + | 5.11.1 Color Data-Type ---------------------- @@ -8662,8 +8737,8 @@ implementation the device-independent RGB709 and sRGB spaces replace the device-dependent RGBi and RGB spaces of Xlib. -File: slib.info, Node: Color Spaces, Next: Spectra, Prev: Color Data-Type, Up: Color - +File: slib-3b5.info, Node: Color Spaces, Next: Spectra, Prev: Color Data-Type, Up: Color + | 5.11.2 Color Spaces ------------------- @@ -8746,6 +8821,7 @@ computed in L*a*b* (or L*C*h). -- Function: color:l*a*b* L* a* b* white-point Returns the L*a*b* color composed of L*, A*, B* with WHITE-POINT. + -- Function: color:l*a*b* L* a* b* Returns the L*a*b* color composed of L*, A*, B*. If the coordinates do not encode a valid L*a*b* color, then an error is @@ -8755,6 +8831,7 @@ computed in L*a*b* (or L*C*h). Returns the list of 3 numbers encoding COLOR in L*a*b* with WHITE-POINT. + -- Function: color->l*a*b* color Returns the list of 3 numbers encoding COLOR in L*a*b*. @@ -8770,6 +8847,7 @@ computed in L*a*b* (or L*C*h). -- Function: color:l*u*v* L* u* v* white-point Returns the L*u*v* color composed of L*, U*, V* with WHITE-POINT. + -- Function: color:l*u*v* L* u* v* Returns the L*u*v* color composed of L*, U*, V*. If the coordinates do not encode a valid L*u*v* color, then an error is @@ -8779,6 +8857,7 @@ computed in L*a*b* (or L*C*h). Returns the list of 3 numbers encoding COLOR in L*u*v* with WHITE-POINT. + -- Function: color->l*u*v* color Returns the list of 3 numbers encoding COLOR in L*u*v*. @@ -8822,6 +8901,7 @@ close colors seem to observers. -- Function: color:l*c*h L* C* h white-point Returns the L*C*h color composed of L*, C*, H with WHITE-POINT. + -- Function: color:l*c*h L* C* h Returns the L*C*h color composed of L*, C*, H. If the coordinates do not encode a valid L*C*h color, then an error is signaled. @@ -8830,6 +8910,7 @@ close colors seem to observers. Returns the list of 3 numbers encoding COLOR in L*C*h with WHITE-POINT. + -- Function: color->l*c*h color Returns the list of 3 numbers encoding COLOR in L*C*h. @@ -8904,9 +8985,11 @@ transform. -- Function: color:e-srgb 10 r g b Returns the e-sRGB10 color composed of integers R, G, B. + -- Function: color:e-srgb 12 r g b Returns the e-sRGB12 color composed of integers R, G, B. + -- Function: color:e-srgb 16 r g b Returns the e-sRGB16 color composed of integers R, G, B. If the coordinates do not encode a valid e-sRGB color, then an error is @@ -8929,15 +9012,15 @@ ICC.1:1998-09: color space. -File: slib.info, Node: Spectra, Next: Color Difference Metrics, Prev: Color Spaces, Up: Color - +File: slib-3b5.info, Node: Spectra, Next: Color Difference Metrics, Prev: Color Spaces, Up: Color + | 5.11.3 Spectra -------------- The following functions compute colors from spectra, scale color luminance, and extract chromaticity. XYZ is used in the names of procedures for unnormalized colors; the coordinates of CIEXYZ colors are -constrained as described in *Note Color Spaces::. +constrained as described in *note Color Spaces::. `(require 'color-space)' @@ -8955,18 +9038,18 @@ and Z "Spectral Tristimulus Values". The files `cie1931.xyz' and `cie1964.xyz' in the distribution contain these CIE-defined values. -- Feature: cie1964 - Loads the Spectral Tristimulus Values `CIE 1964 Supplementary | - Standard Colorimetric Observer', defining CIE:X-BAR, CIE:Y-BAR, | - and CIE:Z-BAR. | + Loads the Spectral Tristimulus Values `CIE 1964 Supplementary + Standard Colorimetric Observer', defining CIE:X-BAR, CIE:Y-BAR, + and CIE:Z-BAR. -- Feature: cie1931 - Loads the Spectral Tristimulus Values `CIE 1931 Supplementary | - Standard Colorimetric Observer', defining CIE:X-BAR, CIE:Y-BAR, | - and CIE:Z-BAR. | + Loads the Spectral Tristimulus Values `CIE 1931 Supplementary + Standard Colorimetric Observer', defining CIE:X-BAR, CIE:Y-BAR, + and CIE:Z-BAR. -- Feature: ciexyz - Requires Spectral Tristimulus Values, defaulting to cie1931, | - defining CIE:X-BAR, CIE:Y-BAR, and CIE:Z-BAR. | + Requires Spectral Tristimulus Values, defaulting to cie1931, + defining CIE:X-BAR, CIE:Y-BAR, and CIE:Z-BAR. `(require 'cie1964)' or `(require 'cie1931)' will `load-ciexyz' specific values used by the following spectrum conversion procedures. @@ -9146,8 +9229,8 @@ is extremely tolerant. Negative numbers are replaced with zero, and chromaticities with sums greater than one are scaled to sum to one. -File: slib.info, Node: Color Difference Metrics, Next: Color Conversions, Prev: Spectra, Up: Color - +File: slib-3b5.info, Node: Color Difference Metrics, Next: Color Conversions, Prev: Spectra, Up: Color + | 5.11.4 Color Difference Metrics ------------------------------- @@ -9169,13 +9252,15 @@ color2 in the function entries. Returns the Euclidean distance in L*a*b* space between COLOR1 and COLOR2. - -- Function: L*C*h:DE*94 lch1 lch2 parametric-factors - -- Function: L*C*h:DE*94 lch1 lch2 + -- Function: L*a*b*:DE*94 lab1 lab2 parametric-factors | + -- Function: L*a*b*:DE*94 lab1 lab2 | -- Function: CIE:DE*94 color1 color2 parametric-factors -- Function: CIE:DE*94 color1 color2 - Measures distance in the L*C*h cylindrical color-space. The three - axes are individually scaled (depending on C*) in their - contributions to the total distance. + Measures distance in the L*a*b* color-space. The three axes are | + individually scaled in their contributions to the total distance. | + | + `DE*94' is not symmetrical in its arguments. LAB1 is the | + "reference" color and LAB2 is the "sample" color. | The CIE has defined reference conditions under which the metric with default parameters can be expected to perform well. These @@ -9217,8 +9302,8 @@ to use a single value pass/fail tolerance for all shades. for acceptability. -File: slib.info, Node: Color Conversions, Next: Color Names, Prev: Color Difference Metrics, Up: Color - +File: slib-3b5.info, Node: Color Conversions, Next: Color Names, Prev: Color Difference Metrics, Up: Color + | 5.11.5 Color Conversions ------------------------ @@ -9288,8 +9373,8 @@ Do not convert e-sRGB precision through `e-sRGB->sRGB' then converts SRGB to e-sRGB of precision N2. -File: slib.info, Node: Color Names, Next: Daylight, Prev: Color Conversions, Up: Color - +File: slib-3b5.info, Node: Color Names, Next: Daylight, Prev: Color Conversions, Up: Color + | 5.11.6 Color Names ------------------ @@ -9332,6 +9417,7 @@ is the key, and the second is the color-string. BASE-TABLE-TYPE. `color-dictionary' returns the read-only table NAME in database NAME if it exists; #f otherwise. + -- Function: color-dictionary name rdb RDB must be an open relational database or a string naming a relational database file; and the symbol NAME a table therein. @@ -9374,7 +9460,7 @@ Dictionary Creation This section has detailed the procedures for creating and loading color dictionaries. So where are the dictionaries to load? - `http://swiss.csail.mit.edu/~jaffer/Color/Dictionaries.html' + `http://people.csail.mit.edu/jaffer/Color/Dictionaries.html' Describes and evaluates several color-name dictionaries on the web. The following procedure creates a database containing two of these @@ -9405,7 +9491,7 @@ The Short List purplish blue bluish purple purple reddish purple red purple purplish red red - (`http://swiss.csail.mit.edu/~jaffer/Color/saturate.pdf'). If + (`http://people.csail.mit.edu/jaffer/Color/saturate.pdf'). If NAME is found, the corresponding color is returned. Otherwise #f is returned. Use saturate only for light source colors. @@ -9417,7 +9503,7 @@ RGB Values List' available. -- Function: resene name Looks for NAME among the 1300 entries in the Resene color-name - dictionary (`http://swiss.csail.mit.edu/~jaffer/Color/resene.pdf'). + dictionary (`http://people.csail.mit.edu/jaffer/Color/resene.pdf'). If NAME is found, the corresponding color is returned. Otherwise #f is returned. The `Resene RGB Values List' is an excellent source for surface colors. @@ -9454,8 +9540,8 @@ program, then you must include its license with your program: detriment of Resene Paints Ltd. -File: slib.info, Node: Daylight, Prev: Color Names, Up: Color - +File: slib-3b5.info, Node: Daylight, Prev: Color Names, Up: Color + | 5.11.7 Daylight --------------- @@ -9552,13 +9638,16 @@ turbidity values less than 1.3. 20; otherwise the `clear-sky-color-xyy' function. -File: slib.info, Node: Root Finding, Next: Minimizing, Prev: Color, Up: Mathematical Packages - +File: slib-3b5.info, Node: Root Finding, Next: Minimizing, Prev: Color, Up: Mathematical Packages + | 5.12 Root Finding ================= `(require 'root)' + In the Newton method, divide the DF/DX argument by the multiplicity | +of the desired root in order to preserve quadratic convergence. | + | -- Function: newton:find-integer-root f df/dx x0 Given integer valued procedure F, its derivative (with respect to its argument) DF/DX, and initial integer value X0 for which @@ -9643,8 +9732,8 @@ Polynomials', IEEE Transactions on Circuits and Systems, Vol. 36, No. non-false if the iteration should be stopped. -File: slib.info, Node: Minimizing, Next: The Limit, Prev: Root Finding, Up: Mathematical Packages - +File: slib-3b5.info, Node: Minimizing, Next: The Limit, Prev: Root Finding, Up: Mathematical Packages + | 5.13 Minimizing =============== @@ -9690,8 +9779,8 @@ approximating the derivative. and Software' Prentice-Hall, 1989, ISBN 0-13-627258-4 -File: slib.info, Node: The Limit, Next: Commutative Rings, Prev: Minimizing, Up: Mathematical Packages - +File: slib-3b5.info, Node: The Limit, Next: Commutative Rings, Prev: Minimizing, Up: Mathematical Packages + | 5.14 The Limit ============== @@ -9790,8 +9879,8 @@ File: slib.info, Node: The Limit, Next: Commutative Rings, Prev: Minimizing, ==> 0.0 -File: slib.info, Node: Commutative Rings, Next: Matrix Algebra, Prev: The Limit, Up: Mathematical Packages - +File: slib-3b5.info, Node: Commutative Rings, Next: Matrix Algebra, Prev: The Limit, Up: Mathematical Packages + | 5.15 Commutative Rings ====================== @@ -10069,8 +10158,8 @@ objects. (* (m a c e b g) (m d f))) -File: slib.info, Node: Matrix Algebra, Prev: Commutative Rings, Up: Mathematical Packages - +File: slib-3b5.info, Node: Matrix Algebra, Prev: Commutative Rings, Up: Mathematical Packages + | 5.18 Matrix Algebra =================== @@ -10083,7 +10172,7 @@ linear-algebra texts, this package uses 0-based coordinates. Returns the list-of-lists form of MATRIX. -- Function: matrix->array matrix - Returns the array form of MATRIX. | + Returns the array form of MATRIX. -- Function: determinant matrix MATRIX must be a square matrix. `determinant' returns the @@ -10106,20 +10195,22 @@ linear-algebra texts, this package uses 0-based coordinates. -- Function: matrix:product m1 m2 Returns the product of matrices M1 and M2. + -- Function: matrix:product m1 z Returns matrix M1 times scalar Z. + -- Function: matrix:product z m1 Returns matrix M1 times scalar Z. -- Function: matrix:inverse matrix - MATRIX must be a square matrix. If MATRIX is singular, then | + MATRIX must be a square matrix. If MATRIX is singular, then `matrix:inverse' returns #f; otherwise `matrix:inverse' returns the `matrix:product' inverse of MATRIX. -File: slib.info, Node: Database Packages, Next: Other Packages, Prev: Mathematical Packages, Up: Top - +File: slib-3b5.info, Node: Database Packages, Next: Other Packages, Prev: Mathematical Packages, Up: Top + | 6 Database Packages ******************* @@ -10130,8 +10221,8 @@ File: slib.info, Node: Database Packages, Next: Other Packages, Prev: Mathema * Weight-Balanced Trees:: 'wt-tree -File: slib.info, Node: Relational Database, Next: Relational Infrastructure, Prev: Database Packages, Up: Database Packages - +File: slib-3b5.info, Node: Relational Database, Next: Relational Infrastructure, Prev: Database Packages, Up: Database Packages + | 6.1 Relational Database ======================= @@ -10140,10 +10231,10 @@ File: slib.info, Node: Relational Database, Next: Relational Infrastructure, This package implements a database system inspired by the Relational Model (`E. F. Codd, A Relational Model of Data for Large Shared Data Banks'). An SLIB relational database implementation can be created -from any *Note Base Table:: implementation. +from any *note Base Table:: implementation. Why relational database? For motivations and design issues see -`http://swiss.csail.mit.edu/~jaffer/DBManifesto.html'. +`http://people.csail.mit.edu/jaffer/DBManifesto.html'. * Menu: @@ -10155,8 +10246,8 @@ from any *Note Base Table:: implementation. * Database Browser:: 'database-browse -File: slib.info, Node: Using Databases, Next: Table Operations, Prev: Relational Database, Up: Relational Database - +File: slib-3b5.info, Node: Using Databases, Next: Table Operations, Prev: Relational Database, Up: Relational Database + | 6.1.1 Using Databases --------------------- @@ -10184,14 +10275,14 @@ returning an already open database (procedure), rather than opening the database file a second time. _Note:_ Databases returned by `open-database' do not include - wrappers applied by packages like *Note Embedded Commands::. But + wrappers applied by packages like *note Embedded Commands::. But wrapped databases do work as arguments to these functions. When a database is created, it is mutable by the creator and not auto-sharable. A database opened mutably is also not auto-sharable. But any number of readers can (open) share a non-mutable database file. -This next set of procedures mirror the whole-database methods in *Note +This next set of procedures mirror the whole-database methods in *note Database Operations::. Except for `create-database', each procedure will accept either a filename or database procedure for its first argument. @@ -10228,6 +10319,7 @@ with one argument. Returns an open relational database associated with RDB. The database will be opened with base-table type BASE-TABLE-TYPE). + -- Function: open-database rdb Returns an open relational database associated with RDB. `open-database' will attempt to deduce the correct base-table-type. @@ -10279,7 +10371,7 @@ Defining Tables -- Function: define-domains rdb row5 ... Adds the domain rows ROW5 ... to the `*domains-data*' table in - RDB. The format of the row is given in *Note Catalog + RDB. The format of the row is given in *note Catalog Representation::. (define-domains rdb '(permittivity #f complex? c64 #f)) @@ -10330,8 +10422,8 @@ Listing Tables argument to `define-tables', will recreate the table. -File: slib.info, Node: Table Operations, Next: Database Interpolation, Prev: Using Databases, Up: Relational Database - +File: slib-3b5.info, Node: Table Operations, Next: Database Interpolation, Prev: Using Databases, Up: Relational Database + | 6.1.2 Table Operations ---------------------- @@ -10365,8 +10457,8 @@ number of primary keys for that table. * Table Administration:: -File: slib.info, Node: Single Row Operations, Next: Match-Keys, Prev: Table Operations, Up: Table Operations - +File: slib-3b5.info, Node: Single Row Operations, Next: Match-Keys, Prev: Table Operations, Up: Table Operations + | 6.1.2.1 Single Row Operations ............................. @@ -10419,8 +10511,8 @@ missing. value returned is unspecified. -File: slib.info, Node: Match-Keys, Next: Multi-Row Operations, Prev: Single Row Operations, Up: Table Operations - +File: slib-3b5.info, Node: Match-Keys, Next: Multi-Row Operations, Prev: Single Row Operations, Up: Table Operations + | 6.1.2.2 Match-Keys .................. @@ -10471,8 +10563,8 @@ argument. The arguments and their actions are: amiga-aztec amiga-dice-c aix) -File: slib.info, Node: Multi-Row Operations, Next: Indexed Sequential Access Methods, Prev: Match-Keys, Up: Table Operations - +File: slib-3b5.info, Node: Multi-Row Operations, Next: Indexed Sequential Access Methods, Prev: Match-Keys, Up: Table Operations + | 6.1.2.3 Multi-Row Operations ............................ @@ -10523,16 +10615,14 @@ Note that `row:insert*' and `row:update*' do _not_ use match-keys. it will be overwritten. The value returned is unspecified. -File: slib.info, Node: Indexed Sequential Access Methods, Next: Sequential Index Operations, Prev: Multi-Row Operations, Up: Table Operations - +File: slib-3b5.info, Node: Indexed Sequential Access Methods, Next: Sequential Index Operations, Prev: Multi-Row Operations, Up: Table Operations + | 6.1.2.4 Indexed Sequential Access Methods ......................................... "Indexed Sequential Access Methods" are a way of arranging database information so that records can be accessed both by key and by key -sequence (ordering). "ISAM" is not part of Codd's relational model. -Hardcore relational programmers might use some least-upper-bound join -for every row to get them into an order. +sequence (ordering). "ISAM" is not part of Codd's relational model. | Associative memory in B-Trees is an example of a database implementation which can support a native key ordering. SLIB's @@ -10547,8 +10637,8 @@ order. For example: (12 a 34) < (12 a 36) < (12 b 1) < (13 a 0) -File: slib.info, Node: Sequential Index Operations, Next: Table Administration, Prev: Indexed Sequential Access Methods, Up: Table Operations - +File: slib-3b5.info, Node: Sequential Index Operations, Next: Table Administration, Prev: Indexed Sequential Access Methods, Up: Table Operations + | 6.1.2.5 Sequential Index Operations ................................... @@ -10604,8 +10694,8 @@ calling the table with that operation symbol will return false. ((table 'isam-prev 'col1) '(12 7)) => (9 8) -File: slib.info, Node: Table Administration, Prev: Sequential Index Operations, Up: Table Operations - +File: slib-3b5.info, Node: Table Administration, Prev: Sequential Index Operations, Up: Table Operations + | 6.1.2.6 Table Administration ............................ @@ -10626,8 +10716,8 @@ File: slib.info, Node: Table Administration, Prev: Sequential Index Operations Subsequent operations to this table will signal an error. -File: slib.info, Node: Database Interpolation, Next: Embedded Commands, Prev: Table Operations, Up: Relational Database - +File: slib-3b5.info, Node: Database Interpolation, Next: Embedded Commands, Prev: Table Operations, Up: Relational Database + | 6.1.3 Database Interpolation ---------------------------- @@ -10651,8 +10741,8 @@ interpolation of associations between those in the table. associated with the smallest stored key is used. -File: slib.info, Node: Embedded Commands, Next: Database Macros, Prev: Database Interpolation, Up: Relational Database - +File: slib-3b5.info, Node: Embedded Commands, Next: Database Macros, Prev: Database Interpolation, Up: Relational Database + | 6.1.4 Embedded Commands ----------------------- @@ -10679,7 +10769,7 @@ run when the `*initialize*' procedure is automatically applied to the enhanced relational-database. Note also that if you wish to shadow or hide from the user -relational-database methods described in *Note Database Operations::, +relational-database methods described in *note Database Operations::, this can be done by a dispatch in the closure returned by the `*initialize*' expression rather than by entries in the `*commands*' table if it is desired that the underlying methods remain accessible to @@ -10695,8 +10785,8 @@ code in the `*commands*' table. * Command Example:: -File: slib.info, Node: Database Extension, Next: Command Intrinsics, Prev: Embedded Commands, Up: Embedded Commands - +File: slib-3b5.info, Node: Database Extension, Next: Command Intrinsics, Prev: Embedded Commands, Up: Embedded Commands + | 6.1.4.1 Database Extension .......................... @@ -10749,13 +10839,13 @@ File: slib.info, Node: Database Extension, Next: Command Intrinsics, Prev: Em otherwise. -File: slib.info, Node: Command Intrinsics, Next: Define-tables Example, Prev: Database Extension, Up: Embedded Commands - +File: slib-3b5.info, Node: Command Intrinsics, Next: Define-tables Example, Prev: Database Extension, Up: Embedded Commands + | 6.1.4.2 Command Intrinsics .......................... Some commands are defined in all extended relational-databases. The are -called just like *Note Database Operations::. +called just like *note Database Operations::. -- Operation on relational-database: add-domain domain-row Adds DOMAIN-ROW to the "domains" table if there is no row in the @@ -10794,8 +10884,8 @@ called just like *Note Database Operations::. DOMAIN. -File: slib.info, Node: Define-tables Example, Next: The *commands* Table, Prev: Command Intrinsics, Up: Embedded Commands - +File: slib-3b5.info, Node: Define-tables Example, Next: The *commands* Table, Prev: Command Intrinsics, Up: Embedded Commands + | 6.1.4.3 Define-tables Example ............................. @@ -10838,8 +10928,8 @@ saved and changed to immutable. (solidify-database my-rdb) -File: slib.info, Node: The *commands* Table, Next: Command Service, Prev: Define-tables Example, Up: Embedded Commands - +File: slib-3b5.info, Node: The *commands* Table, Next: Command Service, Prev: Define-tables Example, Up: Embedded Commands + | 6.1.4.4 The *commands* Table ............................ @@ -10900,8 +10990,8 @@ needed for this column, "sticky" defaults can be implemented using shared state with the domain-integrity-rule. -File: slib.info, Node: Command Service, Next: Command Example, Prev: The *commands* Table, Up: Embedded Commands - +File: slib-3b5.info, Node: Command Service, Next: Command Example, Prev: The *commands* Table, Up: Embedded Commands + | 6.1.4.5 Command Service ....................... @@ -10953,8 +11043,8 @@ File: slib.info, Node: Command Service, Next: Command Example, Prev: The *com For information about parameters, *Note Parameter lists::. -File: slib.info, Node: Command Example, Prev: Command Service, Up: Embedded Commands - +File: slib-3b5.info, Node: Command Example, Prev: Command Service, Up: Embedded Commands + | 6.1.4.6 Command Example ....................... @@ -11065,8 +11155,8 @@ those arguments from a `getopt' style argument list (*note Getopt::). ERROR: getopt->parameter-list "unrecognized option" "-?" -File: slib.info, Node: Database Macros, Next: Database Browser, Prev: Embedded Commands, Up: Relational Database - +File: slib-3b5.info, Node: Database Macros, Next: Database Browser, Prev: Embedded Commands, Up: Relational Database + | 6.1.5 Database Macros --------------------- @@ -11093,8 +11183,8 @@ emacs: * Within-database Example:: -File: slib.info, Node: Within-database, Next: Within-database Example, Prev: Database Macros, Up: Database Macros - +File: slib-3b5.info, Node: Within-database, Next: Within-database Example, Prev: Database Macros, Up: Database Macros + | 6.1.5.1 Within-database ....................... @@ -11171,8 +11261,8 @@ File: slib.info, Node: Within-database, Next: Within-database Example, Prev: ) -File: slib.info, Node: Within-database Example, Prev: Within-database, Up: Database Macros - +File: slib-3b5.info, Node: Within-database Example, Prev: Within-database, Up: Database Macros + | 6.1.5.2 Within-database Example ............................... @@ -11233,8 +11323,8 @@ Here is an example of `within-database' macros: (close-database my-rdb) -File: slib.info, Node: Database Browser, Prev: Database Macros, Up: Relational Database - +File: slib-3b5.info, Node: Database Browser, Prev: Database Macros, Up: Relational Database + | 6.1.6 Database Browser ---------------------- @@ -11264,10 +11354,9 @@ File: slib.info, Node: Database Browser, Prev: Database Macros, Up: Relationa default to it; `browse' prints the records of the table named by the symbol TABLE-NAME. - -File: slib.info, Node: Relational Infrastructure, Next: Weight-Balanced Trees, Prev: Relational Database, Up: Database Packages - +File: slib-3b5.info, Node: Relational Infrastructure, Next: Weight-Balanced Trees, Prev: Relational Database, Up: Database Packages + | 6.2 Relational Infrastructure ============================= @@ -11279,8 +11368,8 @@ File: slib.info, Node: Relational Infrastructure, Next: Weight-Balanced Trees, * Database Operations:: -File: slib.info, Node: Base Table, Next: Catalog Representation, Prev: Relational Infrastructure, Up: Relational Infrastructure - +File: slib-3b5.info, Node: Base Table, Next: Catalog Representation, Prev: Relational Infrastructure, Up: Relational Infrastructure + | 6.2.1 Base Table ---------------- @@ -11325,7 +11414,7 @@ of data. WB comes with two base-table embeddings. integer keys with the correct numerical collation order. This rest of this section documents the interface for a base table -implementation from which the *Note Relational Database:: package +implementation from which the *note Relational Database:: package constructs a Relational system. It will be of interest primarily to those wishing to port or write new base-table implementations. @@ -11347,8 +11436,8 @@ those wishing to port or write new base-table implementations. * Base ISAM Operations:: -File: slib.info, Node: The Base, Next: Base Tables, Prev: Base Table, Up: Base Table - +File: slib-3b5.info, Node: The Base, Next: Base Tables, Prev: Base Table, Up: Base Table + | 6.2.1.1 The Base ................ @@ -11412,8 +11501,8 @@ otherwise. For example: successfully, `#t' is returned. Otherwise, `#f' is returned. -File: slib.info, Node: Base Tables, Next: Base Field Types, Prev: The Base, Up: Base Table - +File: slib-3b5.info, Node: Base Tables, Next: Base Field Types, Prev: The Base, Up: Base Table + | 6.2.1.2 Base Tables ................... @@ -11446,8 +11535,8 @@ File: slib.info, Node: Base Tables, Next: Base Field Types, Prev: The Base, system catalog. -File: slib.info, Node: Base Field Types, Next: Composite Keys, Prev: Base Tables, Up: Base Table - +File: slib-3b5.info, Node: Base Field Types, Next: Composite Keys, Prev: Base Tables, Up: Base Table + | 6.2.1.3 Base Field Types ........................ @@ -11466,8 +11555,8 @@ An "ordinal" is an exact positive integer. The other types are standard Scheme. -File: slib.info, Node: Composite Keys, Next: Base Record Operations, Prev: Base Field Types, Up: Base Table - +File: slib-3b5.info, Node: Composite Keys, Next: Base Record Operations, Prev: Base Field Types, Up: Base Table + | 6.2.1.4 Composite Keys ...................... @@ -11509,8 +11598,8 @@ File: slib.info, Node: Composite Keys, Next: Base Record Operations, Prev: Ba the list which was passed to create COMPOSITE-KEY. -File: slib.info, Node: Base Record Operations, Next: Match Keys, Prev: Composite Keys, Up: Base Table - +File: slib-3b5.info, Node: Base Record Operations, Next: Match Keys, Prev: Composite Keys, Up: Base Table + | 6.2.1.5 Base Record Operations .............................. @@ -11549,8 +11638,8 @@ works with older base-table implementations by using `make-getter'. HANDLE. An unspecified value is returned. -File: slib.info, Node: Match Keys, Next: Aggregate Base Operations, Prev: Base Record Operations, Up: Base Table - +File: slib-3b5.info, Node: Match Keys, Next: Aggregate Base Operations, Prev: Base Record Operations, Up: Base Table + | 6.2.1.6 Match Keys .................. @@ -11572,8 +11661,8 @@ element of the MATCH-KEYS list. The elements and their actions are: Any other value matches only those keys `equal?' to it. -File: slib.info, Node: Aggregate Base Operations, Next: Base ISAM Operations, Prev: Match Keys, Up: Base Table - +File: slib-3b5.info, Node: Aggregate Base Operations, Next: Base ISAM Operations, Prev: Match Keys, Up: Base Table + | 6.2.1.7 Aggregate Base Operations ................................. @@ -11598,8 +11687,8 @@ composite-keys for matching with MATCH-KEYS. MATCH-KEYS in an unspecified order. -File: slib.info, Node: Base ISAM Operations, Prev: Aggregate Base Operations, Up: Base Table - +File: slib-3b5.info, Node: Base ISAM Operations, Prev: Aggregate Base Operations, Up: Base Table + | 6.2.1.8 Base ISAM Operations ............................ @@ -11629,8 +11718,8 @@ These operations are optional for a Base-Table implementation. present. -File: slib.info, Node: Catalog Representation, Next: Relational Database Objects, Prev: Base Table, Up: Relational Infrastructure - +File: slib-3b5.info, Node: Catalog Representation, Next: Relational Database Objects, Prev: Base Table, Up: Relational Infrastructure + | 6.2.2 Catalog Representation ---------------------------- @@ -11698,13 +11787,13 @@ The types for which support is planned are: virtual <expression> -File: slib.info, Node: Relational Database Objects, Next: Database Operations, Prev: Catalog Representation, Up: Relational Infrastructure - +File: slib-3b5.info, Node: Relational Database Objects, Next: Database Operations, Prev: Catalog Representation, Up: Relational Infrastructure + | 6.2.3 Relational Database Objects --------------------------------- This object-oriented interface is deprecated for typical database -applications; *Note Using Databases:: provides an application programmer +applications; *note Using Databases:: provides an application programmer interface which is easier to understand and use. -- Function: make-relational-system base-table-implementation @@ -11739,7 +11828,7 @@ relational system returned by a call to `make-relational-system'. be created if such can be supported by the underlying base table implelentation. If the database cannot be created as specified `#f' is returned. For the fields and layout of descriptor tables, - *Note Catalog Representation:: + *note Catalog Representation:: -- Operation on relational-system: open-database filename mutable? Returns an open relational database associated with FILENAME. If @@ -11751,13 +11840,13 @@ relational system returned by a call to `make-relational-system'. cannot be opened as specified `#f' is returned. -File: slib.info, Node: Database Operations, Prev: Relational Database Objects, Up: Relational Infrastructure - +File: slib-3b5.info, Node: Database Operations, Prev: Relational Database Objects, Up: Relational Infrastructure + | 6.2.4 Database Operations ------------------------- This object-oriented interface is deprecated for typical database -applications; *Note Using Databases:: provides an application programmer +applications; *note Using Databases:: provides an application programmer interface which is easier to understand and use. These are the descriptions of the methods available from an open @@ -11793,9 +11882,8 @@ the database with the symbol name of the operation. For example: -- Operation on relational-database: solidify-database Causes any pending updates to the database file to be written out. - If the writes completed successfully, then the database is - changed to be immutable and `#t' is returned. Otherwise, `#f' is - returned. + If the writes completed successfully, then the database is changed + to be immutable and `#t' is returned. Otherwise, `#f' is returned. -- Operation on relational-database: table-exists? table-name Returns `#t' if TABLE-NAME exists in the system catalog, otherwise @@ -11831,8 +11919,8 @@ These methods will be present only in mutable databases. Not yet implemented. -File: slib.info, Node: Weight-Balanced Trees, Prev: Relational Infrastructure, Up: Database Packages - +File: slib-3b5.info, Node: Weight-Balanced Trees, Prev: Relational Infrastructure, Up: Database Packages + | 6.3 Weight-Balanced Trees ========================= @@ -11914,8 +12002,8 @@ once before calling any of the procedures defined here. * Indexing Operations on Weight-Balanced Trees:: -File: slib.info, Node: Construction of Weight-Balanced Trees, Next: Basic Operations on Weight-Balanced Trees, Prev: Weight-Balanced Trees, Up: Weight-Balanced Trees - +File: slib-3b5.info, Node: Construction of Weight-Balanced Trees, Next: Basic Operations on Weight-Balanced Trees, Prev: Weight-Balanced Trees, Up: Weight-Balanced Trees + | 6.3.1 Construction of Weight-Balanced Trees ------------------------------------------- @@ -11991,8 +12079,8 @@ used many times throughout the program's execution. tree)) -File: slib.info, Node: Basic Operations on Weight-Balanced Trees, Next: Advanced Operations on Weight-Balanced Trees, Prev: Construction of Weight-Balanced Trees, Up: Weight-Balanced Trees - +File: slib-3b5.info, Node: Basic Operations on Weight-Balanced Trees, Next: Advanced Operations on Weight-Balanced Trees, Prev: Construction of Weight-Balanced Trees, Up: Weight-Balanced Trees + | 6.3.2 Basic Operations on Weight-Balanced Trees ----------------------------------------------- @@ -12051,8 +12139,8 @@ number of associations in a tree. of the number of associations in WT-TREE. -File: slib.info, Node: Advanced Operations on Weight-Balanced Trees, Next: Indexing Operations on Weight-Balanced Trees, Prev: Basic Operations on Weight-Balanced Trees, Up: Weight-Balanced Trees - +File: slib-3b5.info, Node: Advanced Operations on Weight-Balanced Trees, Next: Indexing Operations on Weight-Balanced Trees, Prev: Basic Operations on Weight-Balanced Trees, Up: Weight-Balanced Trees + | 6.3.3 Advanced Operations on Weight-Balanced Trees -------------------------------------------------- @@ -12174,9 +12262,52 @@ associations. (display (list key value))) WT-TREE)) + -- procedure+: wt-tree/union-merge wt-tree-1 wt-tree-2 merge | + Returns a new tree containing all the associations from both | + trees. If both trees have an association for the same key, the | + datum associated with that key in the result tree is computed by | + applying the procedure MERGE to the key, the value from WT-TREE-1 | + and the value from WT-TREE-2. MERGE is of the form | + | + (lambda (KEY DATUM-1 DATUM-2) ...) | + | + If some key occurs only in one tree, that association will appear | + in the result tree without being processed by MERGE, so for this | + operation to make sense, either MERGE must have both a right and | + left identity that correspond to the association being absent in | + one of the trees, or some guarantee must be made, for example, all | + the keys in one tree are known to occur in the other. | + | + These are all reasonable procedures for MERGE | + | + (lambda (key val1 val2) (+ val1 val2)) | + (lambda (key val1 val2) (append val1 val2)) | + (lambda (key val1 val2) (wt-tree/union val1 val2)) | + | + However, a procedure like | + | + (lambda (key val1 val2) (- val1 val2)) | + | + would result in a subtraction of the data for all associations | + with keys occuring in both trees but associations with keys | + occuring in only the second tree would be copied, not negated, as | + is presumably be intent. The programmer might ensure that this | + never happens. | + | + This procedure has the same time behavior as `wt-tree/union' but | + with a slightly worse constant factor. Indeed, `wt-tree/union' | + might have been defined like this: | + | + (define (wt-tree/union tree1 tree2) | + (wt-tree/union-merge tree1 tree2 | + (lambda (key val1 val2) val2))) | + | + The MERGE procedure takes the KEY as a parameter in case the data are | +not independent of the key. | + | -File: slib.info, Node: Indexing Operations on Weight-Balanced Trees, Prev: Advanced Operations on Weight-Balanced Trees, Up: Weight-Balanced Trees - +File: slib-3b5.info, Node: Indexing Operations on Weight-Balanced Trees, Prev: Advanced Operations on Weight-Balanced Trees, Up: Weight-Balanced Trees + | 6.3.4 Indexing Operations on Weight-Balanced Trees -------------------------------------------------- @@ -12253,8 +12384,8 @@ determined, both in logarthmic time. (wt-tree/delete! WT-TREE (wt-tree/min WT-TREE)) -File: slib.info, Node: Other Packages, Next: About SLIB, Prev: Database Packages, Up: Top - +File: slib-3b5.info, Node: Other Packages, Next: About SLIB, Prev: Database Packages, Up: Top + | 7 Other Packages **************** @@ -12269,8 +12400,8 @@ File: slib.info, Node: Other Packages, Next: About SLIB, Prev: Database Packa * Extra-SLIB Packages:: Outside the envelope. -File: slib.info, Node: Data Structures, Next: Sorting and Searching, Prev: Other Packages, Up: Other Packages - +File: slib-3b5.info, Node: Data Structures, Next: Sorting and Searching, Prev: Other Packages, Up: Other Packages + | 7.1 Data Structures =================== @@ -12294,8 +12425,8 @@ File: slib.info, Node: Data Structures, Next: Sorting and Searching, Prev: Ot * Records:: 'record -File: slib.info, Node: Arrays, Next: Subarrays, Prev: Data Structures, Up: Data Structures - +File: slib-3b5.info, Node: Arrays, Next: Subarrays, Prev: Data Structures, Up: Data Structures + | 7.1.1 Arrays ------------ @@ -12533,28 +12664,27 @@ finally to vector. Returns a boolean uniform-array prototype. -File: slib.info, Node: Subarrays, Next: Array Mapping, Prev: Arrays, Up: Data Structures - +File: slib-3b5.info, Node: Subarrays, Next: Array Mapping, Prev: Arrays, Up: Data Structures + | 7.1.2 Subarrays --------------- `(require 'subarray)' -- Function: subarray array select ... - selects a subset of an array. For ARRAY of rank n, there must be - at least n SELECTS arguments. For 0 <= j < n, SELECTSj is either + selects a subset of an array. For 0 <= j < n, SELECTj is either | an integer, a list of two integers within the range for the jth index, or #f. - When SELECTSj is a list of two integers, then the jth index is + When SELECTj is a list of two integers, then the jth index is | restricted to that subrange in the returned array. - When SELECTSj is #f, then the full range of the jth index is + When SELECTj is #f, then the full range of the jth index is | accessible in the returned array. An elided argument is equivalent to #f. - When SELECTSj is an integer, then the rank of the returned array is - less than ARRAY, and only elements whose jth index equals SELECTSj + When SELECTj is an integer, then the rank of the returned array is | + less than ARRAY, and only elements whose jth index equals SELECTj | are shared. > (define ra '#2A((a b c) (d e f))) @@ -12599,8 +12729,8 @@ File: slib.info, Node: Subarrays, Next: Array Mapping, Prev: Arrays, Up: Dat => #(1 2 2 4 13) -File: slib.info, Node: Array Mapping, Next: Array Interpolation, Prev: Subarrays, Up: Data Structures - +File: slib-3b5.info, Node: Array Mapping, Next: Array Interpolation, Prev: Subarrays, Up: Data Structures + | 7.1.3 Array Mapping ------------------- @@ -12664,8 +12794,8 @@ File: slib.info, Node: Array Mapping, Next: Array Interpolation, Prev: Subarr The order of copying is unspecified. -File: slib.info, Node: Array Interpolation, Next: Association Lists, Prev: Array Mapping, Up: Data Structures - +File: slib-3b5.info, Node: Array Interpolation, Next: Association Lists, Prev: Array Mapping, Up: Data Structures + | 7.1.4 Array Interpolation ------------------------- @@ -12695,8 +12825,8 @@ File: slib.info, Node: Array Interpolation, Next: Association Lists, Prev: Ar ra ==> #2A:floR64b((1.0 3.0) (2.5 4.5) (4.0 6.0)) -File: slib.info, Node: Association Lists, Next: Byte, Prev: Array Interpolation, Up: Data Structures - +File: slib-3b5.info, Node: Association Lists, Next: Byte, Prev: Array Interpolation, Up: Data Structures + | 7.1.5 Association Lists ----------------------- @@ -12751,8 +12881,8 @@ tables for improved performance. be a function of 2 arguments. The returned value is unspecified. -File: slib.info, Node: Byte, Next: Byte/Number Conversions, Prev: Association Lists, Up: Data Structures - +File: slib-3b5.info, Node: Byte, Next: Byte/Number Conversions, Prev: Association Lists, Up: Data Structures + | 7.1.6 Byte ---------- @@ -12784,28 +12914,28 @@ character sets. These functions abstract the notion of a "byte". -- Function: bytes byte ... Returns a newly allocated byte-array composed of the small nonnegative arguments. - | + -- Function: list->bytes bytes `list->bytes' returns a newly allocated byte-array formed from the small nonnegative integers in the list BYTES. - -- Function: bytes->list bytes | - `bytes->list' returns a newly allocated list of the bytes that | - make up the given byte-array. | - | + -- Function: bytes->list bytes + `bytes->list' returns a newly allocated list of the bytes that + make up the given byte-array. + `Bytes->list' and `list->bytes' are inverses so far as `equal?' is concerned. - -- Function: bytes->string bytes | - Returns a new string formed from applying `integer->char' to each | - byte in `bytes->string'. Note that this may signal an error for | - bytes having values between 128 and 255. | - | - -- Function: string->bytes string | - Returns a new byte-array formed from applying `char->integer' to | - each character in `string->bytes'. Note that this may signal an | - error if an integer is larger than 255. | - | + -- Function: bytes->string bytes + Returns a new string formed from applying `integer->char' to each + byte in `bytes->string'. Note that this may signal an error for + bytes having values between 128 and 255. + + -- Function: string->bytes string + Returns a new byte-array formed from applying `char->integer' to + each character in `string->bytes'. Note that this may signal an + error if an integer is larger than 255. + -- Function: bytes-copy bytes Returns a newly allocated copy of the given BYTES. @@ -12861,8 +12991,8 @@ Byte/Number Conversions:: are always big-endian. `read-bytes' returns a newly allocated bytes-array filled with `(abs N)' bytes read from PORT. If N is positive, then the first byte read is stored at index 0; otherwise the last byte read is - stored at index 0. Note that the length of the returned | - byte-array will be less than `(abs N)' if PORT reaches end-of-file. | + stored at index 0. Note that the length of the returned + byte-array will be less than `(abs N)' if PORT reaches end-of-file. PORT may be omitted, in which case it defaults to the value returned by `current-input-port'. @@ -12881,27 +13011,27 @@ Byte/Number Conversions:: are always big-endian. for reading and writing blocks of bytes. The relative size of START and END determines the order of writing. - -- Procedure: subbytes-read! bts start end port | - -- Procedure: subbytes-read! bts start end | - Fills BTS with up to `(abs (- START END))' bytes read from PORT. | - The first byte read is stored at index BTS. `subbytes-read!' | - returns the number of bytes read. | + -- Procedure: subbytes-read! bts start end port + -- Procedure: subbytes-read! bts start end + Fills BTS with up to `(abs (- START END))' bytes read from PORT. + The first byte read is stored at index BTS. `subbytes-read!' + returns the number of bytes read. PORT may be omitted, in which case it defaults to the value returned by `current-input-port'. - -- Function: subbytes-write bts start end port | - -- Function: subbytes-write bts start end | + -- Function: subbytes-write bts start end port + -- Function: subbytes-write bts start end `subbytes-write' writes `(abs (- START END))' bytes to output-port - PORT. The first byte written is index START of BTS. | + PORT. The first byte written is index START of BTS. `subbytes-write' returns the number of bytes written. PORT may be omitted, in which case it defaults to the value returned by `current-output-port'. -File: slib.info, Node: Byte/Number Conversions, Next: MAT-File Format, Prev: Byte, Up: Data Structures - +File: slib-3b5.info, Node: Byte/Number Conversions, Next: MAT-File Format, Prev: Byte, Up: Data Structures + | 7.1.7 Byte/Number Conversions ----------------------------- @@ -12974,6 +13104,7 @@ determines the signedness of the number. (bytes->ieee-double (bytes 0 4 0 0 0 0 0 0)) => 5.562684646268003e-309 (bytes->ieee-double (bytes 0 0 0 0 0 0 0 1)) => 4.0e-324 + (bytes->ieee-double (list->bytes '(127 239 255 255 255 255 255 255))) 179.76931348623157e306 (bytes->ieee-double (bytes #xFF #xF0 0 0 0 0 0 0)) => -inf.0 (bytes->ieee-double (bytes #x7F #xF0 0 0 0 0 0 0)) => +inf.0 (bytes->ieee-double (bytes #x7F #xF8 0 0 0 0 0 0)) => 0/0 @@ -13059,8 +13190,8 @@ enables the full range of numbers as keys in BYTE-VECTOR modifications. -File: slib.info, Node: MAT-File Format, Next: Portable Image Files, Prev: Byte/Number Conversions, Up: Data Structures - +File: slib-3b5.info, Node: MAT-File Format, Next: Portable Image Files, Prev: Byte/Number Conversions, Up: Data Structures + | 7.1.8 MAT-File Format --------------------- @@ -13090,8 +13221,8 @@ awaits a sample file. list of the symbols defined. -File: slib.info, Node: Portable Image Files, Next: Collections, Prev: MAT-File Format, Up: Data Structures - +File: slib-3b5.info, Node: Portable Image Files, Next: Collections, Prev: MAT-File Format, Up: Data Structures + | 7.1.9 Portable Image Files -------------------------- @@ -13128,6 +13259,7 @@ File: slib.info, Node: Portable Image Files, Next: Collections, Prev: MAT-Fil ARRAY must be the correct size and type for PATH. ARRAY is returned. + -- Function: pnm:image-file->array path `pnm:image-file->array' creates and returns an array with the "portable bitmap graphics" file named by PATH read into it. @@ -13139,8 +13271,8 @@ File: slib.info, Node: Portable Image Files, Next: Collections, Prev: MAT-Fil COMMENTs are included in the file header. -File: slib.info, Node: Collections, Next: Dynamic Data Type, Prev: Portable Image Files, Up: Data Structures - +File: slib-3b5.info, Node: Collections, Next: Dynamic Data Type, Prev: Portable Image Files, Up: Data Structures + | 7.1.10 Collections ------------------ @@ -13219,7 +13351,7 @@ operations. => (c b d a). `Reduce' called with two arguments will work as does the procedure - of the same name from *Note Common List Functions::). + of the same name from *Note Common List Functions::. -- Function: any? pred collection1 ... A generalization of the list-based `some' (*note Lists as @@ -13246,7 +13378,7 @@ operations. Returns the number of elements in COLLECTION. -- Function: Setter list-ref - See *Note Setters:: for a definition of "setter". N.B. `(setter + See *note Setters:: for a definition of "setter". N.B. `(setter list-ref)' doesn't work properly for element 0 of a list. Here is a sample collection: `simple-table' which is also a `table'. @@ -13309,8 +13441,8 @@ operations. ) ) ) ) -File: slib.info, Node: Dynamic Data Type, Next: Hash Tables, Prev: Collections, Up: Data Structures - +File: slib-3b5.info, Node: Dynamic Data Type, Next: Hash Tables, Prev: Collections, Up: Data Structures + | 7.1.11 Dynamic Data Type ------------------------ @@ -13344,8 +13476,8 @@ File: slib.info, Node: Dynamic Data Type, Next: Hash Tables, Prev: Collection The `dynamic-bind' macro is not implemented. -File: slib.info, Node: Hash Tables, Next: Object, Prev: Dynamic Data Type, Up: Data Structures - +File: slib-3b5.info, Node: Hash Tables, Next: Object, Prev: Dynamic Data Type, Up: Data Structures + | 7.1.12 Hash Tables ------------------ @@ -13409,15 +13541,15 @@ should be `eq?', `eqv?', `equal?', `=', `char=?', `char-ci=?', have all of the associations of the old hash table. -File: slib.info, Node: Object, Next: Priority Queues, Prev: Hash Tables, Up: Data Structures - +File: slib-3b5.info, Node: Object, Next: Priority Queues, Prev: Hash Tables, Up: Data Structures + | 7.1.13 Macroless Object System ------------------------------ `(require 'object)' This is the Macroless Object System written by Wade Humeniuk -(whumeniu@datap.ca). Conceptual Tributes: *Note Yasos::, MacScheme's +(whumeniu@datap.ca). Conceptual Tributes: *note Yasos::, MacScheme's %object, CLOS, Lack of R4RS macros. 7.1.14 Concepts @@ -13635,8 +13767,8 @@ Inheritance (invert! x) error--> ERROR: Method not supported: x -File: slib.info, Node: Priority Queues, Next: Queues, Prev: Object, Up: Data Structures - +File: slib-3b5.info, Node: Priority Queues, Next: Queues, Prev: Object, Up: Data Structures + | 7.1.17 Priority Queues ---------------------- @@ -13662,8 +13794,8 @@ Algorithms' by T. Cormen, C. Leiserson, R. Rivest. 1989 MIT Press. error is signaled. -File: slib.info, Node: Queues, Next: Records, Prev: Priority Queues, Up: Data Structures - +File: slib-3b5.info, Node: Queues, Next: Records, Prev: Priority Queues, Up: Data Structures + | 7.1.18 Queues ------------- @@ -13706,8 +13838,8 @@ rear, and removed from the front (i.e., they are what are often called Returns the datum at the rear of the queue Q. -File: slib.info, Node: Records, Prev: Queues, Up: Data Structures - +File: slib-3b5.info, Node: Records, Prev: Queues, Up: Data Structures + | 7.1.19 Records -------------- @@ -13778,8 +13910,8 @@ types which are unforgeable and incorruptible by R4RS procedures. supported. -File: slib.info, Node: Sorting and Searching, Next: Procedures, Prev: Data Structures, Up: Other Packages - +File: slib-3b5.info, Node: Sorting and Searching, Next: Procedures, Prev: Data Structures, Up: Other Packages + | 7.2 Sorting and Searching ========================= @@ -13791,14 +13923,14 @@ File: slib.info, Node: Sorting and Searching, Next: Procedures, Prev: Data St * Sorting:: 'sort * Topological Sort:: Keep your socks on. * Hashing:: 'hash -* Space-Filling Curves:: 'hilbert and 'sierpinski +* Space-Filling Curves:: 'space-filling and 'sierpinski * Soundex:: Dimension Reduction of Last Names * String Search:: Also Search from a Port. * Sequence Comparison:: 'diff and longest-common-subsequence -File: slib.info, Node: Common List Functions, Next: Tree Operations, Prev: Sorting and Searching, Up: Sorting and Searching - +File: slib-3b5.info, Node: Common List Functions, Next: Tree Operations, Prev: Sorting and Searching, Up: Sorting and Searching + | 7.2.1 Common List Functions --------------------------- @@ -13816,8 +13948,8 @@ optional arguments in some cases. * Non-List functions:: -File: slib.info, Node: List construction, Next: Lists as sets, Prev: Common List Functions, Up: Common List Functions - +File: slib-3b5.info, Node: List construction, Next: Lists as sets, Prev: Common List Functions, Up: Common List Functions + | 7.2.1.1 List construction ......................... @@ -13870,8 +14002,8 @@ File: slib.info, Node: List construction, Next: Lists as sets, Prev: Common L => #t -File: slib.info, Node: Lists as sets, Next: Lists as sequences, Prev: List construction, Up: Common List Functions - +File: slib-3b5.info, Node: Lists as sets, Next: Lists as sequences, Prev: List construction, Up: Common List Functions + | 7.2.1.2 Lists as sets ..................... @@ -14079,8 +14211,8 @@ as sets. => (2 4 3) -File: slib.info, Node: Lists as sequences, Next: Destructive list operations, Prev: Lists as sets, Up: Common List Functions - +File: slib-3b5.info, Node: Lists as sequences, Next: Destructive list operations, Prev: Lists as sets, Up: Common List Functions + | 7.2.1.3 Lists as sequences .......................... @@ -14196,7 +14328,7 @@ File: slib.info, Node: Lists as sequences, Next: Destructive list operations, (last '(foo bar baz bang) 2) => (baz bang) (last '(1 2 3) 0) - => 0 + => () | -- Function: butlast lst n `butlast' returns all but the last N elements of LST. @@ -14241,8 +14373,8 @@ identical arguments. => (a b) -File: slib.info, Node: Destructive list operations, Next: Non-List functions, Prev: Lists as sequences, Up: Common List Functions - +File: slib-3b5.info, Node: Destructive list operations, Next: Non-List functions, Prev: Lists as sequences, Up: Common List Functions + | 7.2.1.4 Destructive list operations ................................... @@ -14325,8 +14457,8 @@ mutation is undefined. The examples should suffice to show why this is the case. -File: slib.info, Node: Non-List functions, Prev: Destructive list operations, Up: Common List Functions - +File: slib-3b5.info, Node: Non-List functions, Prev: Destructive list operations, Up: Common List Functions + | 7.2.1.5 Non-List functions .......................... @@ -14364,8 +14496,8 @@ File: slib.info, Node: Non-List functions, Prev: Destructive list operations, => #t -File: slib.info, Node: Tree Operations, Next: Chapter Ordering, Prev: Common List Functions, Up: Sorting and Searching - +File: slib-3b5.info, Node: Tree Operations, Next: Chapter Ordering, Prev: Common List Functions, Up: Sorting and Searching + | 7.2.2 Tree operations --------------------- @@ -14408,8 +14540,8 @@ File: slib.info, Node: Tree Operations, Next: Chapter Ordering, Prev: Common => #f -File: slib.info, Node: Chapter Ordering, Next: Sorting, Prev: Tree Operations, Up: Sorting and Searching - +File: slib-3b5.info, Node: Chapter Ordering, Next: Sorting, Prev: Tree Operations, Up: Sorting and Searching + | 7.2.3 Chapter Ordering ---------------------- @@ -14447,8 +14579,8 @@ like case. (chap:next-string "Revised^{4}") => "Revised^{5}" -File: slib.info, Node: Sorting, Next: Topological Sort, Prev: Chapter Ordering, Up: Sorting and Searching - +File: slib-3b5.info, Node: Sorting, Next: Topological Sort, Prev: Chapter Ordering, Up: Sorting and Searching + | 7.2.4 Sorting ------------- @@ -14536,8 +14668,8 @@ element. (sorted? (sort! SEQUENCE LESS?) LESS?) => #t -File: slib.info, Node: Topological Sort, Next: Hashing, Prev: Sorting, Up: Sorting and Searching - +File: slib-3b5.info, Node: Topological Sort, Next: Hashing, Prev: Sorting, Up: Sorting and Searching + | 7.2.5 Topological Sort ---------------------- @@ -14587,8 +14719,8 @@ The algorithm is inspired by Cormen, Leiserson and Rivest (1990) (socks undershorts pants shoes watch shirt belt tie jacket) -File: slib.info, Node: Hashing, Next: Space-Filling Curves, Prev: Topological Sort, Up: Sorting and Searching - +File: slib-3b5.info, Node: Hashing, Next: Space-Filling Curves, Prev: Topological Sort, Up: Sorting and Searching + | 7.2.6 Hashing ------------- @@ -14618,21 +14750,80 @@ Hash tables use these functions. the same `hashv' implies the items have the same `hashq'. -File: slib.info, Node: Space-Filling Curves, Next: Soundex, Prev: Hashing, Up: Sorting and Searching - +File: slib-3b5.info, Node: Space-Filling Curves, Next: Soundex, Prev: Hashing, Up: Sorting and Searching + | 7.2.7 Space-Filling Curves -------------------------- * Menu: -* Hilbert Space-Filling Curve:: Non-negative coordinates -* Peano Space-Filling Curve:: Integer coordinates -* Sierpinski Curve:: +* Multidimensional Space-Filling Curves:: Includes Hilbert and Peano curves +* Hilbert Space-Filling Curve:: Legacy +* Peano Space-Filling Curve:: Legacy +* Sierpinski Curve:: Rank-2 to scalar -File: slib.info, Node: Hilbert Space-Filling Curve, Next: Peano Space-Filling Curve, Prev: Space-Filling Curves, Up: Space-Filling Curves - -7.2.7.1 Hilbert Space-Filling Curve +File: slib-3b5.info, Node: Multidimensional Space-Filling Curves, Next: Hilbert Space-Filling Curve, Prev: Space-Filling Curves, Up: Space-Filling Curves + | +7.2.7.1 Multidimensional Space-Filling Curves | +............................................. | + | +`(require 'space-filling)' | + | + The algorithms and cell properties are described in | +`http://people.csail.mit.edu/jaffer/Geometry/RMDSFF.pdf' | + | + -- Function: make-cell type rank side precession | + -- Function: make-cell type rank side | + -- Function: make-cell type rank | + TYPE must be the symbol `diagonal', `adjacent', or `centered'. | + RANK must be an integer larger than 1. SIDE, if present, must be | + an even integer larger than 1 if TYPE is `adjacent' or an odd | + integer larger than 2 otherwise; SIDE defaults to the smallest | + value. PRECESSION, if present, must be an integer between 0 and | + SIDE^RANK-1; it is relevant only when TYPE is `diagonal' or | + `centered'. | + | + | + -- Function: make-cell Hamiltonian-path-vector precession | + -- Function: make-cell Hamiltonian-path-vector | + TYPE must be a vector of SIDE^RANK lists of RANK of integers | + encoding the coordinate positions of a Hamiltonian path on the | + RANK-dimensional grid of points starting and ending on corners of | + the grid. The starting corner must be the origin (all-zero | + coordinates). If the side-length is even, then the ending corner | + must be non-zero in only one coordinate; otherwise, the ending | + corner must be the furthest diagonally opposite corner from the | + origin. | + | + `make-cell' returns a data object suitable for passing as the | + first argument to `integer->coordinates' or `coordinates->integer'. | + | + Hilbert, Peano, and centered Peano cells are generated respectively | +by: | + (make-cell 'adjacent RANK 2) ; Hilbert | + (make-cell 'diagonal RANK 3) ; Peano | + (make-cell 'centered RANK 3) ; centered Peano | + | + In the conversion procedures, if the cell is `diagonal' or | +`adjacent', then the coordinates and scalar must be nonnegative | +integers. If `centered', then the integers can be negative. | + | + -- Function: integer->coordinates cell u | + `integer->coordinates' converts the integer U to a list of | + coordinates according to CELL. | + | + -- Function: coordinates->integer cell v | + `coordinates->integer' converts the list of coordinates V to an | + integer according to CELL. | + | + COORDINATES->INTEGER and INTEGER->COORDINATES are inverse functions | +when passed the same CELL argument. | + | + +File: slib-3b5.info, Node: Hilbert Space-Filling Curve, Next: Peano Space-Filling Curve, Prev: Multidimensional Space-Filling Curves, Up: Space-Filling Curves + | +7.2.7.2 Hilbert Space-Filling Curve | ................................... `(require 'hilbert-fill)' @@ -14664,6 +14855,7 @@ For any exact nonnegative integer SCALAR and exact integer RANK > 2, `integer->hilbert-coordinates' for SCALAR arguments 0 and 1 will differ in the first element. + -- Function: integer->hilbert-coordinates scalar rank k SCALAR must be a nonnegative integer of no more than `RANK*K' bits. @@ -14678,7 +14870,7 @@ For any exact nonnegative integer SCALAR and exact integer RANK > 2, Returns an exact non-negative integer corresponding to COORDS, a list of non-negative integer coordinates. -7.2.7.2 Gray code +7.2.7.3 Gray code | ................. A "Gray code" is an ordering of non-negative integers in which exactly @@ -14714,7 +14906,7 @@ of Hilbert space-filling curves. of `(integer->gray-code k1)' and `(integer->gray-code k2)' will return the same value as the corresponding predicate of K1 and K2. -7.2.7.3 Bitwise Lamination +7.2.7.4 Bitwise Lamination | .......................... -- Function: delaminate-list count ks @@ -14730,9 +14922,9 @@ of Hilbert space-filling curves. => (7 6 5 4 0 0 0 0) -File: slib.info, Node: Peano Space-Filling Curve, Next: Sierpinski Curve, Prev: Hilbert Space-Filling Curve, Up: Space-Filling Curves - -7.2.7.4 Peano Space-Filling Curve +File: slib-3b5.info, Node: Peano Space-Filling Curve, Next: Sierpinski Curve, Prev: Hilbert Space-Filling Curve, Up: Space-Filling Curves + | +7.2.7.5 Peano Space-Filling Curve | ................................. `(require 'peano-fill)' @@ -14758,9 +14950,9 @@ File: slib.info, Node: Peano Space-Filling Curve, Next: Sierpinski Curve, Pre coordinates. -File: slib.info, Node: Sierpinski Curve, Prev: Peano Space-Filling Curve, Up: Space-Filling Curves - -7.2.7.5 Sierpinski Curve +File: slib-3b5.info, Node: Sierpinski Curve, Prev: Peano Space-Filling Curve, Up: Space-Filling Curves + | +7.2.7.6 Sierpinski Curve | ........................ `(require 'sierpinski)' @@ -14810,8 +15002,8 @@ File: slib.info, Node: Sierpinski Curve, Prev: Peano Space-Filling Curve, Up: -File: slib.info, Node: Soundex, Next: String Search, Prev: Space-Filling Curves, Up: Sorting and Searching - +File: slib-3b5.info, Node: Soundex, Next: String Search, Prev: Space-Filling Curves, Up: Sorting and Searching + | 7.2.8 Soundex ------------- @@ -14854,8 +15046,8 @@ File: slib.info, Node: Soundex, Next: String Search, Prev: Space-Filling Curv (map soundex '("Tchebysheff" "Chebyshev")) => ("T212" "C121") -File: slib.info, Node: String Search, Next: Sequence Comparison, Prev: Soundex, Up: Sorting and Searching - +File: slib-3b5.info, Node: String Search, Next: Sequence Comparison, Prev: Soundex, Up: Sorting and Searching + | 7.2.9 String Search ------------------- @@ -14917,8 +15109,8 @@ File: slib.info, Node: String Search, Next: Sequence Comparison, Prev: Sounde Returns the number of `#\newline' characters in string STR. -File: slib.info, Node: Sequence Comparison, Prev: String Search, Up: Sorting and Searching - +File: slib-3b5.info, Node: Sequence Comparison, Prev: String Search, Up: Sorting and Searching + | 7.2.10 Sequence Comparison -------------------------- @@ -15001,8 +15193,8 @@ known "spiff" program. ; e c h p q r -File: slib.info, Node: Procedures, Next: Standards Support, Prev: Sorting and Searching, Up: Other Packages - +File: slib-3b5.info, Node: Procedures, Next: Standards Support, Prev: Sorting and Searching, Up: Other Packages + | 7.3 Procedures ============== @@ -15019,8 +15211,8 @@ up here. * Metric Units:: Portable manifest types for numeric values. -File: slib.info, Node: Type Coercion, Next: String-Case, Prev: Procedures, Up: Procedures - +File: slib-3b5.info, Node: Type Coercion, Next: String-Case, Prev: Procedures, Up: Procedures + | 7.3.1 Type Coercion ------------------- @@ -15035,8 +15227,8 @@ File: slib.info, Node: Type Coercion, Next: String-Case, Prev: Procedures, U these symbols). -File: slib.info, Node: String-Case, Next: String Ports, Prev: Type Coercion, Up: Procedures - +File: slib-3b5.info, Node: String-Case, Next: String Ports, Prev: Type Coercion, Up: Procedures + | 7.3.2 String-Case ----------------- @@ -15083,8 +15275,8 @@ File: slib.info, Node: String-Case, Next: String Ports, Prev: Type Coercion, -File: slib.info, Node: String Ports, Next: Line I/O, Prev: String-Case, Up: Procedures - +File: slib-3b5.info, Node: String Ports, Next: Line I/O, Prev: String-Case, Up: Procedures + | 7.3.3 String Ports ------------------ @@ -15103,8 +15295,8 @@ File: slib.info, Node: String Ports, Next: Line I/O, Prev: String-Case, Up: closed and the value yielded by the procedure PROC is returned. -File: slib.info, Node: Line I/O, Next: Multi-Processing, Prev: String Ports, Up: Procedures - +File: slib-3b5.info, Node: Line I/O, Next: Multi-Processing, Prev: String Ports, Up: Procedures + | 7.3.4 Line I/O -------------- @@ -15150,8 +15342,8 @@ File: slib.info, Node: Line I/O, Next: Multi-Processing, Prev: String Ports, programs which generate lots of output is unspecified. -File: slib.info, Node: Multi-Processing, Next: Metric Units, Prev: Line I/O, Up: Procedures - +File: slib-3b5.info, Node: Multi-Processing, Next: Metric Units, Prev: Line I/O, Up: Procedures + | 7.3.5 Multi-Processing ---------------------- @@ -15178,14 +15370,14 @@ implementation, consider it an example of writing schedulers in Scheme. `process:queue', `(slib:exit)' is called (*note System::). -File: slib.info, Node: Metric Units, Prev: Multi-Processing, Up: Procedures - +File: slib-3b5.info, Node: Metric Units, Prev: Multi-Processing, Up: Procedures + | 7.3.6 Metric Units ------------------ `(require 'metric-units)' - `http://swiss.csail.mit.edu/~jaffer/MIXF' + `http://people.csail.mit.edu/jaffer/MIXF' "Metric Interchange Format" is a character string encoding for numerical values and units which: @@ -15372,8 +15564,8 @@ multiple (not submultiple) prefixes can also be used with B (byte). (si:conversion-factor "km/h" "mph" ) => -2 -File: slib.info, Node: Standards Support, Next: Session Support, Prev: Procedures, Up: Other Packages - +File: slib-3b5.info, Node: Standards Support, Next: Session Support, Prev: Procedures, Up: Other Packages + | 7.4 Standards Support ===================== @@ -15394,8 +15586,8 @@ File: slib.info, Node: Standards Support, Next: Session Support, Prev: Proced * SRFI:: 'http://srfi.schemers.org/srfi-0/srfi-0.html -File: slib.info, Node: RnRS, Next: With-File, Prev: Standards Support, Up: Standards Support - +File: slib-3b5.info, Node: RnRS, Next: With-File, Prev: Standards Support, Up: Standards Support + | 7.4.1 RnRS ---------- @@ -15427,8 +15619,8 @@ version of Scheme. namely `values', `macro', and `eval'. -File: slib.info, Node: With-File, Next: Transcripts, Prev: RnRS, Up: Standards Support - +File: slib-3b5.info, Node: With-File, Next: Transcripts, Prev: RnRS, Up: Standards Support + | 7.4.2 With-File --------------- @@ -15439,8 +15631,8 @@ File: slib.info, Node: With-File, Next: Transcripts, Prev: RnRS, Up: Standar Description found in R4RS. -File: slib.info, Node: Transcripts, Next: Rev2 Procedures, Prev: With-File, Up: Standards Support - +File: slib-3b5.info, Node: Transcripts, Next: Rev2 Procedures, Prev: With-File, Up: Standards Support + | 7.4.3 Transcripts ----------------- @@ -15452,8 +15644,8 @@ File: slib.info, Node: Transcripts, Next: Rev2 Procedures, Prev: With-File, and `newline'. -File: slib.info, Node: Rev2 Procedures, Next: Rev4 Optional Procedures, Prev: Transcripts, Up: Standards Support - +File: slib-3b5.info, Node: Rev2 Procedures, Next: Rev4 Optional Procedures, Prev: Transcripts, Up: Standards Support + | 7.4.4 Rev2 Procedures --------------------- @@ -15504,8 +15696,8 @@ Scheme->C, for instance, chokes on this module. without the trailing `?'. -File: slib.info, Node: Rev4 Optional Procedures, Next: Multi-argument / and -, Prev: Rev2 Procedures, Up: Standards Support - +File: slib-3b5.info, Node: Rev4 Optional Procedures, Next: Multi-argument / and -, Prev: Rev2 Procedures, Up: Standards Support + | 7.4.5 Rev4 Optional Procedures ------------------------------ @@ -15523,8 +15715,8 @@ procedures: (r4rs)Standard procedures. -- Procedure: vector-fill! s obj -File: slib.info, Node: Multi-argument / and -, Next: Multi-argument Apply, Prev: Rev4 Optional Procedures, Up: Standards Support - +File: slib-3b5.info, Node: Multi-argument / and -, Next: Multi-argument Apply, Prev: Rev4 Optional Procedures, Up: Standards Support + | 7.4.6 Multi-argument / and - ---------------------------- @@ -15538,8 +15730,8 @@ operations: (r4rs)Numerical operations. -- Function: - minuend subtrahend1 ... -File: slib.info, Node: Multi-argument Apply, Next: Rationalize, Prev: Multi-argument / and -, Up: Standards Support - +File: slib-3b5.info, Node: Multi-argument Apply, Next: Rationalize, Prev: Multi-argument / and -, Up: Standards Support + | 7.4.7 Multi-argument Apply -------------------------- @@ -15551,8 +15743,8 @@ For the specification of this optional form, *Note Control features: -- Function: apply proc arg1 ... -File: slib.info, Node: Rationalize, Next: Promises, Prev: Multi-argument Apply, Up: Standards Support - +File: slib-3b5.info, Node: Rationalize, Next: Promises, Prev: Multi-argument Apply, Up: Standards Support + | 7.4.8 Rationalize ----------------- @@ -15584,8 +15776,8 @@ of the numerator and denominator. (find-ratio-between -3/5 -2/7) => (-1 2) -File: slib.info, Node: Promises, Next: Dynamic-Wind, Prev: Rationalize, Up: Standards Support - +File: slib-3b5.info, Node: Promises, Next: Dynamic-Wind, Prev: Rationalize, Up: Standards Support + | 7.4.9 Promises -------------- @@ -15606,8 +15798,8 @@ File: slib.info, Node: Promises, Next: Dynamic-Wind, Prev: Rationalize, Up: (*note Control features: (r4rs)Control features.). -File: slib.info, Node: Dynamic-Wind, Next: Eval, Prev: Promises, Up: Standards Support - +File: slib-3b5.info, Node: Dynamic-Wind, Next: Eval, Prev: Promises, Up: Standards Support + | 7.4.10 Dynamic-Wind ------------------- @@ -15636,8 +15828,8 @@ designed to take into account the fact that continuations produced by the time of the error or interrupt. -File: slib.info, Node: Eval, Next: Values, Prev: Dynamic-Wind, Up: Standards Support - +File: slib-3b5.info, Node: Eval, Next: Values, Prev: Dynamic-Wind, Up: Standards Support + | 7.4.11 Eval ----------- @@ -15719,8 +15911,8 @@ Here are some more `eval' examples: => buick -File: slib.info, Node: Values, Next: SRFI, Prev: Eval, Up: Standards Support - +File: slib-3b5.info, Node: Values, Next: SRFI, Prev: Eval, Up: Standards Support + | 7.4.12 Values ------------- @@ -15743,8 +15935,8 @@ File: slib.info, Node: Values, Next: SRFI, Prev: Eval, Up: Standards Support unspecified. -File: slib.info, Node: SRFI, Prev: Values, Up: Standards Support - +File: slib-3b5.info, Node: SRFI, Prev: Values, Up: Standards Support + | 7.4.13 SRFI ----------- @@ -15775,38 +15967,40 @@ Implements "Scheme Request For Implementation" (SRFI) as described at * SRFI-1:: list-processing - * SRFI-2 *Note Guarded LET* special form:: + * SRFI-2 *note Guarded LET* special form:: - * SRFI-8 *Note Binding to multiple values:: + * SRFI-8 *note Binding to multiple values:: - * SRFI-9 *Note Define-Record-Type:: + * SRFI-9 *note Define-Record-Type:: - * SRFI-11 *Note Binding to multiple values:: + * SRFI-11 *note Binding to multiple values:: * SRFI-23 `(define error slib:error)' - * SRFI-28 *Note Format:: + * SRFI-28 *note Format:: - * SRFI-47 *Note Arrays:: + * SRFI-39 *note Parameter Objects:: | + | + * SRFI-47 *note Arrays:: - * SRFI-59 *Note Vicinity:: + * SRFI-59 *note Vicinity:: - * SRFI-60 *Note Bit-Twiddling:: + * SRFI-60 *note Bit-Twiddling:: - * SRFI-61 *Note Guarded COND Clause:: + * SRFI-61 *note Guarded COND Clause:: - * SRFI-63 *Note Arrays:: + * SRFI-63 *note Arrays:: - * SRFI-94 *Note Irrational Integer Functions:: and *Note Irrational + * SRFI-94 *note Irrational Integer Functions:: and *note Irrational Real Functions:: - * SRFI-95 *Note Sorting:: + * SRFI-95 *note Sorting:: - * SRFI-96 *Note Universal SLIB Procedures:: | - | - -File: slib.info, Node: SRFI-1, Prev: SRFI, Up: SRFI + * SRFI-96 *note Universal SLIB Procedures:: + +File: slib-3b5.info, Node: SRFI-1, Prev: SRFI, Up: SRFI + | 7.4.13.1 SRFI-1 ............... @@ -16027,8 +16221,8 @@ its list arguments. -- Procedure: lset-diff+intersection! = list1 list2 ... -File: slib.info, Node: Session Support, Next: System Interface, Prev: Standards Support, Up: Other Packages - +File: slib-3b5.info, Node: Session Support, Next: System Interface, Prev: Standards Support, Up: Other Packages + | 7.5 Session Support =================== @@ -16047,8 +16241,8 @@ If `(provided? 'abort)': * Trace:: 'trace -File: slib.info, Node: Repl, Next: Quick Print, Prev: Session Support, Up: Session Support - +File: slib-3b5.info, Node: Repl, Next: Quick Print, Prev: Session Support, Up: Session Support + | 7.5.1 Repl ---------- @@ -16082,8 +16276,8 @@ catching lines and the following lines to your Scheme init file: (repl:top-level macro:eval) -File: slib.info, Node: Quick Print, Next: Debug, Prev: Repl, Up: Session Support - +File: slib-3b5.info, Node: Quick Print, Next: Debug, Prev: Repl, Up: Session Support + | 7.5.2 Quick Print ----------------- @@ -16095,7 +16289,7 @@ limited. This section supplies a procedure to do this. It could be much improved. Notice that the neccessity for truncating output eliminates - Common-Lisp's *Note Format:: from consideration; even when + Common-Lisp's *note Format:: from consideration; even when variables `*print-level*' and `*print-level*' are set, huge strings and bit-vectors are _not_ limited. @@ -16115,8 +16309,8 @@ much improved. `write'n; procedures will be indicated by `#[proc]'. -File: slib.info, Node: Debug, Next: Breakpoints, Prev: Quick Print, Up: Session Support - +File: slib-3b5.info, Node: Debug, Next: Breakpoints, Prev: Quick Print, Up: Session Support + | 7.5.3 Debug ----------- @@ -16149,8 +16343,8 @@ printer for `qp'. This example shows how to do this: top-level in `file' .... -File: slib.info, Node: Breakpoints, Next: Trace, Prev: Debug, Up: Session Support - +File: slib-3b5.info, Node: Breakpoints, Next: Trace, Prev: Debug, Up: Session Support + | 7.5.4 Breakpoints ----------------- @@ -16210,8 +16404,8 @@ supported by your implementation, these might be more convenient to use. (set! SYMBOL (unbreakf SYMBOL)) -File: slib.info, Node: Trace, Prev: Breakpoints, Up: Session Support - +File: slib-3b5.info, Node: Trace, Prev: Breakpoints, Up: Session Support + | 7.5.5 Tracing ------------- @@ -16309,8 +16503,8 @@ supported by your implementation, these might be more convenient to use. (set! SYMBOL (untracef SYMBOL)) -File: slib.info, Node: System Interface, Next: Extra-SLIB Packages, Prev: Session Support, Up: Other Packages - +File: slib-3b5.info, Node: System Interface, Next: Extra-SLIB Packages, Prev: Session Support, Up: Other Packages + | 7.6 System Interface ==================== @@ -16325,14 +16519,15 @@ If `(provided? 'system)': -- Function: system command-string Executes the COMMAND-STRING on the computer and returns the - integer status code. + integer status code. This behaves the same as the POSIX `system' + call. + +If `(provided? 'program-arguments)': + + -- Function: program-arguments + Returns a list of strings, the first of which is the program name + followed by the command-line arguments. -If `(provided? 'program-arguments)': | - | - -- Function: program-arguments | - Returns a list of strings, the first of which is the program name | - followed by the command-line arguments. | - | * Menu: * Directories:: @@ -16340,8 +16535,8 @@ If `(provided? 'program-arguments)': | * CVS:: -File: slib.info, Node: Directories, Next: Transactions, Prev: System Interface, Up: System Interface - +File: slib-3b5.info, Node: Directories, Next: Transactions, Prev: System Interface, Up: System Interface + | 7.6.1 Directories ----------------- @@ -16366,10 +16561,12 @@ File: slib.info, Node: Directories, Next: Transactions, Prev: System Interfac the filenames is unspecified. The value returned by `directory-for-each' is unspecified. + -- Function: directory-for-each proc directory pred Applies PROC only to those filenames for which the procedure PRED returns a non-false value. + -- Function: directory-for-each proc directory match Applies PROC only to those filenames for which `(filename:match?? MATCH)' would return a non-false value (*note Filenames: @@ -16381,9 +16578,18 @@ File: slib.info, Node: Directories, Next: Transactions, Prev: System Interfac "Bev2slib.scm" "Template.scm" + -- Function: directory*-for-each proc path-glob | + PATH-GLOB is a pathname whose last component is a (wildcard) | + pattern (*note Filenames: (slib)Filenames.). PROC must be a | + procedure taking one argument. `directory*-for-each' applies PROC | + to the (string) name of each file in the current directory. The | + dynamic order in which PROC is applied to the filenames is | + unspecified. The value returned by `directory*-for-each' is | + unspecified. | + | -File: slib.info, Node: Transactions, Next: CVS, Prev: Directories, Up: System Interface - +File: slib-3b5.info, Node: Transactions, Next: CVS, Prev: Directories, Up: System Interface + | 7.6.2 Transactions ------------------ @@ -16450,18 +16656,18 @@ maintain and check both Emacs and Word certificates. the locks and returns `#t'. Otherwise, `file-unlock!' leaves the file system unaltered and returns `#f'. - -- Function: describe-file-lock path prefix | - -- Function: describe-file-lock path | - PATH must be a string naming a file. Optional argument PREFIX is | - a string printed before each line of the message. | - `describe-file-lock' prints to `(current-error-port)' that PATH is | - locked for writing and lists its lock-files. | - | - (describe-file-lock "my.txt" ">> ") | - -| | - >> "my.txt" is locked for writing by 'luser@no.com.4829:1200536423' | - >> (lock files are "~$my.txt" and ".#my.txt") | - | + -- Function: describe-file-lock path prefix + -- Function: describe-file-lock path + PATH must be a string naming a file. Optional argument PREFIX is + a string printed before each line of the message. + `describe-file-lock' prints to `(current-error-port)' that PATH is + locked for writing and lists its lock-files. + + (describe-file-lock "my.txt" ">> ") + -| + >> "my.txt" is locked for writing by 'luser@no.com.4829:1200536423' + >> (lock files are "~$my.txt" and ".#my.txt") + File Transactions ................. @@ -16531,8 +16737,8 @@ Identification #f is returned. -File: slib.info, Node: CVS, Prev: Transactions, Up: System Interface - +File: slib-3b5.info, Node: CVS, Prev: Transactions, Up: System Interface + | 7.6.3 CVS --------- @@ -16568,8 +16774,8 @@ File: slib.info, Node: CVS, Prev: Transactions, Up: System Interface or any subdirectory do not match. -File: slib.info, Node: Extra-SLIB Packages, Prev: System Interface, Up: Other Packages - +File: slib-3b5.info, Node: Extra-SLIB Packages, Prev: System Interface, Up: Other Packages + | 7.7 Extra-SLIB Packages ======================= @@ -16588,72 +16794,65 @@ reasons why a package might not be included in the SLIB distribution: * Because I have been too busy to integrate it. Once an optional package is installed (and an entry added to -`*catalog*'), the `require' mechanism allows it to be called up and | -used as easily as any other SLIB package. Some optional packages (for | -which `*catalog*' already has entries) available from SLIB sites are: | +`*catalog*'), the `require' mechanism allows it to be called up and +used as easily as any other SLIB package. Some optional packages (for +which `*catalog*' already has entries) available from SLIB sites are: SLIB-PSD is a portable debugger for Scheme (requires emacs editor). - - http://swiss.csail.mit.edu/ftpdir/scm/slib-psd1-3.tar.gz - - swiss.csail.mit.edu:/pub/scm/slib-psd1-3.tar.gz - - ftp.maths.tcd.ie:pub/bosullvn/jacal/slib-psd1-3.tar.gz - - ftp.cs.indiana.edu:/pub/scheme-repository/utl/slib-psd1-3.tar.gz - + `http://groups.csail.mit.edu/mac/ftpdir/scm/slib-psd1-3.tar.gz' | + `ftp://ftp.cs.indiana.edu/pub/scheme-repository/utl/slib-psd1-3.tar.gz' | With PSD, you can run a Scheme program in an Emacs buffer, set breakpoints, single step evaluation and access and modify the - program's variables. It works by instrumenting the original source - code, so it should run with any R4RS compliant Scheme. It has been + program's variables. It works by instrumenting the original source + code, so it should run with any R4RS compliant Scheme. It has been tested with SCM, Elk 1.5, and the sci interpreter in the Scheme->C - system, but should work with other Schemes with a minimal amount - of porting, if at all. Includes documentation and user's manual. - Written by Pertti Kellom\"aki, pk @ cs.tut.fi. The Lisp Pointers - article describing PSD (Lisp Pointers VI(1):15-23, January-March - 1993) is available as - http://www.cs.tut.fi/staff/pk/scheme/psd/article/article.html + system, but should work with other Schemes with a minimal amount of | + porting, if at all. Includes documentation and user's manual. | + Written by Pertti Kelloma"ki, the Lisp Pointers article describing | + PSD (Lisp Pointers VI(1):15-23, January-March 1993) is available at | + `http://www.cs.tut.fi/staff/pk/scheme/psd/article/article.html' | SCHELOG is an embedding of Prolog in Scheme. - http://www.ccs.neu.edu/~dorai/schelog/schelog.html + `http://www.ccs.neu.edu/~dorai/schelog/schelog.html' | JFILTER is a Scheme program which converts text among the JIS, EUC, and Shift-JIS Japanese character sets. - http://www.sci.toyama-u.ac.jp/~iwao/Scheme/Jfilter/index.html + `http://www.math.u-toyama.ac.jp/~iwao/Scheme/Jfilter' | -File: slib.info, Node: About SLIB, Next: Index, Prev: Other Packages, Up: Top - +File: slib-3b5.info, Node: About SLIB, Next: Index, Prev: Other Packages, Up: Top + | 8 About SLIB ************ More people than I can name have contributed to SLIB. Thanks to all of you! - SLIB 3b1, released February 2008. | - Aubrey Jaffer <agj @ alum.mit.edu> + SLIB 3b5, released January 2015. | + Aubrey Jaffer <agj@alum.mit.edu> Current information about SLIB can be found on SLIB's "WWW" home page: - `http://swiss.csail.mit.edu/~jaffer/SLIB' + `http://people.csail.mit.edu/jaffer/SLIB' + + SLIB is part of the GNU project. - SLIB is part of the GNU project. | - | * Menu: * Installation:: How to install SLIB on your system. * The SLIB script:: Run interactive SLIB sessions. * Porting:: SLIB to new platforms. +* Compiled and Implementation-Specific Features:: * Coding Guidelines:: How to write modules for SLIB. * Copyrights:: Intellectual propery issues. * About this manual:: -File: slib.info, Node: Installation, Next: The SLIB script, Prev: About SLIB, Up: About SLIB - +File: slib-3b5.info, Node: Installation, Next: The SLIB script, Prev: About SLIB, Up: About SLIB + | 8.1 Installation ================ @@ -16663,13 +16862,13 @@ There are five parts to installation: * Install documentation and `slib' script. - * Configure the Scheme implementation(s) to locate the SLIB directory | - and implementation directories. | + * Configure the Scheme implementation(s) to locate the SLIB directory + and implementation directories. - * Arrange for Scheme implementation to load its SLIB initialization - file. + * Arrange for each Scheme implementation to load its SLIB | + initialization file. | - * Build the SLIB catalog for the Scheme implementation. + * Build the SLIB catalog for each Scheme implementation. | 8.1.1 Unpacking the SLIB Distribution ------------------------------------- @@ -16683,7 +16882,7 @@ home directory (if only you will use this SLIB installation); or put it in a location where libraries reside on your system. On unix systems this might be `/usr/share/slib', `/usr/local/lib/slib', or `/usr/lib/slib'. If you know where SLIB should go on other platforms, -please inform agj @ alum.mit.edu. +please inform agj@alum.mit.edu. 8.1.2 Install documentation and slib script ------------------------------------------- @@ -16696,41 +16895,48 @@ please inform agj @ alum.mit.edu. If the Scheme implementation supports `getenv', then the value of the shell environment variable SCHEME_LIBRARY_PATH will be used for -`(library-vicinity)' if it is defined. Currently, Bigloo, Chez, Elk, | -Gambit, Guile, Jscheme, Larceny, MITScheme, MzScheme, RScheme, STk, | -VSCM, and SCM support `getenv'. Scheme48 supports `getenv' but does | -not use it for determining `library-vicinity'. (That is done from the | -Makefile.) | - - The `(library-vicinity)' can also be set from the SLIB initialization | -file or by implementation-specific means. | - | - Support for locating an implementation's auxiliary directory is uneven | -among implementations. Also, the person installing SLIB may not have | -write permission to some of these directories (necessary for writing | -slibcat). Therefore, those implementations supporting `getenv' (except | -SCM and Scheme48) provide a means for specifying the | -`implementation-vicinity' through environment variables. Define the | -indicated environment variable to the pathname (with trailing slash or | -backslash) of the desired directory. Do not use `slib/' as an | -implementation-vicinity! | - | -Bigloo BIGLOO_IMPLEMENTATION_PATH | -Chez CHEZ_IMPLEMENTATION_PATH | -ELK ELK_IMPLEMENTATION_PATH | -Gambit GAMBIT_IMPLEMENTATION_PATH | -Guile GUILE_IMPLEMENTATION_PATH | -Jscheme JSCHEME_IMPLEMENTATION_PATH | -MIT-Scheme MITSCHEME_IMPLEMENTATION_PATH | -MzScheme MZSCHEME_IMPLEMENTATION_PATH | -RScheme RSCHEME_IMPLEMENTATION_PATH | -STk STK_IMPLEMENTATION_PATH | -Vscm VSCM_IMPLEMENTATION_PATH | - -8.1.4 Loading SLIB Initialization File +`(library-vicinity)' if it is defined. Currently, Bigloo, Chez, Elk, +Gambit, Gauche, Guile, Jscheme, Larceny, MITScheme, MzScheme, RScheme, | +S7, STk, VSCM, and SCM support `getenv'. Scheme48 supports `getenv' | +but does not use it for determining `library-vicinity'. (That is done | +from the Makefile.) | + + The `(library-vicinity)' can also be set from the SLIB initialization +file or by implementation-specific means. + +8.1.4 Configure Scheme Implementation to Locate and Implementation Directory | +---------------------------------------------------------------------------- | + | +Support for locating an implementation's auxiliary directory is uneven +among implementations. Also, the person installing SLIB may not have +write permission to some of these directories (necessary for writing +slibcat). Therefore, those implementations supporting `getenv' (except +SCM and Scheme48) provide a means for specifying the +`implementation-vicinity' through environment variables. Define the +indicated environment variable to the pathname (with trailing slash or +backslash) of the desired directory. Do not use `slib/' as an +implementation-vicinity! + +Bigloo BIGLOO_IMPLEMENTATION_PATH +Chez CHEZ_IMPLEMENTATION_PATH +ELK ELK_IMPLEMENTATION_PATH +Gambit GAMBIT_IMPLEMENTATION_PATH +Guile GUILE_IMPLEMENTATION_PATH +Jscheme JSCHEME_IMPLEMENTATION_PATH +MIT-Scheme MITSCHEME_IMPLEMENTATION_PATH +MzScheme MZSCHEME_IMPLEMENTATION_PATH +RScheme RSCHEME_IMPLEMENTATION_PATH +S7 S7_IMPLEMENTATION_PATH | +STk STK_IMPLEMENTATION_PATH +Vscm VSCM_IMPLEMENTATION_PATH + +8.1.5 Loading SLIB Initialization File | -------------------------------------- -Check the manifest in `README' to find a configuration file for your +If you use the `slib' script to start your SLIB session, then this step | +is unnecessary. | + | + Check the manifest in `README' to find a configuration file for your Scheme implementation. Initialization files for most IEEE P1178 compliant Scheme Implementations are included with this distribution. @@ -16742,8 +16948,8 @@ the file for how to configure it. Once this is done, modify the startup file for your Scheme implementation to `load' this initialization file. -8.1.5 Build New SLIB Catalog for Implementation ------------------------------------------------ +8.1.6 Build New SLIB Catalog for the Implementation | +--------------------------------------------------- | When SLIB is first used from an implementation, a file named `slibcat' is written to the `implementation-vicinity' for that implementation. @@ -16763,7 +16969,7 @@ SLIB-installed scheme implementation, type: (require 'new-catalog) (slib:exit) -8.1.6 Implementation-specific Instructions +8.1.7 Implementation-specific Instructions | ------------------------------------------ Multiple implementations of Scheme can all use the same SLIB directory. @@ -16775,37 +16981,43 @@ above. SLIB support is already built into SCM. See the documentation with SCM for installation instructions. - -- Implementation: Larceny | - Starting with version 0.96, Larceny contains its own SLIB | - initialization file, loaded by `(require 'srfi-96)'. If | - SCHEME_LIBRARY_PATH is not set, then Larceny looks for an `slib' | - subdirectory of a directory in the list returned by | - `(current-require-path)' | - | - larceny -- -e "(require 'srfi-96)" | + -- Implementation: Larceny + Starting with version 0.96, Larceny contains its own SLIB + initialization file, loaded by `(require 'srfi-96)'. If + SCHEME_LIBRARY_PATH is not set, then Larceny looks for an `slib' + subdirectory of a directory in the list returned by + `(current-require-path)' + + larceny -- -e "(require 'srfi-96)" + + -- Implementation: Gauche-0.9 | + Gauche also supports SLIB. It finds SLIB at installation time; | + `(use slib)' to enable. | | - -- Implementation: ELK | - elk -i -l ${SCHEME_LIBRARY_PATH}elk.init | + gosh -u slib | | + -- Implementation: ELK + elk -i -l ${SCHEME_LIBRARY_PATH}elk.init + -- Implementation: PLT Scheme -- Implementation: DrScheme -- Implementation: MzScheme The `init.ss' file in the _slibinit_ collection is an SLIB - initialization file. To run SLIB in MzScheme: | + initialization file. To run SLIB in MzScheme: - mzscheme -f ${SCHEME_LIBRARY_PATH}mzscheme.init | + mzscheme -f ${SCHEME_LIBRARY_PATH}mzscheme.init -- Implementation: MIT Scheme - scheme -load ${SCHEME_LIBRARY_PATH}mitscheme.init | + scheme -load ${SCHEME_LIBRARY_PATH}mitscheme.init -- Implementation: Gambit-C 3.0 - gsi -:s ${SCHEME_LIBRARY_PATH}gambit.init - | - | - -- Implementation: SISC | - sisc -e "(load \"${SCHEME_LIBRARY_PATH}sisc.init\")" -- | - | - -- Implementation: Kawa | - kawa -f ${SCHEME_LIBRARY_PATH}kawa.init -- | + gsi -:s ${SCHEME_LIBRARY_PATH}gambit.init - + + -- Implementation: SISC + sisc -e "(load \"${SCHEME_LIBRARY_PATH}sisc.init\")" -- + + -- Implementation: Kawa + kawa -f ${SCHEME_LIBRARY_PATH}kawa.init -- -- Implementation: Guile Guile versions 1.6 and earlier link to an archaic SLIB version. In @@ -16821,10 +17033,21 @@ above. `${SCHEME_LIBRARY_PATH}' is where SLIB gets installed. - Guile with SLIB can then be started thus: + Guile before version 1.8 with SLIB can then be started thus: | - guile -l ${SCHEME_LIBRARY_PATH}guile.init | + guile -l ${SCHEME_LIBRARY_PATH}guile.init + Guile version 1.8 and after with SLIB can then be started thus: | + | + guile -l ${SCHEME_LIBRARY_PATH}guile.init \ | + -l ${SCHEME_LIBRARY_PATH}guile.use | + | + The Guile manual has a different way of installing SLIB: | + | +`http://www.gnu.org/software/guile/manual/html_node/SLIB-installation.html' | + | + | + | -- Implementation: Scheme48 To make a Scheme48 image for an installation under `<prefix>', @@ -16853,20 +17076,28 @@ above. 3. `(slib:dump "dumpfile")' - 4. mv dumpfile place-where-vscm-standard-bootfile-resides. For | - example: | + 4. mv dumpfile place-where-vscm-standard-bootfile-resides. For + example: - `mv dumpfile /usr/local/vscm/lib/scheme-boot' | - | - In this case vscm should have been compiled with flag: | + `mv dumpfile /usr/local/vscm/lib/scheme-boot' + + In this case vscm should have been compiled with flag: + + -DDEFAULT_BOOTFILE='"/usr/local/vscm/lib/scheme-boot"' + + See Makefile (definition of DDP) for details. + + -- Implementation: S7 | + S7 is not a standalone implementation, but runs as the extension | + language for the Snd sound editor. | + `${SCHEME_LIBRARY_PATH}s7.init' can be loaded from the Snd init | + file or on the Snd command line thus: | | - -DDEFAULT_BOOTFILE='"/usr/local/vscm/lib/scheme-boot"' | + snd -l ${SCHEME_LIBRARY_PATH}s7.init | | - See Makefile (definition of DDP) for details. | - -File: slib.info, Node: The SLIB script, Next: Porting, Prev: Installation, Up: About SLIB - +File: slib-3b5.info, Node: The SLIB script, Next: Porting, Prev: Installation, Up: About SLIB + | 8.2 The SLIB script =================== @@ -16882,8 +17113,8 @@ to run. Absent the argument, it searches for implementations in the above order. -File: slib.info, Node: Porting, Next: Coding Guidelines, Prev: The SLIB script, Up: About SLIB - +File: slib-3b5.info, Node: Porting, Next: Compiled and Implementation-Specific Features, Prev: The SLIB script, Up: About SLIB + | 8.3 Porting =========== @@ -16895,6 +17126,9 @@ compliant with `Revised^5 Report on the Algorithmic Language Scheme' in order to support SLIB. (1) +`http://cvs.savannah.gnu.org/viewcvs/*checkout*/scm/scm/r4rstest.scm' +is a file which checks compliance with much of R4RS. + `Template.scm' is an example configuration file. The comments inside will direct you on how to customize it to reflect your system. Give your new initialization file the implementation's name with `.init' @@ -16905,12 +17139,12 @@ initialization file might be called `foo.init'. implementation's initialization. It will load `require.scm' from the library; this will allow the use of `provide', `provided?', and `require' along with the "vicinity" functions (these functions are -documented in the sections *Note Feature:: and *Note Require::). The +documented in the sections *note Feature:: and *note Require::). The rest of the library will then be accessible in a system independent fashion. - Please mail new working configuration files to `agj @ alum.mit.edu' -so that they can be included in the SLIB distribution. + Please mail new working configuration files to `agj@alum.mit.edu' so | +that they can be included in the SLIB distribution. | ---------- Footnotes ---------- @@ -16919,9 +17153,32 @@ Language Scheme' implementation, then you will need to finish writing `sc4sc3.scm' and `load' it from your initialization file. -File: slib.info, Node: Coding Guidelines, Next: Copyrights, Prev: Porting, Up: About SLIB +File: slib-3b5.info, Node: Compiled and Implementation-Specific Features, Next: Coding Guidelines, Prev: Porting, Up: About SLIB + | +8.4 Compiled and Implementation-Specific Features +================================================= + +Often an implementation can implement an SLIB feature more efficiently +than the R4RS-compliant source code in SLIB. Alternatively, +implementations with compilers can compile SLIB source code into binary +files which run faster than loading source code. + + Additionally, the SLIB catalog can be augmented with extra-SLIB +features which can be loaded by the implementation. The catalog format +is described in *Note Library Catalogs::. + + These implementation-specific modifications are made when a new +catalog is created (*note Catalog Creation::). If `mkimpcat.scm' in +`implementation-invicinity' exists, it is loaded. That should produce +the file `implcat' in `implementation-invicinity', whose associations +will override those of SLIB. `implcat' is copied into `slibcat' in +`implementation-vicinity' as part of the catalog creation process; +modifications to `implcat' after that will have no effect. -8.4 Coding Guidelines + +File: slib-3b5.info, Node: Coding Guidelines, Next: Copyrights, Prev: Compiled and Implementation-Specific Features, Up: About SLIB + | +8.5 Coding Guidelines ===================== All library packages are written in IEEE P1178 Scheme and assume that a @@ -16943,7 +17200,7 @@ name. Do not export internal aliases. comments (*note Schmooz::) or `;@' at the beginning of the line immediately preceding the definition (`define', `define-syntax', or `defmacro'). Modules, exports and other relevant issues are discussed -in *Note Compiling Scheme::. +in *note Compiling Scheme::. Code submitted for inclusion in SLIB should not duplicate (more than one) routines already in SLIB files. Use `require' to force those @@ -16956,7 +17213,7 @@ but documentation must be provided. which tests your code. Please run this test _before_ you send me the code! -8.4.1 Modifications +8.5.1 Modifications ------------------- Please document your changes. A line or two for `ChangeLog' is @@ -16978,9 +17235,9 @@ not have the time to fish through 10000 diffs to find your 10 real fixes. -File: slib.info, Node: Copyrights, Next: About this manual, Prev: Coding Guidelines, Up: About SLIB - -8.5 Copyrights +File: slib-3b5.info, Node: Copyrights, Next: About this manual, Prev: Coding Guidelines, Up: About SLIB + | +8.6 Copyrights ============== This section has instructions for SLIB authors regarding copyrights. @@ -16993,12 +17250,12 @@ modify it. The comments at the beginning of `require.scm' and If your code or changes amount to less than about 10 lines, you do not need to add your copyright or send a disclaimer. -8.5.1 Putting code into the Public Domain +8.6.1 Putting code into the Public Domain ----------------------------------------- In order to put code in the public domain you should sign a copyright -disclaimer and send it to the SLIB maintainer. Contact agj @ -alum.mit.edu for the address to mail the disclaimer to. +disclaimer and send it to the SLIB maintainer. Contact | +agj@alum.mit.edu for the address to mail the disclaimer to. | I, <MY-NAME>, hereby affirm that I have placed the software package <NAME> in the public domain. @@ -17018,10 +17275,10 @@ revisions of that module. Make sure no employer has any claim to the copyright on the work you are submitting. If there is any doubt, create a copyright disclaimer and have your employer sign it. Mail the signed disclaimer to the SLIB -maintainer. Contact agj @ alum.mit.edu for the address to mail the +maintainer. Contact agj@alum.mit.edu for the address to mail the disclaimer to. An example disclaimer follows. -8.5.2 Explicit copying terms +8.6.2 Explicit copying terms ---------------------------- If you submit more than about 10 lines of code which you are not @@ -17036,10 +17293,10 @@ placing into the Public Domain (by sending me a disclaimer) you need to: * Make sure no employer has any claim to the copyright on the work you are submitting. If there is any doubt, create a copyright disclaimer and have your employer sign it. Mail the signed - disclaim to the SLIB maintainer. Contact agj @ alum.mit.edu for - the address to mail the disclaimer to. + disclaim to the SLIB maintainer. Contact agj@alum.mit.edu for the | + address to mail the disclaimer to. | -8.5.3 Example: Company Copyright Disclaimer +8.6.3 Example: Company Copyright Disclaimer ------------------------------------------- This disclaimer should be signed by a vice president or general manager @@ -17057,11 +17314,11 @@ license out software produced there will do. Here is a sample wording: <NAME>, <TITLE>, <EMPLOYER> Corporation -File: slib.info, Node: About this manual, Prev: Copyrights, Up: About SLIB - -8.6 About this manual -===================== +File: slib-3b5.info, Node: About this manual, Prev: Copyrights, Up: About SLIB | +8.7 About this manual +===================== + * Entries that are labeled as Functions are called for their return values. Entries that are labeled as Procedures are called primarily for their side effects. @@ -17069,24 +17326,24 @@ File: slib.info, Node: About this manual, Prev: Copyrights, Up: About SLIB * Examples in this text were produced using the `scm' Scheme implementation. - * At the beginning of each section, there is a line that looks like: | - (require 'feature) | - Include this line in your code prior to using the package. | - | + * At the beginning of each section, there is a line that looks like: + (require 'feature) + Include this line in your code prior to using the package. + * Menu: - | + * GNU Free Documentation License:: -File: slib.info, Node: GNU Free Documentation License, Prev: About this manual, Up: About this manual +File: slib-3b5.info, Node: GNU Free Documentation License, Prev: About this manual, Up: About this manual | -8.6.1 GNU Free Documentation License | ------------------------------------- | +8.7.1 GNU Free Documentation License +------------------------------------ - Version 1.2, November 2002 + Version 1.3, 3 November 2008 - Copyright (C) 2000,2001,2002 Free Software Foundation, Inc. - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA | + Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. + `http://fsf.org/' Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -17188,6 +17445,9 @@ File: slib.info, Node: GNU Free Documentation License, Prev: About this manual Page" means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text. + The "publisher" means any person or entity that distributes copies + of the Document to the public. + A section "Entitled XYZ" means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ @@ -17453,12 +17713,29 @@ File: slib.info, Node: GNU Free Documentation License, Prev: About this manual 9. TERMINATION You may not copy, modify, sublicense, or distribute the Document - except as expressly provided for under this License. Any other - attempt to copy, modify, sublicense or distribute the Document is - void, and will automatically terminate your rights under this - License. However, parties who have received copies, or rights, - from you under this License will not have their licenses - terminated so long as such parties remain in full compliance. + except as expressly provided under this License. Any attempt + otherwise to copy, modify, sublicense, or distribute it is void, + and will automatically terminate your rights under this License. + + However, if you cease all violation of this License, then your + license from a particular copyright holder is reinstated (a) + provisionally, unless and until the copyright holder explicitly + and finally terminates your license, and (b) permanently, if the + copyright holder fails to notify you of the violation by some + reasonable means prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is + reinstated permanently if the copyright holder notifies you of the + violation by some reasonable means, this is the first time you have + received notice of violation of this License (for any work) from + that copyright holder, and you cure the violation prior to 30 days + after your receipt of the notice. + + Termination of your rights under this section does not terminate + the licenses of parties who have received copies or rights from + you under this License. If your rights have been terminated and + not permanently reinstated, receipt of a copy of some or all of + the same material does not give you any rights to use it. 10. FUTURE REVISIONS OF THIS LICENSE @@ -17476,10 +17753,44 @@ File: slib.info, Node: GNU Free Documentation License, Prev: About this manual published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the - Free Software Foundation. + Free Software Foundation. If the Document specifies that a proxy + can decide which future versions of this License can be used, that + proxy's public statement of acceptance of a version permanently + authorizes you to choose that version for the Document. + + 11. RELICENSING + + "Massive Multiauthor Collaboration Site" (or "MMC Site") means any + World Wide Web server that publishes copyrightable works and also + provides prominent facilities for anybody to edit those works. A + public wiki that anybody can edit is an example of such a server. + A "Massive Multiauthor Collaboration" (or "MMC") contained in the + site means any set of copyrightable works thus published on the MMC + site. + + "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 + license published by Creative Commons Corporation, a not-for-profit + corporation with a principal place of business in San Francisco, + California, as well as future copyleft versions of that license + published by that same organization. -ADDENDUM: How to use this License for your documents | -==================================================== | + "Incorporate" means to publish or republish a Document, in whole or + in part, as part of another Document. + + An MMC is "eligible for relicensing" if it is licensed under this + License, and if all works that were first published under this + License somewhere other than this MMC, and subsequently + incorporated in whole or in part into the MMC, (1) had no cover + texts or invariant sections, and (2) were thus incorporated prior + to November 1, 2008. + + The operator of an MMC Site may republish an MMC contained in the + site under CC-BY-SA on the same site at any time before August 1, + 2009, provided the MMC is eligible for relicensing. + + +ADDENDUM: How to use this License for your documents +==================================================== To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license @@ -17487,7 +17798,7 @@ notices just after the title page: Copyright (C) YEAR YOUR NAME. Permission is granted to copy, distribute and/or modify this document - under the terms of the GNU Free Documentation License, Version 1.2 + under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU @@ -17510,8 +17821,8 @@ free software license, such as the GNU General Public License, to permit their use in free software. -File: slib.info, Node: Index, Prev: About SLIB, Up: Top - +File: slib-3b5.info, Node: Index, Prev: About SLIB, Up: Top + | Index ***** @@ -17530,7 +17841,7 @@ Procedure and Macro Index * <=?: Rev2 Procedures. (line 46) * <?: Rev2 Procedures. (line 45) * =: Hilbert Space-Filling Curve. - (line 72) + (line 73) | * =?: Rev2 Procedures. (line 47) * >=?: Rev2 Procedures. (line 49) * >?: Rev2 Procedures. (line 48) @@ -17560,7 +17871,7 @@ Procedure and Macro Index * absolute-path?: URI. (line 102) * absolute-uri?: URI. (line 98) * add-command-tables: Database Extension. (line 11) -* add-domain: Using Databases. (line 131) +* add-domain: Using Databases. (line 132) * add-domain on relational-database: Command Intrinsics. (line 10) * add-macro-support: Within-database. (line 52) * add-process!: Multi-Processing. (line 14) @@ -17604,7 +17915,7 @@ Procedure and Macro Index * array-rank: Arrays. (line 44) * array-ref: Arrays. (line 136) * array-set!: Arrays. (line 139) -* array-trim: Subarrays. (line 48) +* array-trim: Subarrays. (line 47) * array:copy!: Array Mapping. (line 60) * array?: Arrays. (line 9) * asctime: Posix Time. (line 62) @@ -17613,8 +17924,8 @@ Procedure and Macro Index * atan: Irrational Real Functions. (line 22) * atom?: Non-List functions. (line 30) -* attlist-add: Parsing XML. (line 451) -* attlist-remove-top: Parsing XML. (line 456) +* attlist-add: Parsing XML. (line 452) +* attlist-remove-top: Parsing XML. (line 457) * batch:call-with-output-script: Batch. (line 47) * batch:command: Batch. (line 64) * batch:comment: Batch. (line 95) @@ -17635,7 +17946,7 @@ Procedure and Macro Index * bitwise-not: Bit-Twiddling. (line 46) * bitwise-xor: Bit-Twiddling. (line 37) * blackbody-spectrum: Spectra. (line 128) -* booleans->integer: Bit-Twiddling. (line 239) +* booleans->integer: Bit-Twiddling. (line 238) * break <1>: Breakpoints. (line 28) * break: SRFI-1. (line 151) * break!: SRFI-1. (line 153) @@ -17643,7 +17954,7 @@ Procedure and Macro Index * breakf: Breakpoints. (line 47) * breakpoint: Breakpoints. (line 16) * browse: Database Browser. (line 9) -* browse-url: System. (line 60) +* browse-url: System. (line 61) * butlast: Lists as sequences. (line 121) * butnthcdr: Lists as sequences. (line 147) * byte-ref: Byte. (line 14) @@ -17667,16 +17978,16 @@ Procedure and Macro Index * call-with-output-string: String Ports. (line 9) * call-with-tmpnam: Filenames. (line 74) * call-with-values: Values. (line 13) -* capture-syntactic-environment: Syntactic Closures. (line 211) +* capture-syntactic-environment: Syntactic Closures. (line 212) * car+cdr: SRFI-1. (line 68) * cart-prod-tables on relational-database: Database Operations. - (line 78) + (line 77) * catalog->html: HTML Tables. (line 49) * catalog-id on base-table: Base Tables. (line 30) * catalog:read: Catalog Vicinities. (line 57) * cdna:base-count: NCBI-DNA. (line 37) * cdna:report-base-count: NCBI-DNA. (line 41) -* cgi:serve-query: HTTP and CGI. (line 69) +* cgi:serve-query: HTTP and CGI. (line 72) * chap:next-string: Chapter Ordering. (line 29) * chap:string<=?: Chapter Ordering. (line 25) * chap:string<?: Chapter Ordering. (line 14) @@ -17698,31 +18009,31 @@ Procedure and Macro Index * CIEXYZ->xRGB: Color Conversions. (line 50) * circular-list: SRFI-1. (line 32) * circular-list?: SRFI-1. (line 40) -* cksum: Cyclic Checksum. (line 149) +* cksum: Cyclic Checksum. (line 150) * clear-sky-color-xyy: Daylight. (line 84) * clip-to-rect: Rectangles. (line 36) * close-base on base-table: The Base. (line 60) -* close-database: Using Databases. (line 89) +* close-database: Using Databases. (line 90) * close-database on relational-database: Database Operations. (line 20) * close-port: Input/Output. (line 47) * close-table on relational-table: Table Administration. (line 20) * CMC-DE: Color Difference Metrics. - (line 61) + (line 63) | * CMC:DE*: Color Difference Metrics. - (line 65) + (line 67) | * codons<-cdna: NCBI-DNA. (line 20) * coerce: Type Coercion. (line 12) * collection?: Collections. (line 36) * color->ciexyz: Color Spaces. (line 34) -* color->e-srgb: Color Spaces. (line 252) -* color->l*a*b*: Color Spaces. (line 91) -* color->l*c*h: Color Spaces. (line 166) -* color->l*u*v*: Color Spaces. (line 115) +* color->e-srgb: Color Spaces. (line 260) +* color->l*a*b*: Color Spaces. (line 92) +* color->l*c*h: Color Spaces. (line 171) +* color->l*u*v*: Color Spaces. (line 118) * color->rgb709: Color Spaces. (line 55) -* color->srgb: Color Spaces. (line 209) +* color->srgb: Color Spaces. (line 215) * color->string: Color Data-Type. (line 95) -* color->xrgb: Color Spaces. (line 212) +* color->xrgb: Color Spaces. (line 218) * color-dictionaries->lookup: Color Names. (line 33) * color-dictionary: Color Names. (line 40) * color-name->color: Color Names. (line 27) @@ -17731,13 +18042,13 @@ Procedure and Macro Index * color-space: Color Data-Type. (line 43) * color-white-point: Color Data-Type. (line 51) * color:ciexyz: Color Spaces. (line 30) -* color:e-srgb: Color Spaces. (line 241) +* color:e-srgb: Color Spaces. (line 247) * color:l*a*b*: Color Spaces. (line 83) -* color:l*c*h: Color Spaces. (line 159) -* color:l*u*v*: Color Spaces. (line 107) +* color:l*c*h: Color Spaces. (line 163) +* color:l*u*v*: Color Spaces. (line 109) * color:linear-transform: Color Conversions. (line 27) * color:rgb709: Color Spaces. (line 51) -* color:srgb: Color Spaces. (line 200) +* color:srgb: Color Spaces. (line 206) * color?: Color Data-Type. (line 9) * column-domains on relational-table: Table Administration. (line 9) @@ -17760,6 +18071,8 @@ Procedure and Macro Index * cons*: SRFI-1. (line 22) * continue: Breakpoints. (line 20) * convert-color: Color Data-Type. (line 54) +* coordinates->integer: Multidimensional Space-Filling Curves. + (line 52) | * copy-bit: Bit-Twiddling. (line 154) * copy-bit-field: Bit-Twiddling. (line 177) * copy-list: List construction. (line 32) @@ -17768,23 +18081,23 @@ Procedure and Macro Index * copy-tree: Tree Operations. (line 33) * count: SRFI-1. (line 106) * count-newlines: String Search. (line 61) -* crc16: Cyclic Checksum. (line 167) -* crc5: Cyclic Checksum. (line 178) -* crc:make-table: Cyclic Checksum. (line 131) +* crc16: Cyclic Checksum. (line 168) +* crc5: Cyclic Checksum. (line 179) +* crc:make-table: Cyclic Checksum. (line 132) * create-array: Arrays. (line 66) * create-database: Using Databases. (line 43) * create-database on relational-system: Relational Database Objects. (line 34) * create-postscript-graph: PostScript Graphing. (line 17) -* create-table on relational-database: Database Operations. (line 64) -* create-view on relational-database: Database Operations. (line 75) +* create-table on relational-database: Database Operations. (line 63) +* create-view on relational-database: Database Operations. (line 74) * cring:define-rule: Commutative Rings. (line 116) * ctime: Posix Time. (line 68) * current-directory: Directories. (line 9) * current-error-port: Input/Output. (line 70) * current-input-port <1>: Byte. (line 94) * current-input-port: Ruleset Definition and Use. - (line 57) + (line 61) * current-output-port: Byte. (line 86) * current-time: Time and Date. (line 20) * cvs-directories: CVS. (line 14) @@ -17801,7 +18114,7 @@ Procedure and Macro Index * define-*commands*: Database Extension. (line 16) * define-access-operation: Setters. (line 53) * define-command: Within-database. (line 17) -* define-domains: Using Databases. (line 124) +* define-domains: Using Databases. (line 125) * define-macro: Within-database. (line 58) * define-operation: Yasos interface. (line 7) * define-predicate: Yasos interface. (line 12) @@ -17809,14 +18122,14 @@ Procedure and Macro Index * define-structure: Define-Structure. (line 12) * define-syntax: Macro by Example. (line 39) * define-table: Within-database. (line 26) -* define-tables: Using Databases. (line 134) -* defmacro: Defmacro. (line 40) +* define-tables: Using Databases. (line 135) +* defmacro: Defmacro. (line 41) * defmacro:eval: Defmacro. (line 15) -* defmacro:expand*: Defmacro. (line 51) +* defmacro:expand*: Defmacro. (line 52) * defmacro:load: Defmacro. (line 19) -* defmacro?: Defmacro. (line 27) +* defmacro?: Defmacro. (line 28) * delaminate-list: Hilbert Space-Filling Curve. - (line 89) + (line 90) | * delay: Promises. (line 15) * delete: Destructive list operations. (line 58) @@ -17832,7 +18145,7 @@ Procedure and Macro Index (line 59) * delete-if-not: Destructive list operations. (line 60) -* delete-table on relational-database: Database Operations. (line 59) +* delete-table on relational-database: Database Operations. (line 58) * dequeue!: Queues. (line 28) * dequeue-all!: Queues. (line 36) * describe-file-lock: Transactions. (line 70) @@ -17845,6 +18158,7 @@ Procedure and Macro Index * diff:edits: Sequence Comparison. (line 45) * diff:longest-common-subsequence: Sequence Comparison. (line 32) * difftime: Time and Date. (line 26) +* directory*-for-each: Directories. (line 45) * directory-for-each: Directories. (line 21) * do-elts: Collections. (line 41) * do-keys: Collections. (line 57) @@ -17858,7 +18172,7 @@ Procedure and Macro Index * dynamic-wind: Dynamic-Wind. (line 13) * dynamic?: Dynamic Data Type. (line 12) * e-sRGB->CIEXYZ: Color Conversions. (line 57) -* e-srgb->color: Color Spaces. (line 235) +* e-srgb->color: Color Spaces. (line 241) * e-sRGB->e-sRGB: Color Conversions. (line 68) * e-sRGB->sRGB: Color Conversions. (line 60) * eighth: SRFI-1. (line 64) @@ -17885,7 +18199,7 @@ Procedure and Macro Index * fft-1: Discrete Fourier Transform. (line 34) * fifth: SRFI-1. (line 61) -* file->color-dictionary: Color Names. (line 68) +* file->color-dictionary: Color Names. (line 69) * file->definitions: Module Manifests. (line 72) * file->exports: Module Manifests. (line 84) * file->loads: Module Manifests. (line 53) @@ -17912,7 +18226,7 @@ Procedure and Macro Index * find-tail: SRFI-1. (line 145) * first: SRFI-1. (line 53) * first-set-bit: Bit-Twiddling. (line 110) -* fluid-let: Fluid-Let. (line 9) +* fluid-let: Fluid-Let. (line 13) * fold: SRFI-1. (line 111) * fold-right: SRFI-1. (line 113) * for-each-elt: Collections. (line 67) @@ -17958,15 +18272,15 @@ Procedure and Macro Index * gmtime: Posix Time. (line 36) * golden-section-search: Minimizing. (line 18) * gray-code->integer: Hilbert Space-Filling Curve. - (line 65) + (line 66) | * gray-code<=?: Hilbert Space-Filling Curve. - (line 75) + (line 76) | * gray-code<?: Hilbert Space-Filling Curve. - (line 73) + (line 74) | * gray-code>=?: Hilbert Space-Filling Curve. - (line 76) + (line 77) | * gray-code>?: Hilbert Space-Filling Curve. - (line 74) + (line 75) | * grey: Color Names. (line 13) * grid-horizontals: Legending. (line 58) * grid-verticals: Legending. (line 54) @@ -17985,7 +18299,7 @@ Procedure and Macro Index * heap-insert!: Priority Queues. (line 19) * heap-length: Priority Queues. (line 16) * hilbert-coordinates->integer: Hilbert Space-Filling Curve. - (line 45) + (line 46) | * histograph: Character Plotting. (line 83) * home-vicinity: Vicinity. (line 51) * htm-fields: Parsing HTML. (line 58) @@ -18023,21 +18337,21 @@ Procedure and Macro Index * http:forwarding-page: HTTP and CGI. (line 26) * http:header: HTTP and CGI. (line 9) * http:serve-query: HTTP and CGI. (line 36) -* identifier=?: Syntactic Closures. (line 369) -* identifier?: Syntactic Closures. (line 334) +* identifier=?: Syntactic Closures. (line 370) +* identifier?: Syntactic Closures. (line 335) * identity: Miscellany. (line 9) * ieee-byte-collate: Byte/Number Conversions. - (line 152) + (line 153) | * ieee-byte-collate!: Byte/Number Conversions. - (line 143) + (line 144) | * ieee-byte-decollate: Byte/Number Conversions. - (line 156) + (line 157) | * ieee-byte-decollate!: Byte/Number Conversions. - (line 148) + (line 149) | * ieee-double->bytes: Byte/Number Conversions. - (line 98) + (line 99) | * ieee-float->bytes: Byte/Number Conversions. - (line 80) + (line 81) | * illuminant-map: Spectra. (line 80) * illuminant-map->XYZ: Spectra. (line 85) * implementation-vicinity: Vicinity. (line 42) @@ -18046,17 +18360,19 @@ Procedure and Macro Index * init-debug: Breakpoints. (line 9) * integer->bytes: Byte/Number Conversions. (line 29) +* integer->coordinates: Multidimensional Space-Filling Curves. + (line 48) | * integer->gray-code: Hilbert Space-Filling Curve. - (line 62) + (line 63) | * integer->hilbert-coordinates: Hilbert Space-Filling Curve. (line 30) * integer->list: Bit-Twiddling. (line 225) * integer->peano-coordinates: Peano Space-Filling Curve. (line 19) * integer-byte-collate: Byte/Number Conversions. - (line 137) + (line 138) | * integer-byte-collate!: Byte/Number Conversions. - (line 131) + (line 132) | * integer-expt: Irrational Integer Functions. (line 9) * integer-length: Bit-Twiddling. (line 98) @@ -18082,14 +18398,14 @@ Procedure and Macro Index * L*a*b*->L*C*h: Color Conversions. (line 44) * L*a*b*:DE*: Color Difference Metrics. (line 17) -* l*c*h->color: Color Spaces. (line 154) -* L*C*h->L*a*b*: Color Conversions. (line 45) -* L*C*h:DE*94: Color Difference Metrics. +* L*a*b*:DE*94: Color Difference Metrics. (line 25) +* l*c*h->color: Color Spaces. (line 158) +* L*C*h->L*a*b*: Color Conversions. (line 45) * L*u*v*->CIEXYZ: Color Conversions. (line 34) -* l*u*v*->color: Color Spaces. (line 102) -* laguerre:find-polynomial-root: Root Finding. (line 54) -* laguerre:find-root: Root Finding. (line 43) +* l*u*v*->color: Color Spaces. (line 104) +* laguerre:find-polynomial-root: Root Finding. (line 57) +* laguerre:find-root: Root Finding. (line 46) * last <1>: SRFI-1. (line 83) * last: Lists as sequences. (line 111) * last-pair: Miscellany. (line 64) @@ -18112,7 +18428,7 @@ Procedure and Macro Index * list-copy: SRFI-1. (line 24) * list-index: SRFI-1. (line 157) * list-of??: Lists as sets. (line 120) -* list-table-definition: Using Databases. (line 167) +* list-table-definition: Using Databases. (line 168) * list-tabulate: SRFI-1. (line 18) * list-tail: Rev4 Optional Procedures. (line 12) @@ -18121,7 +18437,7 @@ Procedure and Macro Index (line 77) * load->path: Module Manifests. (line 63) * load-ciexyz: Spectra. (line 40) -* load-color-dictionary: Color Names. (line 52) +* load-color-dictionary: Color Names. (line 53) * localtime: Posix Time. (line 39) * log2-binary-factors: Bit-Twiddling. (line 109) * logand: Bit-Twiddling. (line 18) @@ -18156,14 +18472,16 @@ Procedure and Macro Index * macro:load <2>: Syntactic Closures. (line 20) * macro:load <3>: Macros That Work. (line 24) * macro:load: R4RS Macros. (line 23) -* macroexpand: Defmacro. (line 31) -* macroexpand-1: Defmacro. (line 30) +* macroexpand: Defmacro. (line 32) +* macroexpand-1: Defmacro. (line 31) * macwork:eval: Macros That Work. (line 19) * macwork:expand: Macros That Work. (line 14) * macwork:load: Macros That Work. (line 25) * make-array: Arrays. (line 54) * make-base on base-table: The Base. (line 19) * make-bytes: Byte. (line 23) +* make-cell: Multidimensional Space-Filling Curves. + (line 12) | * make-color: Color Data-Type. (line 30) * make-command-server: Command Service. (line 7) * make-directory: Directories. (line 17) @@ -18195,10 +18513,10 @@ Procedure and Macro Index * make-promise: Promises. (line 9) * make-putter on base-table: Base Record Operations. (line 31) -* make-query-alist-command-server: HTTP and CGI. (line 86) +* make-query-alist-command-server: HTTP and CGI. (line 92) * make-queue: Queues. (line 13) * make-random-state: Exact Random Numbers. - (line 44) + (line 45) | * make-record-type: Records. (line 12) * make-rectangular: Irrational Real Functions. (line 93) @@ -18207,8 +18525,8 @@ Procedure and Macro Index * make-ruleset: Commutative Rings. (line 82) * make-shared-array: Arrays. (line 69) * make-sierpinski-indexer: Sierpinski Curve. (line 9) -* make-slib-color-name-db: Color Names. (line 94) -* make-syntactic-closure: Syntactic Closures. (line 177) +* make-slib-color-name-db: Color Names. (line 95) +* make-syntactic-closure: Syntactic Closures. (line 178) * make-table on base-table: Base Tables. (line 7) * make-uri: URI. (line 12) * make-vicinity: Vicinity. (line 21) @@ -18226,10 +18544,10 @@ Procedure and Macro Index * matrix->array: Matrix Algebra. (line 15) * matrix->lists: Matrix Algebra. (line 12) * matrix:difference: Matrix Algebra. (line 33) -* matrix:inverse: Matrix Algebra. (line 45) +* matrix:inverse: Matrix Algebra. (line 47) * matrix:product: Matrix Algebra. (line 36) * matrix:sum: Matrix Algebra. (line 30) -* mdbm:report: Using Databases. (line 94) +* mdbm:report: Using Databases. (line 95) * member: SRFI-1. (line 159) * member-if: Lists as sets. (line 62) * merge: Sorting. (line 62) @@ -18246,6 +18564,8 @@ Procedure and Macro Index * modular:invertable?: Modular Arithmetic. (line 44) * modular:negate: Modular Arithmetic. (line 52) * modular:normalize: Modular Arithmetic. (line 23) +* modulo: Irrational Integer Functions. + (line 29) | * mrna<-cdna: NCBI-DNA. (line 17) * must-be-first: Batch. (line 128) * must-be-last: Batch. (line 133) @@ -18255,8 +18575,8 @@ Procedure and Macro Index * ncbi:read-file: NCBI-DNA. (line 13) * nconc: Destructive list operations. (line 10) -* newton:find-integer-root: Root Finding. (line 9) -* newton:find-root: Root Finding. (line 26) +* newton:find-integer-root: Root Finding. (line 12) +* newton:find-root: Root Finding. (line 29) * ninth: SRFI-1. (line 65) * not-pair?: SRFI-1. (line 46) * notany: Lists as sets. (line 105) @@ -18282,10 +18602,10 @@ Procedure and Macro Index * open-database!: Using Databases. (line 68) * open-file <1>: Byte. (line 77) * open-file: Input/Output. (line 18) -* open-table: Using Databases. (line 107) +* open-table: Using Databases. (line 108) * open-table on base-table: Base Tables. (line 16) -* open-table on relational-database: Database Operations. (line 52) -* open-table!: Using Databases. (line 114) +* open-table on relational-database: Database Operations. (line 51) +* open-table!: Using Databases. (line 115) * operate-as: Yasos interface. (line 31) * or?: Non-List functions. (line 19) * ordered-for-each-key on base-table: Base ISAM Operations. @@ -18316,8 +18636,9 @@ Procedure and Macro Index * plot <1>: Legacy Plotting. (line 11) * plot: Character Plotting. (line 17) * plot-column: Drawing the Graph. (line 7) +* plot-text-column: Drawing the Graph. (line 59) * pnm:array-write: Portable Image Files. - (line 44) + (line 45) | * pnm:image-file->array: Portable Image Files. (line 35) * pnm:type-dimensions: Portable Image Files. @@ -18371,9 +18692,9 @@ Procedure and Macro Index * printf: Standard Formatted Output. (line 9) * process:schedule!: Multi-Processing. (line 20) -* program-arguments: System Interface. (line 22) +* program-arguments: System Interface. (line 23) * program-vicinity: Vicinity. (line 30) -* project-table on relational-database: Database Operations. (line 76) +* project-table on relational-database: Database Operations. (line 75) * proper-list?: SRFI-1. (line 38) * protein<-cdna: NCBI-DNA. (line 25) * provide: Feature. (line 58) @@ -18389,6 +18710,8 @@ Procedure and Macro Index * queue?: Queues. (line 16) * quo: Irrational Real Functions. (line 50) +* quotient: Irrational Integer Functions. + (line 27) | * random: Exact Random Numbers. (line 9) * random:exp: Inexact Random Numbers. @@ -18446,6 +18769,8 @@ Procedure and Macro Index * reduce-init: Lists as sequences. (line 61) * rem: Irrational Real Functions. (line 51) +* remainder: Irrational Integer Functions. + (line 28) | * remove <1>: SRFI-1. (line 134) * remove: Lists as sets. (line 153) * remove!: SRFI-1. (line 138) @@ -18457,17 +18782,19 @@ Procedure and Macro Index * repl:quit: Repl. (line 17) * repl:top-level: Repl. (line 11) * replace-suffix: Filenames. (line 65) -* require <1>: Catalog Creation. (line 48) +* require <1>: Catalog Creation. (line 50) * require: Require. (line 25) * require-if: Require. (line 40) * resample-array!: Array Interpolation. (line 19) -* resene: Color Names. (line 129) -* restrict-table on relational-database: Database Operations. (line 77) +* resene: Color Names. (line 130) +* restrict-table on relational-database: Database Operations. (line 76) * reverse!: SRFI-1. (line 93) * reverse-bit-field: Bit-Twiddling. (line 216) * RGB709->CIEXYZ: Color Conversions. (line 30) * rgb709->color: Color Spaces. (line 46) * rotate-bit-field: Bit-Twiddling. (line 202) +* round-quotient: Irrational Integer Functions. + (line 32) | * row:delete on relational-table: Single Row Operations. (line 50) * row:delete* on relational-table: Multi-Row Operations. @@ -18490,7 +18817,7 @@ Procedure and Macro Index (line 47) * rule-horizontal: Legending. (line 40) * rule-vertical: Legending. (line 32) -* saturate: Color Names. (line 109) +* saturate: Color Names. (line 110) * scanf: Standard Formatted Input. (line 13) * scanf-read-list: Standard Formatted Input. @@ -18505,18 +18832,18 @@ Procedure and Macro Index * scene:viewpoints: Solid Modeling. (line 88) * scheme-report-environment: Eval. (line 28) * schmooz: Schmooz. (line 16) -* secant:find-bracketed-root: Root Finding. (line 67) -* secant:find-root: Root Finding. (line 66) +* secant:find-bracketed-root: Root Finding. (line 70) +* secant:find-root: Root Finding. (line 69) * second: SRFI-1. (line 55) * seed->random-state: Exact Random Numbers. - (line 35) + (line 36) | * set: Setters. (line 30) * set-color: Graphics Context. (line 11) * set-difference: Lists as sets. (line 42) * set-font: Graphics Context. (line 18) -* set-glyphsize: Graphics Context. (line 48) -* set-linedash: Graphics Context. (line 39) -* set-linewidth: Graphics Context. (line 34) +* set-glyphsize: Graphics Context. (line 58) +* set-linedash: Graphics Context. (line 47) +* set-linewidth: Graphics Context. (line 42) * set-margin-templates: Legending. (line 27) * Setter: Collections. (line 108) * setter: Setters. (line 22) @@ -18533,17 +18860,17 @@ Procedure and Macro Index * size <1>: Collections. (line 105) * size: Yasos interface. (line 41) * sky-color-xyy: Daylight. (line 85) -* slib:error: System. (line 45) +* slib:error: System. (line 46) * slib:eval: System. (line 30) * slib:eval-load: System. (line 35) -* slib:exit: System. (line 51) +* slib:exit: System. (line 52) * slib:in-catalog?: Require. (line 57) * slib:load: System. (line 20) * slib:load-compiled: System. (line 15) * slib:load-source: System. (line 9) * slib:report: Configuration. (line 43) * slib:report-version: Configuration. (line 36) -* slib:warn: System. (line 42) +* slib:warn: System. (line 43) * snap-range: Column Ranges. (line 16) * software-type: Configuration. (line 32) * solar-declination: Daylight. (line 21) @@ -18565,13 +18892,13 @@ Procedure and Macro Index * solid:polyline: Solid Modeling. (line 262) * solid:prism: Solid Modeling. (line 276) * solid:pyramid: Solid Modeling. (line 241) -* solid:rotation: Solid Modeling. (line 432) -* solid:scale: Solid Modeling. (line 428) +* solid:rotation: Solid Modeling. (line 433) +* solid:scale: Solid Modeling. (line 429) * solid:sphere: Solid Modeling. (line 247) * solid:text: Solid Modeling. (line 308) * solid:texture: Solid Modeling. (line 344) -* solid:translation: Solid Modeling. (line 423) -* solidify-database: Using Databases. (line 86) +* solid:translation: Solid Modeling. (line 424) +* solidify-database: Using Databases. (line 87) * solidify-database on relational-database: Database Operations. (line 42) * some: Lists as sets. (line 73) @@ -18588,38 +18915,38 @@ Procedure and Macro Index * sprintf: Standard Formatted Output. (line 11) * sRGB->CIEXYZ: Color Conversions. (line 48) -* srgb->color: Color Spaces. (line 195) +* srgb->color: Color Spaces. (line 201) * sRGB->e-sRGB: Color Conversions. (line 59) * sRGB->xRGB: Color Conversions. (line 53) * ssax:assert-current-char: Parsing XML. (line 52) -* ssax:assert-token: Parsing XML. (line 630) -* ssax:complete-start-tag: Parsing XML. (line 517) -* ssax:handle-parsed-entity: Parsing XML. (line 436) +* ssax:assert-token: Parsing XML. (line 631) +* ssax:complete-start-tag: Parsing XML. (line 518) +* ssax:handle-parsed-entity: Parsing XML. (line 437) * ssax:init-buffer: Parsing XML. (line 64) -* ssax:make-elem-parser: Parsing XML. (line 667) -* ssax:make-parser: Parsing XML. (line 714) -* ssax:make-pi-parser: Parsing XML. (line 647) +* ssax:make-elem-parser: Parsing XML. (line 668) +* ssax:make-parser: Parsing XML. (line 715) +* ssax:make-pi-parser: Parsing XML. (line 648) * ssax:next-token: Parsing XML. (line 69) * ssax:next-token-of: Parsing XML. (line 83) -* ssax:read-attributes: Parsing XML. (line 460) -* ssax:read-cdata-body: Parsing XML. (line 385) -* ssax:read-char-data: Parsing XML. (line 589) -* ssax:read-char-ref: Parsing XML. (line 415) -* ssax:read-external-id: Parsing XML. (line 553) -* ssax:read-markup-token: Parsing XML. (line 328) -* ssax:read-ncname: Parsing XML. (line 293) -* ssax:read-pi-body-as-string: Parsing XML. (line 373) -* ssax:read-qname: Parsing XML. (line 319) -* ssax:read-string: Parsing XML. (line 110) -* ssax:resolve-name: Parsing XML. (line 504) +* ssax:read-attributes: Parsing XML. (line 461) +* ssax:read-cdata-body: Parsing XML. (line 386) +* ssax:read-char-data: Parsing XML. (line 590) +* ssax:read-char-ref: Parsing XML. (line 416) +* ssax:read-external-id: Parsing XML. (line 554) +* ssax:read-markup-token: Parsing XML. (line 329) +* ssax:read-ncname: Parsing XML. (line 294) +* ssax:read-pi-body-as-string: Parsing XML. (line 374) +* ssax:read-qname: Parsing XML. (line 320) +* ssax:read-string: Parsing XML. (line 111) +* ssax:resolve-name: Parsing XML. (line 505) * ssax:reverse-collect-str: Parsing XML. (line 18) * ssax:reverse-collect-str-drop-ws: Parsing XML. (line 24) -* ssax:scan-misc: Parsing XML. (line 577) -* ssax:skip-internal-dtd: Parsing XML. (line 380) -* ssax:skip-pi: Parsing XML. (line 370) -* ssax:skip-s: Parsing XML. (line 285) +* ssax:scan-misc: Parsing XML. (line 578) +* ssax:skip-internal-dtd: Parsing XML. (line 381) +* ssax:skip-pi: Parsing XML. (line 371) +* ssax:skip-s: Parsing XML. (line 286) * ssax:skip-while: Parsing XML. (line 58) -* ssax:xml->sxml: Parsing XML. (line 803) +* ssax:xml->sxml: Parsing XML. (line 804) * sscanf: Standard Formatted Input. (line 15) * stack: Trace. (line 49) @@ -18667,12 +18994,12 @@ Procedure and Macro Index * symbol-append: String-Case. (line 23) * symmetric:modulus: Modular Arithmetic. (line 13) * sync-base on base-table: The Base. (line 53) -* sync-database: Using Databases. (line 82) +* sync-database: Using Databases. (line 83) * sync-database on relational-database: Database Operations. (line 37) * syncase:eval: Syntax-Case Macros. (line 15) * syncase:expand: Syntax-Case Macros. (line 10) * syncase:load: Syntax-Case Macros. (line 21) -* syncase:sanity-check: Syntax-Case Macros. (line 67) +* syncase:sanity-check: Syntax-Case Macros. (line 68) * synclo:eval: Syntactic Closures. (line 15) * synclo:expand: Syntactic Closures. (line 10) * synclo:load: Syntactic Closures. (line 21) @@ -18681,7 +19008,7 @@ Procedure and Macro Index * system->line: Line I/O. (line 35) * table->linked-html: HTML Tables. (line 34) * table->linked-page: HTML Tables. (line 42) -* table-exists? on relational-database: Database Operations. (line 48) +* table-exists? on relational-database: Database Operations. (line 47) * table-name->filename: HTML Tables. (line 31) * take: SRFI-1. (line 71) * take!: SRFI-1. (line 72) @@ -18697,7 +19024,6 @@ Procedure and Macro Index * title-bottom: Legending. (line 12) * title-top: Legending. (line 7) * tmpnam: Input/Output. (line 65) -* tok:bump-column: Token definition. (line 61) * tok:char-group: Token definition. (line 7) * top-refs: Top-level Variable References. (line 15) @@ -18713,7 +19039,7 @@ Procedure and Macro Index * transact-file-replacement: Transactions. (line 110) * transcript-off: Transcripts. (line 10) * transcript-on: Transcripts. (line 9) -* transformer: Syntactic Closures. (line 113) +* transformer: Syntactic Closures. (line 114) * transpose: Matrix Algebra. (line 26) * truncate-up-to: Batch. (line 113) * tsort: Topological Sort. (line 12) @@ -18742,7 +19068,7 @@ Procedure and Macro Index * uri:split-fields: URI. (line 67) * uric:decode: URI. (line 81) * uric:encode: URI. (line 76) -* url->color-dictionary: Color Names. (line 77) +* url->color-dictionary: Color Names. (line 78) * user-email-address: Transactions. (line 145) * user-vicinity: Vicinity. (line 47) * values: Values. (line 9) @@ -18767,7 +19093,7 @@ Procedure and Macro Index * write-base on base-table: The Base. (line 43) * write-byte: Byte. (line 82) * write-bytes: Byte. (line 118) -* write-database: Using Databases. (line 79) +* write-database: Using Databases. (line 80) * write-database on relational-database: Database Operations. (line 26) * write-line: Line I/O. (line 29) * wt-tree/add: Basic Operations on Weight-Balanced Trees. @@ -18822,11 +19148,12 @@ Procedure and Macro Index (line 59) * wt-tree/union: Advanced Operations on Weight-Balanced Trees. (line 25) +* wt-tree/union-merge: Advanced Operations on Weight-Balanced Trees. + (line 125) | * x-axis: Legending. (line 51) -* x1: Legacy Plotting. (line 18) * xcons: SRFI-1. (line 15) * xRGB->CIEXYZ: Color Conversions. (line 51) -* xrgb->color: Color Spaces. (line 215) +* xrgb->color: Color Spaces. (line 221) * xRGB->sRGB: Color Conversions. (line 54) * xyY->XYZ: Spectra. (line 191) * xyY:normalize-colors: Spectra. (line 193) @@ -18858,7 +19185,7 @@ Variable Index * *syn-ignore-whitespace*: Ruleset Definition and Use. (line 12) * *timezone*: Time Zone. (line 111) -* atm-hec-polynomial: Cyclic Checksum. (line 115) +* atm-hec-polynomial: Cyclic Checksum. (line 116) * bottomedge: Legending. (line 18) * char-code-limit: Configuration. (line 11) * charplot:dimensions: Character Plotting. (line 9) @@ -18868,24 +19195,22 @@ Variable Index * CIEXYZ:D50: Color Conversions. (line 17) * CIEXYZ:D65: Color Conversions. (line 13) * CIEXYZ:E: Color Conversions. (line 24) -* crc-08-polynomial: Cyclic Checksum. (line 109) -* crc-10-polynomial: Cyclic Checksum. (line 98) -* crc-12-polynomial: Cyclic Checksum. (line 77) -* crc-16-polynomial: Cyclic Checksum. (line 69) -* crc-32-polynomial: Cyclic Checksum. (line 45) -* crc-ccitt-polynomial: Cyclic Checksum. (line 61) +* crc-08-polynomial: Cyclic Checksum. (line 110) +* crc-10-polynomial: Cyclic Checksum. (line 99) +* crc-12-polynomial: Cyclic Checksum. (line 78) +* crc-16-polynomial: Cyclic Checksum. (line 70) +* crc-32-polynomial: Cyclic Checksum. (line 46) +* crc-ccitt-polynomial: Cyclic Checksum. (line 62) * D50: Color Data-Type. (line 120) * D65: Color Data-Type. (line 116) * daylight?: Time Zone. (line 117) * debug:max-count: Trace. (line 24) * distribute*: Commutative Rings. (line 100) * distribute/: Commutative Rings. (line 104) -* dowcrc-polynomial: Cyclic Checksum. (line 120) +* dowcrc-polynomial: Cyclic Checksum. (line 121) * graph:dimensions: Legacy Plotting. (line 7) * graphrect: Rectangles. (line 26) * leftedge: Legending. (line 22) -* modulo: Irrational Integer Functions. - (line 29) * most-positive-fixnum: Configuration. (line 15) * nil: Miscellany. (line 61) * number-wt-type: Construction of Weight-Balanced Trees. @@ -18893,10 +19218,6 @@ Variable Index * plotrect: Rectangles. (line 22) * prime:prngs: Prime Numbers. (line 9) * prime:trials: Prime Numbers. (line 24) -* quotient: Irrational Integer Functions. - (line 27) -* remainder: Irrational Integer Functions. - (line 28) * rightedge: Legending. (line 23) * slib:form-feed: Configuration. (line 29) * slib:tab: Configuration. (line 26) @@ -18915,7 +19236,7 @@ Variable Index * tok:whitespaces: Token definition. (line 52) * topedge: Legending. (line 17) * tzname: Time Zone. (line 123) -* usb-token-polynomial: Cyclic Checksum. (line 124) +* usb-token-polynomial: Cyclic Checksum. (line 125) Concept and Feature Index ************************* @@ -18940,9 +19261,9 @@ Concept and Feature Index * array: Arrays. (line 6) * array-for-each: Array Mapping. (line 6) * association function: Association Lists. (line 17) -* Attribute: Parsing XML. (line 460) +* Attribute: Parsing XML. (line 461) * attribute-value: HTML. (line 10) -* AttValue: Parsing XML. (line 472) +* AttValue: Parsing XML. (line 473) * Auto-sharing: Using Databases. (line 25) * balanced binary trees: Weight-Balanced Trees. (line 8) @@ -18975,15 +19296,15 @@ Concept and Feature Index * cgi: HTTP and CGI. (line 6) * chapter-order: Chapter Ordering. (line 6) * charplot: Character Plotting. (line 6) -* Chroma: Color Spaces. (line 141) +* Chroma: Color Spaces. (line 145) * cie1931: Spectra. (line 32) * cie1964: Spectra. (line 27) * ciexyz: Spectra. (line 37) * CIEXYZ: Color Spaces. (line 18) -* cksum-string: Cyclic Checksum. (line 160) +* cksum-string: Cyclic Checksum. (line 161) * coerce: Type Coercion. (line 6) * collect: Collections. (line 6) -* color-database: Color Names. (line 65) +* color-database: Color Names. (line 66) * color-names: Color Names. (line 6) * command line: Command Line. (line 10) * commentfix: Rule Types. (line 35) @@ -19011,7 +19332,7 @@ Concept and Feature Index * define-record-type: Define-Record-Type. (line 6) * defmacro: Library Catalogs. (line 31) * defmacroexpand <1>: Pretty-Print. (line 88) -* defmacroexpand: Defmacro. (line 48) +* defmacroexpand: Defmacro. (line 49) * delim: Rule Types. (line 47) * dequeues: Queues. (line 10) * determinant: Matrix Algebra. (line 6) @@ -19023,15 +19344,15 @@ Concept and Feature Index (line 18) * discrete maps, using binary trees: Weight-Balanced Trees. (line 52) -* DrScheme: Installation. (line 138) +* DrScheme: Installation. (line 151) * dynamic: Dynamic Data Type. (line 6) * dynamic-wind: Dynamic-Wind. (line 6) -* e-sRGB: Color Spaces. (line 218) -* ELK: Installation. (line 134) +* e-sRGB: Color Spaces. (line 224) +* ELK: Installation. (line 147) * emacs: Transactions. (line 33) * Encapsulated-PostScript: PostScript Graphing. (line 23) * escaped: URI. (line 77) -* EUC: Extra-SLIB Packages. (line 53) +* EUC: Extra-SLIB Packages. (line 45) * Euclidean Domain: Commutative Rings. (line 67) * eval: Eval. (line 6) * exchanger: Miscellany. (line 22) @@ -19044,11 +19365,12 @@ Concept and Feature Index * filename <1>: Batch. (line 148) * filename: Filenames. (line 6) * fluid-let: Fluid-Let. (line 6) -* fold: Parsing XML. (line 400) +* fold: Parsing XML. (line 401) * form: HTML. (line 63) * format: Format. (line 6) -* Gambit-C 3.0: Installation. (line 148) +* Gambit-C 3.0: Installation. (line 161) * gamut: Color Spaces. (line 18) +* Gauche-0.9: Installation. (line 141) * generic-write: Generic-Write. (line 6) * getenv: System Interface. (line 6) * getit: URI. (line 118) @@ -19056,12 +19378,12 @@ Concept and Feature Index * getopt: Getopt. (line 6) * getopt-parameters <1>: Command Example. (line 12) * getopt-parameters: Getopt Parameter lists. - (line 6) | + (line 6) * glob: Filenames. (line 6) * Gray code: Hilbert Space-Filling Curve. - (line 52) + (line 53) | * guarded-cond-clause: Guarded COND Clause. (line 6) -* Guile: Installation. (line 157) +* Guile: Installation. (line 170) * hash: Hashing. (line 6) * hash-table: Hash Tables. (line 6) * Hilbert: Hilbert Space-Filling Curve. @@ -19071,16 +19393,16 @@ Concept and Feature Index * hilbert-fill: Hilbert Space-Filling Curve. (line 6) * HOME <1>: Vicinity. (line 51) -* HOME: Catalog Creation. (line 19) +* HOME: Catalog Creation. (line 21) * homecat: Catalog Vicinities. (line 35) * html-for-each: Parsing HTML. (line 6) * html-form: HTML. (line 6) * http: HTTP and CGI. (line 6) -* Hue: Color Spaces. (line 143) -* ICC Profile: Color Spaces. (line 191) +* Hue: Color Spaces. (line 147) +* ICC Profile: Color Spaces. (line 197) * implcat: Catalog Vicinities. (line 23) * indexed-sequential-access-method: Byte/Number Conversions. - (line 128) + (line 129) | * inexact: Feature. (line 13) * infix: Rule Types. (line 19) * Info: Top-level Variable References. @@ -19091,16 +19413,16 @@ Concept and Feature Index * intrinsic feature: Feature. (line 9) * ISAM: Indexed Sequential Access Methods. (line 6) -* Japanese: Extra-SLIB Packages. (line 53) -* JFILTER: Extra-SLIB Packages. (line 53) -* JIS: Extra-SLIB Packages. (line 53) -* Kawa: Installation. (line 154) +* Japanese: Extra-SLIB Packages. (line 45) +* JFILTER: Extra-SLIB Packages. (line 45) +* JIS: Extra-SLIB Packages. (line 45) +* Kawa: Installation. (line 167) * L*a*b*: Color Spaces. (line 68) -* L*C*h: Color Spaces. (line 135) -* L*u*v*: Color Spaces. (line 98) +* L*C*h: Color Spaces. (line 139) +* L*u*v*: Color Spaces. (line 100) * lamination: Hilbert Space-Filling Curve. - (line 88) -* Larceny: Installation. (line 125) + (line 89) | +* Larceny: Installation. (line 132) * Left Denotation, led: Nud and Led Definition. (line 13) * let-values: Binding to multiple values. @@ -19133,7 +19455,7 @@ Concept and Feature Index * minimize: Minimizing. (line 6) * minimum field width (printf): Standard Formatted Output. (line 88) -* MIT Scheme: Installation. (line 145) +* MIT Scheme: Installation. (line 158) * mkimpcat.scm: Catalog Vicinities. (line 28) * mklibcat.scm: Catalog Vicinities. (line 16) * modular: Modular Arithmetic. (line 6) @@ -19141,10 +19463,10 @@ Concept and Feature Index (line 6) * multiarg-apply: Multi-argument Apply. (line 6) -* MzScheme: Installation. (line 139) +* MzScheme: Installation. (line 152) * nary: Rule Types. (line 23) * ncbi-dma: NCBI-DNA. (line 6) -* new-catalog: Catalog Creation. (line 48) +* new-catalog: Catalog Creation. (line 50) * nofix: Rule Types. (line 11) * null: HTML Tables. (line 92) * Null Denotation, nud: Nud and Led Definition. @@ -19170,7 +19492,7 @@ Concept and Feature Index * pgm-raw: Portable Image Files. (line 26) * plain-text: HTML. (line 14) -* PLT Scheme: Installation. (line 137) +* PLT Scheme: Installation. (line 150) * pnm: Portable Image Files. (line 6) * portable bitmap graphics: Portable Image Files. @@ -19195,9 +19517,9 @@ Concept and Feature Index * priority-queue: Priority Queues. (line 6) * PRNG: Random Numbers. (line 6) * process: Multi-Processing. (line 6) -* program-arguments <1>: System Interface. (line 19) +* program-arguments <1>: System Interface. (line 20) * program-arguments: Getopt. (line 102) -* Prolog: Extra-SLIB Packages. (line 49) +* Prolog: Extra-SLIB Packages. (line 41) * promise: Promises. (line 6) * PSD: Extra-SLIB Packages. (line 26) * qp <1>: Quick Print. (line 6) @@ -19225,9 +19547,9 @@ Concept and Feature Index * relational-database: Relational Database. (line 6) * relational-system: Using Databases. (line 53) * repl <1>: Repl. (line 6) -* repl: Syntax-Case Macros. (line 61) -* resene: Color Names. (line 126) -* Resene: Color Names. (line 95) +* repl: Syntax-Case Macros. (line 62) +* resene: Color Names. (line 127) +* Resene: Color Names. (line 96) * reset: HTML. (line 95) * rev2-procedures: Rev2 Procedures. (line 6) * rev4-optional-procedures: Rev4 Optional Procedures. @@ -19239,15 +19561,16 @@ Concept and Feature Index * run-time-loadable option: Weight-Balanced Trees. (line 69) * rwb-isam: Base Table. (line 39) -* saturate: Color Names. (line 95) +* S7: Installation. (line 238) +* saturate: Color Names. (line 96) * scanf: Standard Formatted Input. (line 6) -* SCHELOG: Extra-SLIB Packages. (line 49) +* SCHELOG: Extra-SLIB Packages. (line 41) * scheme: URI. (line 99) * Scheme Request For Implementation: SRFI. (line 8) -* Scheme48: Installation. (line 175) +* Scheme48: Installation. (line 199) * schmooz: Schmooz. (line 6) -* SCM: Installation. (line 120) +* SCM: Installation. (line 127) * script: Installation. (line 37) * self-set: Commutative Rings. (line 17) * Sequence Comparison: Sequence Comparison. (line 6) @@ -19257,7 +19580,7 @@ Concept and Feature Index (line 52) * shell: Command Line. (line 12) * sierpinski: Sierpinski Curve. (line 6) -* SISC: Installation. (line 151) +* SISC: Installation. (line 164) * sitecat: Catalog Vicinities. (line 19) * sky: Daylight. (line 6) * slib: Installation. (line 37) @@ -19270,6 +19593,8 @@ Concept and Feature Index * source: Library Catalogs. (line 18) * Space-Filling: Hilbert Space-Filling Curve. (line 8) +* space-filling: Multidimensional Space-Filling Curves. + (line 6) | * sparse: MAT-File Format. (line 15) * Spectral Tristimulus Values: Spectra. (line 24) * spiff: Sequence Comparison. (line 29) @@ -19284,23 +19609,25 @@ Concept and Feature Index (line 6) * srfi-23: SRFI. (line 39) * srfi-28: SRFI. (line 41) -* srfi-47: SRFI. (line 43) -* srfi-59: SRFI. (line 45) -* srfi-60 <1>: SRFI. (line 47) +* srfi-39 <1>: SRFI. (line 43) +* srfi-39: Parameter Objects. (line 6) +* srfi-47: SRFI. (line 45) +* srfi-59: SRFI. (line 47) +* srfi-60 <1>: SRFI. (line 49) * srfi-60: Bit-Twiddling. (line 6) -* srfi-61 <1>: SRFI. (line 49) +* srfi-61 <1>: SRFI. (line 51) * srfi-61: Guarded COND Clause. (line 6) -* srfi-63: SRFI. (line 51) +* srfi-63: SRFI. (line 53) * srfi-8 <1>: SRFI. (line 33) * srfi-8: Binding to multiple values. (line 6) * srfi-9 <1>: SRFI. (line 35) * srfi-9: Define-Record-Type. (line 6) -* srfi-94: SRFI. (line 53) -* srfi-95 <1>: SRFI. (line 56) +* srfi-94: SRFI. (line 55) +* srfi-95 <1>: SRFI. (line 58) * srfi-95: Sorting. (line 6) -* srfi-96: SRFI. (line 58) -* sRGB: Color Spaces. (line 189) +* srfi-96: SRFI. (line 60) +* sRGB: Color Spaces. (line 195) * stdio: Standard Formatted I/O. (line 14) * string-case: String-Case. (line 6) @@ -19347,261 +19674,264 @@ Concept and Feature Index * variable references: Top-level Variable References. (line 6) * vet: Module Analysis. (line 6) -* VSCM: Installation. (line 186) +* VSCM: Installation. (line 210) * WB: Base Table. (line 34) * wb-table: Base Table. (line 32) * weight-balanced binary trees: Weight-Balanced Trees. (line 8) -* wget: Color Names. (line 81) +* wget: Color Names. (line 82) * white point: Color Data-Type. (line 107) * wild-card: Match Keys. (line 6) * with-file: With-File. (line 6) * Word: Transactions. (line 34) * wt-tree: Weight-Balanced Trees. (line 6) -* xRGB: Color Spaces. (line 204) +* xRGB: Color Spaces. (line 210) * xyY: Spectra. (line 178) * yasos: Yasos. (line 6) Tag Table: -Node: Top844 -Node: The Library System1911 -Node: Feature2578 -Ref: Feature-Footnote-14779 -Node: Require5169 -Node: Library Catalogs7582 -Node: Catalog Creation9013 -Node: Catalog Vicinities11388 -Node: Compiling Scheme14148 -Node: Module Conventions14798 -Ref: Module Conventions-Footnote-116223 -Node: Module Manifests16469 -Node: Module Semantics21941 -Node: Top-level Variable References23559 -Ref: Top-level Variable References-Footnote-125638 -Node: Module Analysis25959 -Node: Universal SLIB Procedures27064 -Node: Vicinity27679 -Node: Configuration31534 -Node: Input/Output34506 -Node: System38461 -Node: Miscellany41631 -Node: Scheme Syntax Extension Packages43534 -Node: Defmacro44472 -Node: R4RS Macros46448 -Node: Macro by Example47712 -Node: Macros That Work50610 -Node: Syntactic Closures56604 -Node: Syntax-Case Macros74132 -Node: Define-Structure78063 -Node: Define-Record-Type80039 -Node: Fluid-Let80672 -Node: Binding to multiple values81642 -Node: Guarded LET* special form82241 -Node: Guarded COND Clause82593 -Node: Yasos84378 -Node: Yasos terms85190 -Node: Yasos interface86228 -Node: Setters88324 -Node: Yasos examples90983 -Node: Textual Conversion Packages93941 -Node: Precedence Parsing94794 -Node: Precedence Parsing Overview95479 -Ref: Precedence Parsing Overview-Footnote-196884 -Node: Rule Types97109 -Node: Ruleset Definition and Use98564 -Node: Token definition100947 -Node: Nud and Led Definition103555 -Node: Grammar Rule Definition106016 -Node: Format113612 -Node: Format Interface113891 -Node: Format Specification115641 -Node: Standard Formatted I/O126586 -Node: Standard Formatted Output127174 -Node: Standard Formatted Input136632 -Node: Programs and Arguments143309 -Node: Getopt143808 -Node: Command Line150431 -Node: Parameter lists153629 -Node: Getopt Parameter lists157535 -Node: Filenames160776 -Node: Batch164722 -Node: HTML172612 -Node: HTML Tables179054 -Node: HTTP and CGI185586 -Node: Parsing HTML190135 -Node: URI192642 -Node: Parsing XML197310 -Node: Printing Scheme230196 -Node: Generic-Write230523 -Node: Object-To-String231939 -Node: Pretty-Print232358 -Node: Time and Date235343 -Node: Time Zone236400 -Node: Posix Time241142 -Node: Common-Lisp Time243310 -Node: Time Infrastructure244936 -Node: NCBI-DNA245287 -Node: Schmooz246659 -Node: Mathematical Packages250895 -Node: Bit-Twiddling251650 -Node: Modular Arithmetic260195 -Node: Irrational Integer Functions262626 -Node: Irrational Real Functions263655 -Node: Prime Numbers267259 -Node: Random Numbers268963 -Node: Exact Random Numbers269805 -Node: Inexact Random Numbers272077 -Node: Discrete Fourier Transform273911 -Node: Cyclic Checksum276346 -Node: Graphing283976 -Node: Character Plotting284171 -Node: PostScript Graphing289683 -Node: Column Ranges291462 -Node: Drawing the Graph292941 -Node: Graphics Context294036 -Node: Rectangles295855 -Node: Legending297302 -Node: Legacy Plotting299531 -Node: Example Graph300543 -Node: Solid Modeling304910 -Node: Color324419 -Node: Color Data-Type325255 -Ref: Color Data-Type-Footnote-1328905 -Node: Color Spaces329646 -Ref: Color Spaces-Footnote-1338906 -Node: Spectra339565 -Node: Color Difference Metrics348676 -Node: Color Conversions351358 -Node: Color Names353502 -Node: Daylight360438 -Node: Root Finding365127 -Node: Minimizing369007 -Ref: Minimizing-Footnote-1370431 -Node: The Limit371049 -Node: Commutative Rings375919 -Node: Matrix Algebra387330 -Node: Database Packages388861 -Node: Relational Database389144 -Node: Using Databases390011 -Node: Table Operations396517 -Node: Single Row Operations397728 -Node: Match-Keys399975 -Node: Multi-Row Operations402054 -Node: Indexed Sequential Access Methods404445 -Node: Sequential Index Operations405453 -Node: Table Administration407809 -Node: Database Interpolation408676 -Node: Embedded Commands409778 -Node: Database Extension411352 -Node: Command Intrinsics413477 -Node: Define-tables Example415039 -Node: The *commands* Table416689 -Node: Command Service418967 -Node: Command Example420929 -Node: Database Macros425482 -Node: Within-database426367 -Node: Within-database Example429274 -Node: Database Browser431061 -Node: Relational Infrastructure432137 -Node: Base Table432441 -Node: The Base434949 -Node: Base Tables438067 -Node: Base Field Types439543 -Node: Composite Keys440326 -Node: Base Record Operations442380 -Node: Match Keys444108 -Node: Aggregate Base Operations444989 -Node: Base ISAM Operations446054 -Node: Catalog Representation447372 -Node: Relational Database Objects450041 -Node: Database Operations452685 -Node: Weight-Balanced Trees456394 -Node: Construction of Weight-Balanced Trees460280 -Node: Basic Operations on Weight-Balanced Trees463746 -Node: Advanced Operations on Weight-Balanced Trees466613 -Node: Indexing Operations on Weight-Balanced Trees472654 -Node: Other Packages476495 -Node: Data Structures477024 -Node: Arrays477865 -Node: Subarrays486552 -Node: Array Mapping488794 -Node: Array Interpolation491594 -Node: Association Lists492858 -Node: Byte495134 -Node: Byte/Number Conversions502020 -Node: MAT-File Format509546 -Node: Portable Image Files510825 -Node: Collections512455 -Node: Dynamic Data Type518569 -Node: Hash Tables519848 -Node: Object522436 -Node: Priority Queues530719 -Node: Queues531574 -Node: Records532819 -Node: Sorting and Searching536329 -Node: Common List Functions537022 -Node: List construction537479 -Node: Lists as sets539194 -Node: Lists as sequences545732 -Node: Destructive list operations550959 -Node: Non-List functions553637 -Node: Tree Operations554726 -Node: Chapter Ordering556419 -Node: Sorting558066 -Node: Topological Sort561592 -Node: Hashing563300 -Node: Space-Filling Curves564317 -Node: Hilbert Space-Filling Curve564621 -Node: Peano Space-Filling Curve568511 -Node: Sierpinski Curve569617 -Node: Soundex572081 -Node: String Search573679 -Node: Sequence Comparison576252 -Node: Procedures579382 -Node: Type Coercion579910 -Node: String-Case580342 -Node: String Ports582169 -Node: Line I/O582941 -Node: Multi-Processing584990 -Node: Metric Units586108 -Node: Standards Support594387 -Node: RnRS595183 -Node: With-File596406 -Node: Transcripts596682 -Node: Rev2 Procedures597016 -Node: Rev4 Optional Procedures598749 -Node: Multi-argument / and -599218 -Node: Multi-argument Apply599628 -Node: Rationalize599965 -Node: Promises601127 -Node: Dynamic-Wind601573 -Node: Eval602841 -Node: Values606186 -Node: SRFI607001 -Node: SRFI-1608641 -Node: Session Support613148 -Node: Repl613722 -Node: Quick Print615018 -Node: Debug616324 -Node: Breakpoints617231 -Node: Trace619273 -Node: System Interface622499 -Node: Directories623552 -Node: Transactions625045 -Node: CVS631516 -Node: Extra-SLIB Packages632683 -Node: About SLIB635024 -Node: Installation635969 -Node: The SLIB script645771 -Node: Porting646270 -Ref: Porting-Footnote-1642993 -Node: Coding Guidelines647834 -Node: Copyrights650248 -Node: About this manual653617 -Node: GNU Free Documentation License654527 -Node: Index677185 +Node: Top912 +Node: The Library System2118 +Node: Feature2868 +Ref: Feature-Footnote-14794 +Node: Require5648 +Node: Library Catalogs8144 +Node: Catalog Creation9658 +Node: Catalog Vicinities12297 +Node: Compiling Scheme15140 +Node: Module Conventions15873 +Ref: Module Conventions-Footnote-116454 +Node: Module Manifests17627 +Node: Module Semantics23182 +Node: Top-level Variable References24883 +Ref: Top-level Variable References-Footnote-125881 +Node: Module Analysis27366 +Node: Universal SLIB Procedures28554 +Node: Vicinity29252 +Node: Configuration33190 +Node: Input/Output36253 +Node: System40291 +Node: Miscellany43572 +Node: Scheme Syntax Extension Packages45558 +Node: Defmacro46620 +Node: R4RS Macros48710 +Node: Macro by Example50084 +Node: Macros That Work53065 +Node: Syntactic Closures59169 +Node: Syntax-Case Macros76807 +Node: Define-Structure80848 +Node: Define-Record-Type83299 +Node: Fluid-Let84015 +Node: Parameter Objects85379 +Node: Binding to multiple values86159 +Node: Guarded LET* special form86897 +Node: Guarded COND Clause87381 +Node: Yasos89304 +Node: Yasos terms90492 +Node: Yasos interface91680 +Node: Setters93931 +Node: Yasos examples96738 +Node: Textual Conversion Packages99843 +Node: Precedence Parsing100779 +Node: Precedence Parsing Overview101547 +Ref: Precedence Parsing Overview-Footnote-198120 +Node: Rule Types103260 +Node: Ruleset Definition and Use104798 +Node: Token definition107469 +Node: Nud and Led Definition109838 +Node: Grammar Rule Definition112382 +Node: Format120061 +Node: Format Interface120423 +Node: Format Specification122099 +Node: Standard Formatted I/O133127 +Node: Standard Formatted Output133798 +Node: Standard Formatted Input143419 +Node: Programs and Arguments150179 +Node: Getopt150761 +Node: Command Line157390 +Node: Parameter lists160671 +Node: Getopt Parameter lists164660 +Node: Filenames167984 +Node: Batch171957 +Node: HTML179875 +Node: HTML Tables186400 +Node: HTTP and CGI193015 +Node: Parsing HTML198279 +Node: URI200975 +Node: Parsing XML205726 +Node: Printing Scheme238696 +Node: Generic-Write239106 +Node: Object-To-String240605 +Node: Pretty-Print241107 +Node: Time and Date244198 +Node: Time Zone245338 +Node: Posix Time250163 +Node: Common-Lisp Time252414 +Node: Time Infrastructure254123 +Node: NCBI-DNA254557 +Node: Schmooz256012 +Node: Mathematical Packages260331 +Node: Bit-Twiddling261169 +Node: Modular Arithmetic269818 +Node: Irrational Integer Functions272332 +Node: Irrational Real Functions274096 +Node: Prime Numbers278385 +Node: Random Numbers280172 +Node: Exact Random Numbers281102 +Node: Inexact Random Numbers283458 +Node: Discrete Fourier Transform285375 +Node: Cyclic Checksum287893 +Node: Graphing295607 +Node: Character Plotting295885 +Node: PostScript Graphing301480 +Node: Column Ranges303342 +Node: Drawing the Graph304904 +Node: Graphics Context308162 +Node: Rectangles310808 +Node: Legending312338 +Node: Legacy Plotting314650 +Node: Example Graph315865 +Node: Solid Modeling320315 +Node: Color339908 +Node: Color Data-Type340827 +Ref: Color Data-Type-Footnote-1331893 +Node: Color Spaces345301 +Ref: Color Spaces-Footnote-1341906 +Node: Spectra355311 +Node: Color Difference Metrics364294 +Node: Color Conversions367353 +Node: Color Names369580 +Node: Daylight376600 +Node: Root Finding381372 +Node: Minimizing385575 +Ref: Minimizing-Footnote-1373682 +Node: The Limit387700 +Node: Commutative Rings392653 +Node: Matrix Algebra404147 +Node: Database Packages405708 +Node: Relational Database406074 +Node: Using Databases407024 +Node: Table Operations413614 +Node: Single Row Operations414908 +Node: Match-Keys417238 +Node: Multi-Row Operations419400 +Node: Indexed Sequential Access Methods421874 +Node: Sequential Index Operations422865 +Node: Table Administration425304 +Node: Database Interpolation426254 +Node: Embedded Commands427439 +Node: Database Extension429096 +Node: Command Intrinsics431304 +Node: Define-tables Example432949 +Node: The *commands* Table434682 +Node: Command Service437043 +Node: Command Example439088 +Node: Database Macros443724 +Node: Within-database444692 +Node: Within-database Example447682 +Node: Database Browser449552 +Node: Relational Infrastructure450710 +Node: Base Table451097 +Node: The Base453688 +Node: Base Tables456889 +Node: Base Field Types458448 +Node: Composite Keys459314 +Node: Base Record Operations461451 +Node: Match Keys463262 +Node: Aggregate Base Operations464226 +Node: Base ISAM Operations465374 +Node: Catalog Representation466775 +Node: Relational Database Objects469527 +Node: Database Operations472254 +Node: Weight-Balanced Trees476041 +Node: Construction of Weight-Balanced Trees480010 +Node: Basic Operations on Weight-Balanced Trees483559 +Node: Advanced Operations on Weight-Balanced Trees486509 +Node: Indexing Operations on Weight-Balanced Trees496073 +Node: Other Packages499997 +Node: Data Structures500609 +Node: Arrays501533 +Node: Subarrays510303 +Node: Array Mapping512607 +Node: Array Interpolation515490 +Node: Association Lists516837 +Node: Byte519196 +Node: Byte/Number Conversions525298 +Node: MAT-File Format533005 +Node: Portable Image Files534367 +Node: Collections536081 +Node: Dynamic Data Type542277 +Node: Hash Tables543639 +Node: Object546310 +Node: Priority Queues554676 +Node: Queues555614 +Node: Records556942 +Node: Sorting and Searching560535 +Node: Common List Functions561317 +Node: List construction561857 +Node: Lists as sets563655 +Node: Lists as sequences570276 +Node: Destructive list operations575648 +Node: Non-List functions578409 +Node: Tree Operations579581 +Node: Chapter Ordering581357 +Node: Sorting583087 +Node: Topological Sort586696 +Node: Hashing588487 +Node: Space-Filling Curves589587 +Node: Multidimensional Space-Filling Curves590080 +Node: Hilbert Space-Filling Curve594720 +Node: Peano Space-Filling Curve598870 +Node: Sierpinski Curve600105 +Node: Soundex602707 +Node: String Search604388 +Node: Sequence Comparison607044 +Node: Procedures610257 +Node: Type Coercion610868 +Node: String-Case611383 +Node: String Ports613293 +Node: Line I/O614148 +Node: Multi-Processing616280 +Node: Metric Units617481 +Node: Standards Support625843 +Node: RnRS626722 +Node: With-File628028 +Node: Transcripts628387 +Node: Rev2 Procedures628804 +Node: Rev4 Optional Procedures630620 +Node: Multi-argument / and -631172 +Node: Multi-argument Apply631665 +Node: Rationalize632085 +Node: Promises633330 +Node: Dynamic-Wind633859 +Node: Eval635210 +Node: Values638638 +Node: SRFI639536 +Node: SRFI-1641307 +Node: Session Support645897 +Node: Repl646554 +Node: Quick Print647933 +Node: Debug649322 +Node: Breakpoints650312 +Node: Trace652437 +Node: System Interface655746 +Node: Directories656646 +Node: Transactions658944 +Node: CVS665064 +Node: Extra-SLIB Packages666314 +Node: About SLIB668681 +Node: Installation669633 +Node: The SLIB script680252 +Node: Porting680834 +Ref: Porting-Footnote-1652860 +Node: Compiled and Implementation-Specific Features682668 +Node: Coding Guidelines683890 +Node: Copyrights686425 +Node: About this manual689963 +Node: GNU Free Documentation License690645 +Node: Index715884 End Tag Table @@ -4,7 +4,7 @@ ; placed in the public domain
; *** version numbers ***
-!define PRODUCT_VERSION "3b1-1"
+!define PRODUCT_VERSION "3b5-1"
; ----------------[ NO CHANGES BELOW ]----------------
@@ -22,7 +22,7 @@ !define PRODUCT_NAME "SLIB"
!define PRODUCT_COMPANY "Voluntocracy"
!define PRODUCT_PUBLISHER "Aubrey Jaffer"
-!define PRODUCT_WEB_SITE "http://swissnet.ai.mit.edu/~jaffer/SLIB"
+!define PRODUCT_WEB_SITE "http://people.csail.mit.edu/jaffer/SLIB"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\slib-${PRODUCT_VERSION}.exe"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
@@ -158,6 +158,7 @@ Section "MainSection" SEC01 File "FAQ"
File "fdl.texi"
File "fluidlet.scm"
+ File "fluid-let.scm"
File "format.scm"
File "format.texi"
File "formatst.scm"
@@ -269,6 +270,7 @@ Section "MainSection" SEC01 File "elk.init"
File "gambit.init"
File "guile.init"
+ File "guile-2.init"
File "jscheme.init"
File "kawa.init"
File "macscheme.init"
@@ -281,6 +283,7 @@ Section "MainSection" SEC01 File "scm.init"
File "scsh.init"
File "sisc.init"
+ File "s7.init"
File "STk.init"
File "t3.init"
File "umbscheme.init"
@@ -338,8 +341,8 @@ Section "MainSection" SEC01 File "vet.scm"
File "vet.txi"
File "withfile.scm"
- File "wttest.scm"
File "wttree.scm"
+ File "wttree-test.scm"
File "yasyn.scm"
; Shortcuts
@@ -399,8 +402,8 @@ Section Uninstall Delete "$INSTDIR\${PRODUCT_NAME}.url"
Delete "$INSTDIR\uninst.exe"
Delete "$INSTDIR\yasyn.scm"
+ Delete "$INSTDIR\wttree-test.scm"
Delete "$INSTDIR\wttree.scm"
- Delete "$INSTDIR\wttest.scm"
Delete "$INSTDIR\withfile.scm"
Delete "$INSTDIR\vet.txi"
Delete "$INSTDIR\vet.scm"
@@ -459,6 +462,7 @@ Section Uninstall Delete "$INSTDIR\elk.init"
Delete "$INSTDIR\gambit.init"
Delete "$INSTDIR\guile.init"
+ Delete "$INSTDIR\guile-2.init"
Delete "$INSTDIR\jscheme.init"
Delete "$INSTDIR\kawa.init"
Delete "$INSTDIR\macscheme.init"
@@ -471,6 +475,7 @@ Section Uninstall Delete "$INSTDIR\scm.init"
Delete "$INSTDIR\scsh.init"
Delete "$INSTDIR\sisc.init"
+ Delete "$INSTDIR\s7.init"
Delete "$INSTDIR\STk.init"
Delete "$INSTDIR\t3.init"
Delete "$INSTDIR\umbscheme.init"
@@ -581,6 +586,7 @@ Section Uninstall Delete "$INSTDIR\formatst.scm"
Delete "$INSTDIR\format.texi"
Delete "$INSTDIR\format.scm"
+ Delete "$INSTDIR\fluid-let.scm"
Delete "$INSTDIR\fluidlet.scm"
Delete "$INSTDIR\fdl.texi"
Delete "$INSTDIR\FAQ"
@@ -28,9 +28,9 @@ Usage: slib SCHEME Usage: slib - Initialize SLIB session using executable (MIT) 'scheme', 'scm', - 'gsi', 'mzscheme', 'guile', 'slib48', 'larceny', 'scmlit', 'elk', - 'sisc', or 'kawa'." + Initialize SLIB session using executable (MIT)'scheme', 'scm', + 'gsi', 'gosh', 'guile', 'slib48', 'larceny', 'scmlit', 'elk', + 'sisc', 'kawa', or 'mzscheme'." case "$1" in -v | --ver*) echo slib "$VERSION"; exit 0;; @@ -41,18 +41,18 @@ case "$1" in *) command="$1" shift esac -# If more arguments are supplied, then err out. -if [ ! -z "$1" ]; then - echo "$usage"; exit 1 -fi +## If more arguments are supplied, then err out. +# if [ ! -z "$1" ]; then +# echo "$usage"; exit 1 +# fi if [ -z "$command" ]; then if type scm>/dev/null 2>&1; then command=scm; implementation=scm elif type gsi>/dev/null 2>&1; then command=gsi; implementation=gam - elif type mzscheme>/dev/null 2>&1; then - command=mzscheme; implementation=plt + elif type gosh>/dev/null 2>&1; then + command=gosh; implementation=gch elif type guile>/dev/null 2>&1; then command=guile; implementation=gui elif type slib48>/dev/null 2>&1; then @@ -67,12 +67,14 @@ if [ -z "$command" ]; then command=sisc; implementation=ssc elif type kawa>/dev/null 2>&1; then command=kawa; implementation=kwa + elif type mzscheme>/dev/null 2>&1; then + command=mzscheme; implementation=plt else echo No Scheme implementation found. exit 1 fi # Gambit 4.0 doesn't allow input redirection; foils --version test. -elif [ "$command" == "gsi" ]; then implementation=gam +elif [ "$command" = "gsi" ]; then implementation=gam elif type $command>/dev/null 2>&1; then SPEW="`$command --version < /dev/null 2>&1`" if echo ${SPEW} | grep 'Initialize load-path (colon-list of directories)'\ @@ -80,12 +82,13 @@ elif type $command>/dev/null 2>&1; then elif echo ${SPEW} | grep 'MIT' >/dev/null 2>&1; then implementation=mit elif echo ${SPEW} | grep 'UMB Scheme'>/dev/null 2>&1; then implementation=umb elif echo ${SPEW} | grep 'scheme48' >/dev/null 2>&1; then implementation=s48 - elif echo ${SPEW} | grep 'MzScheme' >/dev/null 2>&1; then implementation=plt elif echo ${SPEW} | grep 'larceny' >/dev/null 2>&1; then implementation=lar elif echo ${SPEW} | grep 'Guile' >/dev/null 2>&1; then implementation=gui + elif echo ${SPEW} | grep 'gosh' >/dev/null 2>&1; then implementation=gch elif echo ${SPEW} | grep 'SCM' >/dev/null 2>&1; then implementation=scm elif echo ${SPEW} | grep 'SISC' >/dev/null 2>&1; then implementation=ssc elif echo ${SPEW} | grep 'Kawa' >/dev/null 2>&1; then implementation=kwa + elif echo ${SPEW} | grep 'MzScheme' >/dev/null 2>&1; then implementation=plt else implementation= fi else @@ -124,10 +127,14 @@ case $implementation in scm) exec $command -ip1 -l ${SCHEME_LIBRARY_PATH}scm.init "$@";; elk) exec $command -i -l ${SCHEME_LIBRARY_PATH}elk.init "$@";; gam) exec $command -:s ${SCHEME_LIBRARY_PATH}gambit.init - "$@";; + gch) exec $command -l ${SCHEME_LIBRARY_PATH}gosh.init "$@";; ssc) exec $command -e "(load \"${SCHEME_LIBRARY_PATH}sisc.init\")" -- "$@";; kwa) exec $command -f ${SCHEME_LIBRARY_PATH}kawa.init -- "$@";; - plt) exec $command -f ${SCHEME_LIBRARY_PATH}mzscheme.init "$@";; - gui) exec $command -l ${SCHEME_LIBRARY_PATH}guile.init "$@";; + gui) if [ -f ${SCHEME_LIBRARY_PATH}guile.use ]; then + exec $command -l ${SCHEME_LIBRARY_PATH}guile.init -l ${SCHEME_LIBRARY_PATH}guile.use "$@" + else + exec $command -l ${SCHEME_LIBRARY_PATH}guile.init "$@" + fi;; lar) exec $command -- -e "(require 'srfi-96)" "$@";; mit) exec $command -load ${SCHEME_LIBRARY_PATH}mitscheme.init "$@";; s48) if [ -f "${S48_VICINITY}slib.image" ]; then @@ -136,6 +143,7 @@ case $implementation in echo "scheme48 found; in slib directory do: 'make slib48 && make install48'"; fi exit 1;; + plt) exec $command -f ${SCHEME_LIBRARY_PATH}mzscheme.init "$@";; umb) echo "umb-scheme vicinities are too wedged to run slib"; exit 1;; *) exit 1;; esac @@ -1,6 +1,8 @@ +%define slibdir %{_prefix}/lib/slib + Summary: platform independent library for scheme Name: slib -Version: 3b1 +Version: 3b5 Release: 1 Group: Development/Languages BuildArch: noarch @@ -10,8 +12,8 @@ License: distributable, see individual files for copyright Vendor: Aubrey Jaffer <agj @ alum.mit.edu> Provides: slib -Source: ftp://swiss.csail.mit.edu/pub/scm/slib-%{version}.zip -URL: http://swiss.csail.mit.edu/~jaffer/SLIB.html +Source: http://groups.csail.mit.edu/mac/ftpdir/scm/slib-%{version}.zip +URL: http://people.csail.mit.edu/jaffer/SLIB.html BuildRoot: %{_tmppath}/%{name}-%{version}-root %description @@ -23,78 +25,79 @@ transparently extended to accomodate packages specific to a site, implementation, user, or directory. %prep -%setup -q -n %{name} -for i in *; do - cp -f ${i} ${i}.orig - sed -s "s,/usr/local/lib,%{_datadir},g" < ${i} > ${i}.orig - sed -s "s,/usr/lib,%{_datadir},g" < ${i}.orig > ${i} - sed -s "s,/usr/local,/usr,g" < ${i}.orig > ${i} - rm -f ${i}.orig -done +%setup -n slib -c -T +cd .. +unzip ${RPM_SOURCE_DIR}/slib-%{version}.zip +# cd slib +# ./configure --prefix=${RPM_BUILD_ROOT}%{_prefix}/ \ +# --mandir=${RPM_BUILD_ROOT}%{_mandir}/ \ +# --infodir=${RPM_BUILD_ROOT}%{_infodir}/ %build -gzip -9nf slib.info %install -mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/slib -mkdir -p ${RPM_BUILD_ROOT}%{_bindir} -cp *.scm *.init *.xyz *.txt grapheps.ps Makefile ${RPM_BUILD_ROOT}%{_datadir}/slib -mkdir -p ${RPM_BUILD_ROOT}%{_infodir} -install -m644 slib.info.gz ${RPM_BUILD_ROOT}%{_infodir} -make prefix=${RPM_BUILD_ROOT}%{prefix}/ \ +# mkdir -p ${RPM_BUILD_ROOT}%{_bindir} +# mkdir -p ${RPM_BUILD_ROOT}%{slibdir} +# cp *.scm *.init *.xyz *.txt grapheps.ps Makefile ${RPM_BUILD_ROOT}%{slibdir} +make prefix=${RPM_BUILD_ROOT}%{_prefix}/ \ mandir=${RPM_BUILD_ROOT}%{_mandir}/ \ infodir=${RPM_BUILD_ROOT}%{_infodir}/ \ - pinstall + install echo '#! /bin/sh' > ${RPM_BUILD_ROOT}%{_bindir}/slib -echo SCHEME_LIBRARY_PATH=%{_datadir}/slib/ >> ${RPM_BUILD_ROOT}%{_bindir}/slib +echo SCHEME_LIBRARY_PATH=%{slibdir}/ >> ${RPM_BUILD_ROOT}%{_bindir}/slib echo export SCHEME_LIBRARY_PATH >> ${RPM_BUILD_ROOT}%{_bindir}/slib echo VERSION=%{version} >> ${RPM_BUILD_ROOT}%{_bindir}/slib -echo "S48_VICINITY=\"%{_datadir}/scheme48\";export S48_VICINITY" >> ${RPM_BUILD_ROOT}%{_bindir}/slib +echo "S48_VICINITY=\"%{slibdir}/scheme48\";export S48_VICINITY" >> ${RPM_BUILD_ROOT}%{_bindir}/slib cat slib.sh >> ${RPM_BUILD_ROOT}%{_bindir}/slib chmod +x ${RPM_BUILD_ROOT}%{_bindir}/slib %clean rm -rf ${RPM_BUILD_ROOT} %post -# /sbin/install-info ${RPM_BUILD_ROOT}%{_infodir}/slib.info.gz %{_infodir}/dir +# /sbin/ginstall-info ${RPM_BUILD_ROOT}%{_infodir}/slib.info.gz %{_infodir}/dir # This symlink is made as in the spec file of Robert J. Meier. if [ -L /usr/share/guile/slib ]; then rm /usr/share/guile/slib - ln -s %{_datadir}/slib /usr/share/guile/slib + ln -s %{slibdir} /usr/share/guile/slib fi # Rebuild catalogs for as many implementations as possible. export PATH=$PATH:/usr/local/bin echo PATH=${PATH} -cd %{_datadir}/slib/ +cd %{slibdir}/ make catalogs # %postun # if [ $1 = 0 ]; then -# /sbin/install-info --delete %{_infodir}/slib.info.gz %{_infodir}/dir +# /sbin/ginstall-info --delete %{_infodir}/slib.info.gz %{_infodir}/dir # fi %preun -cd %{_datadir}/slib/ +cd %{slibdir}/ rm -f slib.image %files %defattr(-, root, root) %{_bindir}/slib -%dir %{_datadir}/slib -%{_datadir}/slib/*.scm -%{_datadir}/slib/*.init -%{_datadir}/slib/cie1931.xyz -%{_datadir}/slib/cie1964.xyz -%{_datadir}/slib/nbs-iscc.txt -%{_datadir}/slib/saturate.txt -%{_datadir}/slib/resenecolours.txt -%{_datadir}/slib/grapheps.ps -%{_datadir}/slib/Makefile +%dir %{slibdir} +%{slibdir}/*.scm +%{slibdir}/*.sh +%{slibdir}/*.init +%{slibdir}/cie*.xyz +%{slibdir}/cie*.dat +%{slibdir}/nbs-iscc.txt +%{slibdir}/saturate.txt +%{slibdir}/resenecolours.txt +%{slibdir}/grapheps.ps +%{slibdir}/Makefile +%{slibdir}/configure +%{slibdir}/guile.use +%{slibdir}/slib.* %{_infodir}/slib.info.gz -# %{_mandir}/man1/slib.1.gz +%{_infodir}/dir +%{_mandir}/man1/slib.1.gz %doc ANNOUNCE README COPYING FAQ ChangeLog %changelog diff --git a/slib.texi b/slib.texi index b9d9cd7..d65a541 100644..100755 --- a/slib.texi +++ b/slib.texi @@ -23,7 +23,7 @@ Copyright @copyright{} 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, @quotation Permission is granted to copy, distribute and/or modify this document -under the terms of the GNU Free Documentation License, Version 1.2 or +under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU Free @@ -143,11 +143,11 @@ returns @code{#t} if the symbol @var{feature} is the @code{software-type}, the @code{scheme-implementation-type} @footnote{scheme-implementation-type is the name symbol of the running Scheme implementation (RScheme, |STk|, Bigloo, chez, Elk, gambit, -guile, JScheme, kawa, MacScheme, MITScheme, Pocket-Scheme, Scheme48, -Scheme->C, Scheme48, Scsh, SISC, T, umb-scheme, or Vscm). Dependence on -scheme-implementation-type is almost always the wrong way to do -things.}, or if @var{feature} has been provided by a module already -loaded; and @code{#f} otherwise. +gauche, guile, JScheme, kawa, MacScheme, MITScheme, Pocket-Scheme, S7, +Scheme48, Scheme->C, Scheme48, Scsh, SISC, T, umb-scheme, or Vscm). +Dependence on scheme-implementation-type is almost always the wrong +way to do things.}, or if @var{feature} has been provided by a module +already loaded; and @code{#f} otherwise. In some implementations @code{provided?} tests whether a module has been @code{require}d by any module or in any thread; other @@ -351,8 +351,10 @@ standard SLIB packages. @item additional packages of interest to this site. @item -packages specifically for the variety of Scheme which this -session is running. +packages specifically for the variety of Scheme which this session is +running. This catalog, if it exists, is the file @file{implcat} in +@code{implementation-invicinity}, which is created by loading +@file{mkimpcat.scm} in @code{implementation-invicinity} if it exists. @item packages this user wants to always have available. This catalog is the file @file{homecat} in the user's @dfn{HOME} directory. @@ -810,12 +812,14 @@ and the name of the operating system. An unspecified value is returned. Displays the information of @code{(slib:report-version)} followed by almost all the information neccessary for submitting a problem report. An unspecified value is returned. +@end defun -@defunx slib:report #t +@defun slib:report #t provides a more verbose listing. +@end defun -@defunx slib:report filename -Writes the report to file @file{filename}. +@defun slib:report filename +Writes the verbose report to file @file{filename}. @example (slib:report) @@ -938,11 +942,12 @@ omitted, in which case it defaults to the value returned by current position of the character in @var{port} which will next be read or written. If the implementation does not support file-position, then @code{#f} is returned. +@end defun -@defunx file-position port k +@defun file-position port k @var{port} must be open to a file. @code{file-position} sets the current position in @var{port} which will next be read or written. If -successful, @code{#f} is returned; otherwise @code{file-position} +successful, @code{#t} is returned; otherwise @code{file-position} returns @code{#f}. @end defun @@ -1000,11 +1005,12 @@ facility. @end deffn @deffn {Procedure} slib:eval-load filename eval -@var{filename} should be a string. If filename names an existing file, -the Scheme source code expressions and definitions are read from the -file and @var{eval} called with them sequentially. The +@var{filename} should be a string. If filename names an existing +file, the Scheme source code expressions and definitions are read from +the file and @var{eval} called with them sequentially. The @code{slib:eval-load} procedure does not affect the values returned by -@code{current-input-port} and @code{current-output-port}. +@code{current-input-port}, @code{current-error-port}, and +@code{current-output-port}. @end deffn @deffn {Procedure} slib:warn arg1 arg2 @dots{} @@ -1148,6 +1154,7 @@ Syntax extensions (macros) included with SLIB. * Define-Structure:: 'structure * Define-Record-Type:: 'define-record-type, 'srfi-9 * Fluid-Let:: 'fluid-let +* Parameter Objects:: 'srfi-39 * Binding to multiple values:: 'receive, 'srfi-8 * Guarded LET* special form:: 'and-let*, 'srfi-2 * Guarded COND Clause:: 'guarded-cond-clause, 'srfi-61 @@ -1175,13 +1182,13 @@ expression @var{e}. @end defun @defun defmacro:load filename -@var{filename} should be a string. If filename names an existing file, -the @code{defmacro:load} procedure reads Scheme source code expressions -and definitions from the file and evaluates them sequentially. These -source code expressions and definitions may contain defmacro -definitions. The @code{macro:load} procedure does not affect the values -returned by @code{current-input-port} and -@code{current-output-port}. +@var{filename} should be a string. If filename names an existing +file, the @code{defmacro:load} procedure reads Scheme source code +expressions and definitions from the file and evaluates them +sequentially. These source code expressions and definitions may +contain defmacro definitions. The @code{defmacro:load} procedure does +not affect the values returned by @code{current-input-port}, +@code{current-error-port}, and @code{current-output-port}. @end defun @defun defmacro? sym @@ -1240,12 +1247,13 @@ macro expansion, and returns the result of the evaluation. @end defun @deffn {Procedure} macro:load filename -@var{filename} should be a string. If filename names an existing file, -the @code{macro:load} procedure reads Scheme source code expressions and -definitions from the file and evaluates them sequentially. These source -code expressions and definitions may contain macro definitions. The -@code{macro:load} procedure does not affect the values returned by -@code{current-input-port} and @code{current-output-port}. +@var{filename} should be a string. If filename names an existing +file, the @code{macro:load} procedure reads Scheme source code +expressions and definitions from the file and evaluates them +sequentially. These source code expressions and definitions may +contain macro definitions. The @code{macro:load} procedure does not +affect the values returned by @code{current-input-port}, +@code{current-error-port}, and @code{current-output-port}. @end deffn @@ -1358,12 +1366,13 @@ environment. @deffn {Procedure} macro:load filename @deffnx {Procedure} macwork:load filename -@var{filename} should be a string. If filename names an existing file, -the @code{macro:load} procedure reads Scheme source code expressions and -definitions from the file and evaluates them sequentially. These source -code expressions and definitions may contain macro definitions. The -@code{macro:load} procedure does not affect the values returned by -@code{current-input-port} and @code{current-output-port}. +@var{filename} should be a string. If filename names an existing +file, the @code{macro:load} procedure reads Scheme source code +expressions and definitions from the file and evaluates them +sequentially. These source code expressions and definitions may +contain macro definitions. The @code{macro:load} procedure does not +affect the values returned by @code{current-input-port}, +@code{current-error-port}, and @code{current-output-port}. @end deffn References: @@ -1545,12 +1554,13 @@ environment. @deffn {Procedure} macro:load filename @deffnx {Procedure} synclo:load filename -@var{filename} should be a string. If filename names an existing file, -the @code{macro:load} procedure reads Scheme source code expressions and -definitions from the file and evaluates them sequentially. These -source code expressions and definitions may contain macro definitions. -The @code{macro:load} procedure does not affect the values returned by -@code{current-input-port} and @code{current-output-port}. +@var{filename} should be a string. If filename names an existing +file, the @code{macro:load} procedure reads Scheme source code +expressions and definitions from the file and evaluates them +sequentially. These source code expressions and definitions may +contain macro definitions. The @code{macro:load} procedure does not +affect the values returned by @code{current-input-port}, +@code{current-error-port}, and @code{current-output-port}. @end deffn @subsection Syntactic Closure Macro Facility @@ -1996,12 +2006,13 @@ environment. @deffn {Procedure} macro:load filename @deffnx {Procedure} syncase:load filename -@var{filename} should be a string. If filename names an existing file, -the @code{macro:load} procedure reads Scheme source code expressions and -definitions from the file and evaluates them sequentially. These -source code expressions and definitions may contain macro definitions. -The @code{macro:load} procedure does not affect the values returned by -@code{current-input-port} and @code{current-output-port}. +@var{filename} should be a string. If filename names an existing +file, the @code{macro:load} procedure reads Scheme source code +expressions and definitions from the file and evaluates them +sequentially. These source code expressions and definitions may +contain macro definitions. The @code{macro:load} procedure does not +affect the values returned by @code{current-input-port}, +@code{current-error-port}, and @code{current-output-port}. @end deffn This is version 2.1 of @code{syntax-case}, the low-level macro facility @@ -2103,9 +2114,9 @@ Send bug reports, comments, suggestions, and questions to Kent Dybvig @noindent Included with the @code{syntax-case} files was @file{structure.scm} which defines a macro @code{define-structure}. Here is its -documentation from Gambit 4.0: +documentation from Gambit-4.0: -@deffn {special form} define-structure @var{name} @var{field}@dots{} +@deffn {special form} define-structure (@var{name} @var{field}@dots{}) Record data types similar to Pascal records and C @code{struct} types can be defined using the @code{define-structure} special form. @@ -2143,7 +2154,11 @@ the name of the type and the name and value of each field. For example: @smallexample -> @b{(define-structure point x y color)} +> @b{(require 'syntax-case)} +> @b{(require 'repl)} +> @b{(repl:top-level macro:eval)} +> @b{(require 'structure)} +> @b{(define-structure (point x y color))} > @b{(define p (make-point 3 5 'red))} > @b{p} #<point #3 x: 3 y: 5 color: red> @@ -2182,12 +2197,18 @@ Where @end defspec -@node Fluid-Let, Binding to multiple values, Define-Record-Type, Scheme Syntax Extension Packages +@node Fluid-Let, Parameter Objects, Define-Record-Type, Scheme Syntax Extension Packages @section Fluid-Let @code{(require 'fluid-let)} @ftindex fluid-let +@quotation +@emph{Note:} @code{fluid-let} is not thread-safe. It is better to use +@ref{Parameter Objects} (srfi-39) or @ref{Dynamic Data Type}, both of +which will be made thread-safe in the future. +@end quotation + @deffn Syntax fluid-let @code{(@var{bindings} @dots{})} @var{forms}@dots{} @end deffn @lisp @@ -2210,7 +2231,16 @@ by the rules of lexical scoping) of its corresponding @var{variable}. -@node Binding to multiple values, Guarded LET* special form, Fluid-Let, Scheme Syntax Extension Packages +@node Parameter Objects, Binding to multiple values, Fluid-Let, Scheme Syntax Extension Packages +@section Parameter Objects + +@code{(require 'srfi-39)} +@ftindex srfi-39 + +@url{http://srfi.schemers.org/srfi-39/srfi-39.html} + + +@node Binding to multiple values, Guarded LET* special form, Parameter Objects, Scheme Syntax Extension Packages @section Binding to multiple values @code{(require 'receive)} or @code{(require 'srfi-8)} @@ -2336,15 +2366,10 @@ on LISP and Functional Programming, July 1988 [ACM #552880]. Another reference is: -Ken Dickey. -@ifset html -<A HREF="ftp://ftp.cs.indiana.edu/pub/scheme-repository/doc/pubs/swob.txt"> -@end ifset -Scheming with Objects -@ifset html -</A> -@end ifset -@cite{AI Expert} Volume 7, Number 10 (October 1992), pp. 24-33. +Ken Dickey.@* +Scheming with Objects@* +@cite{AI Expert} Volume 7, Number 10 (October 1992), pp. 24-33.@* +@url{ftp://ftp.cs.indiana.edu/pub/scheme-repository/doc/pubs/swob.txt} @menu * Yasos terms:: Definitions and disclaimer. @@ -2403,7 +2428,7 @@ returns @code{#t} if @var{object} has an operation @var{opname?} and @deffn Syntax object @code{((@var{name} @var{self} @var{arg} @dots{}) @var{body})} @dots{} Returns an object (an instance of the object system) with operations. -Invoking @code{(@var{name} @var{object} @var{arg} @dots{}} executes the +Invoking @code{(@var{name} @var{object} @var{arg} @dots{})} executes the @var{body} of the @var{object} with @var{self} bound to @var{object} and with argument(s) @var{arg}@dots{}. @end deffn @@ -2698,7 +2723,7 @@ call graph of grammar rules effectively instantiate the sytnax tree. @noindent The JACAL symbolic math system -(@url{http://swiss.csail.mit.edu/~jaffer/JACAL}) uses +(@url{http://people.csail.mit.edu/jaffer/JACAL}) uses @t{precedence-parse}. Its grammar definitions in the file @file{jacal/English.scm} can serve as examples of use. @@ -2819,8 +2844,8 @@ variable (for use when calling @code{prec:parse}). (define my-ruleset *syn-defs*) @end example -@defun prec:parse ruleset delim -@defunx prec:parse ruleset delim port +@defun prec:parse ruleset delim column +@defunx prec:parse ruleset delim column port The @var{ruleset} argument must be a list of rules as constructed by @code{prec:define-grammar} and extracted from @var{*syn-defs*}. @@ -2836,6 +2861,10 @@ returns the next object parsable from the given input @var{port}, updating @var{port} to point to the first character past the end of the external representation of the object. +For the purpose of reporting problems in error messages, this package +keeps track of the @dfn{current column}. Its initial value is passed +as the third argument to @code{prec:parse}. + If an end of file is encountered in the input before any characters are found that can begin an object, then an end of file object is returned. If a delimiter (such as @var{delim}) is found before any characters are @@ -2903,16 +2932,6 @@ Is the string consisting of all characters between 0 and 255 for which @code{char-whitespace?} returns true. @end defvr -@noindent -For the purpose of reporting problems in error messages, this package -keeps track of the @dfn{current column}. When the column does not -simply track input characters, @code{tok:bump-column} can be used to -adjust the current-column. - -@defun tok:bump-column pos port -Adds @var{pos} to the current-column for input-port @var{port}. -@end defun - @node Nud and Led Definition, Grammar Rule Definition, Token definition, Precedence Parsing @subsection Nud and Led Definition @@ -3204,7 +3223,7 @@ The ruleset in effect before @var{tk} was parsed is restored; @ftindex format @c The @file{format.scm} package was removed because it was not -@c reentrant. @url{http://swiss.csail.mit.edu/~jaffer/SLIB.FAQ} explains +@c reentrant. @url{http://people.csail.mit.edu/jaffer/SLIB.FAQ} explains @c more about FORMAT's woes. @include format.texi @@ -3384,7 +3403,7 @@ non-numeric conversions. A character that specifies the conversion to be applied. @end itemize -@subsubsection Exact Conversions +Exact Conversions @table @asis @item @samp{b}, @samp{B} @@ -3410,7 +3429,7 @@ using the digits @samp{0123456789abcdef}. @samp{%X} prints using the digits @samp{0123456789ABCDEF}. @end table -@subsubsection Inexact Conversions +Inexact Conversions @table @asis @item @samp{f} @@ -3435,7 +3454,8 @@ dot between number and prefix, @samp{%k} does not. @end table -@subsubsection Other Conversions +Other Conversions + @table @asis @item @samp{c} Print a single character. The @samp{-} flag is the only one which can @@ -4419,8 +4439,8 @@ are then @code{pretty-print}ed to this port. Whitepsace and comments (introduced by @code{;}) which are not part of scheme expressions are reproduced in the output. This procedure does -not affect the values returned by @code{current-input-port} and -@code{current-output-port}. +not affect the values returned by @code{current-input-port}, +@code{current-error-port}, and @code{current-output-port}. @end defun @code{pprint-filter-file} can be used to pre-compile macro-expansion and @@ -4576,11 +4596,13 @@ compatability. Because of shared state they are not thread-safe. @defun tzset Returns the default time-zone. +@end defun -@defunx tzset tz +@defun tzset tz Sets (and returns) the default time-zone to @var{tz}. +@end defun -@defunx tzset TZ-string +@defun tzset TZ-string Sets (and returns) the default time-zone to that specified by @var{TZ-string}. @@ -4654,11 +4676,13 @@ is a datatype encapsulating time. @defun gmtime caltime Converts the calendar time @var{caltime} to UTC and returns it. +@end defun -@defunx localtime caltime tz +@defun localtime caltime tz Returns @var{caltime} converted to UTC relative to timezone @var{tz}. +@end defun -@defunx localtime caltime +@defun localtime caltime converts the calendar time @var{caltime} to a vector of integers expressed relative to the user's time zone. @code{localtime} sets the variable @var{*timezone*} with the difference between Coordinated @@ -4670,12 +4694,14 @@ Universal Time (UTC) and local standard time in seconds @defun gmktime univtime Converts a vector of integers in GMT Coordinated Universal Time (UTC) format to a calendar time. +@end defun -@defunx mktime univtime +@defun mktime univtime Converts a vector of integers in local Coordinated Universal Time (UTC) format to a calendar time. +@end defun -@defunx mktime univtime tz +@defun mktime univtime tz Converts a vector of integers in Coordinated Universal Time (UTC) format (relative to time-zone @var{tz}) to calendar time. @@ -5076,17 +5102,20 @@ reversed. @defun integer->list k len @defunx integer->list k -@code{integer->list} returns a list of @var{len} booleans corresponding -to each bit of the given integer. #t is coded for each 1; #f for 0. -The @var{len} argument defaults to @code{(integer-length @var{k})}. +@code{integer->list} returns a list of @var{len} booleans +corresponding to each bit of the non-negative integer @var{k}. #t is +coded for each 1; #f for 0. The @var{len} argument defaults to +@code{(integer-length @var{k})}. +@end defun -@defunx list->integer list +@defun list->integer list @code{list->integer} returns an integer formed from the booleans in the list @var{list}, which must be a list of booleans. A 1 bit is coded for each #t; a 0 bit for #f. -@code{integer->list} and @code{list->integer} are inverses so far as -@code{equal?} is concerned. +@example +(list->integer (integer->list @var{k})) @result{} @var{k} +@end example @end defun @defun booleans->integer bool1 @dots{} @@ -5116,16 +5145,16 @@ Although this package defines real and complex functions, it is safe to load into an integer-only implementation; those functions will be defined to #f. -@defun real-exp @var{x} -@defunx real-ln @var{x} -@defunx real-log @var{y} @var{x} -@defunx real-sin @var{x} -@defunx real-cos @var{x} -@defunx real-tan @var{x} -@defunx real-asin @var{x} -@defunx real-acos @var{x} -@defunx real-atan @var{x} -@defunx atan @var{y} @var{x} +@defun real-exp x +@defunx real-ln x +@defunx real-log y x +@defunx real-sin x +@defunx real-cos x +@defunx real-tan x +@defunx real-asin x +@defunx real-acos x +@defunx real-atan x +@defunx atan y x These procedures are part of every implementation that supports general real numbers; they compute the usual transcendental functions. @@ -5138,7 +5167,7 @@ then these procedures signal an error. @end defun -@defun real-sqrt @var{x} +@defun real-sqrt x For non-negative real @var{x} the result will be its positive square root; otherwise an error will be signaled. @@ -5273,7 +5302,7 @@ A pseudo-random number generator is only as good as the tests it passes. George Marsaglia of Florida State University developed a battery of tests named @dfn{DIEHARD} (@url{http://stat.fsu.edu/~geo/diehard.html}). @file{diehard.c} has a bug which the patch -@url{http://swiss.csail.mit.edu/ftpdir/users/jaffer/diehard.c.pat} corrects. +@url{http://groups.csail.mit.edu/mac/ftpdir/users/jaffer/diehard.c.pat} corrects. SLIB's PRNG generates 8 bits at a time. With the degenerate seed @samp{0}, the numbers generated pass DIEHARD; but when bits are @@ -5355,8 +5384,7 @@ Philip Koopman and Tridib Chakravarty,@* The International Conference on Dependable Systems and Networks, DSN-2004.@* @end itemize -@exdent -@url{http://www.ece.cmu.edu/~koopman/roses/dsn04/koopman04_crc_poly_embedded.pdf} +@exdent @url{http://www.ece.cmu.edu/~koopman/roses/dsn04/koopman04_crc_poly_embedded.pdf} @noindent There is even some controversy over the polynomials themselves. @@ -5502,8 +5530,9 @@ Computes the P1003.2/D11.2 (POSIX.2) 32-bit checksum of @var{file}. (cksum (in-vicinity (library-vicinity) "ratize.scm")) @result{} 157103930 @end example +@end defun -@defunx cksum port +@defun cksum port Computes the checksum of the bytes read from @var{port} until the end-of-file. @@ -5522,8 +5551,9 @@ checksum of the bytes in @var{str}, can be defined as follows: @defun crc16 file Computes the USB data-packet (16-bit) CRC of @var{file}. +@end defun -@defunx crc16 port +@defun crc16 port Computes the USB data-packet (16-bit) CRC of the bytes read from @var{port} until the end-of-file. @@ -5535,8 +5565,9 @@ in http://www.usb.org/developers/data/crcdes.pdf. @defun crc5 file Computes the USB token (5-bit) CRC of @var{file}. +@end defun -@defunx crc5 port +@defun crc5 port Computes the USB token (5-bit) CRC of the bytes read from @var{port} until the end-of-file. @@ -5702,7 +5733,7 @@ vector or list @var{data} <A NAME="Color"></A> @end ifset -@uref{http://swiss.csail.mit.edu/~jaffer/Color} +@uref{http://people.csail.mit.edu/jaffer/Color} @noindent The goals of this package are to provide methods to specify, compute, @@ -5730,8 +5761,9 @@ encountered in practice and the literature. @defun color? obj Returns #t if @var{obj} is a color. +@end defun -@defunx color? obj typ +@defun color? obj typ Returns #t if @var{obj} is a color of color-space @var{typ}. The symbol @var{typ} must be one of: @@ -5944,14 +5976,16 @@ values. Loads the Spectral Tristimulus Values @cite{CIE 1964 Supplementary Standard Colorimetric Observer}, defining @var{cie:x-bar}, @var{cie:y-bar}, and @var{cie:z-bar}. +@end deftp -@deftpx {Feature} cie1931 +@deftp {Feature} cie1931 @ftindex cie1931 Loads the Spectral Tristimulus Values @cite{CIE 1931 Supplementary Standard Colorimetric Observer}, defining @var{cie:x-bar}, @var{cie:y-bar}, and @var{cie:z-bar}. +@end deftp -@deftpx {Feature} ciexyz +@deftp {Feature} ciexyz @ftindex ciexyz Requires Spectral Tristimulus Values, defaulting to cie1931, defining @var{cie:x-bar}, @var{cie:y-bar}, and @var{cie:z-bar}. @@ -6020,8 +6054,9 @@ result of applying @var{proc} to each element of @var{siv}. computes the CIEXYZ(1931) values for the spectrum returned by @var{proc} when called with arguments from 380e-9 to 780e-9, the wavelength in meters. +@end defun -@defunx spectrum->XYZ spectrum x1 x2 +@defun spectrum->XYZ spectrum x1 x2 @var{x1} and @var{x2} must be positive real numbers specifying the wavelengths (in meters) corresponding to the zeroth and last elements of vector or list @var{spectrum}. @code{spectrum->XYZ} returns the @@ -6143,8 +6178,9 @@ Returns a three element list: the @var{x} and @var{y} components of scales each chromaticity so it sums to 1 or less; and divides the @var{Y} values by the maximum @var{Y} in the dataset, so all lie between 0 and 1. +@end defun -@defunx xyY:normalize-colors colors n +@defun xyY:normalize-colors colors n If @var{n} is positive real, then @code{xyY:normalize-colors} divides the @var{Y} values by @var{n} times the maximum @var{Y} in the dataset. @@ -6189,23 +6225,26 @@ color2 in the function entries. @defun L*a*b*:DE* lab1 lab2 Returns the Euclidean distance between @var{lab1} and @var{lab2}. +@end defun -@defunx CIE:DE* color1 color2 white-point +@defun CIE:DE* color1 color2 white-point @defunx CIE:DE* color1 color2 Returns the Euclidean distance in L*a*b* space between @var{color1} and @var{color2}. @end defun -@defun L*C*h:DE*94 lch1 lch2 parametric-factors -@defunx L*C*h:DE*94 lch1 lch2 +@defun L*a*b*:DE*94 lab1 lab2 parametric-factors +@defunx L*a*b*:DE*94 lab1 lab2 @defunx CIE:DE*94 color1 color2 parametric-factors @defunx CIE:DE*94 color1 color2 -Measures distance in the L*C*h cylindrical color-space. -The three axes are individually scaled (depending on C*) in their -contributions to the total distance. +Measures distance in the L*a*b* color-space. The three axes are +individually scaled in their contributions to the total distance. + +@code{DE*94} is not symmetrical in its arguments. @var{lab1} is the +``reference'' color and @var{lab2} is the ``sample'' color. The CIE has defined reference conditions under which the metric with default parameters can be expected to perform well. These are: @@ -6371,7 +6410,7 @@ Looks for @var{name} among the 19 saturated colors from @item red purple @tab purplish red @tab red @end multitable -(@url{http://swiss.csail.mit.edu/~jaffer/Color/saturate.pdf}). If +(@url{http://people.csail.mit.edu/jaffer/Color/saturate.pdf}). If @var{name} is found, the corresponding color is returned. Otherwise #f is returned. Use saturate only for light source colors. @end defun @@ -6387,7 +6426,7 @@ operated paint manufacturing company, has generously made their @defun resene name Looks for @var{name} among the 1300 entries in the Resene color-name -dictionary (@url{http://swiss.csail.mit.edu/~jaffer/Color/resene.pdf}). +dictionary (@url{http://people.csail.mit.edu/jaffer/Color/resene.pdf}). If @var{name} is found, the corresponding color is returned. Otherwise #f is returned. The @cite{Resene RGB Values List} is an excellent source for surface colors. @@ -6448,6 +6487,10 @@ Resene Paints Ltd. @code{(require 'root)} @ftindex root +In the Newton method, divide the @var{df/dx} argument by the +multiplicity of the desired root in order to preserve quadratic +convergence. + @defun newton:find-integer-root f df/dx x0 Given integer valued procedure @var{f}, its derivative (with respect to its argument) @var{df/dx}, and initial integer value @var{x0} for which @@ -6702,8 +6745,9 @@ Defines a rule for the case when the operation represented by symbol @var{sub-op2}, respectively. The argument @var{reduction} is a procedure accepting 2 arguments which will be lists whose @code{car}s are @var{sub-op1} and @var{sub-op2}. +@end defun -@defunx cring:define-rule op sub-op1 'identity reduction +@defun cring:define-rule op sub-op1 'identity reduction Defines a rule for the case when the operation represented by symbol @var{op} is applied to a list whose @code{car} is @var{sub-op1}, and some other argument. @var{Reduction} will be called with the list whose @@ -6900,7 +6944,7 @@ Data Banks}). An SLIB relational database implementation can be created from any @ref{Base Table} implementation. Why relational database? For motivations and design issues see@* -@uref{http://swiss.csail.mit.edu/~jaffer/DBManifesto.html}. +@uref{http://people.csail.mit.edu/jaffer/DBManifesto.html}. @menu * Using Databases:: 'databases @@ -7148,8 +7192,7 @@ it will be overwritten. The value returned is unspecified. @dfn{Indexed Sequential Access Methods} are a way of arranging database information so that records can be accessed both by key and by key sequence (ordering). @dfn{ISAM} is not part of Codd's -relational model. Hardcore relational programmers might use some -least-upper-bound join for every row to get them into an order. +relational model. @noindent Associative memory in B-Trees is an example of a database @@ -7189,8 +7232,9 @@ Returns a procedure of arguments @var{key1} @var{key2} @dots{} which returns the key-list identifying the lowest record higher than @var{key1} @var{key2} @dots{} which is stored in the relational-table; or false if no higher record is present. +@end defop -@defopx {Operation} {relational-table} isam-next column-name +@defop {Operation} {relational-table} isam-next column-name The symbol @var{column-name} names a key field. In the list returned by @code{isam-next}, that field, or a field to its left, will be changed. This allows one to skip over less significant key fields. @@ -7201,8 +7245,9 @@ Returns a procedure of arguments @var{key1} @var{key2} @dots{} which returns the key-list identifying the highest record less than @var{key1} @var{key2} @dots{} which is stored in the relational-table; or false if no lower record is present. +@end defop -@defopx {Operation} {relational-table} isam-prev column-name +@defop {Operation} {relational-table} isam-prev column-name The symbol @var{column-name} names a key field. In the list returned by @code{isam-next}, that field, or a field to its left, will be changed. This allows one to skip over less significant key fields. @@ -7242,8 +7287,9 @@ Return a list of the column names, foreign-key table names, domain names, or type names respectively for this table. These 4 methods are different from the others in that the list is returned, rather than a procedure to obtain the list. +@end defop -@defopx {Operation} {relational-table} primary-limit +@defop {Operation} {relational-table} primary-limit Returns the number of primary keys fields in the relations in this table. @end defop @@ -7376,16 +7422,19 @@ Returns an open enhanced relational database associated with supplied, @code{open-command-database} will attempt to deduce the correct base-table-type. If the database can not be opened or if it lacks the @code{*commands*} table, @code{#f} is returned. +@end defun -@defunx open-command-database! filename +@defun open-command-database! filename @defunx open-command-database! filename base-table-type Returns @emph{mutable} open enhanced relational database @dots{} +@end defun -@defunx open-command-database database +@defun open-command-database database Returns @var{database} if it is an immutable relational database; #f otherwise. +@end defun -@defunx open-command-database! database +@defun open-command-database! database Returns @var{database} if it is a mutable relational database; #f otherwise. @end defun @@ -7740,7 +7789,7 @@ declarations for emacs: etags -lscheme -r'/ *(define-\(command\|table\) (\([^; \t]+\)/\2/' \ source1.scm ... @end example - +@c )) @menu * Within-database:: * Within-database Example:: @@ -7906,32 +7955,31 @@ without-documentation called Prints the names of all the tables in @var{database} and sets browse's default to @var{database}. - -@deffnx {Procedure} browse +@end deffn +@deffn {Procedure} browse Prints the names of all the tables in the default database. - -@deffnx {Procedure} browse table-name +@end deffn +@deffn {Procedure} browse table-name For each record of the table named by the symbol @var{table-name}, prints a line composed of all the field values. - -@deffnx {Procedure} browse pathname +@end deffn +@deffn {Procedure} browse pathname Opens the database named by the string @var{pathname}, prints the names of all its tables, and sets browse's default to the database. - -@deffnx {Procedure} browse database table-name +@end deffn +@deffn {Procedure} browse database table-name Sets browse's default to @var{database} and prints the records of the table named by the symbol @var{table-name}. - -@deffnx {Procedure} browse pathname table-name +@end deffn +@deffn {Procedure} browse pathname table-name Opens the database named by the string @var{pathname} and sets browse's default to it; @code{browse} prints the records of the table named by the symbol @var{table-name}. - @end deffn @@ -8554,8 +8602,9 @@ Returns a methods procedure for a new (open) relational table for describing the columns of a new base table in this database, otherwise returns @code{#f}. For the fields and layout of descriptor tables, @xref{Catalog Representation}. +@end defop -@defopx {Operation} {relational-database} create-table table-name table-desc-name +@defop {Operation} {relational-database} create-table table-name table-desc-name Returns a methods procedure for a new (open) relational table with columns as described by @var{table-desc-name}, otherwise returns @code{#f}. @@ -8984,6 +9033,61 @@ The example prints the tree: @end example @end deffn +@deffn {procedure+} wt-tree/union-merge wt-tree-1 wt-tree-2 merge +Returns a new tree containing all the associations from both trees. If +both trees have an association for the same key, the datum associated +with that key in the result tree is computed by applying the procedure +@var{merge} to the key, the value from @var{wt-tree-1} and the value +from @var{wt-tree-2}. @var{Merge} is of the form + +@example +(lambda (@var{key} @var{datum-1} @var{datum-2}) ...) +@end example + +If some key occurs only in one tree, that association will appear in the +result tree without being processed by @var{merge}, so for this +operation to make sense, either @var{merge} must have both a right and +left identity that correspond to the association being absent in one of +the trees, or some guarantee must be made, for example, all the keys in +one tree are known to occur in the other. + +These are all reasonable procedures for @var{merge} + +@example +@group +(lambda (key val1 val2) (+ val1 val2)) +(lambda (key val1 val2) (append val1 val2)) +(lambda (key val1 val2) (wt-tree/union val1 val2)) +@end group +@end example + +However, a procedure like + +@example +(lambda (key val1 val2) (- val1 val2)) +@end example + +would result in a subtraction of the data for all associations with keys +occuring in both trees but associations with keys occuring in only the +second tree would be copied, not negated, as is presumably be intent. +The programmer might ensure that this never happens. + +This procedure has the same time behavior as @code{wt-tree/union} but +with a slightly worse constant factor. Indeed, @code{wt-tree/union} +might have been defined like this: + +@example +@group +(define (wt-tree/union tree1 tree2) + (wt-tree/union-merge tree1 tree2 + (lambda (key val1 val2) val2))) +@end group +@end example +@end deffn + +The @var{merge} procedure takes the @var{key} as a parameter in case the +data are not independent of the key. + @node Indexing Operations on Weight-Balanced Trees, , Advanced Operations on Weight-Balanced Trees, Weight-Balanced Trees @subsection Indexing Operations on Weight-Balanced Trees @@ -9273,7 +9377,7 @@ Examples: @end lisp @code{Reduce} called with two arguments will work as does the -procedure of the same name from @xref{Common List Functions}). +procedure of the same name from @xref{Common List Functions}. @ftindex common-list-functions @end defun @@ -9583,7 +9687,7 @@ created the type represented by @var{rtd}. * Sorting:: 'sort * Topological Sort:: Keep your socks on. * Hashing:: 'hash -* Space-Filling Curves:: 'hilbert and 'sierpinski +* Space-Filling Curves:: 'space-filling and 'sierpinski * Soundex:: Dimension Reduction of Last Names * String Search:: Also Search from a Port. * Sequence Comparison:: 'diff and longest-common-subsequence @@ -9823,14 +9927,16 @@ Example: @defun list-of?? predicate Returns a predicate which returns true if its argument is a list every element of which satisfies @var{predicate}. +@end defun -@defunx list-of?? predicate low-bound high-bound +@defun list-of?? predicate low-bound high-bound @var{low-bound} and @var{high-bound} are non-negative integers. @code{list-of??} returns a predicate which returns true if its argument is a list of length between @var{low-bound} and @var{high-bound} (inclusive); every element of which satisfies @var{predicate}. +@end defun -@defunx list-of?? predicate bound +@defun list-of?? predicate bound @var{bound} is an integer. If @var{bound} is negative, @code{list-of??} returns a predicate which returns true if its argument is a list of length greater than @code{(- @var{bound})}; every element of which @@ -10069,7 +10175,7 @@ Example: (last '(foo bar baz bang) 2) @result{} (baz bang) (last '(1 2 3) 0) - @result{} 0 + @result{} () @end lisp @end defun @@ -10443,12 +10549,19 @@ items have the same @code{hashv} implies the items have the same @subsection Space-Filling Curves @menu -* Hilbert Space-Filling Curve:: Non-negative coordinates -* Peano Space-Filling Curve:: Integer coordinates -* Sierpinski Curve:: +* Multidimensional Space-Filling Curves:: Includes Hilbert and Peano curves +* Hilbert Space-Filling Curve:: Legacy +* Peano Space-Filling Curve:: Legacy +* Sierpinski Curve:: Rank-2 to scalar @end menu -@node Hilbert Space-Filling Curve, Peano Space-Filling Curve, Space-Filling Curves, Space-Filling Curves +@node Multidimensional Space-Filling Curves, Hilbert Space-Filling Curve, Space-Filling Curves, Space-Filling Curves +@subsubsection Multidimensional Space-Filling Curves + +@include rmdsff.txi + + +@node Hilbert Space-Filling Curve, Peano Space-Filling Curve, Multidimensional Space-Filling Curves, Space-Filling Curves @subsubsection Hilbert Space-Filling Curve @include phil-spc.txi @@ -10607,16 +10720,19 @@ character of the first substring of @var{string} that is equal to @deffn {Procedure} find-string-from-port? str in-port max-no-chars Looks for a string @var{str} within the first @var{max-no-chars} chars of the input port @var{in-port}. +@end deffn -@deffnx {Procedure} find-string-from-port? str in-port +@deffn {Procedure} find-string-from-port? str in-port When called with two arguments, the search span is limited by the end of the input stream. +@end deffn -@deffnx {Procedure} find-string-from-port? str in-port char +@deffn {Procedure} find-string-from-port? str in-port char Searches up to the first occurrence of character @var{char} in @var{str}. +@end deffn -@deffnx {Procedure} find-string-from-port? str in-port proc +@deffn {Procedure} find-string-from-port? str in-port proc Searches up to the first occurrence of the procedure @var{proc} returning non-false when called with a character (from @var{in-port}) argument. @@ -10802,7 +10918,7 @@ Kills the current process and runs the next process from @code{(require 'metric-units)} @ftindex metric-units -@url{http://swiss.csail.mit.edu/~jaffer/MIXF} +@url{http://people.csail.mit.edu/jaffer/MIXF} @dfn{Metric Interchange Format} is a character string encoding for numerical values and units which: @@ -11408,6 +11524,8 @@ unspecified. @item SRFI-23 @code{(define error slib:error)} @ftindex srfi-28 @item SRFI-28 @ref{Format} +@ftindex srfi-39 +@item SRFI-39 @ref{Parameter Objects} @ftindex srfi-47 @item SRFI-47 @ref{Arrays} @ftindex srfi-59 @@ -11556,12 +11674,14 @@ printer for @code{qp}. This example shows how to do this: @deffn {Procedure} trace-all file @dots{} Traces (@pxref{Trace}) all procedures @code{define}d at top-level in @file{file} @dots{}. +@end deffn -@deffnx {Procedure} track-all file @dots{} +@deffn {Procedure} track-all file @dots{} Tracks (@pxref{Trace}) all procedures @code{define}d at top-level in @file{file} @dots{}. +@end deffn -@deffnx {Procedure} stack-all file @dots{} +@deffn {Procedure} stack-all file @dots{} Stacks (@pxref{Trace}) all procedures @code{define}d at top-level in @file{file} @dots{}. @end deffn @@ -11597,8 +11717,9 @@ which it was called on a continuation stack. @defun continue Pops the topmost continuation off of the continuation stack and returns an unspecified value to it. +@end defun -@defunx continue arg1 @dots{} +@defun continue arg1 @dots{} Pops the topmost continuation off of the continuation stack and returns @var{arg1} @dots{} to it. @end defun @@ -11606,7 +11727,9 @@ Pops the topmost continuation off of the continuation stack and returns @defmac break proc1 @dots{} Redefines the top-level named procedures given as arguments so that @code{breakpoint} is called before calling @var{proc1} @dots{}. -@defmacx break +@end defmac + +@defmac break With no arguments, makes sure that all the currently broken identifiers are broken (even if those identifiers have been redefined) and returns a list of the broken identifiers. @@ -11614,7 +11737,9 @@ list of the broken identifiers. @defmac unbreak proc1 @dots{} Turns breakpoints off for its arguments. -@defmacx unbreak +@end defmac + +@defmac unbreak With no arguments, unbreaks all currently broken identifiers and returns a list of these formerly broken identifiers. @end defmac @@ -11689,7 +11814,9 @@ Prints the call-stack to @var{port} or the current-error-port. @defmac trace proc1 @dots{} Traces the top-level named procedures given as arguments. -@defmacx trace +@end defmac + +@defmac trace With no arguments, makes sure that all the currently traced identifiers are traced (even if those identifiers have been redefined) and returns a list of the traced identifiers. @@ -11697,7 +11824,8 @@ list of the traced identifiers. @defmac track proc1 @dots{} Traces the top-level named procedures given as arguments. -@defmacx track +@end defmac +@defmac track With no arguments, makes sure that all the currently tracked identifiers are tracked (even if those identifiers have been redefined) and returns a list of the tracked identifiers. @@ -11705,7 +11833,8 @@ a list of the tracked identifiers. @defmac stack proc1 @dots{} Traces the top-level named procedures given as arguments. -@defmacx stack +@end defmac +@defmac stack With no arguments, makes sure that all the currently stacked identifiers are stacked (even if those identifiers have been redefined) and returns a list of the stacked identifiers. @@ -11713,21 +11842,24 @@ a list of the stacked identifiers. @defmac untrace proc1 @dots{} Turns tracing, tracking, and off for its arguments. -@defmacx untrace +@end defmac +@defmac untrace With no arguments, untraces all currently traced identifiers and returns a list of these formerly traced identifiers. @end defmac @defmac untrack proc1 @dots{} Turns tracing, tracking, and off for its arguments. -@defmacx untrack +@end defmac +@defmac untrack With no arguments, untracks all currently tracked identifiers and returns a list of these formerly tracked identifiers. @end defmac @defmac unstack proc1 @dots{} Turns tracing, stacking, and off for its arguments. -@defmacx unstack +@end defmac +@defmac unstack With no arguments, unstacks all currently stacked identifiers and returns a list of these formerly stacked identifiers. @end defmac @@ -11789,7 +11921,8 @@ If @code{(provided? 'system)}: @defun system command-string Executes the @var{command-string} on the computer and returns the -integer status code. +integer status code. This behaves the same as the POSIX @code{system} +call. @end defun @noindent @@ -11865,52 +11998,33 @@ from SLIB sites are: @table @asis @item SLIB-PSD @cindex PSD -is a portable debugger for Scheme (requires emacs editor). - -@ifset html -<A HREF="http://swiss.csail.mit.edu/ftpdir/scm/slib-psd1-3.tar.gz"> -@end ifset -http://swiss.csail.mit.edu/ftpdir/scm/slib-psd1-3.tar.gz -@ifset html -</A> -@end ifset - -swiss.csail.mit.edu:/pub/scm/slib-psd1-3.tar.gz - -ftp.maths.tcd.ie:pub/bosullvn/jacal/slib-psd1-3.tar.gz - -ftp.cs.indiana.edu:/pub/scheme-repository/utl/slib-psd1-3.tar.gz -@sp 1 +is a portable debugger for Scheme (requires emacs editor).@* +@url{http://groups.csail.mit.edu/mac/ftpdir/scm/slib-psd1-3.tar.gz}@* +@url{ftp://ftp.cs.indiana.edu/pub/scheme-repository/utl/slib-psd1-3.tar.gz}@* With PSD, you can run a Scheme program in an Emacs buffer, set -breakpoints, single step evaluation and access and modify the program's -variables. It works by instrumenting the original source code, so it -should run with any R4RS compliant Scheme. It has been tested with SCM, -Elk 1.5, and the sci interpreter in the Scheme->C system, but should -work with other Schemes with a minimal amount of porting, if at -all. Includes documentation and user's manual. Written by Pertti -Kellom\"aki, pk @@ cs.tut.fi. The Lisp Pointers article describing PSD -(Lisp Pointers VI(1):15-23, January-March 1993) is available as +breakpoints, single step evaluation and access and modify the +program's variables. It works by instrumenting the original source +code, so it should run with any R4RS compliant Scheme. It has been +tested with SCM, Elk 1.5, and the sci interpreter in the Scheme->C +system, but should work with other Schemes with a minimal amount of +porting, if at all. Includes documentation and user's manual. @ifset html -<A HREF="http://www.cs.tut.fi/staff/pk/scheme/psd/article/article.html"> -@end ifset -http://www.cs.tut.fi/staff/pk/scheme/psd/article/article.html -@ifset html -</A> +Written by Pertti Kellomäki, @end ifset +@ifclear html +Written by Pertti Kellom@"aki, +@end ifclear +the Lisp Pointers article describing +PSD (Lisp Pointers VI(1):15-23, January-March 1993) is available at@* +@url{http://www.cs.tut.fi/staff/pk/scheme/psd/article/article.html} @sp 1 @item SCHELOG @cindex SCHELOG @cindex Prolog is an embedding of Prolog in Scheme.@* -@ifset html -<A HREF="http://www.ccs.neu.edu/~dorai/schelog/schelog.html"> -@end ifset -http://www.ccs.neu.edu/~dorai/schelog/schelog.html -@ifset html -</A> -@end ifset +@url{http://www.ccs.neu.edu/~dorai/schelog/schelog.html} @sp 1 @item JFILTER @@ -11920,13 +12034,7 @@ http://www.ccs.neu.edu/~dorai/schelog/schelog.html @cindex EUC is a Scheme program which converts text among the JIS, EUC, and Shift-JIS Japanese character sets.@* -@ifset html -<A HREF="http://www.sci.toyama-u.ac.jp/~iwao/Scheme/Jfilter/index.html"> -@end ifset -http://www.sci.toyama-u.ac.jp/~iwao/Scheme/Jfilter/index.html -@ifset html -</A> -@end ifset +@url{http://www.math.u-toyama.ac.jp/~iwao/Scheme/Jfilter} @end table @@ -11939,14 +12047,14 @@ you! @quotation SLIB @value{SLIBVERSION}, released @value{SLIBDATE}.@* -Aubrey Jaffer <agj @@ alum.mit.edu>@* +Aubrey Jaffer <agj@@alum.mit.edu>@* @c @i{Hyperactive Software} -- The Maniac Inside!@* @end quotation Current information about SLIB can be found on SLIB's @dfn{WWW} home page: -@center @url{http://swiss.csail.mit.edu/~jaffer/SLIB} +@center @url{http://people.csail.mit.edu/jaffer/SLIB} SLIB is part of the GNU project. @@ -11954,6 +12062,7 @@ SLIB is part of the GNU project. * Installation:: How to install SLIB on your system. * The SLIB script:: Run interactive SLIB sessions. * Porting:: SLIB to new platforms. +* Compiled and Implementation-Specific Features:: * Coding Guidelines:: How to write modules for SLIB. * Copyrights:: Intellectual propery issues. * About this manual:: @@ -11979,9 +12088,10 @@ Install documentation and @code{slib} script. Configure the Scheme implementation(s) to locate the SLIB directory and implementation directories. @item -Arrange for Scheme implementation to load its SLIB initialization file. +Arrange for each Scheme implementation to load its SLIB initialization +file. @item -Build the SLIB catalog for the Scheme implementation. +Build the SLIB catalog for each Scheme implementation. @end itemize @subsection Unpacking the SLIB Distribution @@ -11995,7 +12105,7 @@ home directory (if only you will use this SLIB installation); or put it in a location where libraries reside on your system. On unix systems this might be @file{/usr/share/slib}, @file{/usr/local/lib/slib}, or @file{/usr/lib/slib}. If you know where SLIB should go on other -platforms, please inform agj @@ alum.mit.edu. +platforms, please inform agj@@alum.mit.edu. @subsection Install documentation and slib script @@ -12011,14 +12121,16 @@ make install If the Scheme implementation supports @code{getenv}, then the value of the shell environment variable @var{SCHEME_LIBRARY_PATH} will be used for @code{(library-vicinity)} if it is defined. Currently, Bigloo, -Chez, Elk, Gambit, Guile, Jscheme, Larceny, MITScheme, MzScheme, -RScheme, STk, VSCM, and SCM support @code{getenv}. Scheme48 supports -@code{getenv} but does not use it for determining +Chez, Elk, Gambit, Gauche, Guile, Jscheme, Larceny, MITScheme, +MzScheme, RScheme, S7, STk, VSCM, and SCM support @code{getenv}. +Scheme48 supports @code{getenv} but does not use it for determining @code{library-vicinity}. (That is done from the Makefile.) The @code{(library-vicinity)} can also be set from the SLIB initialization file or by implementation-specific means. +@subsection Configure Scheme Implementation to Locate and Implementation Directory + Support for locating an implementation's auxiliary directory is uneven among implementations. Also, the person installing SLIB may not have write permission to some of these directories (necessary for writing @@ -12039,12 +12151,16 @@ as an implementation-vicinity! @item MIT-Scheme @tab MITSCHEME_IMPLEMENTATION_PATH @item MzScheme @tab MZSCHEME_IMPLEMENTATION_PATH @item RScheme @tab RSCHEME_IMPLEMENTATION_PATH +@item S7 @tab S7_IMPLEMENTATION_PATH @item STk @tab STK_IMPLEMENTATION_PATH @item Vscm @tab VSCM_IMPLEMENTATION_PATH @end multitable @subsection Loading SLIB Initialization File +If you use the @code{slib} script to start your SLIB session, then +this step is unnecessary. + Check the manifest in @file{README} to find a configuration file for your Scheme implementation. Initialization files for most IEEE P1178 compliant Scheme Implementations are included with this distribution. @@ -12061,7 +12177,7 @@ comments in the file for how to configure it. Once this is done, modify the startup file for your Scheme implementation to @code{load} this initialization file. -@subsection Build New SLIB Catalog for Implementation +@subsection Build New SLIB Catalog for the Implementation When SLIB is first used from an implementation, a file named @file{slibcat} is written to the @code{implementation-vicinity} for that @@ -12110,6 +12226,17 @@ larceny -- -e "(require 'srfi-96)" @end example @end deftp + +@deftp Implementation {Gauche-0.9} +Gauche also supports SLIB. It finds SLIB at installation time; +@code{(use slib)} to enable. + +@example +gosh -u slib +@end example +@end deftp + + @deftp Implementation {ELK} @example elk -i -l $@{SCHEME_LIBRARY_PATH@}elk.init @@ -12176,11 +12303,23 @@ ln -s $@{SCHEME_LIBRARY_PATH@} /usr/share/guile/1.6/slib @code{$@{SCHEME_LIBRARY_PATH@}} is where SLIB gets installed. -Guile with SLIB can then be started thus: +Guile before version 1.8 with SLIB can then be started thus: @example guile -l $@{SCHEME_LIBRARY_PATH@}guile.init @end example + +Guile version 1.8 and after with SLIB can then be started thus: + +@example +guile -l $@{SCHEME_LIBRARY_PATH@}guile.init \ + -l $@{SCHEME_LIBRARY_PATH@}guile.use +@end example + +The Guile manual has a different way of installing SLIB: + +@exdent @url{http://www.gnu.org/software/guile/manual/html_node/SLIB-installation.html} + @end deftp @@ -12232,6 +12371,18 @@ See Makefile (definition of DDP) for details. @end enumerate @end deftp +@deftp Implementation S7 + +S7 is not a standalone implementation, but runs as the extension +language for the Snd sound editor. +@file{$@{@var{SCHEME_LIBRARY_PATH}@}s7.init} can be loaded from the +Snd init file or on the Snd command line thus: + +@example +snd -l $@{@var{SCHEME_LIBRARY_PATH}@}s7.init +@end example +@end deftp + @node The SLIB script, Porting, Installation, About SLIB @section The SLIB script @@ -12251,7 +12402,7 @@ implementation to run. Absent the argument, it searches for implementations in the above order. -@node Porting, Coding Guidelines, The SLIB script, About SLIB +@node Porting, Compiled and Implementation-Specific Features, The SLIB script, About SLIB @section Porting If there is no initialization file for your Scheme implementation, you @@ -12268,6 +12419,10 @@ in order to support SLIB. @footnote{If you are porting a implementation, then you will need to finish writing @file{sc4sc3.scm} and @code{load} it from your initialization file.} +@noindent +@url{http://cvs.savannah.gnu.org/viewcvs/*checkout*/scm/scm/r4rstest.scm} +is a file which checks compliance with much of R4RS. + @file{Template.scm} is an example configuration file. The comments inside will direct you on how to customize it to reflect your system. Give your new initialization file the implementation's name with @@ -12283,11 +12438,33 @@ functions (these functions are documented in the sections @ref{Feature} and @ref{Require}). The rest of the library will then be accessible in a system independent fashion. -Please mail new working configuration files to @code{agj @@ alum.mit.edu} +Please mail new working configuration files to @code{agj@@alum.mit.edu} so that they can be included in the SLIB distribution. -@node Coding Guidelines, Copyrights, Porting, About SLIB +@node Compiled and Implementation-Specific Features, Coding Guidelines, Porting, About SLIB +@section Compiled and Implementation-Specific Features + +Often an implementation can implement an SLIB feature more efficiently +than the R4RS-compliant source code in SLIB. Alternatively, +implementations with compilers can compile SLIB source code into +binary files which run faster than loading source code. + +Additionally, the SLIB catalog can be augmented with extra-SLIB +features which can be loaded by the implementation. +The catalog format is described in @xref{Library Catalogs}. + +These implementation-specific modifications are made when a new +catalog is created (@pxref{Catalog Creation}). If @file{mkimpcat.scm} +in @code{implementation-invicinity} exists, it is loaded. That should +produce the file @file{implcat} in @code{implementation-invicinity}, +whose associations will override those of SLIB. @file{implcat} is +copied into @file{slibcat} in @code{implementation-vicinity} as part +of the catalog creation process; modifications to @file{implcat} after +that will have no effect. + + +@node Coding Guidelines, Copyrights, Compiled and Implementation-Specific Features, About SLIB @section Coding Guidelines All library packages are written in IEEE P1178 Scheme and assume that a @@ -12367,7 +12544,7 @@ need to add your copyright or send a disclaimer. In order to put code in the public domain you should sign a copyright disclaimer and send it to the SLIB maintainer. Contact -agj @@ alum.mit.edu for the address to mail the disclaimer to. +agj@@alum.mit.edu for the address to mail the disclaimer to. @need 1000 @quotation @@ -12392,7 +12569,7 @@ revisions of that module. Make sure no employer has any claim to the copyright on the work you are submitting. If there is any doubt, create a copyright disclaimer and have your employer sign it. Mail the signed disclaimer to the -SLIB maintainer. Contact agj @@ alum.mit.edu for the address to mail +SLIB maintainer. Contact agj@@alum.mit.edu for the address to mail the disclaimer to. An example disclaimer follows. @subsection Explicit copying terms @@ -12413,7 +12590,7 @@ different from those already in the file. Make sure no employer has any claim to the copyright on the work you are submitting. If there is any doubt, create a copyright disclaimer and have your employer sign it. Mail the signed disclaim to the SLIB -maintainer. Contact agj @@ alum.mit.edu for the address to mail the +maintainer. Contact agj@@alum.mit.edu for the address to mail the disclaimer to. @end itemize diff --git a/solid.scm b/solid.scm index 990fa3d..d794332 100644..100755 --- a/solid.scm +++ b/solid.scm @@ -20,6 +20,7 @@ (require 'printf) (require 'array) (require 'array-for-each) +(require 'multiarg-apply) (require 'color) (require 'color-space) ;for xyY:normalize-colors (require-if 'compiling 'daylight) @@ -36,7 +37,7 @@ ;;@ftindex solid-modeling ;; ;;@noindent -;;@uref{http://swiss.csail.mit.edu/~jaffer/Solid/#Example} gives an +;;@uref{http://people.csail.mit.edu/jaffer/Solid/#Example} gives an ;;example use of this package. (define pi/180 (/ (* 4 (atan 1)) 180)) @@ -317,7 +318,6 @@ (let* ((theta_s (solar-polar (solar-declination julian-day) latitude (solar-hour julian-day hour))) - (phi_s (cadr theta_s)) (sun-chroma (sunlight-chromaticity turbidity (car theta_s))) (sun-color (and sun-chroma (CIEXYZ->color (apply chromaticity->CIEXYZ sun-chroma)))) @@ -487,8 +487,8 @@ (define nargs (length args)) (let ((color (and (>= nargs 1) (color->vrml-field (car args)))) (intensity (and (>= nargs 2) (cadr args))) - (beamwidth (and (>= nargs 3) (car (caddr args)))) - (cutoffangle (and (>= nargs 3) (cadr (caddr args)))) + ;;(beamwidth (and (>= nargs 3) (car (caddr args)))) + ;;(cutoffangle (and (>= nargs 3) (cadr (caddr args)))) (attenuation (and (>= nargs 3) (caddr (caddr args)))) (radius (and (>= nargs 3) (cadddr (caddr args))))) (replicate-for-strength diff --git a/solid.txi b/solid.txi index 3251b13..35fb04d 100644..100755 --- a/solid.txi +++ b/solid.txi @@ -10,7 +10,7 @@ @ftindex solid-modeling @noindent -@uref{http://swiss.csail.mit.edu/~jaffer/Solid/#Example} gives an +@uref{http://people.csail.mit.edu/jaffer/Solid/#Example} gives an example use of this package. @@ -546,7 +546,8 @@ Returns @var{number-c} planes, @var{spacing-c} apart, of @var{number-b} rows, @v pointing metallic arrow centered at @var{center}. -@defunx solid:arrow +@end defun +@defun solid:arrow Returns an upward pointing metallic arrow centered at the origin. @end defun @@ -16,6 +16,7 @@ ;;; jaffer: 2007-01-29: Final SRFI-95. (require 'array) +(require 'multiarg-apply) ; used in SORT ;;; (sorted? sequence less?) ;;; is true when sequence is a list (x0 x1 ... xm) or a vector #(x0 ... xm) @@ -157,12 +158,11 @@ (define (sort! seq less? . opt-key) (define key (if (null? opt-key) #f (car opt-key))) (cond ((array? seq) - (let ((dims (array-dimensions seq))) - (do ((sorted (sort:sort-list! (rank-1-array->list seq) less? key) - (cdr sorted)) - (i 0 (+ i 1))) - ((null? sorted) seq) - (array-set! seq (car sorted) i)))) + (do ((sorted (sort:sort-list! (rank-1-array->list seq) less? key) + (cdr sorted)) + (i 0 (+ i 1))) + ((null? sorted) seq) + (array-set! seq (car sorted) i))) (else ; otherwise, assume it is a list (let ((ret (sort:sort-list! seq less? key))) (if (not (eq? ret seq)) @@ -184,8 +184,7 @@ (define (sort seq less? . opt-key) (define key (if (null? opt-key) #f (car opt-key))) (cond ((array? seq) - (let ((dims (array-dimensions seq))) - (define newra (apply make-array seq dims)) + (let ((newra (apply make-array seq (array-dimensions seq)))) (do ((sorted (sort:sort-list! (rank-1-array->list seq) less? key) (cdr sorted)) (i 0 (+ i 1))) diff --git a/soundex.scm b/soundex.scm index 9853401..9853401 100644..100755 --- a/soundex.scm +++ b/soundex.scm diff --git a/srfi-1.scm b/srfi-1.scm index 405f5a4..485b0c7 100644..100755 --- a/srfi-1.scm +++ b/srfi-1.scm @@ -35,6 +35,7 @@ (require 'common-list-functions) (require 'rev2-procedures) ;for append! +(require 'multiarg-apply) (require 'values) ;;@subheading Constructors diff --git a/srfi-1.txi b/srfi-1.txi index 3c589ce..3c589ce 100644..100755 --- a/srfi-1.txi +++ b/srfi-1.txi diff --git a/srfi-11.scm b/srfi-11.scm index 366e12e..366e12e 100644..100755 --- a/srfi-11.scm +++ b/srfi-11.scm diff --git a/srfi-2.scm b/srfi-2.scm index adb2530..adb2530 100644..100755 --- a/srfi-2.scm +++ b/srfi-2.scm diff --git a/srfi-23.scm b/srfi-23.scm index 33d4da0..33d4da0 100644..100755 --- a/srfi-23.scm +++ b/srfi-23.scm diff --git a/srfi-39.scm b/srfi-39.scm new file mode 100755 index 0000000..f5af915 --- /dev/null +++ b/srfi-39.scm @@ -0,0 +1,81 @@ +;; Copyright (C) Marc Feeley 2002. All Rights Reserved. + +;; Permission is hereby granted, free of charge, to any person +;; obtaining a copy of this software and associated documentation +;; files (the "Software"), to deal in the Software without +;; restriction, including without limitation the rights to use, copy, +;; modify, merge, publish, distribute, sublicense, and/or sell copies +;; of the Software, and to permit persons to whom the Software is +;; furnished to do so, subject to the following conditions: + +;; The above copyright notice and this permission notice shall be +;; included in all copies or substantial portions of the Software. + +;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +;; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +;; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +;; DEALINGS IN THE SOFTWARE. + +;; The following implementation uses association lists to represent +;; local dynamic environments. The global dynamic environment binding +;; is stored in the parameter object itself. Since we are assuming +;; that there is a single thread, the current local dynamic +;; environment can be bound to a global variable, dynamic-env-local. +;; Mutations of this variable are wrapped in a dynamic-wind so that +;; the local dynamic environment returns to its previous value when +;; control exits the body of the parameterize. + +(define (make-parameter init . conv) + (let ((converter + (if (null? conv) identity (car conv)))) + (let ((global-cell + (cons #f (converter init)))) + (letrec ((parameter + (lambda new-val + (let ((cell (dynamic-lookup parameter global-cell))) + (cond ((null? new-val) + (cdr cell)) + ((null? (cdr new-val)) + (set-cdr! cell (converter (car new-val)))) + (else ; this case is needed for parameterize + (converter (car new-val)))))))) + (set-car! global-cell parameter) + parameter)))) + +(define (dynamic-bind parameters values body) + (let* ((old-local + (dynamic-env-local-get)) + (new-cells + (map (lambda (parameter value) + (cons parameter (parameter value #f))) + parameters + values)) + (new-local + (append new-cells old-local))) + (dynamic-wind + (lambda () (dynamic-env-local-set! new-local)) + body + (lambda () (dynamic-env-local-set! old-local))))) + +(define (dynamic-lookup parameter global-cell) + (or (assq parameter (dynamic-env-local-get)) + global-cell)) + +(define dynamic-env-local '()) + +(define (dynamic-env-local-get) + dynamic-env-local) + +(define (dynamic-env-local-set! new-env) + (set! dynamic-env-local new-env)) + +(define-syntax parameterize + (syntax-rules () + ((parameterize ((expr1 expr2) ...) body ...) + (dynamic-bind (list expr1 ...) + (list expr2 ...) + (lambda () body ...))))) diff --git a/srfi-61.scm b/srfi-61.scm index 015320b..015320b 100644..100755 --- a/srfi-61.scm +++ b/srfi-61.scm diff --git a/srfi-8.scm b/srfi-8.scm index 049451f..049451f 100644..100755 --- a/srfi-8.scm +++ b/srfi-8.scm diff --git a/srfi-9.scm b/srfi-9.scm index e55b193..e55b193 100644..100755 --- a/srfi-9.scm +++ b/srfi-9.scm diff --git a/stdio.scm b/stdio.scm index 7fdb46e..7fdb46e 100644..100755 --- a/stdio.scm +++ b/stdio.scm diff --git a/strcase.scm b/strcase.scm index 5925354..5925354 100644..100755 --- a/strcase.scm +++ b/strcase.scm diff --git a/strport.scm b/strport.scm index 9d33363..9d33363 100644..100755 --- a/strport.scm +++ b/strport.scm diff --git a/strsrch.scm b/strsrch.scm index a730234..53c6e4b 100644..100755 --- a/strsrch.scm +++ b/strsrch.scm @@ -2,9 +2,13 @@ ; Written 1995, 1996 by Oleg Kiselyov (oleg@acm.org) ; Modified 1996, 1997, 1998, 2001 by A. Jaffer (agj@alum.mit.edu) ; Modified 2003 by Steve VanDevender (stevev@hexadecimal.uoregon.edu) -; +; 2013-01 A. Jaffer replaced the skip-vector with an alist + ; This code is in the public domain. +(require 'multiarg-apply) ; used in string-subst +(require 'alist) + ;;;@ Return the index of the first occurence of chr in str, or #f (define (string-index str chr) (define len (string-length str)) @@ -35,19 +39,19 @@ ((>= patlen strlen) (and (= patlen strlen) (string=? pat str) 0)) ;; use faster string-index to match a single-character pattern ((= 1 patlen) (string-index str (string-ref pat 0))) - ((or (<= strlen (+ patlen patlen (quotient char-code-limit 2))) - (<= patlen 4)) + ((or (<= strlen (* 2 patlen)) + (<= patlen 2)) (subloop pat patlen str strlen char=?)) (else ;; compute skip values for search pattern characters ;; for all c not in pat, skip[c] = patlen + 1 ;; for c in pat, skip[c] is distance of rightmost occurrence ;; of c from end of str - (let ((skip (make-vector char-code-limit (+ patlen 1)))) + (let ((skip '())) + (define setprop (alist-associator char=?)) (do ((i 0 (+ i 1))) ((= i patlen)) - (vector-set! skip (char->integer (string-ref pat i)) - (- patlen i))) + (set! skip (setprop skip (string-ref pat i) (- patlen i)))) (subskip skip pat patlen str strlen char=?))))) ;@ (define (substring-ci? pat str) @@ -56,23 +60,21 @@ (cond ((zero? patlen) 0) ; trivial match ((>= patlen strlen) (and (= patlen strlen) (string-ci=? pat str) 0)) ((= 1 patlen) (string-index-ci str (string-ref pat 0))) - ((or (<= strlen (+ patlen patlen (quotient char-code-limit 2))) - (<= patlen 4)) + ((or (<= strlen (* 2 patlen)) + (<= patlen 2)) (subloop pat patlen str strlen char-ci=?)) (else - (let ((skip (make-vector char-code-limit (+ patlen 1)))) + (let ((skip '())) + (define setprop (alist-associator char-ci=?)) (do ((i 0 (+ i 1))) ((= i patlen)) - (let ((c (string-ref pat i)) - (d (- patlen i))) - ;; use same skip value for both upper- and lowercase characters - (vector-set! skip (char->integer (char-upcase c)) d) - (vector-set! skip (char->integer (char-downcase c)) d))) + (set! skip (setprop skip (string-ref pat i) (- patlen i)))) (subskip skip pat patlen str strlen char-ci=?))))) (define (subskip skip pat patlen str strlen char=) + (define getprop (alist-inquirer char=?)) (do ((k patlen (if (< k strlen) - (+ k (vector-ref skip (char->integer (string-ref str k)))) + (+ k (or (getprop skip (string-ref str k)) (+ patlen 1))) (+ strlen 1)))) ((or (> k strlen) (do ((i 0 (+ i 1)) diff --git a/structure.scm b/structure.scm index 5cb6f40..bdc5873 100644..100755 --- a/structure.scm +++ b/structure.scm @@ -45,7 +45,7 @@ (syntax (id1 ... id2 ...)))) ((assign ...) (map (lambda (x) - (construct-name x "set-" (syntax name) "-" x "!")) + (construct-name x (syntax name) "-" x "-set!")) (syntax (id1 ... id2 ...)))) (structure-length (+ (length (syntax (id1 ... id2 ...))) 1)) diff --git a/subarray.scm b/subarray.scm index 9f84583..949a7a4 100644..100755 --- a/subarray.scm +++ b/subarray.scm @@ -18,14 +18,15 @@ ;each case. (require 'array) +(require 'multiarg-apply) ;;@code{(require 'subarray)} ;;@ftindex subarray -;;@body -;;selects a subset of an array. For @1 of rank n, there must be at least -;;n @2 arguments. For 0 <= @i{j} < n, @2@i{j} is either an integer, a -;;list of two integers within the range for the @i{j}th index, or #f. +;;@args array select @dots{} +;;selects a subset of an array. For 0 <= @i{j} < n, @2@i{j} is either +;;an integer, a list of two integers within the range for the @i{j}th +;;index, or #f. ;; ;;When @2@i{j} is a list of two integers, then the @i{j}th index is ;;restricted to that subrange in the returned array. @@ -63,7 +64,8 @@ ;;#1A(e d c b a) ;;@end example (define (subarray array . selects) - (apply make-shared-array array + (apply make-shared-array + array (lambda args (let loop ((sels selects) (args args) diff --git a/subarray.txi b/subarray.txi index 17e5a48..d3d8470 100644..100755 --- a/subarray.txi +++ b/subarray.txi @@ -4,18 +4,18 @@ @defun subarray array select @dots{} -selects a subset of an array. For @var{array} of rank n, there must be at least -n @var{selects} arguments. For 0 <= @i{j} < n, @var{selects}@i{j} is either an integer, a -list of two integers within the range for the @i{j}th index, or #f. +selects a subset of an array. For 0 <= @i{j} < n, @var{select}@i{j} is either +an integer, a list of two integers within the range for the @i{j}th +index, or #f. -When @var{selects}@i{j} is a list of two integers, then the @i{j}th index is +When @var{select}@i{j} is a list of two integers, then the @i{j}th index is restricted to that subrange in the returned array. -When @var{selects}@i{j} is #f, then the full range of the @i{j}th index is +When @var{select}@i{j} is #f, then the full range of the @i{j}th index is accessible in the returned array. An elided argument is equivalent to #f. -When @var{selects}@i{j} is an integer, then the rank of the returned array is -less than @var{array}, and only elements whose @i{j}th index equals @var{selects}@i{j} are +When @var{select}@i{j} is an integer, then the rank of the returned array is +less than @var{array}, and only elements whose @i{j}th index equals @var{select}@i{j} are shared. @example diff --git a/synchk.scm b/synchk.scm index 91583c9..91583c9 100644..100755 --- a/synchk.scm +++ b/synchk.scm diff --git a/synclo.scm b/synclo.scm index 5c7bb9f..d435d3a 100644..100755 --- a/synclo.scm +++ b/synclo.scm @@ -442,7 +442,7 @@ (make-record-type "reserved-name-item" '())) (define make-reserved-name-item - (record-constructor reserved-name-item-type)) ; '() + (record-constructor reserved-name-item-type '())) (define reserved-name-item? (record-predicate reserved-name-item-type)) diff --git a/synrul.scm b/synrul.scm index aaad470..aaad470 100644..100755 --- a/synrul.scm +++ b/synrul.scm diff --git a/timecore.scm b/timecore.scm index 4393cdd..057e2fc 100644..100755 --- a/timecore.scm +++ b/timecore.scm @@ -19,6 +19,8 @@ ;;; No, it doesn't do leap seconds. +(require 'multiarg-apply) + (define time:days/month '#(#(31 28 31 30 31 30 31 31 30 31 30 31) ; Normal years. #(31 29 31 30 31 30 31 31 30 31 30 31))) diff --git a/timezone.scm b/timezone.scm index 2d35dd7..2d35dd7 100644..100755 --- a/timezone.scm +++ b/timezone.scm diff --git a/top-refs.scm b/top-refs.scm index 1d7438a..1d7438a 100644..100755 --- a/top-refs.scm +++ b/top-refs.scm diff --git a/top-refs.txi b/top-refs.txi index dd231c8..dd231c8 100644..100755 --- a/top-refs.txi +++ b/top-refs.txi diff --git a/trace.scm b/trace.scm index 690836c..9ac13fe 100644..100755 --- a/trace.scm +++ b/trace.scm @@ -18,6 +18,7 @@ ;each case. (require 'qp) ;for the qp printer. +(require 'multiarg-apply) (require 'alist) (define trace:indent 0) @@ -73,9 +74,9 @@ (cons (list 1 name) debug:call-stack))) (do ((i trace:indent (+ -1 i))) ((zero? i)) (display #\space)) (apply qpn CALL name args) - (set! trace:indent (modulo (+ 1 trace:indent) 16)) + (set! trace:indent (modulo (+ 2 trace:indent) 31)) (let ((ans (apply function args))) - (set! trace:indent (modulo (+ -1 trace:indent) 16)) + (set! trace:indent (modulo (+ -2 trace:indent) 31)) (do ((i trace:indent (+ -1 i))) ((zero? i)) (display #\space)) (qpn RETN name ans) (set! debug:call-stack cs) diff --git a/transact.scm b/transact.scm index 5dfbeb6..2928e17 100644..100755 --- a/transact.scm +++ b/transact.scm @@ -164,8 +164,11 @@ (define (word:lock! path email) (define lockpath (word-lock:path path)) (define at (substring? "@" email)) - (let ((user (substring email 0 at)) - (hostname (substring email (+ 1 at) (string-length email))) + (define (trim str len) (substring str 0 (min len (string-length str)))) + (let ((user + (trim (substring email 0 at) 15)) + (hostname + (trim (substring email (+ 1 at) (string-length email)) 14)) (oport (open-file lockpath 'wb))) (define userlen (string-length user)) (and oport @@ -199,7 +202,8 @@ (slib:error lockpath 'length pos '(not = 162))) #t)) (let ((certificate (word-lock:certificate lockpath))) - (and (equal? email certificate) email))))) + (and (equal? certificate (string-append user "@" hostname)) + certificate))))) (define (emacs:lock! path email) (define lockpath (emacs-lock:path path)) diff --git a/transact.txi b/transact.txi index 10de2ca..10de2ca 100644..100755 --- a/transact.txi +++ b/transact.txi diff --git a/trnscrpt.scm b/trnscrpt.scm index d801621..844e115 100644..100755 --- a/trnscrpt.scm +++ b/trnscrpt.scm @@ -50,21 +50,21 @@ (define write-char (let ((wrt-chr write-char)) (lambda (obj . opt) - (apply wrt-chr obj opt) + (apply wrt-chr (cons obj opt)) (if (output-port? transcript:port) (wrt-chr obj transcript:port))))) ;@ (define write (let ((wrt write)) (lambda (obj . opt) - (apply wrt obj opt) + (apply wrt (cons obj opt)) (if (output-port? transcript:port) (wrt obj transcript:port))))) ;@ (define display (let ((dspl display)) (lambda (obj . opt) - (apply dspl obj opt) + (apply dspl (cons obj opt)) (if (output-port? transcript:port) (dspl obj transcript:port))))) ;@ diff --git a/tsort.scm b/tsort.scm index 9db98f2..9db98f2 100644..100755 --- a/tsort.scm +++ b/tsort.scm diff --git a/tsort.txi b/tsort.txi index 090e6b4..090e6b4 100644..100755 --- a/tsort.txi +++ b/tsort.txi diff --git a/tzfile.scm b/tzfile.scm index 7495dce..ed8f2c5 100644..100755 --- a/tzfile.scm +++ b/tzfile.scm @@ -33,7 +33,7 @@ (define (tzfile:read-bool port) (let ((c (read-char port))) - (if (eof-object? c) c (if (zero? (char->integer c)) #f #t)))) + (if (eof-object? c) c (not (zero? (char->integer c)))))) ;@ (define (tzfile:read path) (call-with-open-ports @@ -82,8 +82,7 @@ (do ((idx 0 (+ 1 idx))) ((>= idx ttisgmtcnt)) (vector-set! (vector-ref mode-table idx) 4 (tzfile:read-bool port))) - (cond ((not (eof-object? (peek-char port))) - (slib:warn 'tzfile:read "bytes left at end"))) + ;;(cond ((not (eof-object? (peek-char port))) (slib:warn 'tzfile:read "bytes left at end of" path (peek-char port)))) (do ((idx 0 (+ 1 idx))) ((>= idx ttisstdcnt)) (let ((rec (vector-ref mode-table idx))) diff --git a/umbscheme.init b/umbscheme.init index b2f6891..b2f6891 100644..100755 --- a/umbscheme.init +++ b/umbscheme.init @@ -77,9 +77,10 @@ ;;Returns a URI string combining the components of list @1. (define (uri:make-path path) (apply string-append - (uric:encode (car path) "$,;:@&=+") - (map (lambda (pth) (string-append "/" (uric:encode pth "$,;:@&=+"))) - (cdr path)))) + (cons + (uric:encode (car path) "$,;:@&=+") + (map (lambda (pth) (string-append "/" (uric:encode pth "$,;:@&=+"))) + (cdr path))))) ;;@body Returns a string which defines this location in the (HTML) file ;;as @1. The hypertext @samp{<A HREF="#@1">} will link to this point. @@ -244,10 +245,11 @@ (substring rxt 0 (or adx (string-length rxt))))) (name (string-ci->symbol (uric:decode (substring query-string 0 edx))))) - (set! lst (append lst (if (equal? "" urid) - '() - (map (lambda (value) (list name value)) - (uri:split-fields urid #\newline))))) + (if (not (equal? "" urid)) + (set! lst (cons (list name urid) lst)) + ;; (set! lst (append lst (map (lambda (value) (list name value)) + ;; (uri:split-fields urid #\newline)))) + ) (set! query-string (if adx (substring rxt (+ 1 adx) (string-length rxt)) ""))))) diff --git a/values.scm b/values.scm index 23d3a1b..ff56c49 100644..100755 --- a/values.scm +++ b/values.scm @@ -10,7 +10,7 @@ '(values))) ;@ (define values - (let ((make-values (record-constructor values:*values-rtd*))) + (let ((make-values (record-constructor values:*values-rtd* '(values)))) (lambda x (if (and (not (null? x)) (null? (cdr x))) diff --git a/version.txi b/version.txi index 29ac912..22a8994 100644..100755 --- a/version.txi +++ b/version.txi @@ -1,2 +1,2 @@ -@set SLIBVERSION 3b1 -@set SLIBDATE February 2008 +@set SLIBVERSION 3b5 +@set SLIBDATE January 2015 diff --git a/vscm.init b/vscm.init index d6e48d3..d6e48d3 100644..100755 --- a/vscm.init +++ b/vscm.init diff --git a/withfile.scm b/withfile.scm index fd527f8..fd527f8 100644..100755 --- a/withfile.scm +++ b/withfile.scm diff --git a/wttest.scm b/wttest.scm deleted file mode 100644 index 4fa8d5a..0000000 --- a/wttest.scm +++ /dev/null @@ -1,136 +0,0 @@ -;;; "wttest.scm" Test Weight balanced trees -*-Scheme-*- -;;; Copyright (c) 1993-1994 Stephen Adams -;;; -;;; Copyright (c) 1993-94 Massachusetts Institute of Technology -;;; -;;; This material was developed by the Scheme project at the -;;; Massachusetts Institute of Technology, Department of Electrical -;;; Engineering and Computer Science. Permission to copy and modify -;;; this software, to redistribute either the original software or a -;;; modified version, and to use this software for any purpose is -;;; granted, subject to the following restrictions and understandings. -;;; -;;; 1. Any copy made of this software must include this copyright -;;; notice in full. -;;; -;;; 2. Users of this software agree to make their best efforts (a) to -;;; return to the MIT Scheme project any improvements or extensions -;;; that they make, so that these may be included in future releases; -;;; and (b) to inform MIT of noteworthy uses of this software. -;;; -;;; 3. All materials developed as a consequence of the use of this -;;; software shall duly acknowledge such use, in accordance with the -;;; usual standards of acknowledging credit in academic research. -;;; -;;; 4. MIT has made no warranty or representation that the operation -;;; of this software will be error-free, and MIT is under no -;;; obligation to provide any services, by way of maintenance, update, -;;; or otherwise. -;;; -;;; 5. In conjunction with products arising from the use of this -;;; material, there shall be no use of the name of the Massachusetts -;;; Institute of Technology nor of any adaptation thereof in any -;;; advertising, promotional, or sales literature without prior -;;; written consent from MIT in each case. - -(require 'wt-tree) - -;; Test code, using maps from digit strings to the numbers they represent. - -(define (wt-test) - - (define (make-map lo hi step) - (let loop ((i lo) (map (make-wt-tree string-wt-type))) - (if (> i hi) - map - (loop (+ i step) (wt-tree/add map (number->string i) i))))) - - (define (wt-tree->alist t) - (wt-tree/fold (lambda (key datum rest) (cons (cons key datum) rest)) '() t)) - - (define (try-all operation trees) - (map (lambda (t1) - (map (lambda (t2) - (operation t1 t2)) - trees)) - trees)) - - (define (chunk tree) - (let ((size (wt-tree/size tree))) - (if (< size 8) - size - (let* ((midpoint (if (even? size) - (/ size 2) - (/ (+ size 1) 2))) - (fulcrum (wt-tree/index tree midpoint))) - (list (chunk (wt-tree/split< tree fulcrum)) - (list fulcrum) - (chunk (wt-tree/split> tree fulcrum))))))) - - (define (verify name result expected) - (newline) - (display "Test ") (display name) - (if (equal? result expected) - (begin - (display " passed")) - (begin - (display " unexpected result") - (newline) - (display "Expected: " expected) - (newline) - (display "Got: " result)))) - - (let ((t1 (make-map 0 99 2)) ; 0,2,4,...,98 - (t2 (make-map 1 100 2)) ; 1,3,5,...,99 - (t3 (make-map 0 100 3))) ; 0,3,6,...,99 - - - (verify 'alist (wt-tree->alist t3) ; - '(("0" . 0) ("12" . 12) ("15" . 15) ("18" . 18) ("21" . 21) - ("24" . 24) ("27" . 27) ("3" . 3) ("30" . 30) ("33" . 33) - ("36" . 36) ("39" . 39) ("42" . 42) ("45" . 45) ("48" . 48) - ("51" . 51) ("54" . 54) ("57" . 57) ("6" . 6) ("60" . 60) - ("63" . 63) ("66" . 66) ("69" . 69) ("72" . 72) ("75" . 75) - ("78" . 78) ("81" . 81) ("84" . 84) ("87" . 87) ("9" . 9) - ("90" . 90) ("93" . 93) ("96" . 96) ("99" . 99))) - - - (verify 'union-sizes - (try-all (lambda (t1 t2) (wt-tree/size (wt-tree/union t1 t2))) - (list t1 t2 t3)) - '((50 100 67) (100 50 67) (67 67 34))) - - (verify 'difference-sizes - (try-all (lambda (t1 t2) - (wt-tree/size (wt-tree/difference t1 t2))) - (list t1 t2 t3)) - '((0 50 33) (50 0 33) (17 17 0))) - - (verify 'intersection-sizes - (try-all (lambda (t1 t2) - (wt-tree/size (wt-tree/intersection t1 t2))) - (list t1 t2 t3)) - '((50 0 17) (0 50 17) (17 17 34))) - - (verify 'equalities - (try-all (lambda (t1 t2) - (wt-tree/set-equal? (wt-tree/difference t1 t2) - (wt-tree/difference t2 t1))) - (list t1 t2 t3)) - '((#t #f #f) (#f #t #f) (#f #f #t))) - - (verify 'indexing - (chunk (make-map 0 99 1)) - '((((7 ("15") 5) ("20") (6 ("27") 4)) ("31") - ((6 ("38") 5) ("43") (6 ("5") 4))) - ("54") - (((7 ("61") 5) ("67") (6 ("73") 4)) ("78") - ((6 ("84") 5) ("9") (5 ("95") 4))))) - (newline))) - -(wt-test) - -;;; Local Variables: -;;; eval: (put 'with-n-node 'scheme-indent-function 1) -;;; eval: (put 'with-n-node 'scheme-indent-hook 1) -;;; End: diff --git a/wttree-test.scm b/wttree-test.scm new file mode 100755 index 0000000..117e365 --- /dev/null +++ b/wttree-test.scm @@ -0,0 +1,232 @@ +;; +;; Copyright (C) 2010 Kazu Yamamoto +;; +;; Permission to use, copy, modify, and/or distribute this software for +;; any purpose with or without fee is hereby granted, provided that the +;; above copyright notice and this permission notice appear in all +;; copies. +;; +;; THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL +;; WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED +;; WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE +;; AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL +;; DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR +;; PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +;; TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +;; PERFORMANCE OF THIS SOFTWARE. + +;; +;; This code is to test "wttree.scm". Test cases are automatically +;; generated and properties are tested. +;; + +;; +;; Preamble +;; + +(require 'wt-tree) +(require 'srfi-1) +(require 'random) +(require 'format) +(require 'sort) + +(define (sort1 lst) + (sort lst <)) + +;; +;; Utilities for wt-tree +;; + +(define (random-alist n) + (zip (random-list n))) + +(define integer-scale 10) + +(define (random-list n) + (let ((range (* n integer-scale))) + (list-tabulate n + (lambda (dummy) + (random range))))) + +(define (from-alist al) + (alist->wt-tree number-wt-type al)) + +(define (to-list tree) + (wt-tree/fold (lambda (k v l) (cons k l)) '() tree)) + +(define (uniq x) + (define (func y z) + (if (and (not (null? z)) (equal? y (car z))) + z + (cons y z))) + (fold-right func () x)) + +;; +;; Engine +;; + +(define number-of-range 10) + +(define (ladder i) + (let* ((unit (quotient number-of-tests number-of-range)) + (size (* unit (+ (quotient i unit) 1)))) + size)) + +(define (try-test lst i) + (let* ((func (car lst)) + (syms (cdr lst)) + (size (ladder i)) + (args (map (type-to-data size) syms))) + (if (apply func args) + #t + args))) + +(define (type-to-data size) + (lambda (type) + (cond + ((eq? type 'alist) + (random-alist size)) + ((eq? type 'ulist) + (uniq (sort1 (random-list size)))) + ((eq? type 'int) + (random size)) + (else + (error "Unknown type: " type))))) + +;; +;; property tests +;; + +(define (prop-alist->wt-tree alst) + (wt-tree/valid? (from-alist alst))) + +(define (prop-wt-tree/index ulst) + (let* ((alst (zip ulst ulst)) + (tree (from-alist alst)) + (idx (quotient (length alst) 2))) + (equal? (wt-tree/index tree idx) (list-ref ulst idx)))) + +(define (prop-wt-tree/fold alst) + (let* ((model (uniq (sort1 (map car alst)))) + (tree (from-alist alst)) + (this (to-list tree))) + (equal? model this))) + +(define (prop-wt-tree/add alst k v) + (wt-tree/valid? (wt-tree/add (from-alist alst) k v))) + +(define (prop-wt-tree/delete alst) + (let* ((tree (from-alist alst)) + (len (length alst)) + (k (car (list-ref alst (quotient len 2))))) + (wt-tree/valid? (wt-tree/delete tree k)))) + +(define (prop-wt-tree/delete-min alst) + (wt-tree/valid? (wt-tree/delete-min (from-alist alst)))) + +(define (prop-wt-tree/lookup alst) + (let* ((tree (from-alist alst)) + (len (length alst)) + (k (car (list-ref alst (quotient len 2))))) + (eq? (wt-tree/lookup tree k #f) '()))) + +(define (prop-wt-tree/add-lookup alst k v) + (let ((tree (wt-tree/add (from-alist alst) k v))) + (eq? (wt-tree/lookup tree k #f) v))) + +(define (prop-wt-tree/union alst1 alst2) + (let ((t1 (from-alist alst1)) + (t2 (from-alist alst2))) + (wt-tree/valid? (wt-tree/union t1 t2)))) + +(define (prop-wt-tree/union-merge alst1 alst2) + (let ((t1 (from-alist alst1)) + (t2 (from-alist alst2))) + (wt-tree/valid? (wt-tree/union-merge + t1 t2 (lambda (key datum-1 datum-2) datum-1))))) + +(define (prop-wt-tree/union-model alst1 alst2) + (let* ((l1 (uniq (sort1 (map car alst1)))) + (l2 (uniq (sort1 (map car alst2)))) + (model (sort1 (lset-union eq? l1 l2))) + (t1 (from-alist alst1)) + (t2 (from-alist alst2)) + (this (sort1 (to-list (wt-tree/union t1 t2))))) + (equal? model this))) + +(define (prop-wt-tree/intersection alst1 alst2) + (let ((t1 (from-alist alst1)) + (t2 (from-alist alst2))) + (wt-tree/valid? (wt-tree/intersection t1 t2)))) + +(define (prop-wt-tree/intersection-model alst1 alst2) + (let* ((l1 (uniq (sort1 (map car alst1)))) + (l2 (uniq (sort1 (map car alst2)))) + (model (sort1 (lset-intersection eq? l1 l2))) + (t1 (from-alist alst1)) + (t2 (from-alist alst2)) + (this (sort1 (to-list (wt-tree/intersection t1 t2))))) + (equal? model this))) + +(define (prop-wt-tree/difference alst1 alst2) + (let ((t1 (from-alist alst1)) + (t2 (from-alist alst2))) + (wt-tree/valid? (wt-tree/difference t1 t2)))) + +(define (prop-wt-tree/difference-model alst1 alst2) + (let* ((l1 (uniq (sort1 (map car alst1)))) + (l2 (uniq (sort1 (map car alst2)))) + (model (sort1 (lset-difference eq? l1 l2))) + (t1 (from-alist alst1)) + (t2 (from-alist alst2)) + (this (sort1 (to-list (wt-tree/difference t1 t2))))) + (equal? model this))) + +;; +;; test db +;; + +(define test-alist + (list + (list "alist->wt-tree" prop-alist->wt-tree 'alist) + (list "wt-tree/index" prop-wt-tree/index 'ulist) + (list "wt-tree/fold" prop-wt-tree/fold 'alist) + (list "wt-tree/add" prop-wt-tree/add 'alist 'int 'int) + (list "wt-tree/delete" prop-wt-tree/delete 'alist) + (list "wt-tree/delete-min" prop-wt-tree/delete-min 'alist) + (list "wt-tree/lookup" prop-wt-tree/lookup 'alist) + (list "wt-tree/add-lookup" prop-wt-tree/add-lookup 'alist 'int 'int) + (list "wt-tree/union" prop-wt-tree/union 'alist 'alist) + (list "wt-tree/union-merge" prop-wt-tree/union-merge 'alist 'alist) + (list "wt-tree/union-model" prop-wt-tree/union-model 'alist 'alist) + (list "wt-tree/intersection" prop-wt-tree/intersection 'alist 'alist) + (list "wt-tree/intersection-model" prop-wt-tree/intersection-model 'alist 'alist) + (list "wt-tree/difference" prop-wt-tree/difference 'alist 'alist) + (list "wt-tree/difference-model" prop-wt-tree/difference-model 'alist 'alist))) + +;; +;; main +;; + +(define number-of-tests 300) + +(define (run-test prop) + (let ((tag (car prop)) + (test (cdr prop))) + (format #t "~a: testing ~d cases... " tag number-of-tests) + (force-output) + (let loop ((i 0)) + (cond + ((>= i number-of-tests) + (display "PASS\n") + (force-output)) + (else + (let ((ret (try-test test i))) + (cond + ((eq? ret #t) + (loop (+ 1 i))) + (else + (display "FAIL\n") + (format #t "~d/~d: ~a\n" i number-of-tests ret))))))))) + +(for-each run-test test-alist) diff --git a/wttree.scm b/wttree.scm index 43620d6..60f25c3 100644..100755 --- a/wttree.scm +++ b/wttree.scm @@ -1,45 +1,32 @@ ;;; "wttree.scm" Weight balanced trees -*-Scheme-*- -;;; Copyright (c) 1993-1994 Stephen Adams ;;; -;;; References: +;;; $ I d : wttree.scm,v 1.10 1999/01/02 06:19:10 cph Exp $ ;;; -;;; Stephen Adams, Implemeting Sets Efficiently in a Functional -;;; Language, CSTR 92-10, Department of Electronics and Computer -;;; Science, University of Southampton, 1992 +;;; Copyright (c) 1993-1999 Massachusetts Institute of Technology ;;; +;;; This program is free software; you can redistribute it and/or modify +;;; it under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 2 of the License, or (at +;;; your option) any later version. ;;; -;;; Copyright (c) 1993-94 Massachusetts Institute of Technology +;;; This program is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;;; General Public License for more details. ;;; -;;; This material was developed by the Scheme project at the -;;; Massachusetts Institute of Technology, Department of Electrical -;;; Engineering and Computer Science. Permission to copy and modify -;;; this software, to redistribute either the original software or a -;;; modified version, and to use this software for any purpose is -;;; granted, subject to the following restrictions and understandings. +;;; You should have received a copy of the GNU General Public License +;;; along with this program; if not, write to the Free Software +;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ;;; -;;; 1. Any copy made of this software must include this copyright -;;; notice in full. +;;; Copyright (c) 1993-1994 Stephen Adams ;;; -;;; 2. Users of this software agree to make their best efforts (a) to -;;; return to the MIT Scheme project any improvements or extensions -;;; that they make, so that these may be included in future releases; -;;; and (b) to inform MIT of noteworthy uses of this software. +;;; References: ;;; -;;; 3. All materials developed as a consequence of the use of this -;;; software shall duly acknowledge such use, in accordance with the -;;; usual standards of acknowledging credit in academic research. +;;; Stephen Adams, Implemeting Sets Efficiently in a Functional +;;; Language, CSTR 92-10, Department of Electronics and Computer +;;; Science, University of Southampton, 1992 ;;; -;;; 4. MIT has made no warranty or representation that the operation -;;; of this software will be error-free, and MIT is under no -;;; obligation to provide any services, by way of maintenance, update, -;;; or otherwise. ;;; -;;; 5. In conjunction with products arising from the use of this -;;; material, there shall be no use of the name of the Massachusetts -;;; Institute of Technology nor of any adaptation thereof in any -;;; advertising, promotional, or sales literature without prior -;;; written consent from MIT in each case. - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Weight Balanced Binary Trees @@ -88,6 +75,7 @@ (define wt-tree/split< #f) (define wt-tree/split> #f) (define wt-tree/union #f) +(define wt-tree/union-merge #f) (define wt-tree/intersection #f) (define wt-tree/difference #f) (define wt-tree/subset? #f) @@ -103,7 +91,7 @@ (define wt-tree/min-pair #f) (define wt-tree/delete-min #f) (define wt-tree/delete-min! #f) - +(define wt-tree/valid? #f) ;; This LET sets all of the above variables. @@ -141,6 +129,7 @@ ;; (split-lt #F read-only true) ;; (split-gt #F read-only true) ;; (union #F read-only true) + ;; (union-merge #F read-only true) ;; (intersection #F read-only true) ;; (difference #F read-only true) ;; (subset? #F read-only true) @@ -159,14 +148,14 @@ delete delete! member? lookup split-lt split-gt - union intersection - difference subset? - rank ) + union union-merge + intersection difference + subset? rank ) (vector tag:tree-type key<? alist->tree add insert! delete delete! member? lookup - split-lt split-gt union intersection - difference subset? rank )) + split-lt split-gt union union-merge + intersection difference subset? rank )) (define (tree-type? tt) (and (vector? tt) @@ -183,10 +172,11 @@ (define (tree-type/split-lt tt) (vector-ref tt 9)) (define (tree-type/split-gt tt) (vector-ref tt 10)) (define (tree-type/union tt) (vector-ref tt 11)) - (define (tree-type/intersection tt) (vector-ref tt 12)) - (define (tree-type/difference tt) (vector-ref tt 13)) - (define (tree-type/subset? tt) (vector-ref tt 14)) - (define (tree-type/rank tt) (vector-ref tt 15)) + (define (tree-type/union-merge tt) (vector-ref tt 12)) + (define (tree-type/intersection tt) (vector-ref tt 13)) + (define (tree-type/difference tt) (vector-ref tt 14)) + (define (tree-type/subset? tt) (vector-ref tt 15)) + (define (tree-type/rank tt) (vector-ref tt 16)) ;; User level tree representation. ;; @@ -273,30 +263,31 @@ (n-join a_k a_v x y1) (n-join c_k c_v y2 z))))))) - ;; (define-integrable wt-tree-ratio 5) - (define wt-tree-ratio 5) + ;; (define-integrable wt-tree-delta 3) + (define wt-tree-delta 3) + (define wt-tree-gamma 2) (define (t-join k v l r) (define (simple-join) (n-join k v l r)) - (let ((l_n (node/size l)) - (r_n (node/size r))) - (cond ((fix:< (fix:+ l_n r_n) 2) (simple-join)) - ((fix:> r_n (fix:* wt-tree-ratio l_n)) + (let ((l_n (fix:+ (node/size l) 1)) + (r_n (fix:+ (node/size r) 1))) + (cond ((fix:> r_n (fix:* wt-tree-delta l_n)) ;; right is too big - (let ((r_l_n (node/size (node/l r))) - (r_r_n (node/size (node/r r)))) - (if (fix:< r_l_n r_r_n) + (let ((r_l_n (fix:+ (node/size (node/l r)) 1)) + (r_r_n (fix:+ (node/size (node/r r)) 1))) + (if (fix:< r_l_n (fix:* wt-tree-gamma r_r_n)) (single-l k v l r) (double-l k v l r)))) - ((fix:> l_n (fix:* wt-tree-ratio r_n)) + ((fix:> l_n (fix:* wt-tree-delta r_n)) ;; left is too big - (let ((l_l_n (node/size (node/l l))) - (l_r_n (node/size (node/r l)))) - (if (fix:< l_r_n l_l_n) + (let ((l_l_n (fix:+ (node/size (node/l l)) 1)) + (l_r_n (fix:+ (node/size (node/r l)) 1))) + (if (fix:< l_r_n (fix:* wt-tree-gamma l_l_n)) (single-r k v l r) (double-r k v l r)))) (else (simple-join))))) + ;; ;; Node tree procedures that are independent of key<? ;; @@ -418,16 +409,16 @@ (node/delmin tree2)))))) (define (node/concat3 k v l r) - (cond ((empty? l) (node/add r k v)) - ((empty? r) (node/add l k v)) + (cond ((empty? l) (node/add r k v)) + ((empty? r) (node/add l k v)) (else - (let ((n1 (node/size l)) - (n2 (node/size r))) - (cond ((fix:< (fix:* wt-tree-ratio n1) n2) + (let ((n1 (fix:+ (node/size l) 1)) + (n2 (fix:+ (node/size r) 1))) + (cond ((fix:< (fix:* wt-tree-delta n1) n2) (with-n-node r (lambda (k2 v2 l2 r2) (t-join k2 v2 (node/concat3 k v l l2) r2)))) - ((fix:< (fix:* wt-tree-ratio n2) n1) + ((fix:< (fix:* wt-tree-delta n2) n1) (with-n-node l (lambda (k1 v1 l1 r1) (t-join k1 v1 l1 (node/concat3 k v r1 r))))) @@ -462,6 +453,22 @@ (r1 (node/split-gt tree1 ak))) (node/concat3 ak av (node/union l1 l) (node/union r1 r)))))))) + (define (node/union-merge tree1 tree2 merge) + (cond ((empty? tree1) tree2) + ((empty? tree2) tree1) + (else + (with-n-node tree2 + (lambda (ak av l r) + (let* ((node1 (node/find ak tree1)) + (l1 (node/split-lt tree1 ak)) + (r1 (node/split-gt tree1 ak)) + (value (if node1 + (merge ak av (node/v node1)) + av))) + (node/concat3 ak value + (node/union-merge l1 l merge) + (node/union-merge r1 r merge)))))))) + (define (node/difference tree1 tree2) (cond ((empty? tree1) empty) ((empty? tree2) tree1) @@ -535,6 +542,11 @@ (%make-wt-tree (tree/type tree1) (node/union (tree/root tree1) (tree/root tree2)))) + (define (tree/union-merge tree1 tree2 merge) + (%make-wt-tree (tree/type tree1) + (node/union-merge (tree/root tree1) (tree/root tree2) + merge))) + (define (tree/intersection tree1 tree2) (%make-wt-tree (tree/type tree1) (node/intersection (tree/root tree1) (tree/root tree2)))) @@ -582,6 +594,7 @@ tree/split-lt ; split-lt tree/split-gt ; split-gt tree/union ; union + tree/union-merge ; union-merge tree/intersection ; intersection tree/difference ; difference tree/subset? ; subset? @@ -607,6 +620,33 @@ (slib:error "The trees" tree1 'and tree2 'have 'incompatible 'types (tree/type tree1) 'and (tree/type tree2)))) + (define (valid? tree) + (let ((root (tree/root tree))) + (and (balanced? root) + (ordered? root)))) + + (define (balanced? n) + (define (isBalanced a b) + (let ((x (fix:+ (node/size a) 1)) + (y (fix:+ (node/size b) 1))) + (fix:<= y (fix:* wt-tree-delta x)))) + (or (empty? n) + (let ((l (node/l n)) + (r (node/r n))) + (and (isBalanced l r) (isBalanced r l) + (balanced? l) (balanced? r))))) + + (define (ordered? n) + (define (isOrdered lo hi m) + (or (empty? m) + (let ((k (node/k m)) + (l (node/l m)) + (r (node/r m))) + (and (lo k) (hi k) + (isOrdered lo (lambda (x) (< x k)) l) + (isOrdered (lambda (x) (< k x)) hi r))))) + (isOrdered (lambda (x) #t) (lambda (x) #t) n)) + ;;;______________________________________________________________________ ;;; ;;; Export interface @@ -682,6 +722,11 @@ (guarantee-compatible-trees tree1 tree2 'wt-tree/union) ((tree-type/union (tree/type tree1)) tree1 tree2))) + (set! wt-tree/union-merge + (lambda (tree1 tree2 merge) + (guarantee-compatible-trees tree1 tree2 'wt-tree/union-merge) + ((tree-type/union-merge (tree/type tree1)) tree1 tree2 merge))) + (set! wt-tree/intersection (lambda (tree1 tree2) (guarantee-compatible-trees tree1 tree2 'wt-tree/intersection) @@ -769,6 +814,11 @@ (set! number-wt-type (local:make-wt-tree-type (lambda (u v) (< u v)))) (set! string-wt-type (local:make-wt-tree-type string<?)) + (set! wt-tree/valid? + (lambda (tree) + (guarantee-tree tree 'wt-tree/valid?) + (valid? tree))) + 'done) ;;; Local Variables: diff --git a/xml-parse.scm b/xml-parse.scm index 3c02942..da9a7fd 100644..100755 --- a/xml-parse.scm +++ b/xml-parse.scm @@ -343,7 +343,7 @@ (do ((idx 0 (+ 1 idx))) ((>= idx len) idx) (let ((chr (read-char port))) - (cond ((eof-object? byt) + (cond ((eof-object? chr) (set! idx (+ -1 idx)) (set! len idx)) (else (string-set! buffer idx chr)))))) diff --git a/xml-parse.txi b/xml-parse.txi index 365d914..c585d92 100644..100755 --- a/xml-parse.txi +++ b/xml-parse.txi @@ -110,7 +110,8 @@ of the set. This character is left on the stream. All the read characters are returned in a string. -@defunx ssax:next-token-of pred port +@end defun +@defun ssax:next-token-of pred port Reads characters from the @var{port} for which @var{pred} (a procedure of one argument) returns non-#f. The reading stops at the first |