diff --git a/benchmarks.larceny/results.Larceny-r6rs b/benchmarks.larceny/results.Larceny-r6rs index 7eca1c3..2d7d542 100644 --- a/benchmarks.larceny/results.Larceny-r6rs +++ b/benchmarks.larceny/results.Larceny-r6rs @@ -8210,3 +8210,112 @@ Words allocated: 358610884 Words reclaimed: 0 Elapsed time...: 3289 ms (User: 3248 ms; System: 39 ms) Elapsed GC time: 486 ms (CPU: 489 in 1368 collections.) + +**************************** +Benchmarking Larceny-r6rs on Fri Sep 14 06:26:30 EDT 2007 under Darwin adsl-66-72-39-123.dsl.bltnin.ameritech.net 8.10.1 Darwin Kernel Version 8.10.1: Wed May 23 16:33:00 PDT 2007; root:xnu-792.22.5~1/RELEASE_I386 i386 i386 + +Testing gcold under Larceny-r6rs +Compiling... +Larceny v0.93 "Deviated Prevert" (Nov 10 2006 04:27:45, precise:BSD Unix:unified) + + +> +> +Running... +Larceny v0.93 "Deviated Prevert" (Nov 10 2006 04:27:45, precise:BSD Unix:unified) + + +> 25 megabytes +0 work units per step. +promotion ratio is 1:10 +pointer mutation rate is 10 +10000 steps +Allocating 76 trees. + (24902160 bytes) + (1245108 nodes) +Initialization complete... + +Words allocated: 2754231001 +Words reclaimed: 0 +Elapsed time...: 25179 ms (User: 20872 ms; System: 4148 ms) +Elapsed GC time: 13554 ms (CPU: 13553 in 10508 collections.) + +**************************** +Benchmarking Larceny-r6rs on Fri Sep 14 06:34:37 EDT 2007 under Darwin adsl-66-72-39-123.dsl.bltnin.ameritech.net 8.10.1 Darwin Kernel Version 8.10.1: Wed May 23 16:33:00 PDT 2007; root:xnu-792.22.5~1/RELEASE_I386 i386 i386 + +Testing paraffins under Larceny-r6rs +Compiling... +Larceny v0.93 "Deviated Prevert" (Nov 10 2006 04:27:45, precise:BSD Unix:unified) + + +> +> +Running... +Larceny v0.93 "Deviated Prevert" (Nov 10 2006 04:27:45, precise:BSD Unix:unified) + + +> +Words allocated: 201324946 +Words reclaimed: 0 +Elapsed time...: 4422 ms (User: 3824 ms; System: 566 ms) +Elapsed GC time: 2542 ms (CPU: 2529 in 768 collections.) + +**************************** +Benchmarking Larceny-r6rs on Fri Sep 14 06:38:58 EDT 2007 under Darwin adsl-66-72-39-123.dsl.bltnin.ameritech.net 8.10.1 Darwin Kernel Version 8.10.1: Wed May 23 16:33:00 PDT 2007; root:xnu-792.22.5~1/RELEASE_I386 i386 i386 + +Testing parsing under Larceny-r6rs +Compiling... +Larceny v0.93 "Deviated Prevert" (Nov 10 2006 04:27:45, precise:BSD Unix:unified) + + +> +> +Running... +Larceny v0.93 "Deviated Prevert" (Nov 10 2006 04:27:45, precise:BSD Unix:unified) + + +> +Words allocated: 100923740 +Words reclaimed: 0 +Elapsed time...: 6650 ms (User: 6528 ms; System: 80 ms) +Elapsed GC time: 301 ms (CPU: 285 in 385 collections.) + +**************************** +Benchmarking Larceny-r6rs on Fri Sep 14 06:44:41 EDT 2007 under Darwin adsl-66-72-39-123.dsl.bltnin.ameritech.net 8.10.1 Darwin Kernel Version 8.10.1: Wed May 23 16:33:00 PDT 2007; root:xnu-792.22.5~1/RELEASE_I386 i386 i386 + +Testing ray under Larceny-r6rs +Compiling... +Larceny v0.93 "Deviated Prevert" (Nov 10 2006 04:27:45, precise:BSD Unix:unified) + + +> +> +Running... +Larceny v0.93 "Deviated Prevert" (Nov 10 2006 04:27:45, precise:BSD Unix:unified) + + +> +Words allocated: 218092882 +Words reclaimed: 0 +Elapsed time...: 23372 ms (User: 13257 ms; System: 9921 ms) +Elapsed GC time: 291 ms (CPU: 309 in 832 collections.) + +**************************** +Benchmarking Larceny-r6rs on Fri Sep 14 06:54:40 EDT 2007 under Darwin adsl-66-72-39-123.dsl.bltnin.ameritech.net 8.10.1 Darwin Kernel Version 8.10.1: Wed May 23 16:33:00 PDT 2007; root:xnu-792.22.5~1/RELEASE_I386 i386 i386 + +Testing slatex under Larceny-r6rs +Compiling... +Larceny v0.93 "Deviated Prevert" (Nov 10 2006 04:27:45, precise:BSD Unix:unified) + + +> +> +Running... +Larceny v0.93 "Deviated Prevert" (Nov 10 2006 04:27:45, precise:BSD Unix:unified) + + +> +Words allocated: 4193866 +Words reclaimed: 0 +Elapsed time...: 2013 ms (User: 534 ms; System: 749 ms) +Elapsed GC time: 8 ms (CPU: 11 in 16 collections.) diff --git a/benchmarks/BUGS b/benchmarks/BUGS index 5394358..d782e96 100644 --- a/benchmarks/BUGS +++ b/benchmarks/BUGS @@ -1,8 +1,8 @@ * maze needs bitwise-and * quicksort needs bignum modulo. * scheme needs complex? and other stuff. -* slatex needs char-alphabetic? * compiler needs string-downcase +* nbody needs real-part * ntakl kinda slow * string too slow diff --git a/benchmarks/r6rs-benchmarks.ss b/benchmarks/r6rs-benchmarks.ss index ac87c10..7305fac 100644 --- a/benchmarks/r6rs-benchmarks.ss +++ b/benchmarks/r6rs-benchmarks.ss @@ -45,6 +45,7 @@ ray-iters sboyer-iters simplex-iters + slatex-iters sum-iters sum1-iters string-iters diff --git a/benchmarks/r6rs-benchmarks/fft.ss b/benchmarks/r6rs-benchmarks/fft.ss index 7831381..bce04c0 100644 --- a/benchmarks/r6rs-benchmarks/fft.ss +++ b/benchmarks/r6rs-benchmarks/fft.ss @@ -4,7 +4,7 @@ (export main) (import (r6rs) (r6rs arithmetic flonums) (r6rs-benchmarks)) - (define flsin sin) + ;(define flsin sin) (define (four1 data) (let ((n (vector-length data)) diff --git a/benchmarks/r6rs-benchmarks/graphs.ss b/benchmarks/r6rs-benchmarks/graphs.ss index 0737cec..734c0e3 100644 --- a/benchmarks/r6rs-benchmarks/graphs.ss +++ b/benchmarks/r6rs-benchmarks/graphs.ss @@ -59,11 +59,12 @@ ((= i len) state))))) - (define vector-map - (lambda (vec proc) - (proc->vector (vector-length vec) - (lambda (i) - (proc (vector-ref vec i)))))) + ; AZIZ: r6rs has vector-map, this is not even used + ;(define vector-map + ; (lambda (vec proc) + ; (proc->vector (vector-length vec) + ; (lambda (i) + ; (proc (vector-ref vec i)))))) ; Given limit, return the list 0, 1, ..., limit-1. (define giota diff --git a/benchmarks/r6rs-benchmarks/maze.ss b/benchmarks/r6rs-benchmarks/maze.ss index 53b849a..9ab29ed 100644 --- a/benchmarks/r6rs-benchmarks/maze.ss +++ b/benchmarks/r6rs-benchmarks/maze.ss @@ -196,8 +196,8 @@ (define (set-cell:mark o v) (vector-set! o 5 v)) ;;; Iterates in reverse order. - - (define (vector-for-each proc v) + ;;; AZIZ: appended rev to the name + (define (vector-for-each-rev proc v) (let lp ((i (- (vector-length v) 1))) (cond ((>= i 0) (proc (vector-ref v i)) @@ -222,7 +222,7 @@ (define (dig-maze walls ncells) (call-with-current-continuation (lambda (quit) - (vector-for-each + (vector-for-each-rev (lambda (wall) ; For each wall, (let* ((c1 (wall:owner wall)) ; find the cells on (set1 (cell:reachable c1)) @@ -373,7 +373,7 @@ (define (harr-for-each proc harr) - (vector-for-each proc (harr:elts harr))) + (vector-for-each-rev proc (harr:elts harr))) ;------------------------------------------------------------------------------ ; Was file "hex.scm". diff --git a/benchmarks/r6rs-benchmarks/slatex.ss b/benchmarks/r6rs-benchmarks/slatex.ss index 80bfa57..fdc4129 100644 --- a/benchmarks/r6rs-benchmarks/slatex.ss +++ b/benchmarks/r6rs-benchmarks/slatex.ss @@ -2345,4 +2345,4 @@ slatex-iters (lambda (result) #t) (lambda (filename) (lambda () (slatex.process-main-tex-file filename))) - "../../src/test"))) + "r6rs-benchmarks/slatex-data/test"))) diff --git a/benchmarks/r6rs-benchmarks/todo-src/slatex.sty b/benchmarks/r6rs-benchmarks/todo-src/slatex.sty deleted file mode 100644 index f487e6b..0000000 --- a/benchmarks/r6rs-benchmarks/todo-src/slatex.sty +++ /dev/null @@ -1,547 +0,0 @@ -% slatex.sty -% SLaTeX v. 2.2 -% style file to be used in (La)TeX when using SLaTeX -% (c) Dorai Sitaram, Rice U., 1991, 1994 - -% This file (or a soft link to it) should be in some -% directory in your TEXINPUTS path (i.e., the one -% (La)TeX scours for \input or \documentstyle option -% files). - -% Do not attempt to debug this file, since the results -% are not transparent just to (La)TeX. The Scheme part -% of SLaTeX depends on information laid out here -- so -% (La)TeX-minded debugging of this file will almost -% inevitably sabotage SLaTeX. - -% It's possible you don't find the default style set -% out here appealing: e.g., you may want to change the -% positioning of displayed code; change the fonts for -% keywords, constants, and variables; add new keywords, -% constants, and variables; use your names instead of -% the provided \scheme, [\begin|\end]{schemedisplay}, -% [\begin|\end]{schemebox}, (or \[end]schemedisplay, -% \[end]schemebox for TeX), which might be seem too -% long or unmnemonic, and many other things. The clean -% way to do these things is outlined in the -% accompanying manual, slatex-d.tex. This way is both -% easier than messing with this .sty file, and safer -% since you will not unwittingly break SLaTeX. - -%%% - -% to prevent loading slatex.sty more than once - -\ifx\slatexignorecurrentfile\UNDEFINED -\else\endinput\fi - -% use \slatexignorecurrentfile to disable slatex for -% the current file. (Unstrangely, the very definition -% disables slatex for the rest of _this_ file, slatex.sty.) - -\def\slatexignorecurrentfile{} - -% checking whether we're using LaTeX or TeX? - -\newif\ifusinglatex -\ifx\newenvironment\UNDEFINED\usinglatexfalse\else\usinglatextrue\fi - -% make @ a letter for TeX -\ifusinglatex\relax\else -\edef\atcatcodebeforeslatex{\the\catcode`@} -\catcode`@11 -\fi - -% identification of TeX/LaTeX style for schemedisplay. -% Do \defslatexenvstyle{tex} to get TeX environment -% style in LaTeX -\def\defslatexenvstyle#1{\gdef\slatexenvstyle{#1}} - -\ifusinglatex\defslatexenvstyle{latex}\else\defslatexenvstyle{tex}\fi - -% TeX doesn't have sans-serif; use roman instead -\ifx\sf\UNDEFINED\def\sf{\rm}\fi - -% tabbing from plain TeX -% -\newif\ifus@ \newif\if@cr -\newbox\tabs \newbox\tabsyet \newbox\tabsdone -% -\def\cleartabs{\global\setbox\tabsyet\null \setbox\tabs\null} -\def\settabs{\setbox\tabs\null \futurelet\next\sett@b} -\let\+=\relax % in case this file is being read in twice -\def\sett@b{\ifx\next\+\let\next\relax - \def\next{\afterassignment\s@tt@b\let\next}% -\else\let\next\s@tcols\fi\next} -\def\s@tt@b{\let\next\relax\us@false\m@ketabbox} -\def\tabalign{\us@true\m@ketabbox} % non-\outer version of \+ -\outer\def\+{\tabalign} -\def\s@tcols#1\columns{\count@#1 \dimen@\hsize - \loop\ifnum\count@>\z@ \@nother \repeat} -\def\@nother{\dimen@ii\dimen@ \divide\dimen@ii\count@ - \setbox\tabs\hbox{\hbox to\dimen@ii{}\unhbox\tabs}% - \advance\dimen@-\dimen@ii \advance\count@\m@ne} -% -\def\m@ketabbox{\begingroup - \global\setbox\tabsyet\copy\tabs - \global\setbox\tabsdone\null - \def\cr{\@crtrue\crcr\egroup\egroup - \ifus@\unvbox\z@\lastbox\fi\endgroup - \setbox\tabs\hbox{\unhbox\tabsyet\unhbox\tabsdone}}% - \setbox\z@\vbox\bgroup\@crfalse - \ialign\bgroup&\t@bbox##\t@bb@x\crcr} -% -\def\t@bbox{\setbox\z@\hbox\bgroup} -\def\t@bb@x{\if@cr\egroup % now \box\z@ holds the column - \else\hss\egroup \global\setbox\tabsyet\hbox{\unhbox\tabsyet - \global\setbox\@ne\lastbox}% now \box\@ne holds its size - \ifvoid\@ne\global\setbox\@ne\hbox to\wd\z@{}% - \else\setbox\z@\hbox to\wd\@ne{\unhbox\z@}\fi - \global\setbox\tabsdone\hbox{\box\@ne\unhbox\tabsdone}\fi - \box\z@} -% finished (re)defining TeX's tabbing macros - -% above from plain.tex; was disabled in lplain.tex. Do -% not modify above unless you really know what you're -% up to. Make all changes you want to following code. -% The new env is preferable to LaTeX's tabbing env -% since latter accepts only a small number of tabs - -% following retrieves something like LaTeX's tabbing -% env without the above problem (it also creates a box -% for easy manipulation!) - -\def\lat@xtabbing{\leavevmode\hbox\bgroup\vbox\bgroup - \def\={\cleartabs&} \def\>{&} \def\\{\cr\tabalign} \tabalign} -\def\endlat@xtabbing{\cr\egroup\egroup} - -%new - -\def\lat@xtabbing{\begingroup -\def\={\cleartabs&} \def\>{&}% -\def\\{\cr\tabalign\lat@xtabbingleftmost}% -\tabalign\lat@xtabbingleftmost} -\def\endlat@xtabbing{\cr\endgroup} -\let\lat@xtabbingleftmost\relax - -% stuff for formating Scheme code - -\newskip\par@nlen \newskip\brack@tlen \newskip\quot@len -\newskip\h@lflambda - -\newbox\garb@ge -\def\s@ttowidth#1#2{\setbox\garb@ge\hbox{#2}#1\wd\garb@ge\relax} - -\s@ttowidth\par@nlen{$($} % size of paren -\s@ttowidth\brack@tlen{$[$} % size of bracket -\s@ttowidth\quot@len{'} % size of quote indentation -\s@ttowidth\h@lflambda{ii} % size of half of lambda indentation - -\def\PRN{\hskip\par@nlen} % these are used by SLaTeX's codesetter -\def\BKT{\hskip\brack@tlen} -\def\QUO{\hskip\quot@len} -\def\HL{\hskip\h@lflambda} - -\newskip\abovecodeskip \newskip\belowcodeskip -\newskip\leftcodeskip \newskip\rightcodeskip - -% the following default assignments give a flushleft -% display - -\abovecodeskip=\medskipamount \belowcodeskip=\medskipamount -\leftcodeskip=0pt \rightcodeskip=0pt - -% adjust above,below,left,right codeskip's to personal -% taste - -% for centered displays -% -% \leftcodeskip=0pt plus 1fil -% \rightcodeskip=0pt plus 1fil -% -% if \rightcodeskip != 0pt, pagebreaks within Scheme -% blocks in {schemedisplay} are disabled - -\def\checkfollpar{\futurelet\next\checkfollparII} -\def\checkfollparII{\ifx\next\par\let\next\relax -\else\par\noindent\let\next\ignorespaces\fi\next} - -% the following are the default font assignments for -% words in code. Change them to suit personal taste - -\def\keywordfont#1{{\bf #1}} -\def\variablefont#1{{\it #1\/}} -\def\constantfont#1{{\sf #1}} -\def\datafont#1{\constantfont{#1}} - -\def\schemecodehook{} - -%program listings that allow page breaks but -%can't be centered - -\def\ZZZZschemedisplay{\edef\thez@skip{\the\z@skip}% -\edef\@tempa{\the\rightcodeskip}% -\ifx\@tempa\thez@skip\let\next\ZZZZschemeprogram -\else\let\next\ZZZZschemeprogramII\fi\next} - -\def\endZZZZschemedisplay{\edef\thez@skip{\the\z@skip}% -\edef\@tempa{\the\rightcodeskip}% -\ifx\@tempa\thez@skip\let\next\endZZZZschemeprogram -\else\let\next\endZZZZschemeprogramII\fi\next} - -\def\ZZZZschemeprogram{\vskip\abovecodeskip -\begingroup -\schemecodehook -\let\sy=\keywordfont \let\cn=\constantfont -\let\va=\variablefont \let\dt=\datafont -\def\lat@xtabbingleftmost{\hskip\leftcodeskip\relax}% -\lat@xtabbing} - -\def\endZZZZschemeprogram{\endlat@xtabbing -\endgroup -\vskip\belowcodeskip -\ifusinglatex\let\next\@endparenv -\else\let\next\checkfollpar\fi\next} - -\def\ZZZZschemeprogramII{\vskip\abovecodeskip -\begingroup -\noindent -%\schemecodehook %\ZZZZschemebox already has it -\hskip\leftcodeskip -\ZZZZschemebox} - -\def\endZZZZschemeprogramII{\endZZZZschemebox -\hskip\rightcodeskip -\endgroup -\vskip\belowcodeskip -\ifusinglatex\let\next\@endparenv -\else\let\next\checkfollpar\fi\next} - -% - -\def\ZZZZschemebox{% -\leavevmode\hbox\bgroup\vbox\bgroup -\schemecodehook -\let\sy=\keywordfont \let\cn=\constantfont -\let\va=\variablefont \let\dt=\datafont -\lat@xtabbing} -\def\endZZZZschemebox{\endlat@xtabbing -\egroup\egroup\ignorespaces} - -%in-text - -\def\ZZZZschemecodeintext{\begingroup - \let\sy\keywordfont \let\cn\constantfont - \let\va\variablefont \let\dt\datafont} - -\def\endZZZZschemecodeintext{\endgroup\ignorespaces} - -\def\ZZZZschemeresultintext{\begingroup - \let\sy\datafont \let\cn\constantfont - \let\va\datafont \let\dt\datafont} - -\def\endZZZZschemeresultintext{\endgroup\ignorespaces} - -% \comm@nt...text... comments out -% TeX source analogous to -% \verb...text.... Sp. case: -% \comm@nt{...text...} == \comm@nt}...text...} - -\def\@makeother#1{\catcode`#112\relax} - -\def\comm@nt{% - \begingroup - \let\do\@makeother \dospecials - \@comm} - -\begingroup\catcode`\<1\catcode`\>2 -\catcode`\{12\catcode`\}12 -\long\gdef\@comm#1<% - \if#1{\long\def\@tempa ##1}<\endgroup>\else - \long\def\@tempa ##1#1<\endgroup>\fi - \@tempa> -\endgroup - -% input file if possible, else relax - -\def\inputifpossible#1{% - \immediate\openin0=#1\relax% - \ifeof0\relax\else\input#1\relax\fi% - \immediate\closein0} - -\def\ZZZZinput#1{\input#1\relax} - -% you may replace the above by -% -% \def\ZZZZinput#1{\inputifpossible{#1}} -% -% if you just want to call (La)TeX on your text -% ignoring the portions that need to be SLaTeX'ed - -%use \subjobname rather than \jobname to generate -%slatex's temp files --- this allows us to change -%\subjobname for more control, if necessary. - -\let\subjobname\jobname - -% counter for generating temp file names - -\newcount\sch@mefilenamecount -\sch@mefilenamecount=-1 - -% To produce displayed Scheme code: -% in LaTeX: -% \begin{schemedisplay} -% ... indented program (with sev'l lines) ... -% \end{schemedisplay} -% -% in TeX: -% \schemedisplay -% ... indented program (with sev'l lines) ... -% \endschemedisplay - -\begingroup\catcode`\|=0\catcode`\[=1\catcode`\]=2% -\catcode`\{=12\catcode`\}=12\catcode`\\=12% -|gdef|defschemedisplaytoken#1[% - |long|expandafter|gdef|csname ZZZZcomment#1|endcsname[% - |begingroup - |let|do|@makeother |dospecials - |csname ZZZZcomment|slatexenvstyle II#1|endcsname]% - |long|expandafter|gdef|csname ZZZZcommentlatexII#1|endcsname##1\end{#1}[% - |endgroup|end[#1]]% - |long|expandafter|gdef|csname ZZZZcommenttexII#1|endcsname##1\end#1[% - |endgroup|csname end#1|endcsname]% - |long|expandafter|gdef|csname #1|endcsname[% - |global|advance|sch@mefilenamecount by 1|relax% - |ZZZZinput[|filehider Z|number|sch@mefilenamecount|subjobname.tex]% - |csname ZZZZcomment#1|endcsname]% - |long|expandafter|gdef|csname end#1|endcsname[]]% -|endgroup - -\defschemedisplaytoken{schemedisplay} - -\def\undefschemedisplaytoken#1{% - \expandafter\gdef\csname#1\endcsname{\UNDEFINED}} - -% \scheme|...program fragment...| produces Scheme code -% in-text. Sp. case: \scheme{...} == \scheme}...} - -\def\defschemetoken#1{% - \long\expandafter\def\csname#1\endcsname{% - \global\advance\sch@mefilenamecount by 1\relax% - \ZZZZinput{\filehider Z\number\sch@mefilenamecount\subjobname.tex}% - \comm@nt}} -\defschemetoken{scheme} - -\def\undefschemetoken#1{% - \expandafter\gdef\csname#1\endcsname{\UNDEFINED}} - -% \schemeresult|...program fragment...| produces a -% Scheme code result in-text: i.e. keyword or variable -% fonts are replaced by the data font. Sp. case: -% \schemeresult{...} == \schemeresult}...} - -\def\defschemeresulttoken#1{% - \long\expandafter\def\csname#1\endcsname{% - \global\advance\sch@mefilenamecount by 1\relax% - \ZZZZinput{\filehider Z\number\sch@mefilenamecount\subjobname.tex}% - \comm@nt}} -\defschemeresulttoken{schemeresult} - -\def\undefschemeresulttoken#1{% - \expandafter\gdef\csname#1\endcsname{\UNDEFINED}} - -% To produce a box of Scheme code: -% in LaTeX: -% \begin{schemebox} -% ... indented program (with sev'l lines) ... -% \end{schemebox} -% -% in TeX: -% \schemebox -% ... indented program (with sev'l lines) ... -% \endschemebox - -\begingroup\catcode`\|=0\catcode`\[=1\catcode`\]=2% -\catcode`\{=12\catcode`\}=12\catcode`\\=12% -|gdef|defschemeboxtoken#1[% - |long|expandafter|gdef|csname ZZZZcomment#1|endcsname[% - |begingroup - |let|do|@makeother |dospecials - |csname ZZZZcomment|slatexenvstyle II#1|endcsname]% - |long|expandafter|gdef|csname ZZZZcommentlatexII#1|endcsname##1\end{#1}[% - |endgroup|end[#1]]% - |long|expandafter|gdef|csname ZZZZcommenttexII#1|endcsname##1\end#1[% - |endgroup|csname end#1|endcsname]% - |long|expandafter|gdef|csname #1|endcsname[% - |global|advance|sch@mefilenamecount by 1|relax% - |ZZZZinput[|filehider Z|number|sch@mefilenamecount|subjobname.tex]% - |csname ZZZZcomment#1|endcsname]% - |long|expandafter|gdef|csname end#1|endcsname[]]% -|endgroup - -\defschemeboxtoken{schemebox} - -\def\undefschemeboxtoken#1{% - \expandafter\gdef\csname#1\endcsname{\UNDEFINED}} - -% for wholesale dumping of all-Scheme files into TeX (converting -% .scm files to .tex), -% use -% \schemeinput{} -% .scm, .ss, .s extensions optional - -\def\defschemeinputtoken#1{% - \long\expandafter\gdef\csname#1\endcsname##1{% - \global\advance\sch@mefilenamecount by 1\relax% - \ZZZZinput{\filehider Z\number\sch@mefilenamecount\subjobname.tex}}} -\defschemeinputtoken{schemeinput} - -\def\undefschemeinputtoken#1{% - \expandafter\gdef\csname#1\endcsname{\UNDEFINED}} - -% delineating a region that features typeset code -% not usually needed, except when using \scheme and schemedisplay -% inside macro-args and macro-definition-bodies -% in LaTeX: -% \begin{schemeregion} -% ... -% \end{schemeregion} -% -% in TeX: -% \schemeregion -% ... -% \endschemeregion - -\begingroup\catcode`\|=0\catcode`\[=1\catcode`\]=2% -\catcode`\{=12\catcode`\}=12\catcode`\\=12% -|gdef|defschemeregiontoken#1[% - |long|expandafter|gdef|csname ZZZZcomment#1|endcsname[% - |begingroup - |let|do|@makeother |dospecials - |csname ZZZZcomment|slatexenvstyle II#1|endcsname]% - |long|expandafter|gdef|csname ZZZZcommentlatexII#1|endcsname##1\end{#1}[% - |endgroup|end[#1]]% - |long|expandafter|gdef|csname ZZZZcommenttexII#1|endcsname##1\end#1[% - |endgroup|csname end#1|endcsname]% - |long|expandafter|gdef|csname #1|endcsname[% - |global|advance|sch@mefilenamecount by 1|relax% - |ZZZZinput[|filehider Z|number|sch@mefilenamecount|subjobname.tex]% - |csname ZZZZcomment#1|endcsname]% - |long|expandafter|gdef|csname end#1|endcsname[]]% -|endgroup - -\defschemeregiontoken{schemeregion} - -\def\undefschemeregiontoken#1{% - \expandafter\gdef\csname#1\endcsname{\UNDEFINED}} - -% introducing new code-tokens to the keyword, variable and constant -% categories - -\def\comm@ntII{% - \begingroup - \let\do\@makeother \dospecials - \@commII} - -\begingroup\catcode`\[1\catcode`\]2 -\catcode`\{12\catcode`\}12 -\long\gdef\@commII{[% - \long\def\@tempa ##1}[\endgroup]\@tempa]% -\endgroup - -\let\setkeyword\comm@ntII -\let\setvariable\comm@ntII -\let\setconstant\comm@ntII - -% \defschememathescape makes the succeeding grouped character an -% escape into latex math from within Scheme code; -% this character can't be } - -\let\defschememathescape\comm@ntII -\let\undefschememathescape\comm@ntII - -% telling SLaTeX that a certain Scheme identifier is to -% be replaced by the specified LaTeX expression. -% Useful for generating ``mathematical''-looking -% typeset code even though the corresponding Scheme -% code is ascii as usual and doesn't violate -% identifier-naming rules - -\def\setspecialsymbol{% - \begingroup - \let\do\@makeother \dospecials - \@commIII} - -\begingroup\catcode`\[1\catcode`\]2 -\catcode`\{12\catcode`\}12 -\long\gdef\@commIII{[% - \long\def\@tempa ##1}[\endgroup\@gobbleI]\@tempa]% -\endgroup - -\def\@gobbleI#1{} - -% \unsetspecialsymbol strips Scheme identifier(s) of -% any ``mathematical'' look lent by the above - -\let\unsetspecialsymbol\comm@ntII - -% enabling/disabling slatex - -\def\slatexdisable#1{\expandafter\gdef\csname#1\endcsname{}} - -% \schemecasesensitive takes either true or false as -% argument - -\def\schemecasesensitive#1{} - -%for latex only: use \slatexseparateincludes before the -%occurrence of any Scheme code in your file, if you -%want the various \include'd files to have their own -%pool of temporary slatex files. This lets you juggle -%your \include's in successive runs of LaTeX without -%having to worry that the temp. files may interfere. -%By default, only a single pool of temp files is used. -%Warning: On DOS, if your \include'd files have fairly -%similar names, avoid \slatexseparateincludes since the -%short filenames on DOS will likely confuse the temp -%file pools of different \include files. - -\def\slatexseparateincludes{% -\gdef\include##1{{\def\subjobname{##1}% -\sch@mefilenamecount=-1% -\@include##1 }}} - -% convenient abbreviations for characters - -\begingroup -\catcode`\|=0 -|catcode`|\=12 -|gdef|ttbackslash{{|tt|catcode`|\=12\}} -|endgroup -\mathchardef\lt="313C -\mathchardef\gt="313E -\begingroup - \catcode`\@12% - \global\let\atsign@% -\endgroup -\chardef\dq=`\" - -% leading character of slatex filenames: . for unix to -% keep them out of the way - -\def\filehider{.} - -% since the above doesn't work of dos, slatex on dos -% will use a different character, and make the -% redefinition available through the following - -\inputifpossible{xZfilhid.tex} - -% @ is no longer a letter for TeX - -\ifusinglatex\relax\else -\catcode`@\atcatcodebeforeslatex -\fi - -\message{*** Check: Are you sure you called SLaTeX? ***} diff --git a/benchmarks/r6rs-benchmarks/todo-src/test.tex b/benchmarks/r6rs-benchmarks/todo-src/test.tex deleted file mode 100644 index 41a3daf..0000000 --- a/benchmarks/r6rs-benchmarks/todo-src/test.tex +++ /dev/null @@ -1,1658 +0,0 @@ -%slatex-d.tex -%SLaTeX Version 2 -%Documentation for SLaTeX -%(c) Dorai Sitaram, 1991, 1994 -%dorai@cs.rice.edu - -\documentstyle[../../src/slatex]{article} - -\slatexdisable{enableslatex} - -\edef\atcatcodebeforepreamble{\the\catcode`@} -\catcode`@11 - -\inputifpossible{multicol.sty} - -%if Frank Mittelbach's multicol.sty is not -%available, the index will simply waste some paper - -%latex wastes too much paper, so... - -\textheight 11in -\textwidth 8.5in -\oddsidemargin 1.25in -\advance\textheight -2\oddsidemargin -\advance\textwidth -2\oddsidemargin -\advance\oddsidemargin -1in -\evensidemargin\oddsidemargin -\topmargin\oddsidemargin -\advance\topmargin -\headheight -\advance\topmargin -\headsep - -%latex's section headings are way too obnoxiously -%large, so... - -\def\nolargefonts{\let\large\normalsize -\let\Large\normalsize -\let\LARGE\normalsize -\let\huge\normalsize -\let\Huge\normalsize} - -%mini headers for introducing paragraphs - -\def\re{\medbreak\parindent0pt% -\aftergroup\smallskip\obeylines -\llap{$\searrow$\enspace\enspace}} - -%a wide line - -\def\wideline{\centerline{\hrulefill}} - -%smart italics - -\def\italicsbegin{\begingroup\it} -\def\italicsend{\endgroup\futurelet\next\italiccorrection} -\def\italiccorrection{\ifx\next,\else\ifx\next.\else\/\fi\fi} -\def\italicstoggle{\italicsbegin\let\italicstoggle\italicsend} -\catcode`\_\active -\def_{\ifmmode\sb\else\expandafter\italicstoggle\fi} - -%quote.tex, by Hunter Goatley - -{\catcode`\"\active -% -\gdef\begindoublequotes{\global\catcode`\"\active -\global\let\dblqu@te=L} -% -\gdef"{\ifinner\else\ifvmode\let\dblqu@te=L\fi\fi -\if L\dblqu@te``\global\let\dblqu@te=R\else -\let\xxx=\spacefactor -''\global\let\dblqu@te=L% -\spacefactor\xxx -\fi}} - -\def\enddoublequotes{\catcode`\"=12} - -%nicer \verb - -\begingroup\catcode`[1\catcode`]2\catcode`\{12\catcode`\}12% -\gdef\@sverb#1[\if#1{\def\@tempa##1}[\leavevmode\null##1\endgroup]\else -\def\@tempa##1#1[\leavevmode\null##1\endgroup]\fi\@tempa]% -\endgroup - -%nicer \footnote - -\let\latexfootnote\footnote -\def\footnote{\unskip\latexfootnote\bgroup\let\dummy=} - -%item - -\let\o\item - -%index environment that exploits multicol.sty if -%available... - -\renewenvironment{theindex}% -{\parindent0pt% -\let\item\@idxitem -\section*{Index}% -\ifx\multicols\undefined\else -\begin{multicols}{2}\fi}% -{\ifx\multicols\undefined\else -\end{multicols}\fi} - -\catcode`@\atcatcodebeforepreamble - -\begindoublequotes -\makeindex - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\title{How to Use SLaTeX} - -\author{Dorai Sitaram\\ -{\tt dorai@cs.rice.edu}\\ -Department of Computer Science\\ -Rice University\\ -Houston, TX 77251--1892} - -\date{Gestated 1990\\ -First public release, Mar. 1991\\ -First major update, Dec. 1991\\ -Current update, Jan. 1994} - -\begin{document} -\maketitle -\nolargefonts - -\section{Introduction} - -SLaTeX\index{introduction} is a Scheme program -that allows you to write programs or program fragments -"as is" in your TeX or LaTeX source. SLaTeX is -particularly geared to the programming languages Scheme -and other Lisps, e.g., Common Lisp. The formatting of -the code includes assigning appropriate fonts to the -various tokens in the code (keywords, variables, -constants, data), at the same time retaining the proper -indentation when going to the non-monospace -(non-typewriter) fonts provided by TeX. SLaTeX comes -with two databases that recognize the identifier -conventions of Scheme and Common Lisp respectively. -These can be modified by the user using easy TeX -commands. In addition, the user can inform SLaTeX to -typeset certain identifiers as specially suited LaTeX -expressions (i.e., beyond just fonting them). All this -is done without interfering with the identifier -conventions of the language of the programming code at -all. In sum, no change need be made to your -(presumably running) program code in order to get a -typeset version suited to the particular need: you can -get a spectrum of styles ranging from _no_ fonting -through basic default fonting to various -"mathematical"-looking output for pedagogic or other -reasons. - -\enableslatex -Other packages~\cite{schemeweb,lisp2tex} for -typesetting code fragments use a \verb{verbatim} -environment where all the characters are in a -\verb{monospace typewriter font}. This \verb{monospace} -ensures that the indentation is not affected. However, -the resulting output fails to distinguish between the -various tokens used in the code, e.g., boldface for -keywords like -\scheme{define} and \scheme{lambda}, sans-serif for -constants like \scheme{#t} and \scheme{42}, and italics -for variables such as \scheme{x} and -\scheme{y} in \scheme{(lambda (x y) (cons x (cons y -'())))}. -\slatexdisable{enableslatex} - -The program SLaTeX provides a convenient way of -capturing the indentation information as well as -assigning distinguishing fonts to code tokens without -requiring the user to worry about fonting and spacing. -It uses temporary files to store its typeset version of -the user's code fragments and then calls TeX or LaTeX -on the user's TeX files as well as these temporaries. - -The following section will introduce you to the basic -use of SLaTeX with a small example. -Section~\ref{slatex.sty} introduces the SLaTeX style -files. Section~\ref{glossary} gives a complete -description of all the SLaTeX control sequences. These -include commands for manipulating output positioning, -enhancing the database, changing the fonting defaults, -adding special symbols, and selective disabling of -SLaTeX. Section~\ref{preamble} desribes how to set up -a preamble that reflects your typesetting taste. -Section~\ref{ftp} contains information on obtaining and -installing SLaTeX. - -\section{A quick illustration of using SLaTeX} -\label{quick} -\index{quick illustration} - -This section presents a short example of SLaTeX use. -We first look at a LaTeX file using SLaTeX commands, -and then give a plain TeX version of the same file. We -will see that there are minor differences between the -ways SLaTeX is used with plain TeX and LaTeX (but see -\verb{\defslatexenvstyle} for a way to use the -plain-TeX style with the LaTeX format, and conversely, -the LaTeX style with the plain format). - -\subsection{For LaTeX users} -\index{LaTeX} -\index{scheme@\verb{\scheme}} -\index{schemedisplay@\verb{schemedisplay}!in LaTeX} -\index{in-text Scheme code} -\index{displayed Scheme code} -\index{slatex.sty@\verb{slatex.sty}} -\index{slatex.sty@\verb{slatex.sty}!as document style} - -Consider the following LaTeX (_and_ SLaTeX) file -\verb{quick.tex}: - -\wideline -\begin{verbatim} -% quick.tex -\documentstyle[slatex]{article} -%or: -% \documentstyle{article} -% \input slatex.sty - -In Scheme, the expression \scheme|(set! x 42)| returns -an unspecified value, rather than \scheme'42'. -However, one could get a \scheme{set!} of the latter -style by: - -\begin{schemedisplay} -(define-syntax setq - (syntax-rules () - [(setq x a) - (begin (set! x a) - x)])) -\end{schemedisplay} - -\end{document} -\end{verbatim} -\wideline - -First, the SLaTeX definitions in the style file -\verb{slatex.sty} are loaded into your LaTeX file --- -this may be done either as a \verb{\documentstyle} -option, or through an \verb{\input} command. - -\index{scheme@\verb{\scheme}!using grouped argument} - -In-text code is introduced by the SLaTeX control -sequence \verb{\scheme} and is flanked by a pair of -identical characters that are not alphabets or -"\verb|{|". As a special convenient case, SLaTeX also -allows the form \verb|\scheme{...}|. - -The SLaTeX control sequences for displayed code are the -opening \verb|\begin{schemedisplay}| and the closing -\verb|\end{schemedisplay}|. - -The file is now SLaTeX'd by running the command -\verb{slatex} on it from the Unix or DOS command line: - -\begin{verbatim} -slatex quick -\end{verbatim} -or -\begin{verbatim} -slatex quick.tex -\end{verbatim} -This calls a Scheme program \verb{slatex.scm} that -typesets the Scheme code fragments in \verb{quick.tex} -into temporary files. Thereafter, \verb{quick.tex} along with -the temporary files are then passed to LaTeX. (For -information on judiciously reusing temporary files, see -\verb{\slatexseparateincludes}.) -The resulting -\verb{quick.dvi} file, when viewed or printed looks like: - -\enableslatex -\wideline -In Scheme, the expression \scheme|(set! x 42)| returns -an unspecified value, rather than -\scheme'42'. However, one could get a \scheme{set!} of -the latter style by: - -\begin{schemedisplay} -(define-syntax setq - (syntax-rules () - [(setq x a) - (begin (set! x a) - x)])) -\end{schemedisplay} -\wideline - -\index{recognizing new syntactic keywords automatically} - -Note that \scheme{setq}, although not normally a -syntactic keyword in Scheme is nevertheless -automatically recognized as such because of the context -in which it occurs. No special treatment is needed to -ensure that it will continue be treated as such in any -subsequent Scheme code in the document. - -\slatexdisable{enableslatex} - -\subsection{For plain TeX users} -\index{plain TeX} -\index{scheme@\verb{\scheme}} -\index{schemedisplay@\verb{schemedisplay}!in plain TeX} -\index{in-text Scheme code} -\index{displayed Scheme code} - -Plain TeX users invoke SLaTeX much the same way, but -for only two exceptions. First, since TeX doesn't have -\verb{\documentstyle}, the file \verb{slatex.sty} is -introduced via an \verb{\input} statement before its -commands can be used in the plain TeX source. - -\index{environments} - -Second, since plain TeX does not have LaTeX's -\verb|\begin{|_env_\verb|}...\end{|_env_\verb|}| -style of environments, any -environment commands in SLaTeX are invoked with the -opening \verb{\}_env_ and the closing \verb{\end}_env_. - -The plain TeX version of \verb{quick.tex} looks like: - -\wideline -\begin{verbatim} -% quick.tex -\input slatex.sty - -In Scheme, the expression \scheme|(set! x 42)| returns -an unspecified value, rather than \scheme'42'. -However, one could get a \scheme{set!} of the latter -style by: - -\schemedisplay -(define-syntax setq - (syntax-rules () - [(setq x a) - (begin (set! x a) - x)])) -\endschemedisplay - -\bye -\end{verbatim} -\wideline - -The file is now SLaTeX'd by invoking \verb{slatex} as -before --- SLaTeX is clever enough to figure out -whether the file it operates on should later be send to -LaTeX or plain Tex. - -\section{The style files} -\label{slatex.sty} -\index{slatex.sty@\verb{slatex.sty}} - -In short, the LaTeX (or TeX) file that is given to -SLaTeX undergoes some code-setting preprocessing and is -then handed over to LaTeX (or TeX). The style file -\verb{slatex.sty} defines the appropriate commands so -that LaTeX (or TeX) can recognize the SLaTeX-specific -directives and either process or ignore them. You may -either \verb|\input| the file \verb{slatex.sty} as -usual, or use it as the \verb|\documentstyle| option -\verb{slatex}. - -\index{cltl.sty@\verb{cltl.sty}} -\index{SLaTeX database!for Scheme} -\index{SLaTeX database!for Common Lisp} -\index{SLaTeX database!modifying} - -The default database of SLaTeX recognizes the keywords -and constants of Scheme. The database can be modified -with the commands \verb{\setkeyword}, -\verb{\setconstant}, \verb{\setvariable}, -\verb{\setspecialsymbol} and \verb{\unsetspecialsymbol} -(q.v.). If you're using Common Lisp rather than -Scheme, use \verb{cltl.sty} instead of -\verb{slatex.sty}. -\verb{cltl.sty} loads \verb{slatex.sty} and modifies -the database to reflect Common Lisp. You may fashion -your own \verb{.sty} files on the model of -\verb{cltl.sty}. - -\section{SLaTeX's control sequences} -\label{glossary} -\index{SLaTeX control sequences} - -You've already seen the SLaTeX control sequence -\verb|\scheme| and the environment -\verb{schemedisplay}. These suffice for quite a few -instances of handling code. However, you will -occasionally require more control on the typesetting -process, and the rest of this section describes the -complete -\footnote{At least that's what you're supposed -to think...} list of SLaTeX control sequences shows you -the ropes. - -{\re -\verb{schemedisplay}} -\index{schemedisplay@\verb{schemedisplay}} -\index{displayed Scheme code} - -[In plain TeX: \verb{\schemedisplay} ... -\verb{\endschemedisplay}; in LaTeX: -\verb|\begin{schemedisplay}| ... -\verb|\end{schemedisplay}|; but see \verb{\defslatexenvstyle}.] - -Typesets the enclosed code, which is typically several -lines of code indented as you normally do in your -Scheme files. E.g., - -\begin{verbatim} -\begin{schemedisplay} -(define compose ;this is also known as $B$ - (lambda (f g) - (lambda (x) - (apply f (g x))))) -\end{schemedisplay} -is the "compose" function. -\end{verbatim} -produces - -\enableslatex -\begin{schemedisplay} -(define compose ;this is also known as $B$ - (lambda (f g) - (lambda (x) - (apply f (g x))))) -\end{schemedisplay} -\slatexdisable{enableslatex} -is the "compose" function. - -As with all LaTeX environment enders, if the line after -\verb|\end{schemedisplay}| contains -non-whitespace text, the paragraph continues. -Otherwise --- i.e., when \verb|\end{schemedisplay}| is -followed by at least one blank line --- a fresh -paragraph is started. Similarly, in plain TeX, a fresh -paragraph is started after a \verb{schemedisplay} only -if -\verb|\endschemedisplay| is followed by at least one -blank line. - -\index{Scheme comments} - -Comments in Scheme are usually introduced by "\verb{;}" -(semicolon). The rest of the line after a "\verb{;}" -is set as a line in LaTeX LR mode. - -\index{TeX paragraphs amidst Scheme code} - -Separate _blocks_ of code can either be introduced in -different \verb{schemedisplay} environments or put in a -single \verb{schemedisplay} and separated by a line with -a "\verb{;}" in the first column. This "\verb{;}" is -not typeset and anything following it on the line is -set in (La)TeX LR paragraph mode. Consecutive lines -with "\verb{;}" in the first column are treated -as input for a TeX paragraph, with words possibly -moved around from line to line to ensure justification. -When in paragraph mode, the first line that has _no_ -leading "\verb{;}" signals a fresh block -of Scheme code within the -\verb{schemedisplay}. (The \verb{schemedisplay} may -end, or commence, on either a paragraph or a Scheme -code block.) - -E.g., - -\begin{verbatim} -\begin{schemedisplay} -(define even? ; testing evenness - (lambda (n) - (if (= n 0) #t (not (odd? (- n 1)))))) -; The procedures {\it even?} above -; and {\it odd?} below are mutually -; recursive. -(define odd? ; testing oddness - (lambda (n) - (if (= n 0) #f (not (even? (- n 1)))))) -\end{schemedisplay} -\end{verbatim} -produces - -\enableslatex -\begin{schemedisplay} -(define even? ; testing evenness - (lambda (n) - (if (= n 0) #t (not (odd? (- n 1)))))) -; The procedures {\it even?} above -; and {\it odd?} below are mutually -; recursive. -(define odd? ; testing oddness - (lambda (n) - (if (= n 0) #f (not (even? (- n 1)))))) -\end{schemedisplay} -\slatexdisable{enableslatex} - -SLaTeX can recognize that blocks of code are separate -if you have at least one empty line separating them. -I.e., there is no need for empty "\verb{;}" lines. This -convenience is to accommodate Scheme files where -definitions are usually separated by one or more blank -lines. - -\index{schemedisplay@\verb{schemedisplay}!allowing page -breaks in} - -Intervening paragraphs, either with lines with a -leading "\verb{;}", or with blank lines, are ideal -spots for \verb{schemedisplay} to allow pagebreaks. In -fact, the default setting for \verb{schemedisplay} also -allows pagebreaks _within_ a Scheme block, but it is -easy to disable this (see entry for -\verb{\rightcodeskip}). - -The space surrounding displayed Scheme code can be -modified by setting the _skip_s \verb{\abovecodeskip}, -\verb{\belowcodeskip}, \verb{\leftcodeskip}, and -\verb{\rightcodeskip} (q.v.). - -Note: see \verb{schemeregion}. - -{\re -\verb{\scheme}} -\index{scheme@\verb{\scheme}} -\index{in-text Scheme code} - -Typesets its argument, which is enclosed in arbitrary -but identical non-alphabetic and non-\verb|{| -characters, as in-text code. Special case: -\verb|\scheme{...}| is a convenience (provided the -\verb|...| doesn't contain a -\verb|}|). E.g., \verb+\scheme|(call/cc (lambda (x) x))|+ -and \verb+\scheme{(call/cc (lambda (x) x))}+ both -produce -\enableslatex -\scheme{(call/cc (lambda (x) x))}. -\slatexdisable{enableslatex} -\index{scheme@\verb{\scheme}!using grouped argument} - -\index{nesting SLaTeX control sequences} -It _is_ permitted to intermix calls to -\verb{schemedisplay} and -\verb|\scheme|. Thus, - -\begin{verbatim} -\begin{schemedisplay} -(define factorial - (lambda (n) - (if (= n 0) ; \scheme{(zero? n)} also possible - 1 (* n (factorial (- n 1)))))) ; or \scheme{... (sub1 1)} -\end{schemedisplay} -\end{verbatim} -produces - -\enableslatex -\begin{schemedisplay} -(define factorial - (lambda (n) - (if (= n 0) ; \scheme{(zero? n)} also possible - 1 - (* n (factorial (- n 1)))))) ; or \scheme{... (sub1 1)} -\end{schemedisplay} -\slatexdisable{enableslatex} - -Note: see \verb{schemeregion}. - -{\re -\verb{\schemeresult}} -\index{schemeresult@\verb{\schemeresult}} - -Typesets its argument, which is enclosed in arbitrary -but identical non-alphabetic and non-\verb|{| -characters, as in-text Scheme "result" or data: i.e., -keyword and variable fonts are disabled. Special -convenient case (as for \verb|\scheme|): -\verb|\schemeresult{...}|. E.g., -\index{schemeresult@\verb{\schemeresult}!using grouped argument} - -\begin{verbatim} -\scheme|((lambda () (cons 'lambda 'cons)))| yields -\schemeresult|(lambda . cons)|. -\end{verbatim} -produces - -\enableslatex -\scheme|((lambda () (cons 'lambda 'cons)))| yields -\schemeresult|(lambda . cons)|. -\slatexdisable{enableslatex} - -{\re -\verb{schemebox}} -\index{schemebox@\verb{schemebox}} -\index{boxed Scheme code} - -[In plain TeX: \verb{\schemebox} ... -\verb{\endschemebox}; in LaTeX: -\verb|\begin{schemebox}| ... -\verb|\end{schemebox}|; but see \verb{defslatexenvstyle}.] - -The \verb{schemebox} environment is similar to -\verb{schemedisplay} except that the code is provided -as a "box" (i.e., it is not "displayed" in the standard -way). Indeed, when the appropriate skip parameters are -set, \verb{schemedisplay} itself _may_ -\footnote{Yes, _may_: Not all \verb{schemedisplay}s invoke -\verb{schemebox}, and if you're curious why, -see entry for \verb{\rightcodeskip}. It is a matter of -whether pagebreaks within Scheme code are allowed or -not.} use a -\verb{schemebox} to create a box of code that is -set off with all-round space as a display. - -Saving a \verb{schemebox} in an explicit box allows you -to move your typeset code arbitrarily. - -Note: see \verb{schemeregion}. - -{\re -\verb{\schemeinput}} -\index{schemeinput@\verb{schemeinput}} -\index{inputting Scheme files as is} - -This can be used to input Scheme files as typeset code. -(Unlike LaTeX's \verb|\input|, \verb|\schemeinput|'s -argument must always be grouped.) The Scheme file can -be specified either by its full name, or without its -extension, if the latter is \verb{.scm}, \verb{.ss} or -\verb{.s}. E.g., - -\begin{verbatim} -\schemeinput{evenodd.scm} % the .scm is optional! -\end{verbatim} -(where \verb{evenodd.scm} is the name of a Scheme file -containing the code for -\enableslatex -\scheme{even?} and \scheme{odd?} above) produces the same -effect as the -\verb{schemedisplay} version. -\slatexdisable{enableslatex} - -Note: see \verb{schemeregion}. - -{\re -\verb{schemeregion}} -\index{schemeregion@\verb{schemeregion}} -\index{nesting SLaTeX control sequences} - -[In plain TeX: \verb{\schemeregion} ... -\verb{\endschemeregion}; in LaTeX: -\verb|\begin{schemeregion}| ... -\verb|\end{schemeregion}|; but see \verb{defslatexenvstyle}.] - -Calls to \verb|\scheme|, \verb|\schemeresult|, -\verb{schemedisplay}, \verb{schemebox} or -\verb|schemeinput| can be nested in (a Scheme comment) -of other calls. In LaTeX text, they can occur in -bodies of environments or otherwise grouped. However, -they cannot normally be passed as arguments to macros -or included in bodies of macro definitions, even though -these are complete calls and not parameterized with -respect to macro arguments. To be able to do this, you -should cordon off such a text with the -\verb{schemeregion} environment. SLaTeX is fairly -generous about where exactly you throw the cordon. - -E.g., you cannot have - -\begin{verbatim} -... -The code fragment -$\underline{\hbox{\scheme{(call/cc I)}}}$ is ... -... -\end{verbatim} -but you _can_ have - -\begin{verbatim} -\begin{schemeregion} -... -The code fragment -$\underline{\hbox{\scheme{(call/cc I)}}}$ is ... -... -\end{schemeregion} -\end{verbatim} -and this will produce - -\enableslatex -\begin{schemeregion} -... - -The code fragment -$\underline{\hbox{\scheme{(call/cc I)}}}$ is ... - -... -\end{schemeregion} -\slatexdisable{enableslatex} - -Thus, the \verb{schemeregion} environment makes it -possible to put SLaTeX-specific commands inside macro -arguments or macro definitions without causing rupture. -Normally, this can't be done since SLaTeX-specific -commands correspond to \verb{comment}-like regions of -LaTeX code once SLaTeX is done preprocessing your text. -These \verb{comment} regions share the characteristic of -LaTeX's \verb{verbatim} regions, which also can't appear -in macro arguments or definitions. - -To solve this, you enclose the offending text in a -\verb{schemeregion} environment. This "inlines" all -the calls to SLaTeX in its body instead of commenting -them and then invoking \verb|\input|, thus escaping -the fate described above. They are no-ops as far as -non-SLaTeX commands are concerned. However, while a -\verb{schemeregion} allows its constituent SLaTeX -commands to be included in macro arguments and bodies, -it itself cannot be so included. Thus, your -\verb{schemeregion} should be in a position that -satisfies the property A: either directly at the -"top-level" or in a LaTeX environment that satisfies A. -Since this recursive rule might look weird, you may -just stick to calling \verb{schemeregion} at the -"top-level". Or, you may even wrap each of your LaTeX -files in one huge \verb{schemeregion} if you so wish. -This will cover any obscure "non-robust" use of the -SLaTeX primitives --- however, SLaTeX will run slower. -(The term "robust" is not necessarily used in the same -sense as in LaTeX.) - -Note that SLaTeX commands are made robust only if they -are surrounded textually (lexically) by a -\verb{schemeregion}. A region marker doesn't have -dynamic scope in the sense that LaTeX files loaded -using \verb|\input| from within a -\verb{schemeregion} will not inherit it. In summary, a -\verb{schemeregion} makes "robust" all calls to -\verb|\scheme|, \verb{schemedisplay}, \verb{schemebox} -and -\verb|\schemeinput| within it. - -{\re -\verb{\setkeyword} -\verb{\setconstant} -\verb{\setvariable}} -\index{setkeyword@\verb{\setkeyword}} -\index{setconstant@\verb{\setconstant}} -\index{setvariable@\verb{\setvariable}} -\index{SLaTeX database!modifying} - -SLaTeX has a database containing information about -which code tokens are to be treated as {\bf keywords}, -which as {\sf constants}, and which as _variables_. -However, there will always be instances where the user -wants to add their own tokens to these categories, or -perhaps even modify the categories as prescribed by -SLaTeX. The control sequences that enable the user to -do these are -\verb|\setkeyword|, \verb|\setconstant|, and -\verb|\setvariable|. Their arguments are entered as -a (space-separated) list enclosed in braces -(\verb|{}|): SLaTeX learns that these are henceforth -to be typeset in the appropriate font. E.g., - -\enableslatex -\begin{verbatim} -\setconstant{infinity -infinity} -\end{verbatim} -tells SLaTeX that \scheme{infinity} and -\scheme{-infinity} are to be typeset as constants. -\slatexdisable{enableslatex} - -\index{recognizing new syntactic keywords automatically} - -The user need not use \verb|\setkeyword| specify such -new keywords as are introduced by Scheme's and Common -Lisp's syntactic definition facilities, viz., -\enableslatex -\scheme{define-syntax}/\scheme{syntax-rules}, -\scheme{defmacro}, \scheme{extend-syntax}, -\scheme{define-macro!}: SLaTeX automatically recognizes -new macros defined using these facilities. -\slatexdisable{enableslatex} - -{\re -\verb{\setspecialsymbol} -\verb{\unsetspecialsymbol}} -\index{setspecialsymbol@\verb{\setspecialsymbol}} -\index{unsetspecialsymbol@\verb{\unsetspecialsymbol}} -\index{SLaTeX database!modifying} -\index{recognizing special symbols} - -These commands are useful to generate -"mathematical"-looking typeset versions of your code, -over and beyond the fonting capabilities provided by -default. For instance, although your code is -restricted to using ascii identifiers that follow some -convention, the corresponding typeset code could be -more mnemonic and utilize the full suite of -mathematical and other symbols provided by TeX. This -of course should not require you to interfere with your -code itself, which should run in its ascii -representation. It is only the typeset version that -has the new look. For instance, you might want all -occurrences of \verb|lambda|, \verb|and|, -\verb|equiv?|, -\verb|below?|, \verb|above?|, \verb|a1| and \verb|a2| in -your code to be typeset as $\lambda$, $\land$, $\equiv$, -$\sqsubseteq$, $\sqsupseteq$, $a_1$ and $a_2$ respectively. -To do this, you should \verb|\setspecialsymbol| the -concerned identifier to the desired TeX expansion, viz., - -\enableslatex -\begin{verbatim} -\setspecialsymbol{lambda}{$\lambda$} -\setspecialsymbol{and}{$\land$} -\setspecialsymbol{equiv?}{$\equiv$} -\setspecialsymbol{below?}{$\sqsubseteq$} -\setspecialsymbol{above?}{$\sqsupseteq$} -\setspecialsymbol{a1}{$a_1$} -\setspecialsymbol{a2}{$a_2$} -\end{verbatim} -\slatexdisable{enableslatex} -Now, typing - -\begin{verbatim} -\begin{schemedisplay} -(define equiv? - (lambda (a1 a2) - (and (below? a1 a2) (above? a1 a2)))) -\end{schemedisplay} -\end{verbatim} -produces - -\enableslatex -\begin{schemedisplay} -(define equiv? - (lambda (a1 a2) - (and (below? a1 a2) (above? a1 a2)))) -\end{schemedisplay} -\slatexdisable{enableslatex} -Note that with the above settings, \verb|lambda| and -\verb|and| have lost their default keyword status, i.e., -they will not be typed {\bf boldface}. To retrieve the -original status of special symbols, you should use -\verb|\unsetspecialsymbol|, e.g. - -\enableslatex -\begin{verbatim} -\unsetspecialsymbol{lambda and} -\end{verbatim} -Typing the same program after unsetting the special symbols -as above produces, as expected: - -\begin{schemedisplay} -(define equiv? - (lambda (a1 a2) - (and (below? a1 a2) (above? a1 a2)))) -\end{schemedisplay} -\slatexdisable{enableslatex} - -In effect, \verb|\setspecialsymbol| extends the -basic "fonting" capability to arbitrary special -typeset versions. - -{\re -\verb{\schemecasesensitive}} -\index{schemecasesensitive@\verb{\schemecasesensitive}} -\index{case sensitivity} - -SLaTeX always typesets output that is of the same case -as your input, regardless of the setting of the -\verb|\schemecasesensitive| command. However, this command -can be used to signal to SLaTeX that all case variations of -an identifier are to be treated identically. E.g. typing -\verb|\schemecasesensitive{false}| implies that while -\verb|lambda| continues to be a keyword, so also are -\verb|Lambda|, \verb|LAMBDA| and \verb|LaMbDa|. -\verb|\schemecasesensitive{true}| reverts it back to -the default mode where case is significant in -determining the class of a token. - -Note that the status \verb|\schemecasesensitive| also -affects the "special symbols" of the previous item. -Thus, in the default case-_sensitive_ setting, only the -case-significant symbol as mentioned in the call to -\verb|\setspecialsymbol| will be replaced by the -corresponding LaTeX expansion. In a case-_in_sensitive -setting, all case variations of the special symbol will -be replaced. - -{\re -\verb{\abovecodeskip} -\verb{\belowcodeskip} -\verb{\leftcodeskip} -\verb{\rightcodeskip}} -\index{abovecodeskip@\verb{\abovecodeskip}} -\index{belowcodeskip@\verb{\belowcodeskip}} -\index{leftcodeskip@\verb{\leftcodeskip}} -\index{rightcodeskip@\verb{\rightcodeskip}} -\index{schemedisplay@\verb{schemedisplay}!adjusting display parameters} - -These are the parameters used by \verb{schemedisplay} for -positioning the displayed code. The default values are - -\begin{verbatim} -\abovecodeskip \medskipamount -\belowcodeskip \medskipamount -\leftcodeskip 0pt -\rightcodeskip 0pt -\end{verbatim} -This produces a flushleft display. The defaults can be -changed to get new display styles. E.g., the -assignment - -\begin{verbatim} -\leftcodeskip5em -\end{verbatim} -shifts the display from the left by a constant 5 ems. - -\index{schemedisplay@\verb{schemedisplay}!allowing page -breaks in} -\index{schemedisplay@\verb{schemedisplay}!disallowing -page breaks in} - -In both the above cases, the \verb{schemedisplay} -environment will be broken naturally across page -boundaries at the right spot if the code is too long to -fit a single page. In fact, automatic pagebreaks -within the Scheme code are allowed if and only if -\verb{\rightcodeskip} is 0pt (its default value). For -all other values of \verb{\rightcodeskip}, each Scheme -code block in a \verb{schemedisplay} is guaranteed to -be on the same page. If you like your current left -indentation, and you're not sure of what value to give -\verb{\rightcodeskip}, but nevertheless don't want -Scheme code broken across pages, you could set - -\begin{verbatim} -\rightcodeskip=0.01pt %or -\rightcodeskip=0pt plus 1fil -\end{verbatim} - -The following explains why the above disable page -breaks within the Scheme block. For example, suppose -you'd set - -\begin{verbatim} -\leftcodeskip=0pt plus 1fil -\rightcodeskip=0pt plus 1fil -\end{verbatim} -This will get you a _centered_ display style. This is -of course because the skip on each side of the code -produces a spring~\cite{tex} that pushes the code to -the center. But for this spring action to work nicely, -the code must have been collected into an unbreakable -box --- which is precisely what -\verb{schemedisplay} does for each of its code blocks -whenever it notices that the prevailing value of -\verb{\rightcodeskip} is not the default zero. -\footnote{0pt plus 1fil $\ne$ 0pt} - -It is this behind-the-scenes selective boxing that -dictates whether a \verb{schemedisplay} block can or -cannot be broken across a page boundary. And the -value of \verb{\rightcodeskip} is used to govern this -selection in a "reasonable" manner. - -{\re -\verb{\keywordfont} -\verb{\constantfont} -\verb{\variablefont}} -\index{keywordfont@\verb{\keywordfont}} -\index{constantfont@\verb{\constantfont}} -\index{variablefont@\verb{\variablefont}} -\index{specifying SLaTeX's fonts} - -These decide the typefaces used for keywords, constants, -and variables. The default definitions are: - -\begin{verbatim} -\def\keywordfont#1{{\bf#1}} -\def\constantfont#1{{\sf#1}} -\def\variablefont#1{{\it#1\/}} -\end{verbatim} - -This is close to the Little Lisper~\cite{ll} style. -Redefine these control sequences for font changes. As -an extreme case, defining all of them to -\verb|{{\tt#1}}| typesets everything in monospace -typewriter font, as, for instance, in SICP~\cite{sicp}. - -{\re -\verb{\defschemedisplaytoken} -\verb{\defschemetoken} -\verb{\defschemeresulttoken} -\verb{\defschemeinputtoken} -\verb{\defschemeregiontoken}} -\index{defschemedisplaytoken@\verb{\defschemedisplaytoken}} -\index{defschemetoken@\verb{\defschemetoken}} -\index{defschemeresulttoken@\verb{\defschemeresulttoken}} -\index{defschemeboxtoken@\verb{\defschemeboxtoken}} -\index{defschemeinputtoken@\verb{\defschemeinputtoken}} -\index{defining SLaTeX control sequences} - -These define the tokens used by SLaTeX to trigger -typesetting of in-text code, display code, box code, -and Scheme files. The default tokens are, as already -described, \verb{schemedisplay}, \verb|\scheme|, -\verb|\schemeresult|, \verb{schemebox}, -\verb|\schemeinput| and \verb{schemeregion} -respectively. If you want shorter or more mnemonic -tokens, the \verb|\defscheme*token| control sequences -prove useful. E.g., if you want \verb|\code| to be -your new control sequence for in-text code, use -\verb|\defschemetoken{code}|. All instances of -\verb|\code+...+| after this definition produce -in-text code, unless overridden by an -\verb|\undefschemetoken| command. - -One can have at any time any number of tokens for the -same activity. One consequence of this is that one can -have nested \verb{schemeregion}s, provided one has -different names for the nested call. Otherwise, the -\verb|\end| of an inner region will prematurely -terminate an outer region. - -{\re -\verb{\undefschemedisplaytoken} -\verb{\undefschemetoken} -\verb{\undefschemeresulttoken} -\verb{\undefschemeinputtoken} -\verb{\undefschemeregiontoken}} -\index{undefschemedisplaytoken@\verb{\undefschemedisplaytoken}} -\index{undefschemetoken@\verb{\undefschemetoken}} -\index{undefschemeresulttoken@\verb{\undefschemeresulttoken}} -\index{undefschemeboxtoken@\verb{\undefschemeboxtoken}} -\index{undefschemeinputtoken@\verb{\undefschemeinputtoken}} -\index{undefschemeregiontoken@\verb{\undefschemeregiontoken}} -\index{undefining SLaTeX control sequences} - -These _un_define the tokens used for triggering -typesetting in-text code, display code, box code, -Scheme files, and robust Scheme regions. Use these if -you want to use these tokens for other purposes and do -not want to unwittingly trip up the SLaTeX system. - -{\re -\verb{\defschememathescape} -\verb{\undefschememathescape}} -\index{defschememathescape@\verb{\defschememathescape}} -\index{undefschememathescape@\verb{\undefschememathescape}} -\index{TeX mathmode in SLaTeX} -\index{escape character for mathmode within Scheme} - -\verb|\defschememathescape{$}| defines the character -\verb|$| as a mathematical escape character to be used -within scheme code. (Any character other than -\verb|}| and whitespace may be chosen instead of -\verb|$|.) This allows one to use LaTeX-like -mathematical subformulas within Scheme code, e.g., - -\begin{verbatim} -\defschememathescape{$} - -\begin{schemedisplay} -(define $\equiv$ - (lambda (a$_1$ a$_2$) - ($\land$ ($\sqsubseteq$ a$_1$ a$_2$) - ($\sqsupseteq$ a$_1$ a$_2$)))) -\end{schemedisplay} -\end{verbatim} -produces - -\enableslatex -\defschememathescape{$} - -\begin{schemedisplay} -(define $\equiv$ - (lambda (a$_1$ a$_2$) - ($\land$ ($\sqsubseteq$ a$_1$ a$_2$) - ($\sqsupseteq$ a$_1$ a$_2$)))) -\end{schemedisplay} -\undefschememathescape{$} -\slatexdisable{enableslatex} -\verb|\undefschememathescape{$}| disables the -math-escape nature, if any, of \verb|$|. - -{\re -\verb{\slatexdisable}} -\index{slatexdisable@\verb{\slatexdisable}} -\index{disabling SLaTeX} - -The tokens for typesetting code, as also the token -\verb|\input| (which is sensitive to SLaTeX, since -the latter uses it to recursively process files within -files), can only be used as calls. If they occur in -the bodies of macro definitions, or their names are -used for defining other control sequences, SLaTeX will -not be able to process them. Sometimes, one wants to -use these tokens, say \verb|\input|, without having -SLaTeX try to process the inputted file. Or the name -\verb|\scheme| may be used in a verbatim environment, -and we don't want such an occurrence to trigger the -codesetting half of SLaTeX to look for code. - -Avoiding such uses altogether can be unduly -restrictive. -\footnote{Especially when one is writing a "How to ..." -manual like this where one both uses _and_ mentions the -control sequences!} One way out is to judiciously use -the \verb|\undefscheme*token| commands to temporarily -remove the SLaTeX-specificity of these names. Even -this can be painful. SLaTeX therefore provides the -commands \verb|\slatexdisable|. This takes one -argument word and makes the corresponding control -sequence out of it. Further, from this point in the -text, SLaTeX is disabled _until_ the manufactured -control sequence shows up. This mechanism makes it -possible to restrict SLaTeX to only appropriate -portions of the text. Note that the token -\verb|\slatexdisable| itself can appear in the text -succeeding its call. The only token that can restore -SLaTeX-sensitivity is the one created during the call -to \verb|\slatexdisable|. - -A typical example of the use of \verb|\slatexdisable| -is when you use the names \verb|\scheme| and -\verb|\begin{schemedisplay}| in a \verb{verbatim} -environment. E.g., - -{\medskip -\obeylines\parindent0pt -\verb|\slatexdisable{slatexenable}| -\verb|\begin{verbatim}| -\verb|slatex provides the command \scheme and the pair| -\verb|\begin{schemedisplay} and \end{schemedisplay} to typeset| -\verb|in-text and displayed Scheme code respectively.| -\verb|\end{verbatim}| -\verb|\slatexenable| -\medskip} - -produces the required - -\begin{verbatim} -slatex provides the command \scheme and the pair -\begin{schemedisplay} and \end{schemedisplay} to typeset -in-text and display Scheme code respectively. -\end{verbatim} - -{\re -\verb{\slatexignorecurrentfile}} -\index{slatexignorecurrentfile@\verb{\slatexignorecurrentfile}} -\index{disabling SLaTeX} - -This is a SLaTeX pragma included to improve efficiency. -If you're sure that the remaining portion of a certain -LaTeX (or TeX) file (including the files that would be -\verb|\input|ed by it) don't contain any SLaTeX -commands, then you may place this control sequence in -it at this point to signal SLaTeX that no preprocessing -is necessary for the rest of the file. - -{\re -\verb{\defslatexenvstyle}} -\index{defslatexenvstyle@\verb{\defslatexenvstyle}} -\index{plain TeX} -\index{LaTeX} -\index{environments} - -As section~\ref{quick} showed, the differences in SLaTeX -usage between plain TeX and LaTeX is simply a matter of -the difference in the "environment" styles of the two -formats. It is easy get the behavior of the one -format with the other. - -\begin{enumerate} -\o If you wish to use the plain-TeX style in LaTeX, -type -\begin{verbatim} -\defslatexenvstyle{tex} -\end{verbatim} -before first such use. - -\o Similarly, if you wish to use the LaTeX -\verb{\begin}/\verb{\end} style in plain TeX, use -\begin{verbatim} -\defslatexenvstyle{latex} -\end{verbatim} -_provided you have already defined \verb{\begin} and -\verb{\end} appropriately!_ - -Before doing this, you should keep in mind that -TeX already has an -\verb{\end} command --- which is used by TeX's -\verb{\bye} --- that ends the document. This function -should be saved under a different name, before -\verb{\end} can be redefined as an environment closer. -The following is one way to accomplish this: -\begin{verbatim} -\let\plaintexend\end -\outer\def\bye{\par\vfill\supereject\plaintexend} -\def\begin#1{\csname#1\endcsname} -\def\end#1{\csname end#1\endcsname} -\end{verbatim} -\end{enumerate} - -In either case, you can revert to the default style with -\verb|\defslatexenvstyle{latex}| and -\verb|\defslatexenvstyle{tex}| respectively. - -{\re -\verb{\slatexseparateincludes}} -\index{slatexseparateincludes@\verb{slatexseparateincludes}} -\index{reusing SLaTeX's temporary files} - -By default, the temporary files of SLaTeX use the name -of the topmost TeX file, i.e., the name stored under -\verb{\jobname}. In large LaTeX documents using -\verb{\include}, this may be unduly restrictive. - -To recapitulate, the \verb{slatex} command creates -temporary files to store typeset code and then passes -the baton on to TeX or LaTeX. If no significant change -has been made to the Scheme code (either in content or -in relative positioning) in the document, then -successive calls to (La)TeX could be made directly -using the old temporary files. This could be a time-saver, -since it avoids calling up the Scheme typesetter. - -However, in a large LaTeX document with -\verb{\include}s, these successive calls to LaTeX often -entail juggling the \verb{\include}s that are chosen. -In this case, even though the relative position of the -Scheme code is preserved within each \verb{include}d -file, the sequence perceived by the main file changes. -This spoils the invariance we needed if we'd wanted to -avoid calling SLaTeX unnecessarily. - -\index{reusing SLaTeX's temporary files!exploiting -LaTeX's \verb{\include}} - -To solve this, the SLaTeX command sequence -\verb{\slatexseparateincludes} --- which must be called -before the first occurrence of Scheme code in your -document --- -guarantees that each -\verb{\include}d file will generate its own pool of -temp files. Thus, if the SLaTeX -files are created once for each \verb{\include}, they -will be correctly loaded no matter what sequence of -\verb{\include}s is taken. - -{\re -\verb{\schemecodehook}} -\index{schemecodehook@\verb{\schemecodehook}} -\index{hook for \verb{schemedisplay} and -\verb{schemebox}} - -The user can define \verb{\schemecodehook} to be -anything. The hook will be evaluated inside each -subsequent call to \verb{schemedisplay} and -\verb{schemebox}. E.g., - -\begin{verbatim} -\let\schemecodehook\tiny -\end{verbatim} -converts your Scheme displays and boxes into {\tiny -small print}. - -The default value of the hook is \verb{\relax}, a -no-op. - -\section{Setting up a file that resets SLaTeX's -defaults} -\label{preamble} -\index{writing personal preamble} -\index{SLaTeX database!modifying} - -A sample style modification file for SLaTeX would -include redefinition of the names of the codesetting -control sequences, adjustment of the display -parameters, modification of the font assignments for -keywords/constants/variables/special symbols, and -addition of new keywords/constants/variables/special -symbols to SLaTeX's database. - -Let's assume you want - -\begin{itemize} -\o a centered display style with no vertical skips; - -\o the names \verb|\code|, \verb{schemefrag}, \verb{scmbox}, -\verb|\sinput| instead of \verb|\scheme|, -\verb{schemefrag}, \verb{schemebox} and -\verb|\schemeinput|; - -\o tokens to disregard case; - -\o the keywords to come out it \verb{typewriter}, the -constants in roman, and the variables in {\sl slant}; - -\o "\verb{und}" and "\verb{oder}" as keywords, -"\verb{true}" and "\verb{false}" as constants, -"\verb{define}" as a variable (overriding default as -keyword!), "\verb{F}" as a constant (\verb{f} will also -be a constant, due to case-insensitivity!); - -\o "\verb{top}" and "\verb{bottom}" to print as -$\top$ and $\bot$ respectively. -\end{itemize} - -This could be set up as - -\begin{verbatim} -\abovecodeskip 0pt -\belowcodeskip 0pt -\leftcodeskip 0pt plus 1fil -\rightcodeskip 0pt plus 1fil - -\undefschemetoken{scheme} -\undefschemeboxtoken{schemebox} -\undefschemedisplaytoken{schemedisplay} -\undefschemeinputtoken{schemeinput} - -\defschemetoken{code} -\defschemeboxtoken{scmbox} -\defschemedisplaytoken{schemegrag} -\defschemeinputtoken{sinput} - -\schemecasesensitive{false} - -\def\keywordfont#1{{\tt#1}} -\def\constantfont#1{{\rm#1}} -\def\variablefont#1{{\sl#1\/}} - -\setkeyword{und oder} -\setconstant{true false} -\setvariable{define} -\setconstant{F} - -\setspecialsymbol{top}{$\top$} -\setspecialsymbol{bottom}{$\bottom$} -\end{verbatim} - -This file can then be \verb|\input| in the preamble of -your LaTeX document. - -\section{How to obtain and install SLaTeX} -\label{ftp} -\index{obtaining and installing SLaTeX} - -\enableslatex -\leftcodeskip=0pt plus 1fil -\rightcodeskip=0pt plus 1fil -\slatexdisable{enableslatex} - -SLaTeX is available via anonymous ftp from -\verb{cs.rice.edu} (or \verb{titan.cs.rice.edu}). -Login as -\verb{anonymous}, give your userid as password, change -to the directory \verb{public/dorai}, convert to -\verb{bin} mode, and get the file -\verb{slatex}_NN_\verb{.tar.gz}, where _NN_ is some -number. Un\verb{gzip}ping and un\verb{tar}ring -produces a directory \verb{slatex}, containing the -SLaTeX files. (The file \verb{manifest} lists the -files in the distribution --- make sure that nothing is -missing.) - -To install SLaTeX on your system: - -\begin{enumerate} -\o First change directory (\verb{cd}) to \verb{slatex}, the -directory housing the SLaTeX files. -\footnote{Some of the SLaTeX files use DOS-style CR-LF -newlines. You may want to use an appropriate newline -modifier to the SLaTeX files to make the files comply -with your operating system's newline format.} - -\o Edit the file \verb{config.dat} as suggested by the -comments in the file itself. - -\o Invoke your Scheme or Common Lisp interpreter. -Load the file \verb{config.scm}, i.e., type - -\enableslatex -\begin{schemedisplay} -(load "config.scm") -\end{schemedisplay} -\slatexdisable{enableslatex} -at the Scheme (or Common Lisp) prompt. This will -configure SLaTeX for your Scheme dialect and operating -system, creating a Scheme file called -\verb{slatex.scm}. (If you informed \verb{config.dat} -that your Scheme dialect is Chez, the file -\verb{slatex.scm} is a compiled version rather than -Scheme source.) The configuration process also creates -a batch file \verb{slatex.bat} (on DOS) or a shell -script \verb{slatex} (on Unix), for convenient -invocation of SLaTeX from your operating system command -line. A Scheme/Common Lisp file \verb{callsla.scm} is -also created --- this lets you call SLaTeX from the -Scheme/Common Lisp prompt. - -\o Exit Scheme/Common Lisp. -\end{enumerate} - -To set up paths and modify shell script/batch file: - -\begin{enumerate} -\o Copy (or move, or link) \verb{slatex.scm} into a -suitable place, e.g., your \verb{bin} or \verb{lib} -directory, or the system \verb{bin} or \verb{lib}. - -\o Copy (or move, or link) \verb{slatex.sty} into a -suitable place, i.e., somewhere in your \verb{TEXINPUTS} -path. For installing on a multiuser system, place in -the directory containing the LaTeX files (on mine this -is \verb{/usr/local/lib/tex/macros}). - - -\o \enableslatex -Copy (or move, or link) the shell script -\verb{slatex} or the batch file \verb{slatex.bat} to a -suitable place in your \verb{PATH}, e.g., your {bin} or -the system {bin} directory. Note that -\verb{slatex}(\verb{.bat}) sets -\scheme{SLaTeX.*texinputs*}. If you're making the same -shell script (or batch file) available to multiple -users, you should change the line -\begin{schemedisplay} -(set! SLaTeX.*texinputs* "...") -\end{schemedisplay} -to -\begin{schemedisplay} -(set! SLaTeX.*texinputs* (getenv "TEXINPUTS")) -\end{schemedisplay} -or some other dialect-dependent way of obtaining the -\verb{TEXINPUTS} environment variable. -\slatexdisable{enableslatex} - -\o Run \verb{slatex} on \verb{slatex-d.tex} (this -file!) for documentation. (This also serves as a check -that SLaTeX does indeed work on your machine.) Refer -to \verb{slatex-d.dvi} when befuddled. -\end{enumerate} - -If your dialect did not allow a nice enough shell -script or batch file, the following provides an -alternate route to unlocking SLaTeX. - -\subsection{Other ways of invoking SLaTeX} - -The configuration process creates shell script/batch -file \verb{slatex}(\verb{.bat}) for a standard invoking -mechanism for SLaTeX. The shell script/batch file is -created to exploit the way your Scheme is called, e.g., -matters like whether it accepts \verb{echo}'d -s-expressions (e.g., Chez) , whether it loads command -line files (e.g., SCM) , and whether it always checks -for an "init" file (e.g., MIT C Scheme). - -\begin{enumerate} -\o If your Scheme doesn't fall into either of these -categories, you may have to write your own -shell script/batch file or devise some other mechanism. - -\o The shell script/batch file invokes -Scheme/Common Lisp. If, -however, you are already in Scheme/Common Lisp and -spend most of the time continuously at the -Scheme/Common Lisp prompt rather than the operating -system prompt, you may avoid some of the delays -inherent in the shell script/batch file. -\end{enumerate} - -\enableslatex -The file \verb{callsla.scm}, which contains just one -small procedure named \scheme{call-slatex}, and which -is created by the configuration process, provides a -simple calling mechanism from Scheme/Common Lisp, as -opposed to the operating system command line. You may -use it as an alternative to the -\verb{slatex}(\verb{.bat}) shell script/batch file. -The usage is as follows: load -\verb{callsla.scm} into Scheme/Common Lisp - -\begin{schemedisplay} -(load "callsla.scm") -\end{schemedisplay} -and type - -\setspecialsymbol{}{\va{$\langle$tex-file$\rangle$}} -\begin{schemedisplay} -(call-slatex ) -\end{schemedisplay} -when you need to call SLaTeX on the (La)TeX file -\scheme{}. This invokes the SLaTeX preprocessor on -\scheme{}. If your Scheme has a -\scheme{system} procedure -that can call the operating system command line, -\scheme{call-slatex} will also send your file to TeX or -LaTeX. If your Scheme does not have such a procedure, -\scheme{call-slatex} will simply prod you to call TeX -or LaTeX -yourself. -\slatexdisable{enableslatex} - -The outline of the shell script/batch file or -\verb{callsla.scm} or of any strategy you devise for -using SLaTeX should include the following actions: - -\begin{enumerate} -\o Load the file \verb{slatex.scm} (created by the -configuration process) into Scheme/Common Lisp. - -\o \enableslatex -Set the variable \scheme{SLaTeX.*texinputs*} to the -path \verb{TEXINPUTS} or \verb{TEXINPUT} used by -TeX -\footnote{There is some variation on the name of -this environment variable. Unix TeX's prefer -\verb{TEXINPUTS} with an \verb{S}, while DOS (e.g., -Eberhard Mattes's emTeX) favors \verb{TEXINPUT} without -the \verb{S}.} -to look for -\slatexdisable{enableslatex} -\verb|\input| -files. - - -\o \enableslatex -Call the procedure -\scheme{SLaTeX.process-main-tex-file} on the \verb{.tex} -file to be processed. -\slatexdisable{enableslatex} - -\o Call either \verb{latex} or \verb{tex} on the \verb{.tex} file. -\end{enumerate} - - -\enableslatex -You may devise your own way of calling -\scheme{SLaTeX.process-main-tex-file}, provided your -method makes sure that \verb{slatex.scm} has been -loaded, \scheme{SLaTeX.*texinputs*} set appropriately -_before_ the call and \verb{latex}/\verb{tex} is called -_after_ the call. - -Note that if you prefer to stay in Scheme/Common Lisp -most of the time, it is a good idea to pre-load the -procedure \scheme{call-slatex}, perhaps through an -"init" file. \scheme{call-slatex} is just a -"one-liner" "call-by-need" hook to SLaTeX and does not -take up much resources. (Global name clashes between -your own code and SLaTeX code won't occur unless you -use variable names starting with "\scheme{SLaTeX.}") If -you made no calls to \scheme{call-slatex}, the bigger -file \verb{slatex.scm} is not loaded at all. If you -make several calls to \scheme{call-slatex}, -\verb{slatex.scm} is loaded only once, at the time of -the first call. -\slatexdisable{enableslatex} - -\subsection{Dialects SLaTeX runs on} -\index{dialects SLaTeX runs on} - -\enableslatex -SLaTeX is implemented in R4RS-compliant Scheme (macros -are not needed). The code uses the non-standard -procedures \scheme{delete-file}, -\scheme{file-exists?} and \scheme{force-output}, but -a Scheme without these procedures can also run SLaTeX -(the configuration defines the corresponding variables -to be dummy procedures, since they are not crucial). -The distribution comes with code to allow SLaTeX to run -also on Common Lisp. The files \verb{readme} and -\verb{install} contain all the information necessary to -configure SLaTeX for your system. -\slatexdisable{enableslatex} - -SLaTeX has been tested successfully in the following -dialects: - -\begin{itemize} -\o _On Unix:_ -Chez Scheme (R. Kent Dybvig), Ibuki Common -Lisp (1987), MIT C Scheme, Elk (Oliver Laumann), -Scheme-to-C (Joel Bartlett), Scm (Aubrey Jaffer) and -UMB Scheme (William Campbell); - -\o _On MS-DOS:_ -MIT C Scheme, Scm (Aubrey Jaffer), Austin Kyoto Common -Lisp (William Schelter's enhanced version of Taiichi -Yuasa and Masami Hagiya's KCL) and CLisp (Bruno Haible -and Michael Stoll). -\iffalse PCScheme/Geneva (Larry Bartholdi and -Marc Vuilleumier) \fi -\end{itemize} - -If your Scheme is not mentioned here but _is_ -R4RS-compliant, please send a note to the author at -\verb{dorai@cs.rice.edu} describing your Scheme's -procedures for deleting files, testing file existence, -and forcing output, if any, and the configuration file -will be enhanced to accommodate the new dialect. - -Bug reports are most welcome --- send to -\verb{dorai@cs.rice.edu}. -\index{bug reports} - -\begin{thebibliography}{9} -\bibitem{sicp} H. Abelson and G.J. Sussman with J. -Sussman. Structure and Interpretation of Computer -Programs. MIT Press, 1985. - -\bibitem{r4rs} W. Clinger and J. Rees, eds. -Revised$^4$ Report on the Algorithmic Language Scheme. -1991. - -\bibitem{ll} D.P. Friedman and M. Felleisen. The -Little Lisper. Science Research Associates, 1989. - -\bibitem{tex} D.E. Knuth. The TeXbook. -Addison-Wesley, 1984. - -\bibitem{latex} L. Lamport. LaTeX User's Guide and -Reference Manual. Addison-Wesley, 1986. - -\bibitem{schemeweb} J. Ramsdell. SchemeWeb. Scheme -Repository, nexus.yorku.ca, maintained by O. Yigit. - -\bibitem{lisp2tex} C. Queinnec. LiSP2TeX. Scheme -Repository. - -\bibitem{cltl2} G.L. Steele Jr. Common Lisp: The -Language, 2nd ed. Digital Press, 1990. -\end{thebibliography} - -%input slatex-d.ind, the index, if available. -%slatex-d.ind is generated by running -% makeind(e)x slatex-d -%after running latex on slatex-d. The next call -% latex slatex-d -%will include slatex-d.ind - -\inputifpossible{slatex-d.ind} - -\end{document} - -\index{schemedisplay@\verb{schemedisplay}!with plain TeX} -\index{schemebox@\verb{schemebox}!with plain TeX} -\index{schemeregion@\verb{schemeregion}!with plain TeX} diff --git a/src/ikarus.boot b/src/ikarus.boot index 2da0a24..12b3006 100644 Binary files a/src/ikarus.boot and b/src/ikarus.boot differ diff --git a/src/ikarus.compiler.ss b/src/ikarus.compiler.ss index 0d66c07..f0065ab 100644 --- a/src/ikarus.compiler.ss +++ b/src/ikarus.compiler.ss @@ -12,7 +12,8 @@ compile-core-expr-to-port assembler-output current-primitive-locations eval-core) (ikarus intel-assembler) - (ikarus fasl write)) + ;(ikarus fasl write) + ) (define-syntax record-case diff --git a/src/ikarus.fixnums.ss b/src/ikarus.fixnums.ss index 24dea17..f6f8d07 100644 --- a/src/ikarus.fixnums.ss +++ b/src/ikarus.fixnums.ss @@ -8,6 +8,7 @@ fxpositive? fxnegative? fxeven? fxodd? fixnum->string + fxarithmetic-shift-left fxarithmetic-shift-right fxarithmetic-shift error@fx+) (import (ikarus system $fx) @@ -22,6 +23,7 @@ fxior fxand fxxor fxnot fxpositive? fxnegative? fxeven? fxodd? + fxarithmetic-shift-left fxarithmetic-shift-right fxarithmetic-shift fixnum->string)) (define fxzero? @@ -206,6 +208,17 @@ (error 'fxsra "negative shift not allowed, got ~s" y)) ($fxsra x y))) + + (define fxarithmetic-shift-right + (lambda (x y) + (unless (fixnum? x) + (error 'fxarithmetic-shift-right "~s is not a fixnum" x)) + (unless (fixnum? y) + (error 'fxarithmetic-shift-right "~s is not a fixnum" y)) + (unless ($fx>= y 0) + (error 'fxarithmetic-shift-right "negative shift not allowed, got ~s" y)) + ($fxsra x y))) + (define fxsll (lambda (x y) (unless (fixnum? x) @@ -216,6 +229,27 @@ (error 'fxsll "negative shift not allowed, got ~s" y)) ($fxsll x y))) + + (define fxarithmetic-shift-left + (lambda (x y) + (unless (fixnum? x) + (error 'fxarithmetic-shift-left "~s is not a fixnum" x)) + (unless (fixnum? y) + (error 'fxarithmetic-shift-left "~s is not a fixnum" y)) + (unless ($fx>= y 0) + (error 'fxarithmetic-shift-left "negative shift not allowed, got ~s" y)) + ($fxsll x y))) + + (define fxarithmetic-shift + (lambda (x y) + (unless (fixnum? x) + (error 'fxarithmetic-shift "~s is not a fixnum" x)) + (unless (fixnum? y) + (error 'fxarithmetic-shift "~s is not a fixnum" y)) + (if ($fx>= y 0) + ($fxsll x y) + ($fxsra x ($fx- 0 y))))) + (define (fxpositive? x) (if (fixnum? x) ($fx> x 0) diff --git a/src/ikarus.numerics.ss b/src/ikarus.numerics.ss index b299ede..22db193 100644 --- a/src/ikarus.numerics.ss +++ b/src/ikarus.numerics.ss @@ -316,7 +316,7 @@ abs truncate fltruncate sra sll exact->inexact inexact floor ceiling round log fl=? fl? fl>=? fl+ fl- fl* fl/ flsqrt flmin flzero? flnegative? - sin cos tan asin acos atan sqrt + sin cos tan asin acos atan sqrt exp flround flmax random) (import (ikarus system $fx) @@ -334,7 +334,7 @@ exact->inexact inexact floor ceiling round log exact-integer-sqrt min max abs fl=? fl? fl>=? fl+ fl- fl* fl/ flsqrt flmin - flzero? flnegative? sra sll + flzero? flnegative? sra sll exp sin cos tan asin acos atan sqrt truncate fltruncate flround flmax random)) @@ -2262,6 +2262,15 @@ (foreign-call "ikrt_bignum_shift_right" n m^))])] [else (error who "~s is not an exact integer" n)])) + (define (exp x) + (cond + [(flonum? x) (flexp x)] + [(fixnum? x) + (if ($fx= x 0) 1 (flexp (fixnum->flonum x)))] + [(bignum? x) (flexp (bignum->flonum x))] + [(ratnum? x) (flexp (ratnum->flonum x))] + [else (error 'exp "~s is not a number" x)])) + ) diff --git a/src/ikarus.trace.ss b/src/ikarus.trace.ss index afdd7a3..01d38ae 100644 --- a/src/ikarus.trace.ss +++ b/src/ikarus.trace.ss @@ -51,12 +51,7 @@ (write (car v*)) (f (cdr v*))]))) (apply values v*)))) - (lambda () (set! k* (cdr k*))))])))))) - - - - - ) + (lambda () (set! k* (cdr k*))))]))))))) #!eof @@ -123,11 +118,33 @@ Try: (cond [(zero? n) (k m)] [else (begin (fact (sub1 n) (* n m) k) 0)])) + + (call/cc (lambda (k) (fact 6 1 (trace-lambda escape (v) (k v))))) + +(call/cc + (lambda k* + (trace-define (fact n) + (cond + [(zero? n) + (call/cc + (lambda (k) + (set! k* (cons k k*)) + 1))] + [else (* n (fact (sub1 n)))])) + (fact 9) + (let ([k (car k*)]) + (set! k* (cdr k*)) + (k 100000)))) + + + + + (trace-define (infinite-loop n) (infinite-loop (add1 n))) (infinite-loop 0) diff --git a/src/ikarus.unicode-data.ss b/src/ikarus.unicode-data.ss index db1d8b6..8a6be26 100644 --- a/src/ikarus.unicode-data.ss +++ b/src/ikarus.unicode-data.ss @@ -209,6 +209,8 @@ ($string-foldcase str) (error 'string-foldcase "~s is not a string" str))) + ;;; FIXME: case-insensitive comparison procedures are slow. + (define string-ci-cmp (lambda (who cmp) (case-lambda diff --git a/src/makefile.ss b/src/makefile.ss index 60802bb..19066cd 100755 --- a/src/makefile.ss +++ b/src/makefile.ss @@ -364,7 +364,7 @@ [char-ci>=? i unicode] [char-alphabetic? i unicode] [char-numeric? i unicode] - [char-whitespace? i unicode] + [char-whitespace? i r unicode] [char-upper-case? i unicode] [char-lower-case? i unicode] [char-title-case? i unicode] @@ -454,6 +454,9 @@ [fxodd? i] [fxpositive? i] [fxnegative? i] + [fxarithmetic-shift-left i] + [fxarithmetic-shift-right i] + [fxarithmetic-shift i] [for-each i r] [map i r] @@ -539,6 +542,7 @@ [add1 i] [sub1 i] [expt i r] + [exp i r] [flexpt i] [sin i r] [cos i r] @@ -938,7 +942,7 @@ [force i] [make-traced-procedure i] [error@fx+ ] - + [fasl-write i] )) (define (verify-map) diff --git a/src/todo-r6rs.ss b/src/todo-r6rs.ss index 5510012..9b37169 100755 --- a/src/todo-r6rs.ss +++ b/src/todo-r6rs.ss @@ -6,6 +6,8 @@ (define library-names '( + [se (scheme-report-environment)] + [r5 (rnrs r5rs (6))] [ct (rnrs control (6))] [ev (rnrs eval (6))] [mp (rnrs mutable-pairs (6))] @@ -31,8 +33,6 @@ [ri (rnrs records inspection (6))] [rp (rnrs records procedural (6))] [rs (rnrs records syntactic (6))] - [r5 (rnrs r5rs (6))] - [se (scheme-report-environment)] )) (define status-names @@ -40,6 +40,7 @@ [S scheduled] [D deferred] [C completed] + [X killed] )) (define identifier-names @@ -142,14 +143,14 @@ [div0-and-mod0 C ba] [dynamic-wind C ba se] [eq? C ba se] - [equal? S ba se] + [equal? C ba se] [eqv? C ba se] [error S ba] [even? C ba se] [exact C ba] [exact-integer-sqrt C ba] [exact? C ba se] - [exp S ba se] + [exp C ba se] [expt C ba se] [finite? C ba] [floor C ba se] @@ -268,9 +269,9 @@ [fx>=? C fx] [fx>? C fx] [fxand C fx] - [fxarithmetic-shift S fx] - [fxarithmetic-shift-left S fx] - [fxarithmetic-shift-right S fx] + [fxarithmetic-shift C fx] + [fxarithmetic-shift-left C fx] + [fxarithmetic-shift-right C fx] [fxbit-count D fx] [fxbit-field D fx] [fxbit-set? D fx] @@ -344,12 +345,12 @@ [fltruncate C fl] [flzero? C fl] [real->flonum D fl] - [make-no-infinities-violation D fl] - [make-no-nans-violation D fl] - [&no-infinities D fl] - [no-infinities-violation? D fl] - [&no-nans D fl] - [no-nans-violation? D fl] + [make-no-infinities-violation X fl] + [make-no-nans-violation X fl] + [&no-infinities X fl] + [no-infinities-violation? X fl] + [&no-nans X fl] + [no-nans-violation? X fl] ;;; [bytevector->sint-list C bv] [bytevector->u8-list C bv] @@ -410,58 +411,58 @@ [utf16->string S bv] [utf32->string S bv] ;;; - [condition? D co] - [&assertion D co] - [assertion-violation? D co] - [&condition D co] - [condition D co] - [condition-accessor D co] - [condition-irritants D co] - [condition-message D co] - [condition-predicate D co] - [condition-who D co] - [define-condition-type D co] - [&error D co] - [error? D co] - [&implementation-restriction D co] - [implementation-restriction-violation? D co] - [&irritants D co] - [irritants-condition? D co] - [&lexical D co] - [lexical-violation? D co] - [make-assertion-violation D co] - [make-error D co] - [make-implementation-restriction-violation D co] - [make-irritants-condition D co] - [make-lexical-violation D co] - [make-message-condition D co] - [make-non-continuable-violation D co] - [make-serious-condition D co] - [make-syntax-violation D co] - [make-undefined-violation D co] - [make-violation D co] - [make-warning D co] - [make-who-condition D co] - [&message D co] - [message-condition? D co] - [&non-continuable D co] - [non-continuable-violation? D co] - [&serious D co] - [serious-condition? D co] - [simple-conditions D co] - [&syntax D co] - [syntax-violation D co sc] - [syntax-violation-form D co] - [syntax-violation-subform D co] - [syntax-violation? D co] - [&undefined D co] - [undefined-violation? D co] - [&violation D co] - [violation? D co] - [&warning D co] - [warning? D co] - [&who D co] - [who-condition? D co] + [condition? X co] + [&assertion X co] + [assertion-violation? X co] + [&condition X co] + [condition X co] + [condition-accessor X co] + [condition-irritants X co] + [condition-message X co] + [condition-predicate X co] + [condition-who X co] + [define-condition-type X co] + [&error X co] + [error? X co] + [&implementation-restriction X co] + [implementation-restriction-violation? X co] + [&irritants X co] + [irritants-condition? X co] + [&lexical X co] + [lexical-violation? X co] + [make-assertion-violation X co] + [make-error X co] + [make-implementation-restriction-violation X co] + [make-irritants-condition X co] + [make-lexical-violation X co] + [make-message-condition X co] + [make-non-continuable-violation X co] + [make-serious-condition X co] + [make-syntax-violation X co] + [make-undefined-violation X co] + [make-violation X co] + [make-warning X co] + [make-who-condition X co] + [&message X co] + [message-condition? X co] + [&non-continuable X co] + [non-continuable-violation? X co] + [&serious X co] + [serious-condition? X co] + [simple-conditions X co] + [&syntax X co] + [syntax-violation X co sc] + [syntax-violation-form X co] + [syntax-violation-subform X co] + [syntax-violation? X co] + [&undefined X co] + [undefined-violation? X co] + [&violation X co] + [violation? X co] + [&warning X co] + [warning? X co] + [&who X co] + [who-condition? X co] ;;; [case-lambda C ct] [do C ct se ne] @@ -486,10 +487,10 @@ [environment C ev] [eval C ev se] ;;; - [raise S ex] - [raise-continuable S ex] - [with-exception-handler S ex] - [guard S ex] + [raise X ex] + [raise-continuable X ex] + [with-exception-handler X ex] + [guard X ex] ;;; [binary-port? D ip] [buffer-mode D ip] @@ -537,7 +538,7 @@ [remainder C r5 se] [null-environment C r5 se] [quotient C r5 se] - [scheme-report-environment S r5 se] + [scheme-report-environment C r5 se] ;;; [close-port D ip] [eol-style D ip] @@ -555,33 +556,33 @@ [get-string-n D ip] [get-string-n! D ip] [get-u8 D ip] - [&i/o D ip is fi] - [&i/o-decoding D ip] - [i/o-decoding-error? D ip] - [&i/o-encoding D ip] - [i/o-encoding-error-char D ip] - [i/o-encoding-error? D ip] - [i/o-error-filename D ip is fi] - [i/o-error-port D ip is fi] - [i/o-error? D ip is fi] - [&i/o-file-already-exists D ip is fi] - [i/o-file-already-exists-error? D ip is fi] - [&i/o-file-does-not-exist D ip is fi] - [i/o-file-does-not-exist-error? D ip is fi] - [&i/o-file-is-read-only D ip is fi] - [i/o-file-is-read-only-error? D ip is fi] - [&i/o-file-protection D ip is fi] - [i/o-file-protection-error? D ip is fi] - [&i/o-filename D ip is fi] - [i/o-filename-error? D ip is fi] - [&i/o-invalid-position D ip is fi] - [i/o-invalid-position-error? D ip is fi] - [&i/o-port D ip is fi] - [i/o-port-error? D ip is fi] - [&i/o-read D ip is fi] - [i/o-read-error? D ip is fi] - [&i/o-write D ip is fi] - [i/o-write-error? D ip is fi] + [&i/o X ip is fi] + [&i/o-decoding X ip] + [i/o-decoding-error? X ip] + [&i/o-encoding X ip] + [i/o-encoding-error-char X ip] + [i/o-encoding-error? X ip] + [i/o-error-filename X ip is fi] + [i/o-error-port X ip is fi] + [i/o-error? X ip is fi] + [&i/o-file-already-exists X ip is fi] + [i/o-file-already-exists-error? X ip is fi] + [&i/o-file-does-not-exist X ip is fi] + [i/o-file-does-not-exist-error? X ip is fi] + [&i/o-file-is-read-only X ip is fi] + [i/o-file-is-read-only-error? X ip is fi] + [&i/o-file-protection X ip is fi] + [i/o-file-protection-error? X ip is fi] + [&i/o-filename X ip is fi] + [i/o-filename-error? X ip is fi] + [&i/o-invalid-position X ip is fi] + [i/o-invalid-position-error? X ip is fi] + [&i/o-port X ip is fi] + [i/o-port-error? X ip is fi] + [&i/o-read X ip is fi] + [i/o-read-error? X ip is fi] + [&i/o-write X ip is fi] + [i/o-write-error? X ip is fi] [lookahead-char D ip] [lookahead-u8 D ip] [make-bytevector C bv] @@ -591,18 +592,18 @@ [make-custom-textual-input-port D ip] [make-custom-textual-input/output-port D ip] [make-custom-textual-output-port D ip] - [make-i/o-decoding-error D ip] - [make-i/o-encoding-error D ip] - [make-i/o-error D ip is fi] - [make-i/o-file-already-exists-error D ip is fi] - [make-i/o-file-does-not-exist-error D ip is fi] - [make-i/o-file-is-read-only-error D ip is fi] - [make-i/o-file-protection-error D ip is fi] - [make-i/o-filename-error D ip is fi] - [make-i/o-invalid-position-error D ip is fi] - [make-i/o-port-error D ip is fi] - [make-i/o-read-error D ip is fi] - [make-i/o-write-error D ip is fi] + [make-i/o-decoding-error X ip] + [make-i/o-encoding-error X ip] + [make-i/o-error X ip is fi] + [make-i/o-file-already-exists-error X ip is fi] + [make-i/o-file-does-not-exist-error X ip is fi] + [make-i/o-file-is-read-only-error X ip is fi] + [make-i/o-file-protection-error X ip is fi] + [make-i/o-filename-error X ip is fi] + [make-i/o-invalid-position-error X ip is fi] + [make-i/o-port-error X ip is fi] + [make-i/o-read-error X ip is fi] + [make-i/o-write-error X ip is fi] [latin-1-codec D ip] [make-transcoder D ip] [native-eol-style D ip] @@ -691,37 +692,37 @@ [file-exists? C fi] [delete-file C fi] ;;; - [define-record-type D rs] - [fields D rs] - [immutable D rs] - [mutable D rs] - [opaque D rs] - [parent D rs] - [parent-rtd D rs] - [protocol D rs] - [record-constructor-descriptor D rs] - [record-type-descriptor D rs] - [sealed D rs] - [nongenerative D rs] + [define-record-type X rs] + [fields X rs] + [immutable X rs] + [mutable X rs] + [opaque X rs] + [parent X rs] + [parent-rtd X rs] + [protocol X rs] + [record-constructor-descriptor X rs] + [record-type-descriptor X rs] + [sealed X rs] + [nongenerative X rs] ;;; - [record-field-mutable? D ri] - [record-rtd D ri] - [record-type-field-names D ri] - [record-type-generative? D ri] - [record-type-name D ri] - [record-type-opaque? D ri] - [record-type-parent D ri] - [record-type-sealed? D ri] - [record-type-uid D ri] - [record? D ri] + [record-field-mutable? X ri] + [record-rtd X ri] + [record-type-field-names X ri] + [record-type-generative? X ri] + [record-type-name X ri] + [record-type-opaque? X ri] + [record-type-parent X ri] + [record-type-sealed? X ri] + [record-type-uid X ri] + [record? X ri] ;;; - [make-record-constructor-descriptor D rp] - [make-record-type-descriptor D rp] - [record-accessor D rp] - [record-constructor D rp] - [record-mutator D rp] - [record-predicate D rp] - [record-type-descriptor? D rp] + [make-record-constructor-descriptor X rp] + [make-record-type-descriptor X rp] + [record-accessor X rp] + [record-constructor X rp] + [record-mutator X rp] + [record-predicate X rp] + [record-type-descriptor? X rp] ;;; [bound-identifier=? C sc] [datum->syntax C sc]