From a69c9fb665459e2bfdbda1bf80741a0af31a7faf Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 20 Feb 2017 00:06:40 -0800 Subject: New upstream version 3b5 --- ANNOUNCE | 172 +--- Bev2slib.scm | 0 COPYING | 0 ChangeLog | 421 ++++++++ FAQ | 33 +- Makefile | 579 ++++++----- README | 27 +- RScheme.init | 0 SLIB.ico | Bin STk.init | 0 Template.scm | 0 alist.scm | 0 alist.txi | 0 alistab.scm | 0 array.scm | 4 +- array.txi | 0 arraymap.scm | 4 +- arraymap.txi | 0 batch.scm | 4 +- bigloo.init | 0 break.scm | 1 + byte.scm | 1 + byte.txi | 0 bytenumb.scm | 7 +- bytenumb.txi | 1 + chap.scm | 0 chap.txi | 0 charplot.scm | 1 + chez.init | 8 +- cie1931.xyz | 0 cie1964.xyz | 0 ciesia.dat | 0 ciesid65.dat | 0 clrnamdb.scm | 40 +- cltime.scm | 0 coerce.scm | 0 coerce.txi | 0 collect.scm | 3 +- collectx.scm | 4 +- color.scm | 15 +- color.txi | 24 +- colornam.scm | 0 colornam.txi | 3 +- colorspc.scm | 32 +- comlist.scm | 2 + comparse.scm | 0 comparse.txi | 0 configure | 377 +++++++ crc.scm | 0 cring.scm | 0 cvs.scm | 0 cvs.txi | 0 daylight.scm | 0 daylight.txi | 0 db2html.scm | 1 + db2html.txi | 0 dbcom.scm | 1 + dbinterp.scm | 0 dbrowse.scm | 2 +- dbsyn.scm | 14 +- dbutil.scm | 6 +- dbutil.txi | 3 +- debug.scm | 0 defmacex.scm | 0 determ.scm | 1 + determ.txi | 6 +- dft.scm | 1 + dft.txi | 0 differ.scm | 0 differ.txi | 0 dirs.scm | 17 + dirs.txi | 18 +- dwindtst.scm | 0 dynamic.scm | 4 +- dynwind.scm | 0 elk.init | 0 eval.scm | 0 factor.scm | 2 +- factor.txi | 0 fdl.texi | 80 +- fluid-let.scm | 39 + fluidlet.scm | 0 format.scm | 0 format.texi | 7 +- formatst.scm | 0 gambit.init | 1 + genwrite.scm | 169 ++-- getopt.scm | 0 getparam.scm | 1 + getparam.txi | 0 glob.scm | 0 glob.txi | 3 +- grapheps.ps | 186 +++- grapheps.scm | 94 +- grapheps.txi | 68 +- guile-2.init | 714 +++++++++++++ guile.init | 392 ++++++-- guile.use | 2 + hash.scm | 0 hashtab.scm | 0 hashtab.txi | 0 html4each.scm | 40 +- html4each.txi | 12 +- htmlform.scm | 3 +- htmlform.txi | 0 http-cgi.scm | 27 +- http-cgi.txi | 23 +- indexes.texi | 0 jscheme.init | 0 kawa.init | 2 +- limit.scm | 6 + limit.texi | 0 lineio.scm | 2 +- lineio.txi | 0 linterp.scm | 4 +- linterp.txi | 0 logical.scm | 1 + macrotst.scm | 0 macscheme.init | 0 macwork.scm | 0 manifest.scm | 0 manifest.txi | 0 matfile.scm | 0 matfile.txi | 0 math-integer.scm | 20 +- math-integer.txi | 20 +- math-real.scm | 2 + mbe.scm | 0 minimize.scm | 0 minimize.txi | 0 mitscheme.init | 127 +-- mkclrnam.scm | 66 +- mkclrnam.txi | 2 +- mklibcat.scm | 369 +++---- mkpltcat.scm | 0 modular.scm | 0 modular.txi | 0 mulapply.scm | 0 mularg.scm | 0 mwdenote.scm | 0 mwexpand.scm | 5 +- mwsynrul.scm | 0 mzscheme.init | 0 nbs-iscc.txt | 0 ncbi-dna.scm | 1 + ncbi-dna.txi | 0 null.scm | 0 obj2str.scm | 0 obj2str.txi | 0 object.scm | 4 +- object.texi | 0 paramlst.scm | 0 peanosfc.scm | 0 peanosfc.txi | 0 phil-spc.scm | 3 +- phil-spc.txi | 6 +- pnm.scm | 1 + pnm.txi | 3 +- pp.scm | 0 ppfile.scm | 0 prec.scm | 342 +++---- printf.scm | 1 + priorque.scm | 2 +- priorque.txi | 0 process.scm | 0 promise.scm | 0 pscheme.init | 0 psxtime.scm | 1 + qp.scm | 7 +- queue.scm | 2 +- queue.txi | 0 r4rsyn.scm | 0 randinex.scm | 1 + randinex.txi | 0 random.scm | 0 random.txi | 3 +- ratize.scm | 0 ratize.txi | 0 rdms.scm | 0 recobj.scm | 0 record.scm | 0 repl.scm | 0 require.scm | 9 +- resenecolours.txt | 0 rmdsff.scm | 317 ++++++ rmdsff.txi | 68 ++ root.scm | 6 +- s7.init | 417 ++++++++ saturate.txt | 42 +- sc2.scm | 0 sc4opt.scm | 0 sc4sc3.scm | 0 scaexpp.scm | 0 scaglob.scm | 0 scainit.scm | 0 scamacr.scm | 0 scanf.scm | 4 +- scaoutp.scm | 0 scheme2c.init | 0 scheme48.init | 2 +- schmooz.scm | 22 +- schmooz.texi | 3 +- scm.init | 0 scmacro.scm | 0 scsh.init | 0 selfset.scm | 0 sierpinski.scm | 0 simetrix.scm | 17 +- sisc.init | 4 +- slib.1 | 4 +- slib.doc | 10 +- slib.info | 2890 +++++++++++++++++++++++++++++------------------------ slib.nsi | 14 +- slib.sh | 34 +- slib.spec | 77 +- slib.texi | 641 +++++++----- solid.scm | 8 +- solid.txi | 5 +- sort.scm | 15 +- soundex.scm | 0 srfi-1.scm | 1 + srfi-1.txi | 0 srfi-11.scm | 0 srfi-2.scm | 0 srfi-23.scm | 0 srfi-39.scm | 81 ++ srfi-61.scm | 0 srfi-8.scm | 0 srfi-9.scm | 0 srfi.scm | 0 srfi.txi | 0 stdio.scm | 0 strcase.scm | 0 strport.scm | 0 strsrch.scm | 32 +- structure.scm | 2 +- subarray.scm | 12 +- subarray.txi | 14 +- synchk.scm | 0 synclo.scm | 2 +- synrul.scm | 0 t3.init | 0 timecore.scm | 2 + timezone.scm | 0 top-refs.scm | 0 top-refs.txi | 0 trace.scm | 5 +- transact.scm | 10 +- transact.txi | 0 tree.scm | 0 tree.txi | 0 trnscrpt.scm | 6 +- tsort.scm | 0 tsort.txi | 0 tzfile.scm | 5 +- umbscheme.init | 0 uri.scm | 16 +- uri.txi | 0 values.scm | 2 +- version.txi | 4 +- vet.scm | 0 vet.txi | 0 vscm.init | 0 withfile.scm | 0 wttest.scm | 136 --- wttree-test.scm | 232 +++++ wttree.scm | 170 ++-- xml-parse.scm | 2 +- xml-parse.txi | 3 +- yasyn.scm | 0 270 files changed, 6911 insertions(+), 3138 deletions(-) mode change 100644 => 100755 Bev2slib.scm mode change 100644 => 100755 COPYING mode change 100644 => 100755 RScheme.init mode change 100644 => 100755 SLIB.ico mode change 100644 => 100755 STk.init mode change 100644 => 100755 Template.scm mode change 100644 => 100755 alist.scm mode change 100644 => 100755 alist.txi mode change 100644 => 100755 alistab.scm mode change 100644 => 100755 array.scm mode change 100644 => 100755 array.txi mode change 100644 => 100755 arraymap.scm mode change 100644 => 100755 arraymap.txi mode change 100644 => 100755 batch.scm mode change 100644 => 100755 bigloo.init mode change 100644 => 100755 break.scm mode change 100644 => 100755 byte.scm mode change 100644 => 100755 byte.txi mode change 100644 => 100755 bytenumb.scm mode change 100644 => 100755 bytenumb.txi mode change 100644 => 100755 chap.scm mode change 100644 => 100755 chap.txi mode change 100644 => 100755 charplot.scm mode change 100644 => 100755 chez.init mode change 100644 => 100755 cie1931.xyz mode change 100644 => 100755 cie1964.xyz mode change 100644 => 100755 ciesia.dat mode change 100644 => 100755 ciesid65.dat mode change 100644 => 100755 clrnamdb.scm mode change 100644 => 100755 cltime.scm mode change 100644 => 100755 coerce.scm mode change 100644 => 100755 coerce.txi mode change 100644 => 100755 collect.scm mode change 100644 => 100755 collectx.scm mode change 100644 => 100755 color.scm mode change 100644 => 100755 color.txi mode change 100644 => 100755 colornam.scm mode change 100644 => 100755 colornam.txi mode change 100644 => 100755 colorspc.scm mode change 100644 => 100755 comlist.scm mode change 100644 => 100755 comparse.scm mode change 100644 => 100755 comparse.txi create mode 100755 configure mode change 100644 => 100755 crc.scm mode change 100644 => 100755 cring.scm mode change 100644 => 100755 cvs.scm mode change 100644 => 100755 cvs.txi mode change 100644 => 100755 daylight.scm mode change 100644 => 100755 daylight.txi mode change 100644 => 100755 db2html.scm mode change 100644 => 100755 db2html.txi mode change 100644 => 100755 dbcom.scm mode change 100644 => 100755 dbinterp.scm mode change 100644 => 100755 dbrowse.scm mode change 100644 => 100755 dbsyn.scm mode change 100644 => 100755 dbutil.scm mode change 100644 => 100755 dbutil.txi mode change 100644 => 100755 debug.scm mode change 100644 => 100755 defmacex.scm mode change 100644 => 100755 determ.scm mode change 100644 => 100755 determ.txi mode change 100644 => 100755 dft.scm mode change 100644 => 100755 dft.txi mode change 100644 => 100755 differ.scm mode change 100644 => 100755 differ.txi mode change 100644 => 100755 dirs.scm mode change 100644 => 100755 dirs.txi mode change 100644 => 100755 dwindtst.scm mode change 100644 => 100755 dynamic.scm mode change 100644 => 100755 dynwind.scm mode change 100644 => 100755 elk.init mode change 100644 => 100755 eval.scm mode change 100644 => 100755 factor.scm mode change 100644 => 100755 factor.txi mode change 100644 => 100755 fdl.texi create mode 100755 fluid-let.scm mode change 100644 => 100755 fluidlet.scm mode change 100644 => 100755 format.scm mode change 100644 => 100755 format.texi mode change 100644 => 100755 formatst.scm mode change 100644 => 100755 gambit.init mode change 100644 => 100755 genwrite.scm mode change 100644 => 100755 getopt.scm mode change 100644 => 100755 getparam.scm mode change 100644 => 100755 getparam.txi mode change 100644 => 100755 glob.scm mode change 100644 => 100755 glob.txi mode change 100644 => 100755 grapheps.ps mode change 100644 => 100755 grapheps.scm mode change 100644 => 100755 grapheps.txi create mode 100755 guile-2.init mode change 100644 => 100755 guile.init create mode 100755 guile.use mode change 100644 => 100755 hash.scm mode change 100644 => 100755 hashtab.scm mode change 100644 => 100755 hashtab.txi mode change 100644 => 100755 html4each.scm mode change 100644 => 100755 html4each.txi mode change 100644 => 100755 htmlform.scm mode change 100644 => 100755 htmlform.txi mode change 100644 => 100755 http-cgi.scm mode change 100644 => 100755 http-cgi.txi mode change 100644 => 100755 indexes.texi mode change 100644 => 100755 jscheme.init mode change 100644 => 100755 kawa.init mode change 100644 => 100755 limit.scm mode change 100644 => 100755 limit.texi mode change 100644 => 100755 lineio.scm mode change 100644 => 100755 lineio.txi mode change 100644 => 100755 linterp.scm mode change 100644 => 100755 linterp.txi mode change 100644 => 100755 logical.scm mode change 100644 => 100755 macrotst.scm mode change 100644 => 100755 macscheme.init mode change 100644 => 100755 macwork.scm mode change 100644 => 100755 manifest.scm mode change 100644 => 100755 manifest.txi mode change 100644 => 100755 matfile.scm mode change 100644 => 100755 matfile.txi mode change 100644 => 100755 math-integer.scm mode change 100644 => 100755 math-integer.txi mode change 100644 => 100755 math-real.scm mode change 100644 => 100755 mbe.scm mode change 100644 => 100755 minimize.scm mode change 100644 => 100755 minimize.txi mode change 100644 => 100755 mitscheme.init mode change 100644 => 100755 mkclrnam.scm mode change 100644 => 100755 mkclrnam.txi mode change 100644 => 100755 mklibcat.scm mode change 100644 => 100755 mkpltcat.scm mode change 100644 => 100755 modular.scm mode change 100644 => 100755 modular.txi mode change 100644 => 100755 mulapply.scm mode change 100644 => 100755 mularg.scm mode change 100644 => 100755 mwdenote.scm mode change 100644 => 100755 mwexpand.scm mode change 100644 => 100755 mwsynrul.scm mode change 100644 => 100755 mzscheme.init mode change 100644 => 100755 nbs-iscc.txt mode change 100644 => 100755 ncbi-dna.scm mode change 100644 => 100755 ncbi-dna.txi mode change 100644 => 100755 null.scm mode change 100644 => 100755 obj2str.scm mode change 100644 => 100755 obj2str.txi mode change 100644 => 100755 object.scm mode change 100644 => 100755 object.texi mode change 100644 => 100755 paramlst.scm mode change 100644 => 100755 peanosfc.scm mode change 100644 => 100755 peanosfc.txi mode change 100644 => 100755 phil-spc.scm mode change 100644 => 100755 phil-spc.txi mode change 100644 => 100755 pnm.scm mode change 100644 => 100755 pnm.txi mode change 100644 => 100755 pp.scm mode change 100644 => 100755 ppfile.scm mode change 100644 => 100755 prec.scm mode change 100644 => 100755 printf.scm mode change 100644 => 100755 priorque.scm mode change 100644 => 100755 priorque.txi mode change 100644 => 100755 process.scm mode change 100644 => 100755 promise.scm mode change 100644 => 100755 pscheme.init mode change 100644 => 100755 psxtime.scm mode change 100644 => 100755 qp.scm mode change 100644 => 100755 queue.scm mode change 100644 => 100755 queue.txi mode change 100644 => 100755 r4rsyn.scm mode change 100644 => 100755 randinex.scm mode change 100644 => 100755 randinex.txi mode change 100644 => 100755 random.scm mode change 100644 => 100755 random.txi mode change 100644 => 100755 ratize.scm mode change 100644 => 100755 ratize.txi mode change 100644 => 100755 rdms.scm mode change 100644 => 100755 recobj.scm mode change 100644 => 100755 record.scm mode change 100644 => 100755 repl.scm mode change 100644 => 100755 resenecolours.txt create mode 100644 rmdsff.scm create mode 100644 rmdsff.txi mode change 100644 => 100755 root.scm create mode 100755 s7.init mode change 100644 => 100755 saturate.txt mode change 100644 => 100755 sc2.scm mode change 100644 => 100755 sc4opt.scm mode change 100644 => 100755 sc4sc3.scm mode change 100644 => 100755 scaexpp.scm mode change 100644 => 100755 scaglob.scm mode change 100644 => 100755 scainit.scm mode change 100644 => 100755 scamacr.scm mode change 100644 => 100755 scanf.scm mode change 100644 => 100755 scaoutp.scm mode change 100644 => 100755 scheme2c.init mode change 100644 => 100755 schmooz.scm mode change 100644 => 100755 schmooz.texi mode change 100644 => 100755 scm.init mode change 100644 => 100755 scmacro.scm mode change 100644 => 100755 scsh.init mode change 100644 => 100755 selfset.scm mode change 100644 => 100755 sierpinski.scm mode change 100644 => 100755 simetrix.scm mode change 100644 => 100755 sisc.init mode change 100644 => 100755 slib.1 mode change 100644 => 100755 slib.doc mode change 100644 => 100755 slib.info mode change 100644 => 100755 slib.texi mode change 100644 => 100755 solid.scm mode change 100644 => 100755 solid.txi mode change 100644 => 100755 sort.scm mode change 100644 => 100755 soundex.scm mode change 100644 => 100755 srfi-1.scm mode change 100644 => 100755 srfi-1.txi mode change 100644 => 100755 srfi-11.scm mode change 100644 => 100755 srfi-2.scm mode change 100644 => 100755 srfi-23.scm create mode 100755 srfi-39.scm mode change 100644 => 100755 srfi-61.scm mode change 100644 => 100755 srfi-8.scm mode change 100644 => 100755 srfi-9.scm mode change 100644 => 100755 srfi.scm mode change 100644 => 100755 srfi.txi mode change 100644 => 100755 stdio.scm mode change 100644 => 100755 strcase.scm mode change 100644 => 100755 strport.scm mode change 100644 => 100755 strsrch.scm mode change 100644 => 100755 structure.scm mode change 100644 => 100755 subarray.scm mode change 100644 => 100755 subarray.txi mode change 100644 => 100755 synchk.scm mode change 100644 => 100755 synclo.scm mode change 100644 => 100755 synrul.scm mode change 100644 => 100755 t3.init mode change 100644 => 100755 timecore.scm mode change 100644 => 100755 timezone.scm mode change 100644 => 100755 top-refs.scm mode change 100644 => 100755 top-refs.txi mode change 100644 => 100755 trace.scm mode change 100644 => 100755 transact.scm mode change 100644 => 100755 transact.txi mode change 100644 => 100755 tree.scm mode change 100644 => 100755 tree.txi mode change 100644 => 100755 trnscrpt.scm mode change 100644 => 100755 tsort.scm mode change 100644 => 100755 tsort.txi mode change 100644 => 100755 tzfile.scm mode change 100644 => 100755 umbscheme.init mode change 100644 => 100755 uri.scm mode change 100644 => 100755 uri.txi mode change 100644 => 100755 values.scm mode change 100644 => 100755 version.txi mode change 100644 => 100755 vet.scm mode change 100644 => 100755 vet.txi mode change 100644 => 100755 vscm.init mode change 100644 => 100755 withfile.scm delete mode 100644 wttest.scm create mode 100755 wttree-test.scm mode change 100644 => 100755 wttree.scm mode change 100644 => 100755 xml-parse.scm mode change 100644 => 100755 xml-parse.txi mode change 100644 => 100755 yasyn.scm diff --git a/ANNOUNCE b/ANNOUNCE index 42d0f61..f3a24ea 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -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). +. Documentation and distributions in several formats are linked from SLIB's home page: - http://swiss.csail.mit.edu/~jaffer/SLIB.html + 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 + - * 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 + - 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 + +Also available as RPM: + + +Also available as MS-Windows installer: + 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 + SCHELOG is an embedding of Prolog in Scheme+SLIB: - 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 + diff --git a/Bev2slib.scm b/Bev2slib.scm old mode 100644 new mode 100755 diff --git a/COPYING b/COPYING old mode 100644 new mode 100755 diff --git a/ChangeLog b/ChangeLog index 537f098..78f8a7f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,424 @@ +2015-01-14 Aubrey Jaffer + + * require.scm (*slib-version*): Bumped from 3b4 to 3b5. + +2014-04-07 Aubrey Jaffer + + * rmdsff.scm (make-cell, integer->coordinates) + (coordinates->integer): Don't depend on LETREC* behavior. + +2014-03-30 Aubrey Jaffer + + * rmdsff.scm: Removed #+CHOICE code comments. + +2014-03-13 Aubrey Jaffer + + * rmdsff.scm: Improved algorithim eliminates gratuitous 0 digit at + top level. + +2014-02-10 Aubrey Jaffer + + * Makefile, mklibcat.scm, rmdsff.scm, slib.texi (space-filling): + Added "rmdsff.scm" and documentation. + +2014-02-08 Aubrey Jaffer + + * 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 + + * require.scm (*slib-version*): Bumped from 3b3 to 3b4. + +2013-01-17 Aubrey Jaffer + + * 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 + + * slib.texi (Root Finding): Added note about root multiplicity. + +2012-06-27 Aubrey Jaffer + + * structure.scm (define-structure): Reconciled with documentation. + +2012-04-09 Aubrey Jaffer + + * Makefile (upgnu): Added target to upload to ftp.gnu.org. + +2012-01-11 Aubrey Jaffer + + * slib.texi, logical.scm (integer->list): Negative k not allowed. + +2011-12-14 Aubrey Jaffer + + * Makefile (html/slib, $(DESTDIR)$(htmldir)slib): HTML generated + by `makeinfo --html'. + +2011-10-25 Aubrey Jaffer + + * Makefile (snapdir, infodir, htmldir): Added defaults so make + works with empty "config.status". + +2011-10-13 Aubrey Jaffer + + * grapheps.ps (whole-page): Extract bounds from %%BoundingBox. + +2011-10-11 Aubrey Jaffer + + * grapheps.scm, grapheps.ps (plot-text-column): Added. + +2011-10-10 Aubrey Jaffer + + * grapheps.ps: Added copyright and license. + +2011-09-05 Aubrey Jaffer + + * 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 + + * slib.texi (Bit-Twiddling): Clarified relationship between + list->integer and integer->list. + +2011-05-20 Aubrey Jaffer + + * 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 + + * Makefile (collectx.scm): Always create, and don't depend on, + "collect.sc". + +2011-01-31 Aubrey Jaffer + + * grapheps.scm (plot): Fixed documentation. + +2011-01-26 Aubrey Jaffer + + * subarray.scm (subarray): Fixed documentation. + +2011-01-19 Aubrey Jaffer + + * uri.scm (uri:decode-query): Don't split values on cr. + +2010-12-20 Aubrey Jaffer + + * 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 + + * 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 + . + +2010-12-01 Aubrey Jaffer + + * mkclrnam.scm (load-rgb-txt): Added method for XKCD dictionary. + +2010-11-11 Aubrey Jaffer + + * mkclrnam.scm (load-rgb-txt): Added method for "bang" dictionary. + +2010-11-10 Aubrey Jaffer + + * colorspc.scm (L*a*b*:DE*94): From + + replaced wedged L*C*h:DE*94. + + * mkclrnam.scm (load-rgb-txt): Added method for FED-STD-595C. + +2010-11-03 Aubrey Jaffer + + * mkclrnam.scm (load-rgb-txt): Extract color-names from "ntc.js". + +2010-09-16 Aubrey Jaffer + + * scanf.scm (*scanf): Handle array-ref argument expressions. + +2010-08-29 Aubrey Jaffer + + * grapheps.scm (set-font): Take optional "encoding" argument. + + * grapheps.ps: Squelch trailing .0 in axis numbers. + +2010-07-08 Aubrey Jaffer + + * slib.sh, gosh.init: Added support for (gosh) Gauche-0.9. + +2010-07-02 Aubrey Jaffer + + * require.scm (*slib-version*): Bumped from 3b2 to 3b3. + + * dbutil.scm (close-database): Close read-only databases. + +2010-06-19 Aubrey Jaffer + + * Makefile: INSTALL_INFO = ginstall-info + + * slib.texi (Lists as sequences): Corrected `last' example. + +2010-05-31 Aubrey Jaffer + + * 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 + + * configure (ac_default_prefix): Was lacking trailing /. + +2010-04-14 Aubrey Jaffer + + * Makefile (allfiles): Added "version.txi". + +2010-03-13 Aubrey Jaffer + + * 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 + + * Makefile (Makefile): Runs ./configure to create config.status. + +2010-02-11 Aubrey Jaffer + + * 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 + + * configure: GNU-style configuration for installation creates + config.status, which is included by Makefile. + +2010-02-03 Aubrey Jaffer + + * guile.init (browse-url, vector->array, array->vector) + (random:chunk): Conditional definitions choke Guile-2. + +2010-02-01 Aubrey Jaffer + + * Makefile: include config.status for install directories. + + * configure: Added Shell script for GNU-compatible configuration. + +2010-01-30 Aubrey Jaffer + + * slib.texi (Installation): Added link to Guile manual. + Corrected @exdent usage. + +2010-01-28 Aubrey Jaffer + + * 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 + + * math-integer.scm (remainder, modulo): Fixed documentation. + + * limit.scm (finite?): Added definition. + +2009-12-16 Aubrey Jaffer + + * qp.scm (qp): Don't truncate symbols when printing. + +2009-10-22 Aubrey Jaffer + + * transact.scm (word:lock!): Truncate email components so MS-Word + style ~$ckfile fits in 162.B. + +2009-10-21 Aubrey Jaffer + + * dirs.scm (directory*-for-each): Added. + +2009-09-30 Aubrey Jaffer + + * Makefile (install, uninstall): Added ciefiles. + +2009-09-19 Aubrey Jaffer + + * srfi-39.scm (make-parameter, parameterize): Added. + +2009-09-11 Aubrey Jaffer + + * s7.init: Added init file for S7, part of the Snd sound-editor. + +2009-08-14 Aubrey Jaffer + + * grapheps.ps (bargraph, impulse): Fixed for ranges not containing 0. + +2009-08-02 Aubrey Jaffer + + * 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 + + * prec.scm (prec:parse): Removed input newline flushing. + +2009-07-03 Aubrey Jaffer + + * 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 + + * 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 + + * 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 + + * format.texi (Format Interface): Updated meta-information. + +2008-12-13 Aubrey Jaffer + + * slib.texi (Catalog Creation): Added mention of implcat. + (Compiled and Implementation-Specific Features): Added section. + +2008-12-09 Aubrey Jaffer + + * tzfile.scm (tzfile:read): Made warning more informative. + (tzfile:read): Commented out warning. + +2008-12-07 Aubrey Jaffer + + * slib.texi (System Interface): The procedure `system' is Posix. + +2008-11-15 Aubrey Jaffer + + * 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 + + * require.scm (report:print): Report locations if given filename + argument. + +2008-05-17 Aubrey Jaffer + + * html4each.scm (htm-fields): Treat DTDs like comments. Fixed + handling of closing tags. Corrected documentation. + +2008-04-09 Aubrey Jaffer + + * 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 + + * 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 + + * slib.texi (Input/Output): Fixed typo in file-position. + (System): Macro:load doesn't affect current-error-port. + 2008-02-01 Aubrey Jaffer * require.scm (*slib-version*): Bumped from 3a5 to 3b1. diff --git a/FAQ b/FAQ index b8e9b61..40395ca 100644 --- a/FAQ +++ b/FAQ @@ -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. diff --git a/Makefile b/Makefile index 8c480e8..678f5cd 100644 --- a/Makefile +++ b/Makefile @@ -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)" $(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)"$(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) diff --git a/README b/README index b1b0b20..759cee7 100644 --- a/README +++ b/README @@ -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 `', @@ -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 old mode 100644 new mode 100755 diff --git a/SLIB.ico b/SLIB.ico old mode 100644 new mode 100755 diff --git a/STk.init b/STk.init old mode 100644 new mode 100755 diff --git a/Template.scm b/Template.scm old mode 100644 new mode 100755 diff --git a/alist.scm b/alist.scm old mode 100644 new mode 100755 diff --git a/alist.txi b/alist.txi old mode 100644 new mode 100755 diff --git a/alistab.scm b/alistab.scm old mode 100644 new mode 100755 diff --git a/array.scm b/array.scm old mode 100644 new mode 100755 index 4cf93b3..d0d3b22 --- 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 old mode 100644 new mode 100755 diff --git a/arraymap.scm b/arraymap.scm old mode 100644 new mode 100755 index bfac855..e34eab6 --- 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 old mode 100644 new mode 100755 diff --git a/batch.scm b/batch.scm old mode 100644 new mode 100755 index 14117d0..b7090e5 --- 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 old mode 100644 new mode 100755 diff --git a/break.scm b/break.scm old mode 100644 new mode 100755 index d62eeb6..de768fc --- a/break.scm +++ b/break.scm @@ -19,6 +19,7 @@ (require 'qp) (require 'alist) +(require 'multiarg-apply) ;;;; BREAKPOINTS diff --git a/byte.scm b/byte.scm old mode 100644 new mode 100755 index 6fdde3d..439bbca --- a/byte.scm +++ b/byte.scm @@ -18,6 +18,7 @@ ;each case. (require 'array) +(require 'multiarg-apply) ;;@code{(require 'byte)} ;;@ftindex byte diff --git a/byte.txi b/byte.txi old mode 100644 new mode 100755 diff --git a/bytenumb.scm b/bytenumb.scm old mode 100644 new mode 100755 index 053a433..4af40b6 --- 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 old mode 100644 new mode 100755 index d5fc680..ea222da --- 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/chap.scm b/chap.scm old mode 100644 new mode 100755 diff --git a/chap.txi b/chap.txi old mode 100644 new mode 100755 diff --git a/charplot.scm b/charplot.scm old mode 100644 new mode 100755 index 31d0fea..71fdaea --- 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 old mode 100644 new mode 100755 index dd923f9..cb85c4a --- 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 old mode 100644 new mode 100755 diff --git a/cie1964.xyz b/cie1964.xyz old mode 100644 new mode 100755 diff --git a/ciesia.dat b/ciesia.dat old mode 100644 new mode 100755 diff --git a/ciesid65.dat b/ciesid65.dat old mode 100644 new mode 100755 diff --git a/clrnamdb.scm b/clrnamdb.scm old mode 100644 new mode 100755 index f95575f..f9ea288 --- 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 old mode 100644 new mode 100755 diff --git a/coerce.scm b/coerce.scm old mode 100644 new mode 100755 diff --git a/coerce.txi b/coerce.txi old mode 100644 new mode 100755 diff --git a/collect.scm b/collect.scm old mode 100644 new mode 100755 index d4ccb6f..c987318 --- a/collect.scm +++ b/collect.scm @@ -131,7 +131,8 @@ (cond ((< count max+1) (set! - (apply (map (lambda (g) (g)) generators))) + (apply + (cons (map (lambda (g) (g)) generators)))) (loop (collect:add1 count))) (else )))))) diff --git a/collectx.scm b/collectx.scm old mode 100644 new mode 100755 index 5ca0ca5..02d4d06 --- a/collectx.scm +++ b/collectx.scm @@ -155,8 +155,8 @@ (cond ((< count!5 max+1!4) (set! !1 (apply !1 - !1 - (map (lambda (g!7) (g!7)) generators!4))) + (cons !1 + (map (lambda (g!7) (g!7)) generators!4)))) (loop!6 (collect:add1 count!5))) (else !1)))))))) diff --git a/color.scm b/color.scm old mode 100644 new mode 100755 index bf8a921..08b3ec2 --- 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 old mode 100644 new mode 100755 index 101bc7b..0fa2dde --- 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 old mode 100644 new mode 100755 diff --git a/colornam.txi b/colornam.txi old mode 100644 new mode 100755 index bc70632..c4ef7a6 --- 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 old mode 100644 new mode 100755 index 723a197..4a17065 --- 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 old mode 100644 new mode 100755 index 3ca909f..e51b3f2 --- 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 old mode 100644 new mode 100755 diff --git a/comparse.txi b/comparse.txi old mode 100644 new mode 100755 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/crc.scm b/crc.scm old mode 100644 new mode 100755 diff --git a/cring.scm b/cring.scm old mode 100644 new mode 100755 diff --git a/cvs.scm b/cvs.scm old mode 100644 new mode 100755 diff --git a/cvs.txi b/cvs.txi old mode 100644 new mode 100755 diff --git a/daylight.scm b/daylight.scm old mode 100644 new mode 100755 diff --git a/daylight.txi b/daylight.txi old mode 100644 new mode 100755 diff --git a/db2html.scm b/db2html.scm old mode 100644 new mode 100755 index 9b4709f..92da4eb --- 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 old mode 100644 new mode 100755 diff --git a/dbcom.scm b/dbcom.scm old mode 100644 new mode 100755 index 428e3db..4bd6352 --- 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 old mode 100644 new mode 100755 diff --git a/dbrowse.scm b/dbrowse.scm old mode 100644 new mode 100755 index 9401c6d..e56fc9b --- 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 old mode 100644 new mode 100755 index f807642..84d4c7b --- 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 old mode 100644 new mode 100755 index 7df51ce..f29f119 --- 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 old mode 100644 new mode 100755 index f7af3af..02d058a --- 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 old mode 100644 new mode 100755 diff --git a/defmacex.scm b/defmacex.scm old mode 100644 new mode 100755 diff --git a/determ.scm b/determ.scm old mode 100644 new mode 100755 index be7e00f..cb545e8 --- 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 old mode 100644 new mode 100755 index c230046..4c37346 --- 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 diff --git a/dft.scm b/dft.scm old mode 100644 new mode 100755 index 29180d0..690095c --- a/dft.scm +++ b/dft.scm @@ -30,6 +30,7 @@ (require 'array) (require 'logical) (require 'subarray) +(require 'multiarg-apply) ;;@code{(require 'dft)} or ;;@code{(require 'Fourier-transform)} diff --git a/dft.txi b/dft.txi old mode 100644 new mode 100755 diff --git a/differ.scm b/differ.scm old mode 100644 new mode 100755 diff --git a/differ.txi b/differ.txi old mode 100644 new mode 100755 diff --git a/dirs.scm b/dirs.scm old mode 100644 new mode 100755 index 15d1ffd..0d1212d --- a/dirs.scm +++ b/dirs.scm @@ -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))) diff --git a/dirs.txi b/dirs.txi old mode 100644 new mode 100755 index 3542374..d8ea60a --- a/dirs.txi +++ b/dirs.txi @@ -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 old mode 100644 new mode 100755 diff --git a/dynamic.scm b/dynamic.scm old mode 100644 new mode 100755 index 3bdd037..9c30e7e --- 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 old mode 100644 new mode 100755 diff --git a/elk.init b/elk.init old mode 100644 new mode 100755 diff --git a/eval.scm b/eval.scm old mode 100644 new mode 100755 diff --git a/factor.scm b/factor.scm old mode 100644 new mode 100755 index c445004..a008fb2 --- 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 old mode 100644 new mode 100755 diff --git a/fdl.texi b/fdl.texi old mode 100644 new mode 100755 index 6c91624..8805f1a --- a/fdl.texi +++ b/fdl.texi @@ -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 +; +;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 old mode 100644 new mode 100755 diff --git a/format.scm b/format.scm old mode 100644 new mode 100755 diff --git a/format.texi b/format.texi old mode 100644 new mode 100755 index 34d5e0a..e662331 --- 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 old mode 100644 new mode 100755 diff --git a/gambit.init b/gambit.init old mode 100644 new mode 100755 index dce1a07..d96ab96 --- 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 old mode 100644 new mode 100755 index 4f9105f..6d9b569 --- 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 old mode 100644 new mode 100755 diff --git a/getparam.scm b/getparam.scm old mode 100644 new mode 100755 index 21d7d39..3c8cb93 --- 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 old mode 100644 new mode 100755 diff --git a/glob.scm b/glob.scm old mode 100644 new mode 100755 diff --git a/glob.txi b/glob.txi old mode 100644 new mode 100755 index 1fc2d87..f5a08be --- a/glob.txi +++ b/glob.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 old mode 100644 new mode 100755 index 4d41fd9..1f59e65 --- 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 old mode 100644 new mode 100755 index 857829c..7f7a465 --- 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: @@ -313,6 +373,14 @@ ;;@item Symbol ;;@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. @@ -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 old mode 100644 new mode 100755 index a889dd0..6e975ec --- 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 @@ -194,6 +228,14 @@ The base set of PostScript fonts is: @item Symbol @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 ) ) +;@ +(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 ) + getenv ;posix (getenv ) + 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 . ) +(define* (file-position port #:optional k) + (if k + (seek port k SEEK_SET) + (ftell port))) + +;;; (OUTPUT-PORT-WIDTH ) +(define (output-port-width . arg) 79) + +;;; (OUTPUT-PORT-HEIGHT ) +(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 ) + (save-module-excursion + (lambda () + (set-current-module slib-module) + (load (string-append (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 >=? >=) + +(slib:load (in-vicinity (library-vicinity) "require")) diff --git a/guile.init b/guile.init old mode 100644 new mode 100755 index 1b59833..a728e33 --- 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.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") + 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 () - (load-file (string-append (scheme-file-suffix)))))) - )) + (load-file (string-append (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/hash.scm b/hash.scm old mode 100644 new mode 100755 diff --git a/hashtab.scm b/hashtab.scm old mode 100644 new mode 100755 diff --git a/hashtab.txi b/hashtab.txi old mode 100644 new mode 100755 diff --git a/html4each.scm b/html4each.scm old mode 100644 new mode 100755 index f115616..bfb1972 --- 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? " 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 + SLIB 3b5, released January 2015. | + Aubrey Jaffer 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 `', @@ -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, , hereby affirm that I have placed the software package 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: , , <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. -ADDENDUM: How to use this License for your documents | -==================================================== | + "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. + + +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 diff --git a/slib.nsi b/slib.nsi index 91e2b7b..540b134 100644 --- a/slib.nsi +++ b/slib.nsi @@ -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" diff --git a/slib.sh b/slib.sh index 2401d14..fd0ef04 100755 --- a/slib.sh +++ b/slib.sh @@ -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 diff --git a/slib.spec b/slib.spec index 558596a..8526d9d 100644 --- a/slib.spec +++ b/slib.spec @@ -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 old mode 100644 new mode 100755 index b9d9cd7..d65a541 --- 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 old mode 100644 new mode 100755 index 990fa3d..d794332 --- 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 old mode 100644 new mode 100755 index 3251b13..35fb04d --- 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 diff --git a/sort.scm b/sort.scm old mode 100644 new mode 100755 index ab5f896..c06c834 --- a/sort.scm +++ b/sort.scm @@ -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 old mode 100644 new mode 100755 diff --git a/srfi-1.scm b/srfi-1.scm old mode 100644 new mode 100755 index 405f5a4..485b0c7 --- 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 old mode 100644 new mode 100755 diff --git a/srfi-11.scm b/srfi-11.scm old mode 100644 new mode 100755 diff --git a/srfi-2.scm b/srfi-2.scm old mode 100644 new mode 100755 diff --git a/srfi-23.scm b/srfi-23.scm old mode 100644 new mode 100755 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 old mode 100644 new mode 100755 diff --git a/srfi-8.scm b/srfi-8.scm old mode 100644 new mode 100755 diff --git a/srfi-9.scm b/srfi-9.scm old mode 100644 new mode 100755 diff --git a/srfi.scm b/srfi.scm old mode 100644 new mode 100755 diff --git a/srfi.txi b/srfi.txi old mode 100644 new mode 100755 diff --git a/stdio.scm b/stdio.scm old mode 100644 new mode 100755 diff --git a/strcase.scm b/strcase.scm old mode 100644 new mode 100755 diff --git a/strport.scm b/strport.scm old mode 100644 new mode 100755 diff --git a/strsrch.scm b/strsrch.scm old mode 100644 new mode 100755 index a730234..53c6e4b --- 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 old mode 100644 new mode 100755 index 5cb6f40..bdc5873 --- 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 old mode 100644 new mode 100755 index 9f84583..949a7a4 --- 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 old mode 100644 new mode 100755 index 17e5a48..d3d8470 --- 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 old mode 100644 new mode 100755 diff --git a/synclo.scm b/synclo.scm old mode 100644 new mode 100755 index 5c7bb9f..d435d3a --- 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 old mode 100644 new mode 100755 diff --git a/t3.init b/t3.init old mode 100644 new mode 100755 diff --git a/timecore.scm b/timecore.scm old mode 100644 new mode 100755 index 4393cdd..057e2fc --- 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 old mode 100644 new mode 100755 diff --git a/top-refs.scm b/top-refs.scm old mode 100644 new mode 100755 diff --git a/top-refs.txi b/top-refs.txi old mode 100644 new mode 100755 diff --git a/trace.scm b/trace.scm old mode 100644 new mode 100755 index 690836c..9ac13fe --- 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 old mode 100644 new mode 100755 index 5dfbeb6..2928e17 --- 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 old mode 100644 new mode 100755 diff --git a/tree.scm b/tree.scm old mode 100644 new mode 100755 diff --git a/tree.txi b/tree.txi old mode 100644 new mode 100755 diff --git a/trnscrpt.scm b/trnscrpt.scm old mode 100644 new mode 100755 index d801621..844e115 --- 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 old mode 100644 new mode 100755 diff --git a/tsort.txi b/tsort.txi old mode 100644 new mode 100755 diff --git a/tzfile.scm b/tzfile.scm old mode 100644 new mode 100755 index 7495dce..ed8f2c5 --- 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 old mode 100644 new mode 100755 diff --git a/uri.scm b/uri.scm old mode 100644 new mode 100755 index 9a0db0b..c76b25a --- a/uri.scm +++ b/uri.scm @@ -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/uri.txi b/uri.txi old mode 100644 new mode 100755 diff --git a/values.scm b/values.scm old mode 100644 new mode 100755 index 23d3a1b..ff56c49 --- 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 old mode 100644 new mode 100755 index 29ac912..22a8994 --- 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/vet.scm b/vet.scm old mode 100644 new mode 100755 diff --git a/vet.txi b/vet.txi old mode 100644 new mode 100755 diff --git a/vscm.init b/vscm.init old mode 100644 new mode 100755 diff --git a/withfile.scm b/withfile.scm old mode 100644 new mode 100755 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 old mode 100644 new mode 100755 index 43620d6..60f25c3 --- 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 old mode 100644 new mode 100755 index 3c02942..da9a7fd --- 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 old mode 100644 new mode 100755 index 365d914..c585d92 --- 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 diff --git a/yasyn.scm b/yasyn.scm old mode 100644 new mode 100755 -- cgit v1.2.3