diff --git a/doc/scsh-manual.ps b/doc/scsh-manual.ps index 6d46438..26321dc 100644 --- a/doc/scsh-manual.ps +++ b/doc/scsh-manual.ps @@ -1,74 +1,82 @@ %!PS-Adobe-2.0 -%%Creator: dvipsk 5.58f Copyright 1986, 1994 Radical Eye Software +%%Creator: dvips(k) 5.85 Copyright 1999 Radical Eye Software %%Title: man.dvi -%%Pages: 169 +%%Pages: 201 %%PageOrder: Ascend -%%BoundingBox: 0 0 612 792 +%%BoundingBox: 0 0 596 842 %%DocumentFonts: Palatino-Bold Palatino-Roman Palatino-Italic -%%DocumentPaperSizes: Letter %%EndComments +%DVIPSWebPage: (www.radicaleye.com) %DVIPSCommandLine: dvips -o man.ps man.dvi -%DVIPSParameters: dpi=600, comments removed -%DVIPSSource: TeX output 1997.04.18:2358 -%%BeginProcSet: tex.pro -/TeXDict 250 dict def TeXDict begin /N{def}def /B{bind def}N /S{exch}N -/X{S N}B /TR{translate}N /isls false N /vsize 11 72 mul N /hsize 8.5 72 -mul N /landplus90{false}def /@rigin{isls{[0 landplus90{1 -1}{-1 1} -ifelse 0 0 0]concat}if 72 Resolution div 72 VResolution div neg scale -isls{landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div -hsize mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul -TR[matrix currentmatrix{dup dup round sub abs 0.00001 lt{round}if} -forall round exch round exch]setmatrix}N /@landscape{/isls true N}B -/@manualfeed{statusdict /manualfeed true put}B /@copies{/#copies X}B -/FMat[1 0 0 -1 0 0]N /FBB[0 0 0 0]N /nn 0 N /IE 0 N /ctr 0 N /df-tail{ -/nn 8 dict N nn begin /FontType 3 N /FontMatrix fntrx N /FontBBox FBB N -string /base X array /BitMaps X /BuildChar{CharBuilder}N /Encoding IE N -end dup{/foo setfont}2 array copy cvx N load 0 nn put /ctr 0 N[}B /df{ -/sf 1 N /fntrx FMat N df-tail}B /dfs{div /sf X /fntrx[sf 0 0 sf neg 0 0] -N df-tail}B /E{pop nn dup definefont setfont}B /ch-width{ch-data dup -length 5 sub get}B /ch-height{ch-data dup length 4 sub get}B /ch-xoff{ -128 ch-data dup length 3 sub get sub}B /ch-yoff{ch-data dup length 2 sub -get 127 sub}B /ch-dx{ch-data dup length 1 sub get}B /ch-image{ch-data -dup type /stringtype ne{ctr get /ctr ctr 1 add N}if}B /id 0 N /rw 0 N -/rc 0 N /gp 0 N /cp 0 N /G 0 N /sf 0 N /CharBuilder{save 3 1 roll S dup -/base get 2 index get S /BitMaps get S get /ch-data X pop /ctr 0 N ch-dx -0 ch-xoff ch-yoff ch-height sub ch-xoff ch-width add ch-yoff -setcachedevice ch-width ch-height true[1 0 0 -1 -.1 ch-xoff sub ch-yoff -.1 sub]{ch-image}imagemask restore}B /D{/cc X dup type /stringtype ne{]} -if nn /base get cc ctr put nn /BitMaps get S ctr S sf 1 ne{dup dup -length 1 sub dup 2 index S get sf div put}if put /ctr ctr 1 add N}B /I{ -cc 1 add D}B /bop{userdict /bop-hook known{bop-hook}if /SI save N @rigin -0 0 moveto /V matrix currentmatrix dup 1 get dup mul exch 0 get dup mul -add .99 lt{/QV}{/RV}ifelse load def pop pop}N /eop{SI restore userdict -/eop-hook known{eop-hook}if showpage}N /@start{userdict /start-hook -known{start-hook}if pop /VResolution X /Resolution X 1000 div /DVImag X -/IE 256 array N 0 1 255{IE S 1 string dup 0 3 index put cvn put}for -65781.76 div /vsize X 65781.76 div /hsize X}N /p{show}N /RMat[1 0 0 -1 0 -0]N /BDot 260 string N /rulex 0 N /ruley 0 N /v{/ruley X /rulex X V}B /V -{}B /RV statusdict begin /product where{pop product dup length 7 ge{0 7 -getinterval dup(Display)eq exch 0 4 getinterval(NeXT)eq or}{pop false} -ifelse}{false}ifelse end{{gsave TR -.1 .1 TR 1 1 scale rulex ruley false -RMat{BDot}imagemask grestore}}{{gsave TR -.1 .1 TR rulex ruley scale 1 1 -false RMat{BDot}imagemask grestore}}ifelse B /QV{gsave newpath transform -round exch round exch itransform moveto rulex 0 rlineto 0 ruley neg -rlineto rulex neg 0 rlineto fill grestore}B /a{moveto}B /delta 0 N /tail -{dup /delta X 0 rmoveto}B /M{S p delta add tail}B /b{S p tail}B /c{-4 M} -B /d{-3 M}B /e{-2 M}B /f{-1 M}B /g{0 M}B /h{1 M}B /i{2 M}B /j{3 M}B /k{ -4 M}B /w{0 rmoveto}B /l{p -4 w}B /m{p -3 w}B /n{p -2 w}B /o{p -1 w}B /q{ -p 1 w}B /r{p 2 w}B /s{p 3 w}B /t{p 4 w}B /x{0 S rmoveto}B /y{3 2 roll p -a}B /bos{/SS save N}B /eos{SS restore}B end +%DVIPSParameters: dpi=600, compressed +%DVIPSSource: TeX output 1999.10.03:1843 +%%BeginProcSet: texc.pro +%! +/TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S +N}B/A{dup}B/TR{translate}N/isls false N/vsize 11 72 mul N/hsize 8.5 72 +mul N/landplus90{false}def/@rigin{isls{[0 landplus90{1 -1}{-1 1}ifelse 0 +0 0]concat}if 72 Resolution div 72 VResolution div neg scale isls{ +landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div hsize +mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul TR[ +matrix currentmatrix{A A round sub abs 0.00001 lt{round}if}forall round +exch round exch]setmatrix}N/@landscape{/isls true N}B/@manualfeed{ +statusdict/manualfeed true put}B/@copies{/#copies X}B/FMat[1 0 0 -1 0 0] +N/FBB[0 0 0 0]N/nn 0 N/IEn 0 N/ctr 0 N/df-tail{/nn 8 dict N nn begin +/FontType 3 N/FontMatrix fntrx N/FontBBox FBB N string/base X array +/BitMaps X/BuildChar{CharBuilder}N/Encoding IEn N end A{/foo setfont}2 +array copy cvx N load 0 nn put/ctr 0 N[}B/sf 0 N/df{/sf 1 N/fntrx FMat N +df-tail}B/dfs{div/sf X/fntrx[sf 0 0 sf neg 0 0]N df-tail}B/E{pop nn A +definefont setfont}B/Cw{Cd A length 5 sub get}B/Ch{Cd A length 4 sub get +}B/Cx{128 Cd A length 3 sub get sub}B/Cy{Cd A length 2 sub get 127 sub} +B/Cdx{Cd A length 1 sub get}B/Ci{Cd A type/stringtype ne{ctr get/ctr ctr +1 add N}if}B/id 0 N/rw 0 N/rc 0 N/gp 0 N/cp 0 N/G 0 N/CharBuilder{save 3 +1 roll S A/base get 2 index get S/BitMaps get S get/Cd X pop/ctr 0 N Cdx +0 Cx Cy Ch sub Cx Cw add Cy setcachedevice Cw Ch true[1 0 0 -1 -.1 Cx +sub Cy .1 sub]/id Ci N/rw Cw 7 add 8 idiv string N/rc 0 N/gp 0 N/cp 0 N{ +rc 0 ne{rc 1 sub/rc X rw}{G}ifelse}imagemask restore}B/G{{id gp get/gp +gp 1 add N A 18 mod S 18 idiv pl S get exec}loop}B/adv{cp add/cp X}B +/chg{rw cp id gp 4 index getinterval putinterval A gp add/gp X adv}B/nd{ +/cp 0 N rw exit}B/lsh{rw cp 2 copy get A 0 eq{pop 1}{A 255 eq{pop 254}{ +A A add 255 and S 1 and or}ifelse}ifelse put 1 adv}B/rsh{rw cp 2 copy +get A 0 eq{pop 128}{A 255 eq{pop 127}{A 2 idiv S 128 and or}ifelse} +ifelse put 1 adv}B/clr{rw cp 2 index string putinterval adv}B/set{rw cp +fillstr 0 4 index getinterval putinterval adv}B/fillstr 18 string 0 1 17 +{2 copy 255 put pop}for N/pl[{adv 1 chg}{adv 1 chg nd}{1 add chg}{1 add +chg nd}{adv lsh}{adv lsh nd}{adv rsh}{adv rsh nd}{1 add adv}{/rc X nd}{ +1 add set}{1 add clr}{adv 2 chg}{adv 2 chg nd}{pop nd}]A{bind pop} +forall N/D{/cc X A type/stringtype ne{]}if nn/base get cc ctr put nn +/BitMaps get S ctr S sf 1 ne{A A length 1 sub A 2 index S get sf div put +}if put/ctr ctr 1 add N}B/I{cc 1 add D}B/bop{userdict/bop-hook known{ +bop-hook}if/SI save N @rigin 0 0 moveto/V matrix currentmatrix A 1 get A +mul exch 0 get A mul add .99 lt{/QV}{/RV}ifelse load def pop pop}N/eop{ +SI restore userdict/eop-hook known{eop-hook}if showpage}N/@start{ +userdict/start-hook known{start-hook}if pop/VResolution X/Resolution X +1000 div/DVImag X/IEn 256 array N 2 string 0 1 255{IEn S A 360 add 36 4 +index cvrs cvn put}for pop 65781.76 div/vsize X 65781.76 div/hsize X}N +/p{show}N/RMat[1 0 0 -1 0 0]N/BDot 260 string N/Rx 0 N/Ry 0 N/V{}B/RV/v{ +/Ry X/Rx X V}B statusdict begin/product where{pop false[(Display)(NeXT) +(LaserWriter 16/600)]{A length product length le{A length product exch 0 +exch getinterval eq{pop true exit}if}{pop}ifelse}forall}{false}ifelse +end{{gsave TR -.1 .1 TR 1 1 scale Rx Ry false RMat{BDot}imagemask +grestore}}{{gsave TR -.1 .1 TR Rx Ry scale 1 1 false RMat{BDot} +imagemask grestore}}ifelse B/QV{gsave newpath transform round exch round +exch itransform moveto Rx 0 rlineto 0 Ry neg rlineto Rx neg 0 rlineto +fill grestore}B/a{moveto}B/delta 0 N/tail{A/delta X 0 rmoveto}B/M{S p +delta add tail}B/b{S p tail}B/c{-4 M}B/d{-3 M}B/e{-2 M}B/f{-1 M}B/g{0 M} +B/h{1 M}B/i{2 M}B/j{3 M}B/k{4 M}B/w{0 rmoveto}B/l{p -4 w}B/m{p -3 w}B/n{ +p -2 w}B/o{p -1 w}B/q{p 1 w}B/r{p 2 w}B/s{p 3 w}B/t{p 4 w}B/x{0 S +rmoveto}B/y{3 2 roll p a}B/bos{/SS save N}B/eos{SS restore}B end + %%EndProcSet -%%BeginFont: Palatino-Bold +%%BeginProcSet: 8r.enc % @@psencodingfile@{ % author = "S. Rahtz, P. MacKay, Alan Jeffrey, B. Horn, K. Berry", % version = "0.6", -% date = "22 June 1996", +% date = "1 July 1998", % filename = "8r.enc", -% email = "kb@@mail.tug.org", -% address = "135 Center Hill Rd. // Plymouth, MA 02360", -% codetable = "ISO/ASCII", -% checksum = "119 662 4424", -% docstring = "Encoding for TrueType or Type 1 fonts to be used with TeX." +% email = "tex-fonts@@tug.org", +% docstring = "Encoding for TrueType or Type 1 fonts +% to be used with TeX." % @} % % Idea is to have all the characters normally included in Type 1 fonts @@ -96,7 +104,8 @@ a}B /bos{/SS save N}B /eos{SS restore}B end % upward-compatible revisions, if someday more characters are generally % available. % -% (5) hyphen appears twice for compatibility with both ASCII and Windows. +% (5) hyphen appears twice for compatibility with both +% ASCII and Windows. % /TeXBase1Encoding [ % 0x00 (encoded characters from Adobe Standard not in Windows 3.1) @@ -114,7 +123,7 @@ a}B /bos{/SS save N}B /eos{SS restore}B end /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef % very contentious; it's so painful not having quoteleft and quoteright - % at 96 and 145 that we move the things normally found there down to here. + % at 96 and 145 that we move the things normally found there to here. /grave /quotesingle % 0x20 (ASCII begins) /space /exclam /quotedbl /numbersign @@ -178,1678 +187,824 @@ a}B /bos{/SS save N}B /eos{SS restore}B end /oslash /ugrave /uacute /ucircumflex /udieresis /yacute /thorn /ydieresis ] def -%%EndFont -%%BeginProcSet: texps.pro -TeXDict begin /rf{findfont dup length 1 add dict begin{1 index /FID ne 2 -index /UniqueID ne and{def}{pop pop}ifelse}forall[1 index 0 6 -1 roll -exec 0 exch 5 -1 roll VResolution Resolution div mul neg 0 0]/Metrics -exch def dict begin Encoding{exch dup type /integertype ne{pop pop 1 sub -dup 0 le{pop}{[}ifelse}{FontMatrix 0 get div Metrics 0 get div def} -ifelse}forall Metrics /Metrics currentdict end def[2 index currentdict -end definefont 3 -1 roll makefont /setfont load]cvx def}def -/ObliqueSlant{dup sin S cos div neg}B /SlantFont{4 index mul add}def -/ExtendFont{3 -1 roll mul exch}def /ReEncodeFont{/Encoding exch def}def -end + %%EndProcSet -TeXDict begin 40258431 52099146 1000 600 600 (man.dvi) -@start /Fa 1 42 df<0000000000F00000000000000000F00000000000000000F80000 -0000000000007C00000000000000003C00000000000000003E00000000000000001F0000 -0000000000001F00000000000000000F800000000000000007C00000000000000003E000 -007FFFFFFFFFFFF00000FFFFFFFFFFFFF80000FFFFFFFFFFFFFC00007FFFFFFFFFFFFF00 -000000000000001F80000000000000000FE00000000000000003F00000000000000001FE -00000000000000007F80000000000000001FF0000000000000001FF0000000000000007F -8000000000000001FE0000000000000003F0000000000000000FE0000000000000001F80 -007FFFFFFFFFFFFF0000FFFFFFFFFFFFFC0000FFFFFFFFFFFFF800007FFFFFFFFFFFF000 -00000000000003E00000000000000007C0000000000000000F80000000000000001F0000 -0000000000001F00000000000000003E00000000000000003C00000000000000007C0000 -000000000000F80000000000000000F00000000000000000F0000000442A7CA74D>41 -D E /Fb 1 62 df<7FFFFFFFFFFFC0FFFFFFFFFFFFE0FFFFFFFFFFFFE07FFFFFFFFFFFC0 -000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000007FFFFFFFFFFFC0FFFFFFFFFFFFE0FFFFFFFFFFFFE07FFFFF -FFFFFFC033147C9C3C>61 D E /Fc 1 16 df<007F800001FFE00007FFF8000FFFFC001F -FFFE003FFFFF003FFFFF007FFFFF807FFFFF80FFFFFFC0FFFFFFC0FFFFFFC0FFFFFFC0FF -FFFFC0FFFFFFC0FFFFFFC0FFFFFFC0FFFFFFC07FFFFF807FFFFF803FFFFF003FFFFF001F -FFFE000FFFFC0007FFF80001FFE000007F80001A1B7C9D23>15 D -E /Fd 1 22 df<007C000000007F800000001FE00000000FE000000007F000000007F000 -000003F800000003F800000003F800000001FC00000001FC00000001FC00000000FE0000 -0000FE00000000FF000000007F000000007F000000003F800000003F800000003F800000 -001FC00000001FC00000001FE00000000FE00000000FE000000007F000000007F0000000 -07F000000007F80000000FF80000001FF80000003DFC00000079FC000000F8FE000001F0 -FE000003E0FE000007C07F00000F807F00001F007F00003E003F80007E003F8000FC003F -C001F8001FC003F0001FC007E0000FE01FC0000FE03FC0000FE07F800007F0FF000007F0 -FE000007F8FC000003F8F8000001FCF0000000FC26357CB32D>21 -D E /Fe 157[23 22 97[{ TeXBase1Encoding ReEncodeFont }2 -50.000001 /Palatino-Italic rf /Ff 157[27 26 97[{ - TeXBase1Encoding ReEncodeFont }2 58.333334 /Palatino-Italic -rf /Fg 167[40 4[31 3[47 5[20 73[{ TeXBase1Encoding ReEncodeFont }4 -59.999974 /Palatino-Roman rf /Fh 87 126 df<3C7EFFFFFFFFFFFFFFFFFFFFFFFF -FFFFFF7E7E7E7E7E7E7E7E7E7E7E7E7E7E3C000000000000003C7EFFFFFFFF7E3C082F71 -AE27>33 D<1000207C00F8FE01FCFE01FCFE01FCFE01FCFE01FCFE01FCFE01FCFE01FCFE -01FCFE01FCFC00FC7C00F87C00F87C00F87C00F87C00F87C00F87C00F87C00F87C00F838 -0070161778AE27>I<003C03C0007E07E0007E07E0007E07E0007E07E0007E07E0007E07 -E0007E07E000FE0FE000FC0FC000FC0FC07FFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -FF3FFFFFFE01F81F8001F81F8001F81F8001F81F8001F81F8001F81F8001F81F8001F81F -8001F81F8001F81F8001F81F8001F81F803FFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF -FF7FFFFFFE03F03F0003F03F0007F07F0007E07E0007E07E0007E07E0007E07E0007E07E -0007E07E0007E07E0003C03C00202E7DAD27>I<000380000007C0000007C0000007C000 -0007C0000007C000001FF00000FFFE0003FFFF8007FFFFC01FFFFFE01FE7DFF03F87C7F8 -7E07C3F87C07C1F8FC07C0FCF807C0FCF807C1FCF807C1FCF807C1FCFC07C0F8FE07C070 -7F07C0007F87C0003FFFC0001FFFC0000FFFF80007FFFE0003FFFF8000FFFFC0000FFFE0 -0007FFF00007CFF00007C3F80007C1F83807C0FC7C07C0FCFE07C07CFE07C07CFE07C07C -FE07C07CFC07C07CFE07C0F87E07C1F87F07C3F03F87C7F03FF7FFE01FFFFFC00FFFFF80 -03FFFF0001FFFC00003FE0000007C0000007C0000007C0000007C0000007C00000038000 -1E3A7CB327>I<001F000000007FC0000000FFE0000001FFE0000001FFF0000003F1F000 -0003E1F8000007E0F8000007C0F8000007C0F8000007C0F8000007C0F8000007C0F80000 -07C1F8000007C1F0000007C3F1FF8007E3E1FFC003E7E3FFC003EFC1FFC003FFC1FF8003 -FF81F80003FF01F00001FE01F00001FC03F00001F803E00003F807E00007FC07C0000FFC -07C0001FFE0FC0003FBE0F80003F3F1F80007E1F1F00007E1F9F0000FC0FBF0000FC0FFE -0000FC07FE0000FC07FC0200FC03FC0F80FC01F80F80FC01F80F80FE03FC0F807E07FE0F -807F1FFF9F803FFFFFFF003FFF9FFF001FFF0FFE000FFC03FC0003F000F80022307EAE27 ->38 D<0F001FC03FC03FE03FE03FF01FF00FF001F001F001F001F003F003E007E00FC00F -C03F807F00FF00FE00F80070000C1773AD27>I<0001C00003E0000FE0001FE0003FC000 -7F8000FE0001FC0001F80003F80007F00007E0000FC0000FC0001F80001F80003F00003F -00003F00007E00007E00007E00007E0000FC0000FC0000FC0000FC0000FC0000FC0000FC -0000FC0000FC0000FC0000FC0000FC00007E00007E00007E00007E00003F00003F00003F -00001F80001F80000FC0000FC00007E00007F00003F80001F80001FC0000FE00007F8000 -3FC0001FE0000FE00003E00001C0133A73B327>I<700000F80000FE0000FF00007F8000 -3FC0000FE00007F00003F00003F80001FC0000FC00007E00007E00003F00003F00001F80 -001F80001F80000FC0000FC0000FC0000FC00007E00007E00007E00007E00007E00007E0 -0007E00007E00007E00007E00007E00007E0000FC0000FC0000FC0000FC0001F80001F80 -001F80003F00003F00007E00007E0000FC0001FC0003F80003F00007F0000FE0003FC000 -7F8000FF0000FE0000F80000700000133A7AB327>I<000F0000001F8000001F8000001F -8000001F8000001F8000001F8000781F81E0FE1F87F0FF1F8FF0FFDFBFF07FFFFFE03FFF -FFC00FFFFF0003FFFC0000FFF00000FFF00003FFFC000FFFFF003FFFFFC07FFFFFE0FFDF -BFF0FF1F8FF0FE1F87F0781F81E0001F8000001F8000001F8000001F8000001F8000001F -8000000F00001C207BA627>I<0003C0000007E0000007E0000007E0000007E0000007E0 -000007E0000007E0000007E0000007E0000007E0000007E0000007E0000007E0007FFFFF -FEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFE0007E0000007E0000007E0000007E0 -000007E0000007E0000007E0000007E0000007E0000007E0000007E0000007E0000007E0 -000003C00020227DA727>I<0F003FC03FE07FF07FF07FF87FF83FF83FF80FF801F801F0 -03F007E01FE07FC0FF80FF00FE0070000D14738927>I<7FFFFFF8FFFFFFFCFFFFFFFCFF -FFFFFCFFFFFFFC7FFFFFF81E067C9927>I<1E007F807F80FFC0FFC0FFC0FFC07F807F80 -1E000A0A728927>I<000000380000007C000000FC000000FC000001FC000001F8000003 -F8000003F0000007F0000007E000000FE000000FC000001FC000001F8000003F8000003F -0000003F0000007F0000007E000000FE000000FC000001FC000001F8000003F8000003F0 -000007F0000007E000000FE000000FC000000FC000001FC000001F8000003F8000003F00 -00007F0000007E000000FE000000FC000001FC000001F8000003F8000003F0000003F000 -0007F0000007E000000FE000000FC000001FC000001F8000003F8000003F0000007F0000 -007E000000FE000000FC000000FC000000F8000000780000001E3A7CB327>I<0007E000 -003FFC00007FFE0000FFFF0001FFFF8003FC3FC007F00FE00FE007F00FC003F01F8001F8 -1F8001F83F0000FC3F0000FC3E00007C7E00007E7E00007E7E00007E7C00003EFC00003F -FC00003FFC00003FFC00003FFC00003FFC00003FFC00003FFC00003FFC00003FFC00003F -FC00003FFC00003F7E00007E7E00007E7E00007E7E00007E3F0000FC3F0000FC3F8001FC -1F8001F81FC003F80FC003F00FE007F007F00FE003FC3FC001FFFF8000FFFF00007FFE00 -003FFC000007E00020307DAE27>I<000E0000001F0000001F0000003F0000007F000000 -7F000000FF000001FF000003FF00007FFF0000FFFF0000FFFF0000FFBF00007E3F000000 -3F0000003F0000003F0000003F0000003F0000003F0000003F0000003F0000003F000000 -3F0000003F0000003F0000003F0000003F0000003F0000003F0000003F0000003F000000 -3F0000003F0000003F0000003F0000003F0000003F0000003F0000003F0000003F000000 -3F00003FFFFF807FFFFF807FFFFFC07FFFFF807FFFFF801A2F79AE27>I<003FE00001FF -F80003FFFE000FFFFF801FFFFFC03FE07FE03F800FE07F0007F07E0003F8FE0001F8FC00 -01F8FE0001FCFE0000FCFE0000FCFE0000FC7C0000FC000000FC000000FC000001FC0000 -01F8000001F8000003F8000003F0000007F000000FE000001FC000003FC000007F800000 -FF000001FE000003FC000007F800000FF000001FE000003FC000007F800000FE000001FC -000007F800780FF000FC1FE000FC3FC000FC7FFFFFFCFFFFFFFCFFFFFFFCFFFFFFFC7FFF -FFF81E2F7CAE27>I<001FF80000FFFE0003FFFF800FFFFFC00FFFFFE01FF01FF03FC007 -F83F8001F83F8001FC3F8000FC3F8000FC1F0000FC040000FC000000FC000001FC000001 -F8000003F8000007F000000FF000003FE0001FFFC0003FFF80003FFF80003FFFE0001FFF -F000001FF8000003FC000001FC000000FE0000007E0000007F0000003F0000003F380000 -3F7C00003FFE00003FFE00003FFE00007FFC00007EFE0000FE7F0001FC7F8003FC3FF01F -F81FFFFFF00FFFFFE003FFFF8000FFFE00001FF80020307DAE27>I<00003F800000007F -C00000007FC0000000FFC0000001FFC0000001FFC0000003F7C0000007E7C0000007E7C0 -00000FC7C000000F87C000001F87C000003F07C000003F07C000007E07C00000FC07C000 -00FC07C00001F807C00001F007C00003F007C00007E007C00007E007C0000FC007C0001F -8007C0001F8007C0003F0007C0003E0007C0007E0007C000FC0007C000FFFFFFFF80FFFF -FFFFC0FFFFFFFFC0FFFFFFFFC07FFFFFFF80000007C000000007C000000007C000000007 -C000000007C000000007C000000007C000000007C0000001FFFF000003FFFF800003FFFF -800003FFFF800001FFFF00222F7EAE27>I<1FFFFFE03FFFFFF03FFFFFF03FFFFFF03FFF -FFE03F0000003F0000003F0000003F0000003F0000003F0000003F0000003F0000003F00 -00003F0000003F0000003F0000003F1FF0003FFFFC003FFFFF003FFFFF803FFFFFC03FF0 -3FE03FC00FF03F0007F03E0003F81C0001F8000001F8000001FC000000FC000000FC0000 -00FC7C0000FCFE0000FCFE0000FCFE0001FCFE0001F8FC0003F8FE0003F07F000FF07F80 -1FE03FE07FC01FFFFF800FFFFF0007FFFE0001FFF800007FC0001E2F7CAD27>I<0000FF -000007FFC0001FFFF0003FFFF800FFFFF801FF81FC03FE01FC03F801FC07F001FC0FE001 -FC0FC000F81FC000003F8000003F0000003F0000007F0000007E0000007E0FF800FE3FFE -00FCFFFF80FFFFFFC0FFFFFFE0FFF80FF0FFE007F8FF8001FCFF0000FCFF0000FEFE0000 -7EFE00007FFE00003FFE00003FFE00003F7E00003F7E00003F7E00003F7F00003F3F0000 -7F3F00007E1F8000FE1FC001FC0FC001FC0FF007F807F81FF003FFFFE001FFFFC000FFFF -80003FFE00000FF80020307DAE27>I<78000000FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF -FFFFFFFEFC0001FCFC0003F8FC0007F0780007E000000FE000001FC000001F8000003F80 -00007F0000007E000000FE000000FC000001FC000001F8000003F8000003F0000007F000 -0007E0000007E000000FC000000FC000000FC000001F8000001F8000001F8000003F8000 -003F0000003F0000003F0000003F0000003F0000007F0000007E0000007E0000007E0000 -007E0000007E0000007E0000007E0000007E0000007E0000003C000020307DAE27>I<00 -0FF000007FFE0001FFFF8003FFFFC00FFFFFF00FF81FF01FE007F83F8001FC3F0000FC7F -0000FE7E00007E7E00007E7E00007E7E00007E7E00007E3F0000FC3F8001FC1FC003F80F -E007F007FC3FE001FFFF80007FFE00003FFC0000FFFF0003FFFFC00FF00FF01FC003F83F -8001FC3F0000FC7E00007E7E00007EFC00003FFC00003FFC00003FFC00003FFC00003FFC -00003F7E00007E7E00007E7F0000FE3F8001FC1FE007F81FF81FF80FFFFFF007FFFFE001 -FFFF80007FFE00000FF00020307DAE27>I<000FF000007FFC0001FFFF0003FFFF8007FF -FFC00FF81FE01FE007F03FC003F83F8001F87F0001FC7E0000FCFE0000FCFC00007EFC00 -007EFC00007EFC00007EFC00007FFC00007FFC00007FFE00007F7E00007F7F0000FF3F00 -00FF3F8001FF1FE007FF0FF01FFF07FFFFFF03FFFFFF01FFFF3F007FFC7F001FF07E0000 -007E0000007E000000FC000000FC000001FC000001F81F0003F83F8007F03F800FE03F80 -1FE03F803FC03FC0FF801FFFFF001FFFFE000FFFF80003FFE00000FF800020307DAE27> -I<1E007F807F80FFC0FFC0FFC0FFC07F807F801E00000000000000000000000000000000 -0000000000000000001E007F807F80FFC0FFC0FFC0FFC07F807F801E000A20729F27>I< -0F003FC03FC07FE07FE07FE07FE03FC03FC00F0000000000000000000000000000000000 -00000000000000000F003F803FC07FC07FE07FE07FE03FE03FE00FE007E007C00FC00FC0 -3F807F00FF00FE00F80070000B2A739F27>I<7FFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFF -FFFFFF3FFFFFFE0000000000000000000000000000000000000000000000003FFFFFFEFF -FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFE20127D9F27>61 D<70000000FC000000FE -000000FF800000FFC000007FF000001FF800000FFC000003FF000001FF8000007FE00000 -3FF000001FF8000007FE000003FF000000FFC000007FE000003FF800000FFC000007FC00 -0007FC00000FFC00003FF800007FE00000FFC00003FF000007FE00001FF800003FF00000 -7FE00001FF800003FF00000FFC00001FF800007FF00000FFC00000FF800000FE000000FC -000000700000001E287CAA27>I<00FFF80003FFFF000FFFFFC03FFFFFE07FFFFFF07FC0 -1FF8FF0003FCFE0001FCFE0000FCFE0000FCFE0001FC7C0003FC00000FF800001FF00000 -7FE00000FFC00001FF000003FC000007F8000007F000000FE000000FC000001FC000001F -8000001F8000001F8000001F8000001F8000001F8000001F8000000F0000000000000000 -00000000000000000000000000000000000000000000000F0000001F8000003FC000003F -C000003FC000003FC000001F8000000F00001E2E7CAD27>I<0001FE000007FF80001FFF -C0007FFFE000FFFFF001FF03F803FC01F807F000FC0FE01F7C0FC07FFE1F80FFFE1F01FF -FE3F03FFFE3E07F1FF7E07E0FF7C0FC07F7C0F803F7C0F803FFC1F803FF81F001FF81F00 -1FF81F001FF81F001FF81F001FF81F001FF81F001FF81F001FFC1F803F7C0F803E7C0F80 -3E7C0FC07E7E07E0FC3E07F1FC3F03FFF81F01FFF01F80FFE00FC07FC00FE01F1E07F000 -3F03FC007F01FF03FF00FFFFFE007FFFFC001FFFF00007FFC00001FF00202E7DAD27>I< -0003F000000007F800000007F80000000FFC0000000FFC0000000FFC0000000FFC000000 -0F3C0000001F3E0000001F3E0000001F3E0000001F3E0000001F3E0000003F3F0000003F -3F0000003F3F0000003E1F0000003E1F0000007E1F8000007E1F8000007E1F8000007E1F -800000FC0FC00000FC0FC00000FC0FC00000FC0FC00000FC0FC00001F807E00001F807E0 -0001F807E00001FFFFE00001FFFFE00003FFFFF00003FFFFF00003FFFFF00003F003F000 -03F003F00007E001F80007E001F80007E001F80007E001F8000FE001FC007FFC0FFF80FF -FC0FFFC0FFFE1FFFC0FFFC0FFFC07FFC0FFF80222F7EAE27>I<7FFFFF0000FFFFFFC000 -FFFFFFE000FFFFFFF8007FFFFFF80007E003FC0007E000FE0007E0007E0007E0007F0007 -E0003F0007E0003F0007E0003F0007E0003F0007E0003F0007E0003F0007E0007E0007E0 -007E0007E000FC0007E003FC0007E00FF80007FFFFF00007FFFFC00007FFFFF00007FFFF -F80007FFFFFC0007E000FE0007E0007F0007E0003F8007E0001F8007E0001F8007E0000F -C007E0000FC007E0000FC007E0000FC007E0000FC007E0000FC007E0001FC007E0001F80 -07E0003F8007E0007F0007E001FF007FFFFFFE00FFFFFFFC00FFFFFFF800FFFFFFE0007F -FFFF8000222E7FAD27>I<0003F80E001FFE1F003FFFBF00FFFFFF01FFFFFF03FE0FFF07 -F803FF07F001FF0FE000FF1FC000FF1F80007F1F80007F3F00003F3F00003F7F00003F7E -00003F7E00001E7E000000FE000000FC000000FC000000FC000000FC000000FC000000FC -000000FC000000FC000000FC000000FC000000FE0000007E0000007E0000007E00001E7F -00003F3F00003F3F00003F1F80003F1F80007F1FC0007E0FE000FE07F001FC07F803FC03 -FE0FF801FFFFF000FFFFE0003FFFC0001FFF000003F80020307DAE27>I<7FFFFC00007F -FFFF0000FFFFFFC0007FFFFFE0007FFFFFF00007E00FF80007E007F80007E001FC0007E0 -00FE0007E000FE0007E0007E0007E0007F0007E0003F0007E0003F8007E0001F8007E000 -1F8007E0001F8007E0001FC007E0000FC007E0000FC007E0000FC007E0000FC007E0000F -C007E0000FC007E0000FC007E0000FC007E0000FC007E0000FC007E0000FC007E0001F80 -07E0001F8007E0001F8007E0003F8007E0003F0007E0003F0007E0007F0007E000FE0007 -E000FE0007E001FC0007E003F80007E00FF8007FFFFFF0007FFFFFE000FFFFFFC0007FFF -FF00007FFFFC0000222E7FAD27>I<7FFFFFFF80FFFFFFFFC0FFFFFFFFC0FFFFFFFFC07F -FFFFFFC007E0000FC007E0000FC007E0000FC007E0000FC007E0000FC007E0000FC007E0 -00078007E000000007E000000007E000000007E000000007E007800007E00FC00007E00F -C00007E00FC00007FFFFC00007FFFFC00007FFFFC00007FFFFC00007FFFFC00007E00FC0 -0007E00FC00007E00FC00007E007800007E000000007E000000007E000000007E0000000 -07E00003C007E00007E007E00007E007E00007E007E00007E007E00007E007E00007E007 -E00007E07FFFFFFFE0FFFFFFFFE0FFFFFFFFE0FFFFFFFFE07FFFFFFFC0232E7FAD27>I< -7FFFFFFF80FFFFFFFFC0FFFFFFFFC0FFFFFFFFC07FFFFFFFC007E0000FC007E0000FC007 -E0000FC007E0000FC007E0000FC007E0000FC007E000078007E000000007E000000007E0 -00000007E000000007E007800007E00FC00007E00FC00007E00FC00007FFFFC00007FFFF -C00007FFFFC00007FFFFC00007FFFFC00007E00FC00007E00FC00007E00FC00007E00780 -0007E000000007E000000007E000000007E000000007E000000007E000000007E0000000 -07E000000007E000000007E000000007E000000007E00000007FFF800000FFFFC00000FF -FFC00000FFFFC000007FFF800000222E7EAD27>I<0007F03800001FFC7C00007FFFFC00 -00FFFFFC0001FFFFFC0003FC1FFC0007F00FFC000FE007FC000FC003FC001FC001FC001F -8001FC003F8001FC003F0000FC003F0000FC007E0000FC007E0000FC007E000078007E00 -000000FC00000000FC00000000FC00000000FC00000000FC00000000FC00000000FC0000 -0000FC00000000FC001FFF00FC003FFF80FC003FFF80FC003FFF807E001FFF007E0000FC -007E0000FC007E0000FC003F0001FC003F0001FC003F8001FC001F8001FC001FC003FC00 -0FC003FC000FE007FC0007F00FFC0003FC1FFC0001FFFFFC0000FFFFFC00007FFEFC0000 -1FFC78000007F0000021307DAE27>I<7FFE07FFE0FFFF0FFFF0FFFF0FFFF0FFFF0FFFF0 -7FFE07FFE007E0007E0007E0007E0007E0007E0007E0007E0007E0007E0007E0007E0007 -E0007E0007E0007E0007E0007E0007E0007E0007E0007E0007E0007E0007E0007E0007E0 -007E0007E0007E0007FFFFFE0007FFFFFE0007FFFFFE0007FFFFFE0007FFFFFE0007E000 -7E0007E0007E0007E0007E0007E0007E0007E0007E0007E0007E0007E0007E0007E0007E -0007E0007E0007E0007E0007E0007E0007E0007E0007E0007E0007E0007E0007E0007E00 -07E0007E007FFE07FFE0FFFF0FFFF0FFFF0FFFF0FFFF0FFFF07FFE07FFE0242E7FAD27> -I<7FFFFFE0FFFFFFF0FFFFFFF0FFFFFFF07FFFFFE0001F8000001F8000001F8000001F80 -00001F8000001F8000001F8000001F8000001F8000001F8000001F8000001F8000001F80 -00001F8000001F8000001F8000001F8000001F8000001F8000001F8000001F8000001F80 -00001F8000001F8000001F8000001F8000001F8000001F8000001F8000001F8000001F80 -00001F8000001F8000001F8000001F8000001F80007FFFFFE0FFFFFFF0FFFFFFF0FFFFFF -F07FFFFFE01C2E7BAD27>I<001FFFF8003FFFFC003FFFFC003FFFFC001FFFF800001F80 -00001F8000001F8000001F8000001F8000001F8000001F8000001F8000001F8000001F80 -00001F8000001F8000001F8000001F8000001F8000001F8000001F8000001F8000001F80 -00001F8000001F8000001F8000001F8000001F8000001F8000001F8000001F8000001F80 -00001F8000001F807C001F807C001F80FE001F80FE001F80FE003F00FE007F007F81FE00 -7FFFFE003FFFFC001FFFF80007FFE00000FF00001E2F7BAD27>I<7FFC07FF807FFC07FF -C0FFFE0FFFC07FFC07FFC07FFC07FF8007C001F80007C003F80007C003F00007C007E000 -07C00FC00007C01FC00007C01F800007C03F000007C07E000007C0FE000007C0FC000007 -C1F8000007C3F0000007C7F0000007C7E0000007CFF0000007DFF8000007FFF8000007FF -FC000007FEFC000007FC7E000007FC3E000007F83F000007F01F000007E01F800007E00F -800007C00FC00007C007C00007C007E00007C003E00007C003F00007C001F80007C001F8 -0007C000FC0007C0007C0007C0007E007FFC01FFC07FFC01FFE0FFFE03FFE07FFC01FFE0 -7FFC01FFC0232E7FAD27>I<7FFFC000007FFFE00000FFFFE000007FFFE000007FFFC000 -0003F000000003F000000003F000000003F000000003F000000003F000000003F0000000 -03F000000003F000000003F000000003F000000003F000000003F000000003F000000003 -F000000003F000000003F000000003F000000003F000000003F000000003F000000003F0 -00000003F000000003F000000003F000000003F000000003F000000003F000000003F000 -078003F0000FC003F0000FC003F0000FC003F0000FC003F0000FC003F0000FC003F0000F -C07FFFFFFFC07FFFFFFFC0FFFFFFFFC07FFFFFFFC07FFFFFFF80222E7FAD27>I<7FE000 -7FE0FFF000FFF0FFF000FFF0FFF801FFF07FF801FFE00FF801FF000FB801DF000FBC03DF -000FBC03DF000FBC03DF000FBE07DF000F9E079F000F9E079F000F9E079F000F9F0F9F00 -0F9F0F9F000F8F0F1F000F8F0F1F000F8F9F1F000F8F9F1F000F879E1F000F879E1F000F -879E1F000F879E1F000F839C1F000F83FC1F000F83FC1F000F83FC1F000F81F81F000F81 -F81F000F80F01F000F80001F000F80001F000F80001F000F80001F000F80001F000F8000 -1F000F80001F000F80001F000F80001F000F80001F007FF000FFE0FFF801FFF0FFF801FF -F0FFF801FFF07FF000FFE0242E7FAD27>I<7FF003FFE0FFF807FFF0FFF807FFF0FFFC07 -FFF07FFC03FFE007FC003E0007DE003E0007DE003E0007DE003E0007CF003E0007CF003E -0007CF003E0007CF803E0007C7803E0007C7C03E0007C7C03E0007C3C03E0007C3E03E00 -07C3E03E0007C1E03E0007C1F03E0007C1F03E0007C1F03E0007C0F83E0007C0F83E0007 -C0F83E0007C0783E0007C07C3E0007C07C3E0007C03C3E0007C03E3E0007C03E3E0007C0 -1E3E0007C01F3E0007C00F3E0007C00F3E0007C00F3E0007C007BE0007C007BE0007C007 -BE0007C003FE007FFC03FE00FFFE03FE00FFFE01FE00FFFE01FE007FFC00FC00242E7FAD -27>I<00FFFC0007FFFF801FFFFFE01FFFFFE03FFFFFF03FC00FF07F8007F87F0003F87E -0001F87E0001F87E0001F8FC0000FCFC0000FCFC0000FCFC0000FCFC0000FCFC0000FCFC -0000FCFC0000FCFC0000FCFC0000FCFC0000FCFC0000FCFC0000FCFC0000FCFC0000FCFC -0000FCFC0000FCFC0000FCFC0000FCFC0000FCFC0000FCFC0000FCFC0000FCFC0000FCFC -0000FCFE0001FC7E0001F87E0001F87E0001F87F0003F87F8007F83FE01FF03FFFFFF01F -FFFFE01FFFFFE007FFFF8000FFFC001E307CAE27>I<7FFFFF0000FFFFFFE000FFFFFFF0 -00FFFFFFF8007FFFFFFC0007E003FE0007E000FF0007E0007F0007E0003F8007E0001F80 -07E0001FC007E0000FC007E0000FC007E0000FC007E0000FC007E0000FC007E0000FC007 -E0001FC007E0001F8007E0003F8007E0007F0007E000FF0007E003FE0007FFFFFC0007FF -FFF80007FFFFF00007FFFFE00007FFFF000007E000000007E000000007E000000007E000 -000007E000000007E000000007E000000007E000000007E000000007E000000007E00000 -0007E000000007E00000007FFE000000FFFF000000FFFF000000FFFF0000007FFE000000 -222E7FAD27>I<7FFFF00000FFFFFE0000FFFFFF8000FFFFFFC0007FFFFFE00007E01FF0 -0007E007F00007E003F80007E001F80007E001FC0007E000FC0007E000FC0007E000FC00 -07E000FC0007E000FC0007E001FC0007E001F80007E003F80007E007F00007E01FF00007 -FFFFE00007FFFFC00007FFFF800007FFFF800007FFFFC00007E01FC00007E00FE00007E0 -07E00007E003F00007E003F00007E003F00007E003F00007E003F00007E003F00007E003 -F00007E003F00007E003F0F007E003F1F807E003F1F807E003F1F807E003F1F87FFE01FB -F8FFFF01FFF0FFFF00FFF0FFFF00FFE07FFE007FC00000001F00252F7FAD27>82 -D<007FC0E001FFF1F007FFFFF00FFFFFF01FFFFFF03FE0FFF03F801FF07F000FF07E0007 -F0FE0007F0FC0007F0FC0003F0FC0003F0FC0003F0FC0001E0FE0000007E0000007F0000 -003FC000003FF800001FFF80000FFFF80007FFFE0003FFFF8000FFFFC0000FFFE00000FF -F000000FF0000007F8000003F8000001F8000001FC000000FC780000FCFC0000FCFC0000 -FCFC0000FCFC0000FCFE0001F8FE0001F8FF0003F8FF8007F0FFF01FE0FFFFFFE0FFFFFF -C0FFFFFF00F8FFFE00701FF8001E307CAE27>I<7FFFFFFF80FFFFFFFFC0FFFFFFFFC0FF -FFFFFFC0FFFFFFFFC0FC03F00FC0FC03F00FC0FC03F00FC0FC03F00FC0FC03F00FC0FC03 -F00FC07803F007800003F000000003F000000003F000000003F000000003F000000003F0 -00000003F000000003F000000003F000000003F000000003F000000003F000000003F000 -000003F000000003F000000003F000000003F000000003F000000003F000000003F00000 -0003F000000003F000000003F000000003F000000003F000000003F000000003F0000000 -03F000000003F0000000FFFFC00001FFFFE00001FFFFE00001FFFFE00000FFFFC000222E -7EAD27>I<7FFE01FFF8FFFF03FFFCFFFF03FFFCFFFF03FFFC7FFE01FFF807E0001F8007 -E0001F8007E0001F8007E0001F8007E0001F8007E0001F8007E0001F8007E0001F8007E0 -001F8007E0001F8007E0001F8007E0001F8007E0001F8007E0001F8007E0001F8007E000 -1F8007E0001F8007E0001F8007E0001F8007E0001F8007E0001F8007E0001F8007E0001F -8007E0001F8007E0001F8007E0001F8007E0001F8007E0001F8007E0001F8007F0003F80 -03F0003F0003F0003F0003F8007F0001F8007E0001FC00FE0000FE01FC00007F87F80000 -7FFFF800003FFFF000000FFFC0000007FF80000001FE0000262F80AD27>I<7FFC03FFE0 -7FFE07FFE0FFFE07FFF07FFE07FFE07FFC03FFE007E0007E0007E0007E0007E0007E0007 -E0007E0003F000FC0003F000FC0003F000FC0003F000FC0003F801FC0001F801F80001F8 -01F80001F801F80001F801F80000FC03F00000FC03F00000FC03F00000FC03F000007E07 -E000007E07E000007E07E000007E07E000007E07E000003F0FC000003F0FC000003F0FC0 -00003F0FC000001F0F8000001F9F8000001F9F8000001F9F8000000F9F0000000F9F0000 -000F9F0000000F9F0000000F9F00000007FE00000007FE00000007FE00000007FE000000 -03FC00000003FC00000001F80000242F7FAD27>I<7FE0007FE0FFF000FFF0FFF000FFF0 -FFF000FFF07FE0007FE01F00000F801F00000F801F00000F801F00000F801F00000F801F -00000F801F00000F800F80001F000F80001F000F80001F000F80001F000F80001F000F80 -001F000F80F01F000F81F81F0007C3FC3E0007C3FC3E0007C3FC3E0007C3FC3E0007C39C -3E0007C79E3E0007C79E3E0007C79E3E0003C79E3C0003C79E3C0003C79E3C0003E79E7C -0003EF9F7C0003EF9F7C0003EF0F7C0003EF0F7C0001EF0F780001EF0F780001EF0F7800 -01EF0F780001FE07F80001FE07F80001FE07F80000FE07F00000FE07F00000FC03F00000 -7801E000242F7FAD27>I<3FFC1FFE007FFE3FFE007FFE3FFF007FFE3FFE003FFC1FFE00 -03F00FE00003F80FC00001F80FC00001FC1FC00000FC1F800000FE3F8000007E3F000000 -7F7F0000003F7E0000003FFE0000001FFC0000001FFC0000000FF80000000FF800000007 -F000000007F000000003F000000007F000000007F80000000FF80000000FFC0000001FFC -0000001FFE0000003F7E0000003F7F0000007F3F0000007E3F8000007E1F800000FC1FC0 -0000FC0FC00001F80FE00001F807E00003F807E00003F003F00007F003F00007E003F800 -7FFC0FFF80FFFC0FFFC0FFFE1FFFC0FFFC0FFFC07FFC0FFF80222E7EAD27>I<7FFC03FF -E07FFE07FFE0FFFE07FFF07FFE07FFE07FFC03FFE007F000FE0003F000FC0003F801FC00 -01F801F80001F801F80001FC03F80000FC03F00000FE07F000007E07E000007E07E00000 -3F0FC000003F0FC000001F9F8000001F9F8000001F9F8000000F9F0000000F9F00000007 -FE00000007FE00000003FC00000003FC00000001F800000001F800000001F800000001F8 -00000001F800000001F800000001F800000001F800000001F800000001F800000001F800 -000001F800000001F800000001F800000001F80000001FFF8000003FFFC000003FFFC000 -003FFFC000001FFF8000242E7FAD27>I<7FFFF0FFFFF8FFFFF8FFFFF8FFFFF0FC0000FC -0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC -0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC -0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC -0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FFFFF0FF -FFF8FFFFF8FFFFF87FFFF0153A71B327>91 D<78000000F8000000FC000000FC000000FE -0000007E0000007F0000003F0000003F8000001F8000001FC000000FC000000FE0000007 -E0000007F0000003F0000003F0000003F8000001F8000001FC000000FC000000FE000000 -7E0000007F0000003F0000003F8000001F8000001FC000000FC000000FC000000FE00000 -07E0000007F0000003F0000003F8000001F8000001FC000000FC000000FE0000007E0000 -007F0000003F0000003F0000003F8000001F8000001FC000000FC000000FE0000007E000 -0007F0000003F0000003F8000001F8000001FC000000FC000000FC0000007C000000381E -3A7CB327>I<7FFFF0FFFFF8FFFFF8FFFFF87FFFF80001F80001F80001F80001F80001F8 -0001F80001F80001F80001F80001F80001F80001F80001F80001F80001F80001F80001F8 -0001F80001F80001F80001F80001F80001F80001F80001F80001F80001F80001F80001F8 -0001F80001F80001F80001F80001F80001F80001F80001F80001F80001F80001F80001F8 -0001F80001F80001F80001F80001F80001F80001F87FFFF8FFFFF8FFFFF8FFFFF87FFFF0 -153A7EB327>I<001C00007E0001FF8007FFE01FFFF83FFFFCFFE7FFFFC3FFFF00FFFC00 -3F78001E180B79AD27>I<00E001F007F00FF00FE01FC03F003F007E007C00FC00F800F8 -00F800F800FF00FF80FFC07FC07FC03FC03F800F000C1773B227>96 -D<03FFC000000FFFF000001FFFFC00003FFFFF00003FFFFF80003F80FF80003F801FC000 -1F000FC00004000FE000000007E000000007E000000FFFE000007FFFE00003FFFFE0000F -FFFFE0001FFFFFE0003FFC07E0007FC007E0007F0007E000FE0007E000FC0007E000FC00 -07E000FC0007E000FC0007E000FE000FE0007F001FE0007FC0FFE0003FFFFFFF801FFFFF -FFC00FFFFFFFC003FFF1FFC000FF807F8022207C9F27>I<7FE0000000FFF0000000FFF0 -000000FFF00000007FF000000003F000000003F000000003F000000003F000000003F000 -000003F000000003F000000003F000000003F000000003F0FF000003F3FFC00003FFFFF0 -0003FFFFF80003FFFFFC0003FF81FE0003FE00FF0003FC003F8003F8001F8003F8001FC0 -03F0000FC003F0000FC003F0000FE003F00007E003F00007E003F00007E003F00007E003 -F00007E003F00007E003F0000FE003F0000FC003F8000FC003F8001FC003FC003F8003FC -007F8003FE00FF0003FF83FE0003FFFFFC0003FFFFF80003FFFFF00003F3FFC00001E0FE -0000232E7FAD27>I<000FFF00007FFFC001FFFFE003FFFFF007FFFFF00FF807F01FE007 -F03FC003E03F8000807F0000007E0000007E000000FE000000FC000000FC000000FC0000 -00FC000000FC000000FC000000FE0000007E0000007E0000007F0000F03F8001F83FC001 -F81FE003F80FF80FF007FFFFF003FFFFE001FFFFC0007FFF00000FF8001D207B9F27>I< -00003FF00000007FF80000007FF80000007FF80000003FF800000001F800000001F80000 -0001F800000001F800000001F800000001F800000001F800000001F800000001F800000F -E1F800007FFDF80001FFFFF80003FFFFF80007FFFFF8000FF83FF8001FE00FF8003FC007 -F8003F8003F8007F0003F8007E0001F8007E0001F800FE0001F800FC0001F800FC0001F8 -00FC0001F800FC0001F800FC0001F800FC0001F800FE0001F8007E0003F8007E0003F800 -7F0003F8003F0007F8003F800FF8001FE01FF8000FF03FF80007FFFFFFC003FFFFFFE001 -FFFDFFE0007FF9FFE0001FE0FFC0232E7EAD27>I<000FF800003FFE0000FFFF8003FFFF -C007FFFFE00FFC0FF01FE003F81FC001F83F8001FC7F0000FC7E0000FC7E00007EFE0000 -7EFFFFFFFEFFFFFFFEFFFFFFFEFFFFFFFEFFFFFFFCFC000000FE0000007E0000007F0000 -003F00003C3F80007E1FC0007E1FF000FE0FFC07FC07FFFFFC01FFFFF800FFFFF0003FFF -C00007FE001F207D9F27>I<00001FF00000FFF80001FFFC0003FFFE0007FFFE000FF0FE -000FC0FE001FC07C001F8000001F8000001F8000001F8000001F8000001F80007FFFFFF0 -FFFFFFF8FFFFFFF8FFFFFFF87FFFFFF0001F8000001F8000001F8000001F8000001F8000 -001F8000001F8000001F8000001F8000001F8000001F8000001F8000001F8000001F8000 -001F8000001F8000001F8000001F8000001F8000001F8000001F8000001F80003FFFFFC0 -7FFFFFE07FFFFFE07FFFFFE03FFFFFC01F2E7EAD27>I<0000003F00001FC0FF80007FF3 -FFC001FFFFFFE003FFFFFFE007FFFFEFE00FF07F87E01FC01FC3C01FC01FC0001F800FC0 -003F0007E0003F0007E0003F0007E0003F0007E0003F0007E0003F0007E0001F800FC000 -1FC01FC0001FC01FC0000FF07F80000FFFFF00000FFFFE00001FFFFC00001F7FF000001F -1FC000001F000000001F000000001F800000000FFFFF00000FFFFFE0000FFFFFF8001FFF -FFFE003FFFFFFF003F8001FF007E00003F807C00000F80FC00000FC0F8000007C0F80000 -07C0F8000007C0F8000007C0FC00000FC07C00000F807F00003F803F80007F003FF807FF -001FFFFFFE0007FFFFF80003FFFFF00000FFFFC000000FFC000023337EA027>I<7FE000 -0000FFF0000000FFF0000000FFF00000007FF000000003F000000003F000000003F00000 -0003F000000003F000000003F000000003F000000003F000000003F000000003F07F0000 -03F1FFC00003F7FFF00003FFFFF00003FFFFF80003FFC1F80003FF01FC0003FE00FC0003 -FC00FC0003F800FC0003F800FC0003F000FC0003F000FC0003F000FC0003F000FC0003F0 -00FC0003F000FC0003F000FC0003F000FC0003F000FC0003F000FC0003F000FC0003F000 -FC0003F000FC0003F000FC0003F000FC0003F000FC007FFF83FFE0FFFFC7FFF0FFFFC7FF -F0FFFFC7FFF07FFF83FFE0242E7FAD27>I<000F0000001F8000003FC000003FC000003F -C000003FC000001F8000000F000000000000000000000000000000000000000000000000 -0000000000003FFF80007FFFC0007FFFC0007FFFC0003FFFC000000FC000000FC000000F -C000000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000000F -C000000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000000F -C000000FC0007FFFFFF0FFFFFFF0FFFFFFF8FFFFFFF07FFFFFF01D2F7BAE27>I<7FE000 -00007FF0000000FFF00000007FF00000007FF000000001F000000001F000000001F00000 -0001F000000001F000000001F000000001F000000001F000000001F000000001F03FFFC0 -01F07FFFE001F07FFFE001F07FFFE001F03FFFC001F003F80001F007F00001F00FE00001 -F01FC00001F03F800001F0FF000001F1FE000001F3FC000001F7F8000001FFFC000001FF -FE000001FFFF000001FF3F000001FE1F800001FC0FC00001F80FE00001F007E00001F003 -F00001F001F80001F001FC0001F000FE0001F0007E007FFFC1FFF07FFFC3FFF8FFFFE3FF -F87FFFC3FFF87FFFC3FFF0252E80AD27>107 D<7FFF8000FFFFC000FFFFC000FFFFC000 -7FFFC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000 -000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000 -000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000 -000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000 -000FC0007FFFFFF8FFFFFFFCFFFFFFFCFFFFFFFC7FFFFFF81E2E7CAD27>I<7F07C01F00 -00FF9FF07FC000FFFFF9FFE000FFFFFFFFF0007FFFFFFFF0000FFC7FF1F8000FF03FC0F8 -000FE03F80F8000FC03F00F8000FC03F00F8000FC03F00F8000F803E00F8000F803E00F8 -000F803E00F8000F803E00F8000F803E00F8000F803E00F8000F803E00F8000F803E00F8 -000F803E00F8000F803E00F8000F803E00F8000F803E00F8000F803E00F8000F803E00F8 -000F803E00F8000F803E00F8007FF0FFC3FF00FFF8FFE3FF80FFF9FFE7FF80FFF8FFE3FF -807FF0FFC3FF002920819F27>I<7FE07F0000FFF1FFC000FFF7FFF000FFFFFFF0007FFF -FFF80003FFC1F80003FF01FC0003FE00FC0003FC00FC0003F800FC0003F800FC0003F000 -FC0003F000FC0003F000FC0003F000FC0003F000FC0003F000FC0003F000FC0003F000FC -0003F000FC0003F000FC0003F000FC0003F000FC0003F000FC0003F000FC0003F000FC00 -03F000FC007FFF83FFE0FFFFC7FFF0FFFFC7FFF0FFFFC7FFF07FFF83FFE024207F9F27> -I<001FE000007FF80001FFFE0003FFFF0007FFFF800FF03FC01FC00FE03F8007F03F0003 -F07F0003F87E0001F87E0001F8FC0000FCFC0000FCFC0000FCFC0000FCFC0000FCFC0000 -FCFC0000FCFE0001FC7E0001F87E0001F87F0003F83F8007F03F8007F01FE01FE00FF03F -C007FFFF8003FFFF0001FFFE00007FF800001FE0001E207C9F27>I<7FE0FF0000FFF3FF -C000FFFFFFF000FFFFFFF8007FFFFFFC0003FF81FE0003FE00FF0003FC003F8003F8001F -8003F8001FC003F0000FC003F0000FC003F0000FE003F00007E003F00007E003F00007E0 -03F00007E003F00007E003F00007E003F0000FE003F0000FC003F8000FC003F8001FC003 -FC003F8003FC007F8003FE00FF0003FF83FE0003FFFFFC0003FFFFF80003FFFFF00003F3 -FFC00003F0FE000003F000000003F000000003F000000003F000000003F000000003F000 -000003F000000003F000000003F000000003F000000003F000000003F00000007FFF8000 -00FFFFC00000FFFFC00000FFFFC000007FFF80000023317F9F27>I<000FF03C00003FFE -7E0000FFFF7E0003FFFFFE0007FFFFFE000FFC1FFE001FE007FE001FC003FE003F8001FE -007F0000FE007E0000FE007E0000FE00FE00007E00FC00007E00FC00007E00FC00007E00 -FC00007E00FC00007E00FC00007E00FE00007E007E0000FE007E0000FE007F0001FE003F -8001FE003FC003FE001FE007FE000FF81FFE0007FFFFFE0003FFFFFE0001FFFF7E00007F -FC7E00000FF07E000000007E000000007E000000007E000000007E000000007E00000000 -7E000000007E000000007E000000007E000000007E000000007E000000007E0000001FFF -F800001FFFF800003FFFFC00001FFFF800001FFFF826317E9F27>I<7FFC03FC00FFFE0F -FF00FFFE3FFF80FFFE7FFFC07FFEFFFFC0007FFE1FC0007FF81FC0007FF00F80007FE002 -00007FC00000007F800000007F800000007F000000007F000000007E000000007E000000 -007E000000007E000000007E000000007E000000007E000000007E000000007E00000000 -7E000000007E000000007E000000007E0000007FFFFF8000FFFFFFC000FFFFFFC000FFFF -FFC0007FFFFF800022207E9F27>I<00FFF38007FFFFC01FFFFFC03FFFFFC07FFFFFC07F -803FC0FC000FC0F8000FC0F8000FC0F8000780FC0000007F8000007FFC00003FFFF0001F -FFFC0007FFFF0001FFFF80000FFFC000003FE0000007E0780003F0FC0001F0FC0001F0FE -0001F0FE0003F0FF0007E0FFE01FE0FFFFFFC0FFFFFF80FFFFFF00FBFFFC00707FF0001C -207B9F27>I<003C0000007E0000007E0000007E0000007E0000007E0000007E0000007E -0000007E00007FFFFFF0FFFFFFF8FFFFFFF8FFFFFFF87FFFFFF0007E0000007E0000007E -0000007E0000007E0000007E0000007E0000007E0000007E0000007E0000007E0000007E -0000007E0000007E0000007E0018007E007E007E007E007E007E007E007E007E00FE003F -00FC003F83FC003FFFF8001FFFF0000FFFE00003FFC00000FF001F297EA827>I<7FE01F -F800FFF03FFC00FFF03FFC00FFF03FFC007FF01FFC0003F000FC0003F000FC0003F000FC -0003F000FC0003F000FC0003F000FC0003F000FC0003F000FC0003F000FC0003F000FC00 -03F000FC0003F000FC0003F000FC0003F000FC0003F000FC0003F000FC0003F000FC0003 -F000FC0003F001FC0003F001FC0003F003FC0003FC0FFC0001FFFFFFE001FFFFFFF000FF -FFFFF0003FFEFFF0000FF87FE024207F9F27>I<7FFC0FFF80FFFE1FFFC0FFFE1FFFC0FF -FE1FFFC07FFC0FFF8007C000F80007E001F80003E001F00003E001F00003F003F00001F0 -03E00001F003E00001F807E00000F807C00000F807C00000F807C000007C0F8000007C0F -8000007C0F8000003E1F0000003E1F0000003E1F0000003F3F0000001F3E0000001F3E00 -00001FFE0000000FFC0000000FFC0000000FFC00000007F800000007F800000003F00000 -22207E9F27>I<7FFE07FFE0FFFE07FFF0FFFF0FFFF0FFFE07FFF07FFE07FFE00F80001F -000F80001F000F80001F000FC0003F0007C0003E0007C0003E0007C0003E0007C0003E00 -07C0F03E0007C1F83E0003E3FC7C0003E3FC7C0003E3FC7C0003E3FC7C0003E79E7C0003 -E79E7C0001E79E780001E79E780001E79E780001F79EF80001F79EF80001FF0FF80000FF -0FF00000FF0FF00000FF0FF00000FE07F000007C03E00024207F9F27>I<3FFC1FFF007F -FE3FFF007FFE3FFF807FFE3FFF003FFC1FFF0001F807E00000FC0FC00000FC1F8000007E -1F0000003F3F0000001F7E0000001FFC0000000FF800000007F800000003F000000003E0 -00000003F000000007F80000000FF80000001FFC0000001F3E0000003E3F0000007E1F00 -00007C0F800000F80FC00001F807E00003F003E0007FFE1FFF807FFE1FFF80FFFF3FFFC0 -7FFE1FFF807FFE1FFF8022207E9F27>I<7FFC0FFF80FFFE1FFFC0FFFE1FFFC0FFFE1FFF -C07FFC0FFF8007E000F80003E001F80003E001F00003F001F00001F003F00001F803E000 -00F803E00000F803E00000FC07C000007C07C000007C07C000007E0F8000003E0F800000 -3E0F8000001F0F0000001F1F0000001F1F0000000F1F0000000F9E0000000FBE00000007 -BE00000007FC00000003FC00000003FC00000003F800000001F800000001F800000001F0 -00000001F000000003F000000003E000000003E000000007E000000007C000000807C000 -003E0FC000007F0F8000007F1F8000007E7F0000007FFE0000003FFC0000003FF8000000 -1FF000000007C000000022317E9F27>I<1FFFFFFE3FFFFFFF3FFFFFFF3FFFFFFF3FFFFF -FF3F0001FE3F0003FC3F0007F83F000FF01E001FE000003FC000007F800000FF000001FE -000003FC000007F800001FE000003FC000007F800000FF000001FE000003FC001E07F800 -3F0FF0003F1FE0003F3FC0003F7F80003FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFF -FE20207E9F27>I<000007F800003FFC0000FFFC0003FFFC0003FFF80007FE00000FF000 -000FE000000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000 -000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000001FC000 -007F80003FFF8000FFFF0000FFFE0000FFFE0000FFFF00003FFF8000007F8000001FC000 -000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000 -000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FE000000FF000 -0007FE000003FFF80003FFFC0000FFFC00003FFC000007F81E3A7CB327>I<78FCFCFCFC -FCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFC -FCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFC78063A70B327>I<7F800000FFF00000FFFC0000 -FFFF00007FFF000001FF8000003FC000001FC000000FC000000FC000000FC000000FC000 -000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000 -000FC000000FC000000FC000000FE0000007F8000007FFF00003FFFC0001FFFC0001FFFC -0003FFFC0007FFF00007F800000FE000000FC000000FC000000FC000000FC000000FC000 -000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000 -000FC000000FC000001FC000003FC00001FF80007FFF0000FFFF0000FFFC0000FFF00000 -7F8000001E3A7CB327>I E /Fi 134[37 2[37 42 25 29 29 1[37 -33 42 58 1[33 1[21 37 37 21 29 37 30 1[33 7[50 5[42 19[37 -16[19 46[{ TeXBase1Encoding ReEncodeFont }23 75.000000 -/Palatino-Italic rf /Fj 21 122 df<7FFFFF80FFFFFFC0FFFFFFC0FFFFFFC0FFFFFF -C07FFFFF801A067C9623>45 D<00000380000007C000000FC000000FC000001FC000001F -8000003F8000003F0000007F0000007E0000007E000000FE000000FC000001FC000001F8 -000003F8000003F0000007F0000007E0000007E000000FE000000FC000001FC000001F80 -00003F8000003F0000003F0000007F0000007E000000FE000000FC000001FC000001F800 -0001F8000003F8000003F0000007F0000007E000000FE000000FC000001FC000001F8000 -001F8000003F8000003F0000007F0000007E000000FE000000FC000000FC000000F80000 -00780000001A347CAD23>47 D<70000000FC000000FE000000FF000000FFC000007FE000 -001FF800000FFC000007FE000001FF800000FFC000003FE000001FF800000FFC000003FE -000001FF800000FFC000003FC000003FC00000FFC00001FF800003FE00000FFC00001FF8 -00003FE00000FFC00001FF800007FE00000FFC00001FF800007FE00000FFC00000FF0000 -00FE000000FC000000700000001A247CA523>62 D<03FF80000FFFE0001FFFF8003FFFFC -003FFFFE003F80FF003F803F801F001F8000001F8000000F800000FF80007FFF8003FFFF -800FFFFF801FFFFF807FF00F807F000F80FC000F80FC000F80F8000F80F8001F80FC001F -80FE003F807F81FF807FFFFFFC3FFFFFFE1FFFFFFE07FFC7FE01FE01FC1F1D7D9C23>97 -DI<0000FF800000FFC0 -0000FFC00000FFC00000FFC0000007C0000007C0000007C0000007C0000007C0000007C0 -000007C0007F87C001FFE7C003FFF7C00FFFFFC01FFFFFC01FE0FFC03F803FC07F001FC0 -7E000FC07E000FC0FC0007C0FC0007C0F80007C0F80007C0F80007C0F80007C0F80007C0 -FC000FC0FC000FC07E000FC07E001FC07F003FC03F807FC03FE0FFC01FFFFFFE0FFFFFFE -03FFF7FE01FFC7FE007F03FE1F297EA823>100 D<003FC00000FFF80003FFFC0007FFFF -000FFFFF801FF07F803F801FC03F000FC07E0007C07E0007E0FC0007E0FFFFFFE0FFFFFF -E0FFFFFFE0FFFFFFE0FFFFFFC0F8000000FC000000FC0000007E0001C07F0003E03F8007 -E03FE007E01FF81FC00FFFFFC007FFFF8001FFFE00007FFC00001FE0001B1D7D9C23>I< -00007F000001FFC00007FFE0000FFFE0001FFFE0003FCFE0003F0FE0003E07C0003E0000 -003E0000003E0000003E00007FFFFF80FFFFFFC0FFFFFFC0FFFFFFC07FFFFF80003E0000 -003E0000003E0000003E0000003E0000003E0000003E0000003E0000003E0000003E0000 -003E0000003E0000003E0000003E0000003E0000003E0000003E0000003E0000003E0000 -3FFFFE007FFFFF007FFFFF007FFFFF003FFFFE001B297EA823>I<00380000FE0000FE00 -00FE0000FE0000FE000038000000000000000000000000000000000000007FFC00FFFE00 -FFFE00FFFE007FFE00003E00003E00003E00003E00003E00003E00003E00003E00003E00 -003E00003E00003E00003E00003E00003E00003E00003E00003E00003E007FFFFEFFFFFF -FFFFFFFFFFFF7FFFFE182A7AA923>105 D<7F800000FFC00000FFC00000FFC000007FC0 -000003C0000003C0000003C0000003C0000003C0000003C0000003C0000003C0FFFC03C1 -FFFC03C1FFFC03C1FFFC03C0FFFC03C03F0003C07E0003C0FC0003C1F80003C3F00003C7 -E00003CFC00003DFE00003FFF00003FFF00003FCF80003F8FC0003F07E0003E03E0003C0 -1F0003C01F8003C00FC003C007C003C003E07FFE0FFFFFFF1FFFFFFF1FFFFFFF1FFF7FFE -0FFF20297FA823>107 D<7FFE0000FFFF0000FFFF0000FFFF00007FFF0000001F000000 -1F0000001F0000001F0000001F0000001F0000001F0000001F0000001F0000001F000000 -1F0000001F0000001F0000001F0000001F0000001F0000001F0000001F0000001F000000 -1F0000001F0000001F0000001F0000001F0000001F0000001F0000001F0000001F000000 -1F0000001F0000001F00007FFFFFC0FFFFFFE0FFFFFFE0FFFFFFE07FFFFFC01B297CA823 ->I<7E1F01F000FF7FC7FC00FFFFEFFE00FFFFFFFE007FFFFFFF000FE1FE1F000FC1FC1F -000FC0FC0F000F80F80F000F80F80F000F00F00F000F00F00F000F00F00F000F00F00F00 -0F00F00F000F00F00F000F00F00F000F00F00F000F00F00F000F00F00F000F00F00F000F -00F00F000F00F00F000F00F00F007FE3FE3FE0FFF3FF3FF0FFF3FF3FF0FFF3FF3FF07FE3 -FE3FE0241D819C23>II<003F000001FFE00003FFF0 -0007FFF8000FFFFC001FC0FE003F807F003E001F007E001F807C000F80FC000FC0F80007 -C0F80007C0F80007C0F80007C0F80007C0F80007C0FC000FC0FC000FC07C000F807E001F -803F003F003F807F001FE1FE000FFFFC0007FFF80003FFF00001FFE000003F00001A1D7C -9C23>II<7FF00FE0FFF87FF8FFF8FFFCFFFBFFFC7FFFFFFC00FFF8FC00FFC07800 -FF800000FF000000FE000000FE000000FC000000FC000000FC000000F8000000F8000000 -F8000000F8000000F8000000F8000000F8000000F8000000F8000000F800007FFFFC00FF -FFFE00FFFFFE00FFFFFE007FFFFC001E1D7E9C23>114 D<01FF9C0FFFFE1FFFFE7FFFFE -7FFFFEFF00FEFC007EF8003EF8003EFC001CFE00007FF0003FFF800FFFE007FFF8007FFC -0001FE00007F70003FF8001FFC001FFC003FFE003FFF80FFFFFFFEFFFFFCFFFFF8FFFFF0 -70FF80181D7B9C23>I<0070000000F8000000F8000000F8000000F8000000F8000000F8 -000000F800007FFFFF80FFFFFFC0FFFFFFC0FFFFFFC07FFFFF8000F8000000F8000000F8 -000000F8000000F8000000F8000000F8000000F8000000F8000000F8000000F8000000F8 -000000F801C000F803E000F803E000F803E000FC07E000FC0FE000FE1FC0007FFFC0007F -FF80003FFE00000FFC000007F0001B257EA423>II< -FFF03FFCFFF03FFCFFF03FFCFFF03FFCFFF03FFC0F8007C0078007800780078007C00F80 -03C00F0003C00F0003E01F0001E01E0001E01E0001F03E0000F03C0000F03C0000F87C00 -0078780000787800007CF800003CF000003CF000003FF000001FE000001FE000001FE000 -000FC000000780001E1D7E9C23>I121 D E /Fk 104[75 2[37 -37 25[42 39 62 42 45 24 32 30 42 45 41 43 66 22 42 17 -22 43 42 25 36 46 33 41 37 6[50 50 50 75 54 58 46 39 -50 1[45 59 62 71 46 2[25 62 57 42 46 58 53 46 58 1[33 -3[19 19 37 37 1[37 37 37 37 37 37 37 45 19 25 19 45 1[25 -25 21 35[45 45 2[{ TeXBase1Encoding ReEncodeFont }73 -75.000000 /Palatino-Roman rf /Fl 140[32 30 1[45 41 1[66 +%%BeginProcSet: texps.pro +%! +TeXDict begin/rf{findfont dup length 1 add dict begin{1 index/FID ne 2 +index/UniqueID ne and{def}{pop pop}ifelse}forall[1 index 0 6 -1 roll +exec 0 exch 5 -1 roll VResolution Resolution div mul neg 0 0]/Metrics +exch def dict begin Encoding{exch dup type/integertype ne{pop pop 1 sub +dup 0 le{pop}{[}ifelse}{FontMatrix 0 get div Metrics 0 get div def} +ifelse}forall Metrics/Metrics currentdict end def[2 index currentdict +end definefont 3 -1 roll makefont/setfont cvx]cvx def}def/ObliqueSlant{ +dup sin S cos div neg}B/SlantFont{4 index mul add}def/ExtendFont{3 -1 +roll mul exch}def/ReEncodeFont{CharStrings rcheck{/Encoding false def +dup[exch{dup CharStrings exch known not{pop/.notdef/Encoding true def} +if}forall Encoding{]exch pop}{cleartomark}ifelse}if/Encoding exch def} +def end + +%%EndProcSet +TeXDict begin 39158280 55380996 1000 600 600 (man.dvi) +@start +%DVIPSBitmapFont: Fa cmsy9 9 1 +/Fa 1 42 df<17F0A283177C173C173E83A2717E717E717E007FB87EB97E846C17FFCBEA +1F80F00FE0F003F0F001FE9538007F80F11FF0A2F17F80953801FE00F003F0F00FE0F01F +80007FB9C7FCB912FC606C5FCAEA03E04D5A4D5A4DC8FCA2173E173C177C5F5FA2442A7C +A74D>41 D E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fb cmr9 9 1 +/Fb 1 62 df<007FB812C0B912E0A26C17C0CCFCAC007FB812C0B912E0A26C17C033147C +9C3C>61 D E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fc cmsy8 8 1 +/Fc 1 16 df15 D E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fd cmmi9 9 1 +/Fd 1 22 df<137CEB7F80EB1FE0130F6D7EA26D7EA36D7EA36D7EA28080A26E7EA36E7E +A281140FA26E7EA381140F141FEC3DFC1479ECF8FEEB01F0EB03E0903807C07FEB0F80EB +1F00013EEB3F80137E4914C04848131F485A4848EB0FE0EA1FC0123F4848EB07F048C7FC +4815F848140348EC01FC48140026357CB32D>21 D E +%EndDVIPSBitmapFont +/Fe 157[23 22 97[{TeXBase1Encoding ReEncodeFont}2 49.8132 +/Palatino-Italic rf /Ff 157[27 26 97[{TeXBase1Encoding ReEncodeFont}2 +58.1154 /Palatino-Italic rf /Fg 167[40 4[31 3[47 5[20 +73[{TeXBase1Encoding ReEncodeFont}4 59.7758 /Palatino-Roman +rf /Fh 134[37 2[37 42 25 29 29 1[37 33 42 58 1[33 1[21 +37 37 21 29 37 30 1[33 7[50 5[42 19[37 15[22 19 46[{ +TeXBase1Encoding ReEncodeFont}24 74.7198 /Palatino-Italic +rf +%DVIPSBitmapFont: Fi cmtt8 8 25 +/Fi 25 122 df<007FB51280B612C0A46C14801A067C9623>45 D47 D<123E127FEAFF80A5EA7F00123EC7FCAB123E127FEAFF80A5EA +7F00123E091D739C23>58 D<127012FC7E7E13C06C7EEA1FF86C7E6C7E3801FF806C7FEB +3FE0EB1FF86D7EEB03FE903801FF806D13C0143FA214FF491380903803FE00EB0FFC495A +EB3FE0EBFFC0485BD807FEC7FC485A485AEA7FE0485A90C8FC5A5A12701A247CA523>62 +D<3803FF80000F13E04813F8487F80EB80FFEC3F80381F001FC7FC140F14FF137F0003B5 +FC120F5A387FF00F130012FCA25A141F7E6C133F387F81FF90B512FC6C14FE7E000713C7 +3901FE01FC1F1D7D9C23>97 DIIII<147F903801FFC0 +010713E05B5BEB3FCF140F90383E07C091C7FCA4007FB51280B612C0A36C1480D8003EC7 +FCB3383FFFFE487FA36C5B1B297EA823>I +104 D<133813FEA5133890C7FCA6EA7FFC487EA3127FEA003EB3387FFFFEB6FCA36C13FE +182A7AA923>I107 DI<397E1F01F039FF7FC7FC9038FFEFFE14FF6C80 +390FE1FE1FEBC1FC01C07FEB80F8A2EB00F0AE3A7FE3FE3FE026FFF3FF13F0A3267FE3FE +13E0241D819C23>I<38FF81FCEBC7FF01DF138090B512C0A23907FE0FE0EBF807EBF003 +13E0A313C0AD39FFFE1FFF5CA380201D7F9C23>I<133F3801FFE0487F487F487F381FC0 +FE383F807F383E001F007E1480007C130F00FC14C0481307A66C130FA2007C1480007E13 +1F6CEB3F006D5A381FE1FE6CB45A6C5B6C5B6C5BD8003FC7FC1A1D7C9C23>I<38FF81FC +EBC7FF01DF13C090B512E015F03907FE0FF8EBF8039038F001FCEBE000A249137EA2153E +A5157E7F15FC7F14019038F803F89038FE0FF090B5FC15E001DF138001CF1300EBC3F801 +C0C7FCAAEAFFFEA51F2C7F9C23>I<90383FC1C09038FFF3E0000313FB4813FF5A381FF0 +7F383FC01F387F000F127E14075A14035AA57E1407127E140F007F131FEA3F80381FE07F +90B5FC12076C13FB6C13E338003F83EB0003AAEC7FFF91B51280A36E1300212C7E9C23> +I<397FF00FE039FFF87FF8ECFFFC13FB6CB5FCC613F8ECC078EC800091C7FC5BA25BA35B +AA387FFFFCB57EA36C5B1E1D7E9C23>I<3801FF9C000F13FE5A127FA2EAFF0000FC137E +48133EA26C131C6C1300EA7FF0383FFF80000F13E06C13F838007FFCEB01FEEB007F0070 +133F00F8131F7E143F7E38FF80FFEBFFFE14FC14F814F000701380181D7B9C23>I<1370 +13F8A7007FB51280B612C0A36C1480D800F8C7FCACEC01C0EC03E0A3EBFC07140F9038FE +1FC0EB7FFF158090383FFE00EB0FFCEB07F01B257EA423>I<39FF807FC001C013E0A400 +071303B01407140FEBE03F90B6FC7EA2C613F3EB3FC1201D7F9C23>I<39FFF03FFCA539 +0F8007C000071480A2EBC00F00031400A26D5A0001131EA2EBF03E0000133CA2EBF87CEB +7878A2EB7CF8EB3CF0A2133F6D5AA36D5A6D5A1E1D7E9C23>I<39FFF03FFCA539078007 +C0158013C00003130F1500EA01E05CEBF01E1200A26D5A1378A26D5AA3EB1E7014F0130E +EB0FE0A213075CA35CA2130F91C7FCA2EA3E1FEA7F1E133EEA7CFC127F5B6C5A6C5AEA0F +801E2C7E9C23>121 D E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fj cmtt9 9 87 +/Fj 87 126 df<123C127E12FFAF127EAE123C1200A7123C127E12FFA4127E123C082F71 +AE27>33 D<00101320007C13F838FE01FCAAEAFC00007C13F8A900381370161778AE27> +I<90383C03C090387E07E0A7EBFE0F01FC13C0A2007FB512FEB7FCA4003F14FE3901F81F +80AC003FB512FEB7FCA46C14FE3903F03F00A200075BEBE07EA73803C03C202E7DAD27> +II<131FEB7FC0497E5A80EA03F1EBE1 +F8EA07E013C0A513C15C9039C3F1FF80D9E3E113C03803E7E3EBEFC101FF1480913881F8 +00EC01F0EA01FEEBFC0301F85B00031307D807FC5B120F381FFE0FD83FBE5BEB3F1FD87E +1F90C7FC149F38FC0FBF14FE1307ECFC020103EB0F80EB01F8A238FE03FC387E07FE397F +1FFF9F6CB61200149F6CEB0FFE390FFC03FC3903F000F822307EAE27>38 +D<120FEA1FC0123F13E0A213F0121F120F1201A4120313E01207EA0FC0A2EA3F80EA7F00 +5A5A12F812700C1773AD27>II<127012F812FE7E6C7E +6C7EEA0FE06C7E12037F6C7E1200137EA27FA2EB1F80A3EB0FC0A4EB07E0ACEB0FC0A4EB +1F80A3EB3F00A2137EA25B1201485A5B1207485AEA3FC0485A48C7FC5A12F81270133A7A +B327>I<130F497EA60078EB81E000FEEB87F000FF138FEBDFBF6CB512E06C14C0000F14 +00000313FCC613F0A2000313FC000F13FF003F14C04814E039FFDFBFF0EB1F8F00FE1387 +0078EB81E00000EB8000A66DC7FC1C207BA627>II<120FEA3FC013E0EA7FF0A213F8A2123FA2120F +120113F01203EA07E0121FEA7FC0EAFF8013005A12700D14738927>I<007FB512F8B612 +FCA46C14F81E067C9927>I<121EEA7F80A2EAFFC0A4EA7F80A2EA1E000A0A728927>I<15 +38157C15FCA2140115F8140315F0140715E0140F15C0141F1580143F1500A25C147E14FE +5C13015C13035C13075C130F5CA2131F5C133F91C7FC5B137E13FE5B12015B12035BA212 +075B120F5B121F5B123F90C8FC5A127E12FE5AA25A12781E3A7CB327>II<130E131FA25B5BA25B5A5A127FB5FCA213BFEA7E3F1200B3AA003FB512805A15 +C01580A21A2F79AE27>IIII<001FB512E04814F0A315E090C8FCACEB1FF0EBFFFC14FF1580 +15C09038F03FE09038C00FF0EB0007003EEB03F8001C1301C7FC15FC1400A3127C12FEA2 +140115F84813036C14F0007F130F9038801FE0393FE07FC06CB512806C14006C5B000113 +F838007FC01E2F7CAD27>I<14FF010713C0011F13F04913F890B5FC48EB81FC3803FE01 +13F8EA07F0EA0FE09038C000F8001F1400485A90C8FCA25A127EEB0FF838FE3FFE48B512 +80B612C015E09038F80FF09038E007F890388001FC90C7FC15FE48147E157F153F5A7E12 +7EA3127F6C147F157E6C6C13FE9038C001FC120F9038F007F83907F81FF06CB512E06C14 +C06C148090383FFE00EB0FF820307DAE27>I<1278B612FE15FFA315FE39FC0001FCEC03 +F8EC07F0007814E0C7120FEC1FC01580143FEC7F00147E14FE5C13015C13035C13075CA2 +495AA3495AA3133F91C7FCA55B137EA9133C20307DAE27>I +I +I<121EEA7F80A2EAFFC0A4EA7F80A2EA1E00C7FCAC121EEA7F80A2EAFFC0A4EA7F80A2EA +1E000A20729F27>I<120FEA3FC0A2EA7FE0A4EA3FC0A2EA0F00C7FCAC120FEA3F8013C0 +127F13E0A3123FA2120F120713C0120FA2EA3F80EA7F005A5A12F812700B2A739F27>I< +007FB512FEB7FCA4003F14FEC9FCA6003FB512FEB7FCA46C14FE20127D9F27>61 +D<127012FC7E6C7E7FEA7FF0EA1FF86C7EEA03FF6C7F38007FE06D7E6D7EEB07FE6D7E01 +0013C0EC7FE0EC3FF8EC0FFC1407A2140FEC3FF8EC7FE0ECFFC001031300495AEB1FF849 +5A495A3801FF804890C7FCEA0FFC485AEA7FF0EAFFC05B48C8FC5A12701E287CAA27>I< +EBFFF8000313FF000F14C0003F14E04814F09038C01FF839FF0003FC4813011400A21401 +007C1303C7EA0FF8EC1FF0EC7FE0ECFFC0491300EB03FC495A5C495A5C131F5CA76DC7FC +90C8FCA7130F497E497EA46D5A6DC7FC1E2E7CAD27>III<007FB5FCB612C08115F87E3907E003FCEC00FE15 +7E157F81A6157EA25D1403EC0FF890B55A15C015F081819038E000FE157FED3F80151FA2 +ED0FC0A6151F1680153FED7F004A5A007FB55AB65A5D15E06C1480222E7FAD27>I<9038 +03F80E90381FFE1F90383FFFBF90B6FC5A3803FE0F3807F803497E48487E485A49137FA2 +48C7123FA25A127E151E150012FE5AAA7E127EA2151E007F143F7EA26C7E157F6D137E6C +6C13FE3907F001FCEBF8033903FE0FF86CB512F06C14E0013F13C06D1300EB03F820307D +AE27>I<387FFFFC14FFB612C06C80813907E00FF81407EC01FC6E7EA2157E157F811680 +151FA316C0150FABED1F80A3153F1600A25D15FEA24A5A4A5A140F007FB55A5DB65A6C91 +C7FC14FC222E7FAD27>I<007FB61280B712C0A37E3907E0000FA6ED078092C7FCA4EC07 +804A7EA390B5FCA5EBE00FA36E5A91C8FCA4ED03C0ED07E0A7007FB6FCB7FCA36C15C023 +2E7FAD27>I<007FB61280B712C0A37E3907E0000FA6ED078092C7FCA4EC07804A7EA390 +B5FCA5EBE00FA36E5A91C8FCAC387FFF80B57EA36C5B222E7EAD27>I<903807F0389038 +1FFC7C90387FFFFC90B5FC5A3803FC1F3807F00F380FE007EBC003001F13011380123F90 +C7FCA2127EA2157892C7FC5AA8EC1FFF4A1380A3007E6D1300EC00FCA36C1301A2138012 +1FEBC003120FEBE0073807F00F3803FC1F6CB5FC7EEB7FFE90381FFC78D907F0C7FC2130 +7DAE27>I<3A7FFE07FFE0B54813F0A36C486C13E03A07E0007E00AF90B512FEA59038E0 +007EB03A7FFE07FFE0B54813F0A36C486C13E0242E7FAD27>I<007FB512E0B612F0A36C +14E039001F8000B3B2007FB512E0B612F0A36C14E01C2E7BAD27>I<90381FFFF84913FC +A36D13F89038001F80B3AC127CA212FEA2EC3F005C387F81FE13FF6C5B6C5B000713E0C6 +90C7FC1E2F7BAD27>I<3A7FFC07FF8016C0486C5A6C487E16803A07C001F80014035D4A +5A4A5A141F5D4AC7FC147E14FE5CEBC1F8EBC3F013C75CEBCFF0EBDFF813FF8013FEEBFC +7E143EEBF83F497E01E07F140F01C07F1407811403816E7EA26E7E157C157E3A7FFC01FF +C016E0486C5A6C487E16C0232E7FAD27>I<387FFFC080B5FC7E5CD803F0C8FCB3AAED07 +80ED0FC0A7007FB6FCA2B7FC7E1680222E7FAD27>II<3A7FF003FFE0486C4813F0A213FC007F6D13E000079038003E0013DE +A313CFA3148013C714C0A213C314E0A213C114F0A3EBC0F8A31478147CA2143C143EA214 +1E141F140FA3EC07BEA3EC03FEEA7FFCEAFFFE1401A26C486C5A242E7FAD27>II<007FB5FCB612E081816C803907E003FEEC00FF81ED3F80151F16C0150FA615 +1F1680153FED7F005DEC03FE90B55A5D5D5D92C7FC01E0C8FCADEA7FFEB5FCA36C5A222E +7FAD27>I<387FFFF0B512FE6E7E816C803907E01FF014076E7E1401811400A514015D14 +034A5A141F90B55A5D5DA281EBE01F6E7E14076E7EA816F0EDF1F8A4397FFE01FBB5EBFF +F08016E06C48EB7FC0C8EA1F00252F7FAD27>82 D<90387FC0E03901FFF1F0000713FF5A +5AEA3FE0EB801F387F000F007E130712FE5A1403A3EC01E06C90C7FC127E127FEA3FC013 +F86CB47E6C13F86C13FE6CEBFF80C614C0010F13E0010013F0140FEC07F81403140115FC +1400127812FCA46CEB01F8A26C130390388007F09038F01FE090B5FC15C0150000F85B38 +701FF81E307CAE27>I<007FB61280B712C0A439FC03F00FA60078EC0780000091C7FCB3 +AB90B512C04880A36C5C222E7EAD27>I<3A7FFE01FFF8B54813FCA36C486C13F83A07E0 +001F80B3AB6D133F00031500A26D5B0001147E6D13FE6C6C485A90387F87F814FF6D5B01 +0F13C06D5BD901FEC7FC262F80AD27>I<3A7FFC03FFE06D5A00FF15F0007F15E0497E3A +07E0007E00A46C6C5BA4EBF80100015CA46C6C485AA490387E07E0A56D485AA4011F5B14 +9FA3010F90C7FCA5EB07FEA46D5AA26D5A242F7FAD27>II<393FFC1FFE387FFE3F815D383FFC1F3903F00FE001F85B1201EBFC +1F00005CEBFE3F017E90C7FCEB7F7FEB3F7E14FE6D5AA26D5AA26D5AA21303130780130F +80131F80EB3F7E147F497E017E7F141F01FC7F140FD801F87F14071203496C7E120701E0 +7F3A7FFC0FFF8000FF15C06D5A497E007F1580222E7EAD27>I<3A7FFC03FFE06D5A00FF +15F0007F15E0497E3A07F000FE0000035CEBF80100015CA2EBFC0300005CEBFE07017E5B +A26D485AA290381F9F80A3010F90C7FCA2EB07FEA26D5AA26D5AAF90381FFF80497FA36D +5B242E7FAD27>I<387FFFF0B512F8A314F000FCC7FCB3B3ACB512F014F8A36C13F0153A +71B327>91 D<127812F87EA27E127E127F7E7F121F7F120F7F12077F1203A27F12017F12 +007F137E137F7F80131F80130FA280130780130380130180130080147E147F80A2158014 +1F15C0140F15E0140715F0140315F8140115FC1400A2157C15381E3A7CB327>I<387FFF +F0B512F8A37EEA0001B3B3ACEA7FFFB5FCA36C13F0153A7EB327>I<131C137E3801FF80 +000713E0001F13F84813FC38FFE7FF13C3130000FC133F0078131E180B79AD27>I<13E0 +EA01F01207120F13E0EA1FC0EA3F00A2127E127C12FC5AA4B4FC138013C0127FA2123F13 +80EA0F000C1773B227>96 D<3803FFC0000F13F04813FC4813FF811380EC1FC0381F000F +000480C71207A2EB0FFF137F0003B5FC120F5A383FFC07EA7FC0130012FE5AA46C130F00 +7F131FEBC0FF6CB612806C15C07E000313F1C69038807F8022207C9F27>IIIIII<153F90391FC0FF80D97FF313C048B612E05A4814EF390FF07F873A1FC01F +C3C0EDC000EB800F48486C7EA66C6C485AEBC01FA2390FF07F8090B5C7FC5C485BEB7FF0 +EB1FC090C9FCA27F6CB5FC15E015F84814FE4880EB8001007EC7EA3F80007C140F00FC15 +C0481407A46C140F007C1580007F143F6C6CEB7F009038F807FF6CB55A000714F86C5CC6 +14C0D90FFCC7FC23337EA027>II<130F497E497EA46D5A6DC7FC90C8FCA7383FFF80487FA37EEA000FB3A4007F +B512F0B6FC15F815F07E1D2F7BAE27>I107 D<387FFF80B57EA37EEA000FB3B2007FB512F8B612FCA3 +6C14F81E2E7CAD27>I<397F07C01F3AFF9FF07FC09039FFF9FFE091B57E7E3A0FFC7FF1 +F89038F03FC001E0138001C01300A3EB803EB03A7FF0FFC3FF486C01E3138001F913E701 +F813E36C4801C313002920819F27>I<387FE07F39FFF1FFC001F713F090B5FC6C800003 +13C1EC01FCEBFE005B5BA25BB03A7FFF83FFE0B500C713F0A36C018313E024207F9F27> +II<387FE0FFD8FFF313C090 +B512F0816C800003EB81FE49C67E49EB3F8049131F16C049130FA216E01507A6150F16C0 +7F151F6DEB3F80157F6DEBFF009038FF83FEECFFFC5D5D01F313C0D9F0FEC7FC91C8FCAC +387FFF80B57EA36C5B23317F9F27>I<90380FF03C90383FFE7E90B5FC000314FE5A380F +FC1F381FE007EBC003383F800148C7FC127EA200FE147E5AA67E007E14FEA2007F1301EA +3F80EBC003381FE007380FF81F6CB5FC7E6C147E38007FFCEB0FF090C7FCAC91381FFFF8 +A24A13FC6E13F8A226317E9F27>I<397FFC03FC39FFFE0FFF023F13804A13C0007F90B5 +FC39007FFE1F14F89138F00F809138E002004AC7FC5CA291C8FCA2137EAD007FB57EB67E +A36C5C22207E9F27>I<9038FFF3800007EBFFC0121F5A5AEB803F38FC000F5AA2EC0780 +6C90C7FCEA7F8013FC383FFFF06C13FC000713FF00011480D8000F13C09038003FE01407 +0078EB03F000FC1301A27E14036CEB07E0EBE01F90B512C01580150000FB13FC38707FF0 +1C207B9F27>I<133C137EA8007FB512F0B612F8A36C14F0D8007EC7FCAE1518157EA415 +FE6D13FC1483ECFFF86D13F06D13E0010313C0010013001F297EA827>I<397FE01FF848 +6C487EA3007F131F00031300B21401A21403EBFC0F6CB612E016F07EEB3FFE90390FF87F +E024207F9F27>I<3A7FFC0FFF80486C4813C0A36C486C13803A07C000F800EBE0010003 +5CA2EBF00300015CA2EBF80700005CA390387C0F80A36D48C7FCA3EB3F3FEB1F3EA214FE +6D5AA36D5AA26D5A22207E9F27>I<3A7FFE07FFE000FF15F06D5A497E007F15E03A0F80 +001F00A36D5B0007143EA414F0EBC1F83903E3FC7CA4EBE79EA200011478A301F713F8A2 +EBFF0F6C5CA3EBFE0790387C03E024207F9F27>I<393FFC1FFF486C5A168016006C487E +3901F807E06C6C485A4A5A017E90C7FC6D5AEB1F7E5C6D5A13076D5A5C80497E130F497E +143EEB3E3FEB7E1F90387C0F8001F87F00016D7E3803F0033A7FFE1FFF80A2B54813C06C +486C1380A222207E9F27>I<3A7FFC0FFF80486C4813C0A36C486C13803A07E000F80000 +0313015D13F00001130301F85B1200A26D485A137CA290387E0F80133EA2011F90C7FC5C +A2130F149E14BE130714FC1303A25C1301A25CA213035CA213075C1208EA3E0F007F5B13 +1FD87E7FC8FCEA7FFE6C5A5B6C5AEA07C022317E9F27>I<001FB512FE4814FFA4903800 +01FEEC03FCEC07F8EC0FF0001EEB1FE0C7EA3FC0EC7F80ECFF00495A495A495AEB1FE049 +5A495A49C7FC485A4848131E4848133F485A485A485A485AB7FCA46C14FE20207E9F27> +II<127812FCB3B3B3A21278063A70B327>II E +%EndDVIPSBitmapFont +/Fk 104[75 2[37 37 25[42 39 62 42 45 24 32 30 42 45 41 +43 66 22 42 17 22 43 42 25 36 46 33 41 37 6[50 50 50 +75 54 58 46 39 50 1[45 59 62 71 46 2[25 62 57 42 46 58 +53 46 58 1[33 3[19 19 37 37 1[37 37 37 37 37 37 37 45 +19 25 19 45 1[25 25 21 35[45 45 2[{TeXBase1Encoding ReEncodeFont}73 +74.7198 /Palatino-Roman rf /Fl 140[32 30 1[45 41 1[66 1[42 5[36 3[37 14[50 2[59 20[19 58[{ - .167 SlantFont TeXBase1Encoding ReEncodeFont }11 75.000000 -/Palatino-Roman rf /Fm 1 4 df<00380000380000380000380000380060380CF8383E -FC387EFE38FE3FBBF807FFC001FF00007C0001FF0007FFC03FBBF8FE38FEFC387EF8383E -60380C00380000380000380000380000380017197B9A22>3 D E -/Fn 7 94 df41 D<00000030000000000000780000000000007800000000000078000000 -000000780000000000007800000000000078000000000000780000000000007800000000 -000078000000000000780000000000007800000000000078000000000000780000000000 -007800000000000078000000000000780000000000007800000000000078000000000000 -780000000000007800000000000078000000000000780000000000007800000000000078 -0000007FFFFFFFFFFFF8FFFFFFFFFFFFFCFFFFFFFFFFFFFC7FFFFFFFFFFFF80000007800 -000000000078000000000000780000000000007800000000000078000000000000780000 -000000007800000000000078000000000000780000000000007800000000000078000000 -000000780000000000007800000000000078000000000000780000000000007800000000 -000078000000000000780000000000007800000000000078000000000000780000000000 -007800000000000078000000000000780000000000003000000036367BAF41>43 -D<0003F80000001FFF0000007E0FC00000F803E00001E000F00003C000780007C0007C00 -0F80003E000F80003E001F00001F001F00001F003F00001F803F00001F803F00001F807E -00000FC07E00000FC07E00000FC07E00000FC07E00000FC07E00000FC0FE00000FE0FE00 -000FE0FE00000FE0FE00000FE0FE00000FE0FE00000FE0FE00000FE0FE00000FE0FE0000 -0FE0FE00000FE0FE00000FE0FE00000FE0FE00000FE0FE00000FE0FE00000FE0FE00000F -E0FE00000FE0FE00000FE0FE00000FE07E00000FC07E00000FC07E00000FC07E00000FC0 -7F00001FC03F00001F803F00001F803F00001F801F00001F001F80003F000F80003E000F -80003E0007C0007C0003E000F80001F001F00000F803E000007E0FC000001FFF00000003 -F80000233A7DB72A>48 D<0001C0000003C0000007C000001FC00000FFC000FFFFC000FF -FFC000FF1FC000001FC000001FC000001FC000001FC000001FC000001FC000001FC00000 -1FC000001FC000001FC000001FC000001FC000001FC000001FC000001FC000001FC00000 -1FC000001FC000001FC000001FC000001FC000001FC000001FC000001FC000001FC00000 -1FC000001FC000001FC000001FC000001FC000001FC000001FC000001FC000001FC00000 -1FC000001FC000001FC000001FC000001FC000001FC000001FC000001FC000001FC00000 -1FC000003FE0007FFFFFF07FFFFFF07FFFFFF01C3879B72A>I<7FFFFFFFFFFFF8FFFFFF -FFFFFFFCFFFFFFFFFFFFFC7FFFFFFFFFFFF8000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000007FFFFFFFFFFFF8FFFFFFFFFFFFFCFFFFFFFFFFFFFC7FFFFFFFFFFFF8 -36167B9F41>61 D -91 D93 -D E /Fo 13 121 df<003F00000000003FC00000000007F00000000003F80000000003FC -0000000001FC0000000001FC0000000000FE0000000000FE0000000000FE00000000007F -00000000007F00000000007F00000000003F80000000003F80000000003F80000000001F -C0000000001FC0000000001FC0000000000FE0000000000FE0000000000FE00000000007 -F00000000007F00000000007F00000000003F80000000003F80000000003F80000000001 -FC0000000001FC0000000000FE0000000000FE0000000001FE0000000003FF0000000007 -FF000000000F7F000000001E3F800000003C3F80000000783F80000000F01FC0000001F0 -1FC0000003E01FC0000007C00FE000000F800FE000001F000FE000003F0007F000007E00 -07F00000FC0007F00001F80003F80003F00003F80007E00003F8000FE00001FC001FC000 -01FC003F800001FC007F000000FE00FE000000FE00FE0000007F00FC0000007F80700000 -001F80293B7CB930>21 D<0003800000000007E0000700000FE0000F80000FE0001F8000 -0FC0001F80000FC0001F80001FC0003F80001FC0003F80001F80003F00001F80003F0000 -3F80007F00003F80007F00003F00007E00003F00007E00007F0000FE00007F0000FE0000 -7E0000FC00007E0000FC0000FE0001FC0000FE0001FC0000FC0001F80000FC0001F80001 -FC0003F80001FC0003F80001F80003F01801F80003F01803F80007F01803F80007F03803 -F80007E03003F8000FE03007F8000FE07007F8001FE06007F8003FE06007FC0077E0E00F -FE00E3E1C00FFF03C1F3800FCFFF00FF000FC3FC003E001FC0000000001FC0000000001F -80000000001F80000000003F80000000003F80000000003F00000000003F00000000007F -00000000007F00000000007E00000000007E0000000000FE0000000000FE0000000000FC -0000000000FC00000000007000000000002D377EA432>I<1C007F00FF80FF80FFC0FFC0 -FFC07FC01CC000C000C000C000C001C00180018003800300070006000E001C0038007000 -60000A19798817>59 D<0000000000038000000000000FC000000000003FC00000000000 -FF800000000003FE00000000000FF800000000003FE00000000000FF800000000003FE00 -000000000FF800000000003FE00000000000FF800000000003FE00000000000FF8000000 -00003FE00000000000FF800000000003FE00000000000FF800000000003FE00000000000 -FF800000000003FE00000000000FF800000000003FE000000000007F800000000000FE00 -0000000000FE0000000000007F8000000000003FE000000000000FF8000000000003FE00 -0000000000FF8000000000003FE000000000000FF8000000000003FE000000000000FF80 -00000000003FE000000000000FF8000000000003FE000000000000FF8000000000003FE0 -00000000000FF8000000000003FE000000000000FF8000000000003FE000000000000FF8 -000000000003FE000000000000FF8000000000003FC000000000000FC000000000000380 -323279AD41>I<60000000000000FC000000000000FF0000000000007FC000000000001F -F0000000000007FC000000000001FF0000000000007FC000000000001FF0000000000007 -FC000000000001FF0000000000007FC000000000001FF0000000000007FC000000000001 -FF0000000000007FC000000000001FF0000000000007FC000000000001FF000000000000 -7FC000000000001FF0000000000007FC000000000001FF0000000000007F800000000000 -1FC000000000001FC000000000007F800000000001FF000000000007FC00000000001FF0 -00000000007FC00000000001FF000000000007FC00000000001FF000000000007FC00000 -000001FF000000000007FC00000000001FF000000000007FC00000000001FF0000000000 -07FC00000000001FF000000000007FC00000000001FF000000000007FC00000000003FF0 -00000000007FC00000000000FF000000000000FC00000000000070000000000000323279 -AD41>62 D<0000001FE00380000000FFFC0300000003FFFE070000000FE01F8F0000003F -0007DF0000007E0001FE000000F80000FE000001F00000FE000003E000007E000003E000 -007C000007C000003C00000F8000003C00000F8000003C00001F8000003800001F000000 -3800001F0000003800001F0000003800003F0000003000003F0000003000003F80000030 -00003F8000000000003FC000000000003FE000000000001FF000000000001FFE00000000 -001FFFE0000000000FFFFE0000000007FFFFC000000003FFFFF000000001FFFFF8000000 -00FFFFFC000000001FFFFE0000000003FFFF00000000003FFF000000000003FF80000000 -0000FF8000000000007F8000000000003F8000000000001F8000000000001F8000000000 -001F80000C0000001F80000C0000000F80000C0000000F80001C0000001F80001C000000 -1F00001C0000001F00001C0000001F00003C0000003E00003C0000003E00003C0000007C -00003E000000F800007E000000F800007F000001F000007F800003E000007FC0000FC000 -00F9F0001F800000F0FE00FE000000E03FFFF8000000E00FFFE0000000C001FF00000000 -313D7CBA33>83 D<00000000F80000000003FE000000000F87000000001F0F800000003E -3F800000003E7F800000007C7F800000007C7F80000000FC7F80000000FC7F00000000FC -1C00000001F80000000001F80000000001F80000000001F80000000003F80000000003F0 -0000000003F00000000003F00000000003F00000000007F00000000007E00000000007E0 -00000007FFFFF0000007FFFFF0000007FFFFF00000000FE0000000000FC0000000000FC0 -000000000FC0000000000FC0000000001FC0000000001F80000000001F80000000001F80 -000000001F80000000003F80000000003F00000000003F00000000003F00000000003F00 -000000007F00000000007E00000000007E00000000007E00000000007E00000000007E00 -00000000FE0000000000FC0000000000FC0000000000FC0000000000FC0000000001FC00 -00000001F80000000001F80000000001F80000000001F80000000003F00000000003F000 -00000003F00000000003F00000000003E00000000007E00000000007E00000000007C000 -00001E07C00000003F07C00000007F8F800000007F8F80000000FF8F00000000FF1E0000 -0000FE1E000000007C3C000000007878000000001FF00000000007C000000000294C7CBA -29>102 D<0000E00003F80003F80007F80007F80007F80007F00001C000000000000000 -000000000000000000000000000000000000000000000000000000F80003FE00070F000E -0F801C0F80180F80380F80300F80701F80601F80603F80E03F00C03F00C07F00007E0000 -7E0000FE0000FC0001FC0001FC0001F80003F80003F00003F00007F01807E01807E0380F -E0300FC0300FC0700F80600F80E00F80C00F81C00F838007870003FE0000F80015397EB7 -1D>105 D<0000000F000000003F800000003F800000007F800000007F800000007F8000 -00007F000000001C00000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000F800000003F -E0000000F0F0000001C0F800000380FC00000300FC00000700FC00000E00FC00000C00FC -00001C00FC00001801FC00003801FC00003001F800003001F800000003F800000003F800 -000003F000000003F000000007F000000007F000000007E000000007E00000000FE00000 -000FE00000000FC00000000FC00000001FC00000001FC00000001F800000001F80000000 -3F800000003F800000003F000000003F000000007F000000007F000000007E000000007E -00000000FE00000000FE00000000FC00000000FC00000001FC00001E01F800003F01F800 -007F83F000007F83F00000FF87E00000FF0FC00000FE0F8000007C1F000000707E000000 -3FF80000000FC0000000214981B722>I<03E0007F000007F801FFE0000E3C0781F0001C -3E1E00F800383F3800FC00303F7000FC00303FE0007C00703FC0007C00603F80007C0060 -3F80007C00E03F0000FC00C07F0000FC00C07E0000FC00C07E0000FC00007E0001FC0000 -FE0001F80000FC0001F80000FC0001F80000FC0003F80001FC0003F00001F80003F00001 -F80007F00001F80007E00003F80007E00003F0000FE03003F0000FC03003F0001FC07007 -F0001F806007E0001F806007E0001F80E007E0001F00C00FE0001F01C00FC0001F01800F -C0001F03800FC0001F07001FC0000F0E001F800007FC0007000001F0002C267EA432> -110 D<000F8003F000001FE00FFC000039F03C1F000070F8700F8000E0FDE007C000C0FF -8007C000C0FF0007E001C0FE0003E00180FE0003F00180FC0003F00381FC0003F00301FC -0003F00301F80003F00301F80003F00003F80007F00003F80007F00003F00007F00003F0 -0007F00007F0000FF00007F0000FF00007E0000FE00007E0000FE0000FE0001FE0000FE0 -001FC0000FC0001FC0000FC0003F80001FC0003F80001FC0007F00001F80007E00001F80 -00FE00003F8000FC00003FC001F800003FC003F000003FE007E000007F700F8000007F38 -3F0000007E1FFC0000007E07E0000000FE0000000000FE0000000000FC0000000000FC00 -00000001FC0000000001FC0000000001F80000000001F80000000003F80000000003F800 -00000003F00000000007F000000000FFFFC0000000FFFFC0000000FFFFC00000002C3583 -A42A>112 D<00F80003C003FE0007E0070F000FE00E0F800FF01C0F800FF0180F800FF0 -380F8007F0300F8003F0701F8001F0601F8001F0601F8000F0E03F8000E0C03F0000E0C0 -7F0000E0007E0000E0007E0000C000FE0000C000FC0000C000FC0001C001FC00018001F8 -00018001F800038001F800030003F800030003F000070003F000060003F0000E0003F000 -0C0003F0001C0003F000180003F000380003F000700001F000E00001F801C00000FC0380 -00007E0F0000001FFE00000007F0000024267EA428>118 D<0007E001F000001FF807FC -0000783E0E0F0000E01F1C1F0001C01F383F8003800FF07F8003000FE0FF8007000FE0FF -800E000FC0FF000C000FC07E000C001FC03C001C001F80000018001F80000018001F8000 -0000003F80000000003F80000000003F00000000003F00000000007F00000000007F0000 -0000007E00000000007E0000000000FE0000000000FE0000000000FC000C000000FC000C -000001FC001C001E01FC0018003F01F80018007F81F80038007F83F8007000FF83F80060 -00FF07F800E000FE0E7C01C0007C1C7C03800078383E0F00001FF00FFC000007C003F000 -0029267EA42F>120 D E /Fp 3 111 df<003E000007FE000007FE0000007C0000007C00 -0000FC000000FC000000F8000000F8000001F8000001F8000001F0000001F0000003F000 -0003F0FC0003E3FF0003EF078007FC07C007F003C007E003C007E003C00FC003C00FC007 -C00F8007C00F8007C01F8007C01F800F801F000F801F000F803F001F003F001F003E001F -063E003E067E003E067E007C0C7C007C0C7C007C18FC003C30FC003C70F8001FE070000F -801F297CA727>104 D<000E00001F00003F00003F00003E00001C000000000000000000 -0000000000000000000000000003E00007F0000C7800187C00307C00307C00607C0060F8 -00C0F800C0F80001F00001F00001F00003E00003E00007C00007C00007C1800F81800F81 -801F03001F03001F06000F0C000F1C0007F00003E00011287DA617>I<07801FC0000FE0 -7FF00018F0E0F80030F1807C0030FB007C0060FE003C0060FC003C0060F8003C00C1F800 -7C00C1F0007C0001F0007C0001F0007C0003E000F80003E000F80003E000F80003E001F0 -0007C001F00007C001F06007C003E06007C003E0600F8007C0C00F8007C0C00F8007C180 -0F8003C3001F0003C7001F0001FE000E0000F800231B7D9929>110 -D E /Fq 167[35 4[28 3[42 5[18 73[{ TeXBase1Encoding ReEncodeFont }4 -53.333281 /Palatino-Roman rf /Fr 203[25 25 25 25 49[{ - TeXBase1Encoding ReEncodeFont }4 50.000001 /Palatino-Roman -rf /Fs 190[45 11[29 29 29 29 29 49[{ TeXBase1Encoding ReEncodeFont }6 -58.333334 /Palatino-Roman rf /Ft 9 115 df<7FFFFFFFFE7FFFFFFFFEFFFFFFFFFF -FFFFFFFFFFFFFFFFFFFF7FFFFFFFFE7FFFFFFFFE28077BA133>45 -D<0000FFF0000007FFFE00001FFFFF80003FFFFFC0007FFFFFE001FFFFFFF003FFC01FF0 -03FE000FF007FC000FF00FF8000FF01FF00007E01FE00003C03FC00000003F800000003F -800000007F800000007F000000007F00000000FF00000000FE00000000FE00000000FE00 -000000FE00000000FE00000000FE00000000FE00000000FE00000000FE00000000FF0000 -00007F000000007F000000007F800000003F800001F03FC00003F81FE00003F81FF00007 -F80FF80007F007FC000FF007FF001FE003FFE07FE001FFFFFFC000FFFFFF80003FFFFF00 -001FFFFC000007FFF8000000FFC000252E79AC33>99 D<0000007FF800000000FFFC0000 -0001FFFC00000001FFFC00000000FFFC000000007FFC0000000001FC0000000001FC0000 -000001FC0000000001FC0000000001FC0000000001FC0000000001FC0000000001FC0000 -000001FC0000000001FC0000000001FC000001FF01FC000007FFC1FC00001FFFF1FC0000 -7FFFF9FC0000FFFFFFFC0001FFFFFFFC0003FF81FFFC0007FE003FFC000FF8001FFC000F -F0000FFC001FE00007FC001FC00003FC003FC00003FC003F800001FC007F800001FC007F -000001FC007F000001FC00FF000001FC00FE000001FC00FE000001FC00FE000001FC00FE -000001FC00FE000001FC00FE000001FC00FE000001FC00FE000001FC00FE000001FC00FF -000001FC007F000001FC007F000003FC007F800003FC003F800003FC003FC00007FC003F -C00007FC001FE0000FFC001FF0001FFC000FF8003FFC0007FC007FFC0003FF81FFFFF003 -FFFFFFFFF800FFFFFDFFFC007FFFF9FFFC003FFFE1FFF8000FFF80FFF00001FE0000002E -3E7DBC33>I<0000FF80000007FFF000001FFFFC00003FFFFE0000FFFFFF0001FFFFFF80 -03FF80FFC007FE003FE007F8000FF00FF00007F01FE00007F81FC00003F83FC00003FC3F -800001FC7F800001FC7F000001FC7F000001FE7F000000FEFF000000FEFE000000FEFFFF -FFFFFEFFFFFFFFFEFFFFFFFFFEFFFFFFFFFEFFFFFFFFFEFFFFFFFFFCFE00000000FF0000 -00007F000000007F000000007F000000003F800000003F8000007C1FC00000FE1FE00000 -FE0FF00000FE0FF80001FE07FC0003FC03FF000FFC01FFC03FF800FFFFFFF0007FFFFFE0 -003FFFFFC0000FFFFF000003FFFC0000007FE000272E7BAC33>I<0000003FE0000001FF -FC000007FFFE00001FFFFE00003FFFFF00007FFFFF0000FFC0FF0000FF00FF0001FE007E -0001FC003C0003FC00000003F800000003F800000003F800000003F800000003F8000000 -03F800000003F800000003F800003FFFFFFFF87FFFFFFFFCFFFFFFFFFCFFFFFFFFFCFFFF -FFFFFC7FFFFFFFF80003F800000003F800000003F800000003F800000003F800000003F8 -00000003F800000003F800000003F800000003F800000003F800000003F800000003F800 -000003F800000003F800000003F800000003F800000003F800000003F800000003F80000 -0003F800000003F800000003F800000003F800000003F800000003F800000003F8000000 -03F800000003F800000003F800000003F800003FFFFFFF807FFFFFFFC07FFFFFFFC07FFF -FFFFC07FFFFFFFC03FFFFFFF80283E7DBD33>I<0000E000000003F800000003F8000000 -07FC00000007FC00000007FC00000003F800000003F800000000E0000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000003FFFF800007FFFFC00007FFFFC00007FFFFC00007FFFFC00003FFFFC00 -000001FC00000001FC00000001FC00000001FC00000001FC00000001FC00000001FC0000 -0001FC00000001FC00000001FC00000001FC00000001FC00000001FC00000001FC000000 -01FC00000001FC00000001FC00000001FC00000001FC00000001FC00000001FC00000001 -FC00000001FC00000001FC00000001FC00000001FC00000001FC00000001FC00000001FC -00000001FC00000001FC00007FFFFFFFC0FFFFFFFFE0FFFFFFFFF0FFFFFFFFF0FFFFFFFF -E07FFFFFFFC0243E78BD33>105 D<000001FF00003FFC07FFC0007FFE1FFFF000FFFE7F -FFF800FFFEFFFFF8007FFFFFFFFC003FFFFF07FE0000FFF801FE0000FFF000FE0000FFE0 -00FF0000FFC0007F0000FF80007F0000FF80007F0000FF00007F0000FF00007F0000FF00 -007F0000FE00007F0000FE00007F0000FE00007F0000FE00007F0000FE00007F0000FE00 -007F0000FE00007F0000FE00007F0000FE00007F0000FE00007F0000FE00007F0000FE00 -007F0000FE00007F0000FE00007F0000FE00007F0000FE00007F0000FE00007F0000FE00 -007F0000FE00007F0000FE00007F0000FE00007F0000FE00007F003FFFF80FFFFC7FFFFC -1FFFFEFFFFFE3FFFFFFFFFFE3FFFFF7FFFFC1FFFFE3FFFF80FFFFC302C7FAB33>110 -D<0001FE0000000FFFC000003FFFF000007FFFF80000FFFFFC0001FFFFFE0003FF03FF00 -07FC00FF800FF8007FC00FF0003FC01FE0001FE01FC0000FE03F800007F03F800007F07F -800007F87F000003F87F000003F87F000003F8FE000001FCFE000001FCFE000001FCFE00 -0001FCFE000001FCFE000001FCFE000001FCFE000001FCFE000001FCFE000001FCFF0000 -03FC7F000003F87F000003F87F800007F83F800007F03FC0000FF03FC0000FF01FE0001F -E01FF0003FE00FF8007FC007FC00FF8003FF03FF0001FFFFFE0000FFFFFC00007FFFF800 -003FFFF000000FFFC0000001FE0000262E7AAC33>I<00000003FE007FFF801FFF80FFFF -C07FFFE0FFFFC1FFFFE0FFFFC3FFFFF0FFFFC7FFFFF07FFFCFFE0FF0001FDFF00FF0001F -FFC007E0001FFF8003C0001FFF000000001FFE000000001FFC000000001FF8000000001F -F8000000001FF0000000001FF0000000001FE0000000001FE0000000001FE0000000001F -C0000000001FC0000000001FC0000000001FC0000000001FC0000000001FC0000000001F -C0000000001FC0000000001FC0000000001FC0000000001FC0000000001FC0000000001F -C0000000001FC0000000001FC0000000001FC0000000001FC0000000001FC00000007FFF -FFFE0000FFFFFFFF0000FFFFFFFF0000FFFFFFFF0000FFFFFFFF00007FFFFFFE00002C2C -7DAB33>114 D E /Fu 14 121 df<00000038000000FC000001FC000007FC00000FF800 -001FE000007FC00000FF000001FE000003FC000007F800000FF000000FE000001FC00000 -3F8000007F0000007E000000FE000001FC000001F8000003F8000003F0000007E0000007 -E000000FC000000FC000001FC000001F8000003F8000003F0000003F0000003F0000007F -0000007E0000007E0000007E000000FE000000FC000000FC000000FC000000FC000000FC -000000FC000000FC000000FC000000FC000000FC000000FC0000007C0000007E0000007E -0000007E0000003E0000003F0000003F0000001F8000001F8000000FC000000FE0000007 -F0000003F0000003FC000001FC000000FE0000007C0000001C00001E426DB92C>40 -D<0000E0000001F0000001F8000001FC000000FE0000007F0000003F8000001F8000000F -C000000FC0000007E0000007E0000003F0000003F0000003F0000001F8000001F8000001 -F8000001F8000001F8000001F8000000F8000000F8000000F8000001F8000001F8000001 -F8000001F8000001F8000001F8000001F8000003F8000003F0000003F0000003F0000007 -F0000007E0000007E000000FE000000FC000001FC000001F8000001F8000003F0000007F -0000007E000000FE000000FC000001FC000003F8000007F0000007F000000FE000001FC0 -00003F8000007F000000FE000003FC000007F800000FF000003FE000007FC00000FF0000 -00FE000000F8000000700000001D427AB92C>I<0F801FC03FE07FE07FE0FFE0FFE0FFE0 -7FC03F801E000B0B6F8A2C>46 D<0007FFFE00000FFFFF00000FFFFF00000FFFFF000007 -FFFE0000007F000000007E000000007E00000000FE00000000FE00000000FC00000000FC -00000001FC00000001FC00000001F800000001F800000003F800000003F800000003F000 -000003F000000007F000000007F000000007E000000007E00000000FE00000000FE00000 -000FC00000000FC00000001FC00000001FC00000001F800000001F800000003F80000000 -3F800000003F000000003F000000007F000000007F00001E007E00003F007E00003F00FE -00007F00FE00007E00FC00007E00FC00007E01FC0000FE01FC0000FC7FFFFFFFFC7FFFFF -FFFCFFFFFFFFFC7FFFFFFFF87FFFFFFFF828337EB22C>76 D<0003F00000000FFC780000 -3FFFFC00007FFFFC0000FFFFFC0001FE1FFC0003FC0FF80007F80FF8000FF007F8000FE0 -07F8001FC007F0001F8007F0003F8007F0003F0007F0007F0007E0007E0007E0007E0007 -E0007E000FE000FE000FE000FC000FC000FC000FC000FC001FC180FC001F87E0FC003F87 -E0FC003F87E0FC007F8FE0FC00FF0FC0FC01FF0FC0FE03FF0FC07E07FF1F807F0FFF3F80 -3FFFFFFF001FFFDFFF001FFF8FFE0007FE07FC0001F801F000232476A32C>97 -D<00007F800003FFE0000FFFF8003FFFFC007FFFFC00FFC1FE01FE00FE03FC01FE07F801 -FE0FF001FE0FE001FC1FC001FC3F8000703F0000003F0000007E0000007E0000007E0000 -00FE000000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FE0000 -007E00001C7F00003E3F8000FE3FC00FFE1FFFFFFE0FFFFFFC07FFFFF001FFFFC0007FFE -001F2475A32C>99 D<00007F000003FFC0000FFFF0003FFFF8007FFFFC00FFC1FC01FE00 -FC03FC007E07F8007E0FE000FE0FE000FC1FC000FC3F8001FC3F0007F87F003FF87FFFFF -F07FFFFFE07FFFFF80FFFFFE00FFFFF000FC000000FC000000FC000000FC000000FC0000 -00FC0000007E0000007E00001C7F00003E3F8000FE3FC00FFE1FFFFFFE0FFFFFFC07FFFF -F001FFFFC0007FFE001F2475A32C>101 D<07FF0000000FFF8000000FFF8000000FFF80 -000007FF800000003F800000003F000000003F000000007F000000007F000000007E0000 -00007E00000000FE00000000FE00000000FC00000000FC3FC00001FCFFF00001FFFFF800 -01FFFFFC0001FFFFFC0003FFF0FE0003FFC07E0003FF007E0003FE007E0007FE007E0007 -FC007E0007F8007E0007F8007E000FF000FE000FF000FC000FE000FC000FE000FC001FC0 -01FC001FC001F8001FC001F8001F8003F8003F8003F0303F8003F0FC3F0007F0FC3F0007 -E0FC7F0007E1FC7F000FE1F87E000FC1F87E000FC3F0FE000FC7F0FE000FCFE0FC000FFF -E0FC0007FFC0FC0007FF80F80003FE00700000FC00263379B22C>104 -D<00707E007E000079FF81FF8000FFFFC7FFC000FFFFCFFFC000FFFFFFFFE000FFC3FFC3 -E001FF83FF83E001FF03FF03F001FE03FE03F001FC03FC03E003FC03FC03E003F803F803 -E003F803F803E003F007F007E007F007F007C007F007F007C007E007E007C00FE00FE00F -C00FC00FC00F800FC00FC00F801FC01FC01F801F801F801F001F801F801F001F801F803F -003F803F803E003F003F003E003F003F007E003F003F007C007F007F007C007E007E007C -007E007E007C007E007E007F00FE00FE007F00FC00FC003F80FC00FC003F00780078000F -002C247DA32C>109 D<01F007F00007F81FFC000FFC7FFE001FFEFFFF003FFFFFFF803F -3FFE1F803F3FF81F807E3FF01F807E3FE01F807E7FC01F80FE7FC01F80FC7F801F80FC7F -001F80FCFF003F8000FE003F0000FE003F0000FE003F0001FC007F0001FC007E0001FC00 -7E0001F800FE0003F800FC1803F800FC7E03F001FC7E03F001F87E07F001F8FE07F003F8 -FC07E003F0FC07E003F1FC0FE003F1F80FE003F3F00FC003FFF00FC001FFE00FC001FFC0 -0F8000FF800700003E0027247AA32C>I<0000FE000007FF80001FFFE0003FFFF000FFFF -F001FF83F803FE01FC03F800FC07F000FC0FE0007E1FC0007E1FC0007E3F80007E3F0000 -7E7F00007E7E00007E7E00007E7E0000FEFE0000FEFC0000FCFC0000FCFC0001FCFC0001 -F8FC0003F8FC0007F0FC0007F0FC000FE07E001FC07E003F807F00FF803F83FF001FFFFE -001FFFF8000FFFF00003FFC00000FE00001F2476A32C>I<0000FFE0000007FFFC00001F -FFFE00003FFFFF00007FFFFF8000FF807F8000FC007F8001F8007F8001F0007F8001F000 -7F8003F0003F0003F0001C0001F800000001FE00000001FFF8000000FFFF0000007FFFC0 -00001FFFF0000007FFF80000003FFC00000001FC000000007E000000007E001C00003E00 -7F00003E007F00007E00FF00007C00FF0000FC00FF0001FC00FE0003F800FF803FF0007F -FFFFE0003FFFFFC0001FFFFF800007FFFE000000FFE00000212478A32C>115 -D<0001E0000003F0000003F0000003F0000007F0000007F0000007E0000007E000000FE0 -00000FE000000FC000000FC000001FC000001FC000001F80007FFFFF807FFFFFC0FFFFFF -C07FFFFFC07FFFFF80007F0000007F0000007E0000007E000000FE000000FE000000FC00 -0000FC000001FC000001FC000001F8000001F8000003F8000003F8000003F0000003F000 -0007F000C007F003F007E003F007E003F00FE007F00FE00FE00FC01FE00FC03FC00FC07F -800FE1FF0007FFFE0007FFFC0003FFF80001FFE000007F00001C3374B22C>I<001FC01F -8000FFF07FE001FFF9FFF807FFFFFFF80FFFFFFFFC1FF0FFF0FC3FC07FE07E3F803FC0FE -7F003F81FE7E003F83FEFE003F03FEFC003F01FCFC003F01F8FC007F00F000007F000000 -007E000000007E00000000FE00000000FE00000000FC00000000FC00000001FC00181E01 -FC007E3F01F8007E7F01F8007E7F83F800FEFF83F800FCFF03F801FCFE07F803F8FC0FFC -07F87E1FFE1FF07FFFFFFFE03FFFFFFFC03FFF3FFF000FFC1FFE0003F007F00027247AA3 -2C>120 D E /Fv 107[33 33 25[37 34 55 38 40 22 28 26 1[40 -36 39 59 19 37 1[19 39 37 22 32 41 29 37 33 8[44 66 48 -52 41 35 44 1[40 52 55 63 2[22 22 55 1[37 1[51 47 41 -52 1[29 3[17 17 1[33 33 2[33 33 1[33 2[17 22 17 2[22 -22 18 36[40 2[{ TeXBase1Encoding ReEncodeFont }59 66.666667 -/Palatino-Roman rf /Fw 12 107 df<7FFFFFFFFFFF80FFFFFFFFFFFFC0FFFFFFFFFF -FFC07FFFFFFFFFFF803204799641>0 D<000FE000007FFC0000FFFE0003FFFF8007F83F -C00FC007E01F8003F03F0001F83E0000F87C00007C7C00007C7800003CF800003EF80000 -3EF000001EF000001EF000001EF000001EF800003EF800003E7800003C7C00007C7C0000 -7C3E0000F83F0001F81F8003F00FC007E007F83FC003FFFF8000FFFE00007FFC00000FE0 -001F207BA42A>14 D<000FE000007FFC0000FFFE0003FFFF8007FFFFC00FFFFFE01FFFFF -F03FFFFFF83FFFFFF87FFFFFFC7FFFFFFC7FFFFFFCFFFFFFFEFFFFFFFEFFFFFFFEFFFFFF -FEFFFFFFFEFFFFFFFEFFFFFFFEFFFFFFFE7FFFFFFC7FFFFFFC7FFFFFFC3FFFFFF83FFFFF -F81FFFFFF00FFFFFE007FFFFC003FFFF8000FFFE00007FFC00000FE0001F207BA42A>I< -7FFFFFFFFFFFF8FFFFFFFFFFFFFCFFFFFFFFFFFFFC7FFFFFFFFFFFF80000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000007FFFFFFFFFFFF8FFFFFFFFFFFFFCFFFFFFFF -FFFFFC7FFFFFFFFFFFF80000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000 -7FFFFFFFFFFFF8FFFFFFFFFFFFFCFFFFFFFFFFFFFC7FFFFFFFFFFFF836287BA841>17 -D<00000000000180000000000007C000000000001FC000000000007F800000000001FF00 -0000000007FC00000000001FF000000000007FC00000000001FF000000000007FC000000 -00001FF000000000007FC00000000001FF000000000007FC00000000001FF00000000000 -7FC00000000001FF000000000007FC00000000001FF000000000007FC00000000001FF00 -0000000007FC00000000003FF000000000007FC00000000000FF000000000000FE000000 -0000007F8000000000003FE000000000000FF8000000000003FE000000000000FF800000 -0000003FE000000000000FF8000000000003FE000000000000FF8000000000003FE00000 -0000000FF8000000000003FE000000000000FF8000000000003FE000000000000FF80000 -00000003FE000000000000FF8000000000003FE000000000000FF8000000000003FE0000 -00000000FF8000000000003FC000000000000FC000000000000380000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000007FFFFFFFFFFF80FFFFFFFFFFFFC0FFFFFFFFFF -FFC07FFFFFFFFFFF80324479B441>20 D<0000000000001E00000000000000001E000000 -00000000001E00000000000000001E00000000000000001F00000000000000000F000000 -00000000000F00000000000000000F800000000000000007800000000000000007C00000 -000000000003E00000000000000003E00000000000000001F00000000000000000F80000 -000000000000FC00000000000000007E00000000000000003F00000000000000001F8000 -0000000000000FC00000000000000007F07FFFFFFFFFFFFFFFFCFFFFFFFFFFFFFFFFFFFF -FFFFFFFFFFFFFFFF7FFFFFFFFFFFFFFFFC0000000000000007F0000000000000000FC000 -0000000000001F80000000000000003F00000000000000007E0000000000000000FC0000 -000000000000F80000000000000001F00000000000000003E00000000000000003E00000 -000000000007C0000000000000000780000000000000000F80000000000000000F000000 -00000000000F00000000000000001F00000000000000001E00000000000000001E000000 -00000000001E00000000000000001E0000482C7BAA53>33 D<0000300000000030000000 -003000000000780000000078000000007800000000FC00000000FC00000001FE00000001 -FE00000003FF00000007FF80000007FF8000000FFFC000001F7BE000003E79F00000FC78 -FC0001F8787E0007F0783F803FE0781FF0FF807807FCFE007801FCF80078007CC0007800 -0C0000780000000078000000007800000000780000000078000000007800000000780000 -000078000000007800000000780000000078000000007800000000780000000078000000 -007800000000780000000078000000007800000000780000000078000000007800000000 -780000000078000000007800000000780000000078000000007800000000780000000078 -000000007800000000780000000078000000007800000000780000000078000000007800 -000000780000000078000000007800000000780000000078000000007800000000780000 -000078000000007800000000780000000078000000007800000000780000000030000026 -4A7EB92A>I<00000000003C00000000000000003C00000000000000003E000000000000 -00001E00000000000000001F00000000000000000F00000000000000000F800000000000 -000007C00000000000000003C00000000000000003E00000000000000001F00000000000 -000000F800000000000000007C00007FFFFFFFFFFFFE0000FFFFFFFFFFFFFF0000FFFFFF -FFFFFFFF80007FFFFFFFFFFFFFC00000000000000003F00000000000000001F800000000 -00000000FE00000000000000003F80000000000000001FE00000000000000007F8000000 -0000000001FF0000000000000001FF0000000000000007F8000000000000001FE0000000 -000000003F8000000000000000FE0000000000000001F80000000000000003F0007FFFFF -FFFFFFFFC000FFFFFFFFFFFFFF8000FFFFFFFFFFFFFF00007FFFFFFFFFFFFE0000000000 -0000007C0000000000000000F80000000000000001F00000000000000003E00000000000 -000003C00000000000000007C0000000000000000F80000000000000000F000000000000 -00001F00000000000000001E00000000000000003E00000000000000003C000000000000 -00003C00000048307BAC53>41 D<00001FFFFE0000FFFFFF0003FFFFFF000FFFFFFE001F -F00000007F80000000FE00000001F800000003F000000007E00000000FC00000000F8000 -00001F000000001F000000003E000000003E000000007C000000007C0000000078000000 -00F800000000F800000000F000000000F000000000FFFFFFFFFEFFFFFFFFFFFFFFFFFFFF -FFFFFFFFFEF000000000F000000000F800000000F80000000078000000007C000000007C -000000003E000000003E000000001F000000001F000000000F800000000FC000000007E0 -00000003F000000001F800000000FE000000007F800000001FF00000000FFFFFFE0003FF -FFFF0000FFFFFF00001FFFFE283279AD37>50 D<000001F800000FF800003F800000FC00 -0001F8000003F0000007E0000007E000000FE000000FC000000FC000000FC000000FC000 -000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000 -000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000 -000FC000000FC000000FC000001FC000001F8000003F8000007F000000FE000003F80000 -7FE00000FF0000007FE0000003F8000000FE0000007F0000003F8000001F8000001FC000 -000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000 -000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000 -000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FE0000007E000 -0007E0000003F0000001F8000000FC0000003F8000000FF8000001F81D537ABD2A>102 -DI<60F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0 -F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0 -F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F060045377BD17>106 -D E /Fx 5 117 df<00000E00000000000E00000000000E00000000000E00000000000E -00000000000E00000000000E00000000000E00000000000E00000000000E00000000000E -00000000000E00000000000E00000000000E00000000000E00000000000E00000000000E -00000000000E00000000000E00000000000E000000FFFFFFFFFFE0FFFFFFFFFFE0FFFFFF -FFFFE000000E00000000000E00000000000E00000000000E00000000000E00000000000E -00000000000E00000000000E00000000000E00000000000E00000000000E00000000000E -00000000000E00000000000E00000000000E00000000000E00000000000E00000000000E -00000000000E00000000000E0000002B2B7DA333>43 D<00380000780001F8001FF800FE -F800E0F80000F80000F80000F80000F80000F80000F80000F80000F80000F80000F80000 -F80000F80000F80000F80000F80000F80000F80000F80000F80000F80000F80000F80000 -F80000F80000F80000F80000F80000F80000F80001FC00FFFFF8FFFFF815267BA521>49 -D<00FF000003FFE0000E03F0001800F80030007C0060007E0078003F00FC003F00FE001F -80FE001F80FE001F80FE001F807C001F8000001F8000001F0000003F0000003E0000007E -0000007C000000F8000001F0000003E0000003C00000078000000E0000001C0000003800 -000070018000E001800180018003000300060003000C0003001FFFFF003FFFFF007FFFFE -00FFFFFE00FFFFFE0019267DA521>I<0F800000FF800000FF8000001F8000000F800000 -0F8000000F8000000F8000000F8000000F8000000F8000000F8000000F8000000F800000 -0F81FC000F8FFF000F9C0F800FB007C00FE007C00FC003E00FC003E00FC003E00F8003E0 -0F8003E00F8003E00F8003E00F8003E00F8003E00F8003E00F8003E00F8003E00F8003E0 -0F8003E00F8003E00F8003E00F8003E00F8003E01FC007F0FFF83FFEFFF83FFE1F287EA7 -25>104 D<00C00000C00000C00000C00001C00001C00001C00003C00007C0000FC0001F -C000FFFFE0FFFFE007C00007C00007C00007C00007C00007C00007C00007C00007C00007 -C00007C00007C00007C03007C03007C03007C03007C03007C03007C03003E06003E06001 -F0C000FF80003F0014257FA31A>116 D E /Fy 134[55 50 83 55 -61 33 44 39 61 61 55 61 89 33 61 1[33 61 55 39 50 61 -44 61 50 11[78 66 61 72 1[61 83 83 100 61 2[39 83 1[55 -61 83 72 66 78 7[50 50 50 50 50 50 50 50 50 50 29 25 -33 42[61 2[{ TeXBase1Encoding ReEncodeFont }55 100.000003 -/Palatino-Bold rf /Fz 139[57 1[67 1[105 7[105 2[86 3[86 -29[124 9[86 86 86 86 86 86 86 86 86 86 48[{ - TeXBase1Encoding ReEncodeFont }17 172.833377 /Palatino-Bold -rf /FA 94 127 df<1C007F00FF80FF80FF80FF80FF80FF80FF80FF80FF80FF80FF80FF -80FF80FF80FF80FF80FF807F007F007F007F007F007F007F007F007F007F007F007F007F -007F007F003E00000000000000000000000000000000001C007F007F00FF80FF80FF807F -007F001C0009346FB32C>33 D<3C001E007F007F00FF007F80FF007F80FF007F80FF007F -80FF007F80FF007F807F007F007F007F007F007F007F007F007F007F007F007F007E003F -007E003F007E003F007E003F007E003F007E003F003E003E003E003E003E003E003C001E -001C001C00191977B32C>I<000F003C00001F807E00001F807E00001F807E00001F807E -00001F807E00001F807E00001F807E00001F807E00003F80FE00003F00FC00003F00FC00 -003F00FC00003F00FC007FFFFFFFF0FFFFFFFFF8FFFFFFFFF8FFFFFFFFF8FFFFFFFFF83F -FFFFFFF0007E01F800007E01F800007E01F800007E01F800007E01F80000FE03F80000FC -03F00000FC03F00000FC03F00000FC03F00000FC03F00000FC03F0003FFFFFFFF0FFFFFF -FFF8FFFFFFFFF8FFFFFFFFF8FFFFFFFFF87FFFFFFFF001F807E00001F807E00001F807E0 -0003F80FE00003F00FC00003F00FC00003F00FC00003F00FC00003F00FC00003F00FC000 -03F00FC00003F00FC00001E007800025337DB22C>I<0001C000000003E000000003E000 -000003E000000003E000000003E000000003E00000000FFC0000007FFF800001FFFFE000 -07FFFFF0000FFFFFF8001FFBEFFC003FC3E1FE003F03E07F007E03E03F007C03E03F00FC -03E03F80F803E03F80F803E07F80F803E07F80F803E07F80FC03E03F00FC03E03F007E03 -E000007F03E000003FC3E000003FFBE000001FFFE000000FFFFC000007FFFF000001FFFF -C000007FFFE000001FFFF8000003FFFC000003E7FC000003E1FE000003E07F000003E03F -001803E01F007E03E01F807E03E00F80FF03E00F80FF03E00F80FF03E00F80FE03E00F80 -FE03E01F80FE03E01F007E03E03F007F03E03E003F83E0FE003FC3E1FC001FFBEFF8000F -FFFFF00007FFFFE00003FFFFC00000FFFF0000001FF800000003E000000003E000000003 -E000000003E000000003E000000003E000000001C0000021417BB92C>I<07800007001F -E0000F801FE0001F803FF0001F807FF8003F807FF8003F007CF8007F00FCFC007E00F87C -007E00F87C00FE00F87C00FC00F87C01FC00F87C01F800F87C01F800F87C03F800FCFC03 -F0007CF803F0007FF807F0007FF807E0003FF00FE0001FE00FC0001FE00FC00007801FC0 -0000001F800000003F800000003F000000003F000000007F000000007E00000000FE0000 -0000FC00000000FC00000001FC00000001F800000001F800000003F800000003F0000000 -07F000000007E000000007E00000000FE00000000FC00000001FC00000001F800F00001F -803FC0003F807FE0003F007FE0007F00FFF0007E00F9F0007E00F9F000FE01F9F800FC01 -F0F800FC01F0F801FC01F0F801F801F0F803F801F0F803F001F0F803F001F9F807F000F9 -F007E000F9F00FE000FFF00FC0007FE00FC0007FE007C0003FC00380000F0025417DB92C ->I<000FC00000003FE00000007FF0000000FFF8000000FFFC000001F8FC000001F07C00 -0001F07E000003F03E000003E03E000003E03E000003E03E000003E03E000003E03E0000 -03E07E000003E07C000003E0FC3FF803F0F87FFC01F1F87FFC01F3F07FFC01F7F03FF801 -F7E01F0001FFC03F0000FF803E0000FF803E0000FF007E0000FE007C0001FC007C0003FE -00FC0007FE00F80007FF01F8000FDF01F0001F9F81F0003F8F83F0003F0FC3E0007E07E7 -E0007E07E7C000FC03F7C000FC01FFC000FC01FF8000FC00FF8010FC00FF007CFC007F00 -7CFC007F007CFE00FF807C7E01FFC07C7F03FFE0FC3F87F7F1F83FFFE3FFF81FFFC1FFF0 -0FFF80FFF007FF007FC001FC001F8026357EB32C>I<0F801FC03FE03FF03FF03FF83FF8 -1FF80FF800F800F800F800F801F801F001F003F003E007E00FC01FC03F807F00FE00FC00 -F80070000D1B71B22C>I<0000380000FC0001FC0003FC0007F8000FF0001FC0003F8000 -7F0000FE0001FC0003F80003F00007F00007E0000FE0000FC0001F80001F80003F80003F -00003F00007F00007E00007E00007E0000FE0000FC0000FC0000FC0000FC0000FC0000FC -0000FC0000FC0000FC0000FC0000FC0000FC0000FE00007E00007E00007E00007F00003F -00003F00003F80001F80001F80000FC0000FE00007E00007F00003F00003F80001FC0000 -FE00007F00003F80001FC0000FF00007F80003FC0001FC0000FC000038164272B92C>I< -700000FC0000FE0000FF00007F80003FC0000FE00007F00003F80001FC0000FE00007F00 -003F00003F80001F80001FC0000FC00007E00007E00007F00003F00003F00003F80001F8 -0001F80001F80001FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC -0000FC0000FC0000FC0001FC0001F80001F80001F80003F80003F00003F00007F00007E0 -0007E0000FC0001FC0001F80003F80003F00007F0000FE0001FC0003F80007F0000FE000 -3FC0007F8000FF0000FE0000FC0000700000164279B92C>I<000380000007C0000007C0 -000007C0000007C0000007C0000007C0002007C008F807C03EFE07C0FEFF07C1FEFFC7C7 -FEFFE7CFFE3FFFFFF80FFFFFE003FFFF8001FFFF00007FFC00007FFC0001FFFF0003FFFF -800FFFFFE03FFFFFF8FFE7CFFEFFC7C7FEFF07C1FEFE07C0FEF807C03E2007C0080007C0 -000007C0000007C0000007C0000007C0000007C000000380001F247AAA2C>I<00007800 -000000FC00000000FC00000000FC00000000FC00000000FC00000000FC00000000FC0000 -0000FC00000000FC00000000FC00000000FC00000000FC00000000FC00000000FC000000 -00FC00007FFFFFFFF0FFFFFFFFF8FFFFFFFFF8FFFFFFFFF8FFFFFFFFF87FFFFFFFF00000 -FC00000000FC00000000FC00000000FC00000000FC00000000FC00000000FC00000000FC -00000000FC00000000FC00000000FC00000000FC00000000FC00000000FC00000000FC00 -00000078000025267DAB2C>I<0F801FE03FF07FF87FF87FFC7FFC7FFC3FFC1FFC0FFC00 -FC00F800F801F803F007F01FE07FC0FF80FF00FC0070000E17718A2C>I<7FFFFFFF00FF -FFFFFF80FFFFFFFF80FFFFFFFF80FFFFFFFF807FFFFFFF0021067B9B2C>I<1F003F807F -C0FFE0FFE0FFE0FFE0FFE07FC03F801F000B0B708A2C>I<00000007000000000F800000 -001F800000001F800000003F800000003F000000007F000000007E00000000FE00000000 -FC00000001FC00000001F800000003F800000003F000000003F000000007F000000007E0 -0000000FE00000000FC00000001FC00000001F800000003F800000003F000000007F0000 -00007E00000000FE00000000FC00000000FC00000001FC00000001F800000003F8000000 -03F000000007F000000007E00000000FE00000000FC00000001FC00000001F800000001F -800000003F800000003F000000007F000000007E00000000FE00000000FC00000001FC00 -000001F800000003F800000003F000000007F000000007E000000007E00000000FE00000 -000FC00000001FC00000001F800000003F800000003F000000007F000000007E00000000 -FE00000000FC00000000FC00000000F800000000780000000021417BB92C>I<0003F800 -00000FFE0000003FFF8000007FFFC00000FFFFE00001FE0FF00003F803F80007F001FC00 -07E000FC000FC0007E000FC0007E001F80003F001F80003F003F00001F803F00001F803E -00000F807E00000FC07E00000FC07E00000FC07C000007C0FC000007E0FC000007E0FC00 -0007E0FC000007E0FC000007E0FC000007E0FC000007E0FC000007E0FC000007E0FC0000 -07E0FC000007E0FC000007E0FE00000FE07E00000FC07E00000FC07E00000FC07E00000F -C03F00001F803F00001F803F00001F801F80003F001F80003F000FC0007E000FE000FE00 -07E000FC0007F001FC0003F803F80001FE0FF00000FFFFE000007FFFC000003FFF800000 -0FFE00000003F8000023357CB32C>I<00070000000F8000000F8000001F8000001F8000 -003F8000007F800000FF800001FF800007FF80007FFF8000FFFF8000FFDF8000FF9F8000 -7C1F8000001F8000001F8000001F8000001F8000001F8000001F8000001F8000001F8000 -001F8000001F8000001F8000001F8000001F8000001F8000001F8000001F8000001F8000 -001F8000001F8000001F8000001F8000001F8000001F8000001F8000001F8000001F8000 -001F8000001F8000001F8000001F8000001F8000001F80007FFFFFE0FFFFFFF0FFFFFFF0 -FFFFFFF07FFFFFE01C3477B32C>I<000FF80000007FFF800001FFFFE00007FFFFF0000F -FFFFFC001FF80FFE003FE001FF003F80007F007F00003F807E00001F80FE00001FC0FE00 -000FC0FF00000FE0FF000007E0FF000007E0FF000007E07E000007E03C000007E0000000 -07E000000007E00000000FE00000000FC00000001FC00000001F800000003F800000003F -000000007F00000000FE00000001FC00000003FC00000007F80000000FF00000001FE000 -00003FC0000000FF80000001FE00000003FC00000007F80000000FF00000003FE0000000 -7F80000000FF00000001FE00000003FC0003C007F80007E01FE00007E03FC00007E07FFF -FFFFE0FFFFFFFFE0FFFFFFFFE0FFFFFFFFE07FFFFFFFC023347CB32C>I<000FFC000000 -7FFF800001FFFFE00007FFFFF8000FFFFFFC001FF807FE001FC000FE003F80007F003FC0 -003F003FC0003F803FC0001F803FC0001F801F80001F800F00001F800000001F80000000 -3F800000003F000000007F00000000FE00000001FE00000003FC0000001FF800001FFFF0 -00003FFFE000003FFFE000003FFFF800001FFFFC00000007FE00000000FF000000007F00 -0000003F800000001FC00000000FC00000000FC00000000FE000000007E000000007E03C -000007E07E000007E0FF000007E0FF00000FE0FF00000FC0FF00000FC0FE00001FC07F00 -003F807F80007F003FC000FF001FF807FE000FFFFFFC0007FFFFF80003FFFFE000007FFF -8000000FFC000023357CB32C>I<000007F00000000FF80000001FF80000003FF8000000 -3FF80000007EF80000007EF8000000FCF8000001F8F8000001F8F8000003F0F8000007E0 -F8000007E0F800000FC0F800001F80F800001F80F800003F00F800007E00F800007E00F8 -0000FC00F80001F800F80001F800F80003F000F80003E000F80007E000F8000FC000F800 -0FC000F8001F8000F8003F0000F8003F0000F8007E0000F800FC0000F800FFFFFFFFFCFF -FFFFFFFEFFFFFFFFFEFFFFFFFFFE7FFFFFFFFC000000F800000000F800000000F8000000 -00F800000000F800000000F800000000F800000000F800000000F800000000F80000007F -FFF00000FFFFF80000FFFFF80000FFFFF800007FFFF027347EB32C>I<0FFFFFFE001FFF -FFFF001FFFFFFF001FFFFFFF001FFFFFFE001F800000001F800000001F800000001F8000 -00001F800000001F800000001F800000001F800000001F800000001F800000001F800000 -001F800000001F800000001F83FE00001F9FFF80001FFFFFE0001FFFFFF8001FFFFFFC00 -1FFE03FE001FF000FF001FC0007F001F80003F801F00001F800F00001FC00000000FC000 -00000FC000000007E000000007E000000007E000000007E03C000007E07E000007E0FF00 -0007E0FF00000FE0FF00000FC0FF00000FC0FE00001FC07E00003F807F00007F003F8000 -FF003FC001FE001FF80FFC000FFFFFF80007FFFFF00001FFFFC000007FFF0000000FF800 -0023347CB22C>I<00003FC0000001FFF8000007FFFC00001FFFFE00003FFFFF00007FE0 -7F0000FF003F8001FE007F8003F8007F8007F0007F8007E0007F800FE0003F001FC0001E -001F800000003F800000003F000000003F000000007F000000007E000000007E03FE0000 -7E1FFF8000FC7FFFE000FDFFFFF000FFFFFFF800FFFE07FC00FFF001FE00FFC0007F00FF -80003F80FF00001F80FF00001FC0FE00000FC0FE00000FE0FE000007E0FE000007E0FE00 -0007E07E000007E07E000007E07E000007E07E000007E03F000007E03F00000FE03F8000 -0FC01F80001FC01FC0001F800FC0003F800FE0007F0007F801FE0003FE07FC0001FFFFF8 -0000FFFFF000007FFFE000001FFF80000007FC000023357CB32C>I<7800000000FFFFFF -FFC0FFFFFFFFE0FFFFFFFFE0FFFFFFFFE0FFFFFFFFC0FC00003F80FC00007F00FC0000FE -00780000FC00000001FC00000003F800000007F000000007E00000000FE00000000FC000 -00001F800000003F800000003F000000007F000000007E00000000FE00000000FC000000 -01FC00000001F800000001F800000003F000000003F000000007F000000007E000000007 -E000000007E00000000FC00000000FC00000000FC00000000FC00000001F800000001F80 -0000001F800000001F800000001F800000003F800000003F000000003F000000003F0000 -00003F000000003F000000003F000000003F000000003F000000003F000000003F000000 -001E00000023357CB32C>I<0007FC0000003FFF800000FFFFE00003FFFFF80007FFFFFC -000FFC07FE001FF001FF001FC0007F003F80003F803F00001F807F00001FC07E00000FC0 -7E00000FC07E00000FC07E00000FC07E00000FC03F00001F803F00001F801F80003F001F -C0007F000FF001FE0003FC07F80001FFFFF000007FFFC0000007FC0000007FFFC00001FF -FFF00003FC07F8000FF001FE001FC0007F001F80003F003F00001F807E00000FC07E0000 -0FC0FC000007E0FC000007E0FC000007E0FC000007E0FC000007E0FC000007E0FC000007 -E07E00000FC07E00000FC07F00001FC03F80003F801FC0007F001FF001FF000FFC07FE00 -07FFFFFC0003FFFFF80000FFFFE000003FFF80000007FC000023357CB32C>I<0007FC00 -00003FFF000000FFFFC00001FFFFE00003FFFFF00007FC07F8000FF001FC001FE000FE00 -3F80007E003F80007F007F00003F007E00001F80FE00001F80FC00001F80FC00000FC0FC -00000FC0FC00000FC0FC00000FC0FC00000FE0FC00000FE0FC00000FE0FE00000FE07E00 -000FE07F00001FE03F00001FE03F80003FE01FC0007FE00FF001FFE007FC0FFFE003FFFF -FFE001FFFFF7E000FFFFC7E0003FFF0FE0000FF80FC00000000FC00000000FC00000001F -C00000001F800000003F800000003F000F00007F001F80007E003FC000FE003FC001FC00 -3FC003F8003FC007F8003F801FF0001FE07FE0001FFFFFC0000FFFFF000007FFFE000001 -FFF80000007FC0000023357CB32C>I<1F003F807FC0FFE0FFE0FFE0FFE0FFE07FC03F80 -1F00000000000000000000000000000000000000000000000000000000001F003F807FC0 -FFE0FFE0FFE0FFE0FFE07FC03F801F000B2470A32C>I<0F801FC03FE07FF07FF07FF07F -F07FF03FE01FC00F80000000000000000000000000000000000000000000000000000000 -000F801FC03FE07FE07FF07FF07FF07FF03FF01FF00FF001F003F003E007E00FC00FC03F -807F00FF00FE00F80070000C3071A32C>I<00000007000000001F800000003F80000000 -FF80000003FF80000007FF0000001FFC0000003FF8000000FFE0000001FF80000007FF00 -00000FFC0000003FF80000007FE0000001FFC0000003FF0000000FFE0000001FF8000000 -7FF0000000FFC0000000FF80000000FF80000000FFC00000007FF00000001FF80000000F -FE00000003FF00000001FFC00000007FE00000003FF80000000FFC00000007FF00000001 -FF80000000FFE00000003FF80000001FFC00000007FF00000003FF80000000FF80000000 -3F800000001F800000000700212A7BAD2C>I<7FFFFFFFF0FFFFFFFFF8FFFFFFFFF8FFFF -FFFFF8FFFFFFFFF83FFFFFFFF00000000000000000000000000000000000000000000000 -00000000000000000000000000000000003FFFFFFFF0FFFFFFFFF8FFFFFFFFF8FFFFFFFF -F8FFFFFFFFF87FFFFFFFF025147DA22C>I<7000000000FC00000000FE00000000FF8000 -0000FFE00000007FF00000001FFC0000000FFE00000003FF80000000FFC00000007FF000 -00001FF80000000FFE00000003FF00000001FFC00000007FE00000003FF80000000FFC00 -000007FF00000001FF80000000FF80000000FF80000001FF80000007FF0000000FFC0000 -003FF80000007FE0000001FFC0000003FF0000000FFE0000001FF80000007FF0000000FF -C0000003FF8000000FFE0000001FFC0000007FF0000000FFE0000000FF80000000FE0000 -0000FC000000007000000000212A7BAD2C>I<003FFE000003FFFFC0000FFFFFF0001FFF -FFFC003FFFFFFE007FE007FF007F0000FF00FE00003F80FF00001F80FF00001F80FF0000 -1F80FF00003F807E00007F003C0000FF00000003FE0000000FFC0000001FF80000003FE0 -0000007FC0000000FF00000001FE00000003FC00000003F800000007F800000007F00000 -000FF00000000FE00000000FE00000000FE00000000FE00000000FE00000000FE0000000 -0FE000000007C00000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000003800000000FE00000000FE00000001FF00000001FF0 -0000001FF00000000FE00000000FE00000000380000021337BB22C>I<00007F80000003 -FFE000000FFFF000003FFFF800007FFFFC0000FFC0FE0001FE007F0003F8003F0007F000 -1F8007E00FCF800FC03FFF801F807FFFC01F80FFFFC03F01FFFFC03E03F87FC03E07F03F -E07E07E01FE07C0FC00FE07C0F8007E07C0F8007E0FC1F8007E0F81F0003E0F81F0003E0 -F81F0003E0F81F0003E0F81F0003E0F81F0003E0F81F0003E0F81F0003E0F81F0003E0FC -1F8007E07C0F8007C07C0F8007C07C0FC00FC07E07E01F803E07F03F803E03F87F003F01 -FFFE001F80FFFC001F807FF8000FC03FF00007E00FC00007F00007C003F8000FE001FE00 -1FE000FFC0FFE0007FFFFFC0003FFFFF80000FFFFE000003FFF80000007FC00023337CB2 -2C>I<0000FE00000001FF00000001FF00000001FF00000001FF00000003FF80000003FF -80000003EF80000003EF80000007EF80000007EFC0000007EFC0000007C7C0000007C7C0 -00000FC7E000000FC7E000000FC7E000000FC3E000001F83F000001F83F000001F83F000 -001F83F000001F83F000003F01F800003F01F800003F01F800003F01F800007E00FC0000 -7E00FC00007E00FC00007E00FC00007E00FC0000FC007E0000FFFFFE0000FFFFFE0000FF -FFFE0001FFFFFF0001FFFFFF0001F8003F0001F8003F0001F8003F0003F0001F8003F000 -1F8003F0001F8003F0001F8007F0001FC007E0000FC07FFE00FFFC7FFF01FFFCFFFF01FF -FE7FFF01FFFC7FFE00FFFC27347EB32C>I<7FFFFFE0007FFFFFF800FFFFFFFE007FFFFF -FF007FFFFFFFC003F0003FC003F0000FE003F00007F003F00003F003F00003F003F00001 -F803F00001F803F00001F803F00001F803F00001F803F00001F803F00003F003F00003F0 -03F00007F003F0000FE003F0001FC003F000FF8003FFFFFF0003FFFFFE0003FFFFFC0003 -FFFFFF0003FFFFFFC003F0001FE003F00007F003F00003F803F00001F803F00000FC03F0 -0000FC03F00000FE03F000007E03F000007E03F000007E03F000007E03F000007E03F000 -007E03F00000FE03F00000FC03F00001FC03F00003F803F0000FF803F0003FF07FFFFFFF -E07FFFFFFFC0FFFFFFFF807FFFFFFE007FFFFFF00027337FB22C>I<0000FF00700007FF -E0F8000FFFF9F8003FFFFDF8007FFFFFF800FF81FFF801FE007FF803FC001FF807F0000F -F807F00007F80FE00007F80FC00003F81F800003F81F800001F83F000001F83F000001F8 -7F000001F87E000000F07E000000007E00000000FE00000000FC00000000FC00000000FC -00000000FC00000000FC00000000FC00000000FC00000000FC00000000FC00000000FC00 -000000FC00000000FE000000007E000000007E000000007E000000007F000000F03F0000 -01F83F000001F81F800001F81F800001F80FC00003F80FE00003F007F00007F007F00007 -E003FC001FE001FE003FC000FF81FF80007FFFFF00003FFFFE00000FFFFC000007FFF000 -0000FF800025357DB32C>I<7FFFFF0000FFFFFFC000FFFFFFF000FFFFFFF8007FFFFFFC -0007E003FE0007E000FF0007E0007F8007E0003F8007E0001FC007E0000FE007E0000FE0 -07E00007E007E00007F007E00003F007E00003F807E00001F807E00001F807E00001F807 -E00001F807E00000FC07E00000FC07E00000FC07E00000FC07E00000FC07E00000FC07E0 -0000FC07E00000FC07E00000FC07E00000FC07E00000FC07E00000FC07E00001F807E000 -01F807E00001F807E00003F807E00003F007E00003F007E00007F007E00007E007E0000F -E007E0001FC007E0003FC007E0007F8007E000FF0007E003FE007FFFFFFC00FFFFFFF800 -FFFFFFF000FFFFFFC0007FFFFF000026337EB22C>I<7FFFFFFFF0FFFFFFFFF8FFFFFFFF -F8FFFFFFFFF87FFFFFFFF803F00001F803F00001F803F00001F803F00001F803F00001F8 -03F00001F803F00001F803F00000F003F000000003F000000003F000000003F000000003 -F001E00003F003F00003F003F00003F003F00003F003F00003FFFFF00003FFFFF00003FF -FFF00003FFFFF00003FFFFF00003F003F00003F003F00003F003F00003F003F00003F001 -E00003F000000003F000000003F000000003F000000003F000000003F000003C03F00000 -7E03F000007E03F000007E03F000007E03F000007E03F000007E03F000007E03F000007E -7FFFFFFFFEFFFFFFFFFEFFFFFFFFFEFFFFFFFFFE7FFFFFFFFC27337EB22C>I<7FFFFFFF -F8FFFFFFFFFCFFFFFFFFFCFFFFFFFFFC7FFFFFFFFC03F00000FC03F00000FC03F00000FC -03F00000FC03F00000FC03F00000FC03F00000FC03F000007803F000000003F000000003 -F000000003F000000003F000000003F000F00003F001F80003F001F80003F001F80003F0 -01F80003FFFFF80003FFFFF80003FFFFF80003FFFFF80003FFFFF80003F001F80003F001 -F80003F001F80003F001F80003F000F00003F000000003F000000003F000000003F00000 -0003F000000003F000000003F000000003F000000003F000000003F000000003F0000000 -03F000000003F00000007FFFE00000FFFFE00000FFFFF00000FFFFE000007FFFE0000026 -337EB22C>I<0001FC0380000FFF87C0001FFFEFC0007FFFFFC000FFFFFFC001FF07FFC0 -03FC01FFC003F800FFC007F0007FC00FE0003FC00FC0001FC01FC0001FC01F80001FC03F -80000FC03F00000FC03F00000FC07E00000FC07E000007807E000000007E00000000FE00 -000000FC00000000FC00000000FC00000000FC00000000FC00000000FC00000000FC0000 -0000FC00000000FC0003FFF8FC0007FFFCFC0007FFFCFE0007FFFC7E0003FFF87E00000F -C07E00000FC07E00000FC03F00001FC03F00001FC03F80001FC01F80001FC01FC0003FC0 -0FC0003FC00FE0007FC007F0007FC003F800FFC003FC01FFC001FF07FFC000FFFFFFC000 -7FFFEFC0001FFFCFC0000FFF07800001FC000026357DB32C>I<7FFE00FFFCFFFF01FFFE -FFFF01FFFEFFFF01FFFE7FFE00FFFC07E0000FC007E0000FC007E0000FC007E0000FC007 -E0000FC007E0000FC007E0000FC007E0000FC007E0000FC007E0000FC007E0000FC007E0 -000FC007E0000FC007E0000FC007E0000FC007E0000FC007E0000FC007FFFFFFC007FFFF -FFC007FFFFFFC007FFFFFFC007FFFFFFC007E0000FC007E0000FC007E0000FC007E0000F -C007E0000FC007E0000FC007E0000FC007E0000FC007E0000FC007E0000FC007E0000FC0 -07E0000FC007E0000FC007E0000FC007E0000FC007E0000FC007E0000FC007E0000FC007 -E0000FC07FFE00FFFCFFFF01FFFEFFFF01FFFEFFFF01FFFE7FFE00FFFC27337EB22C>I< -7FFFFFF8FFFFFFFCFFFFFFFCFFFFFFFC7FFFFFF8000FC000000FC000000FC000000FC000 -000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000 -000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000 -000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000 -000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000 -000FC0007FFFFFF8FFFFFFFCFFFFFFFCFFFFFFFC7FFFFFF81E3379B22C>I<0007FFFF80 -000FFFFFC0000FFFFFC0000FFFFFC00007FFFF80000003F000000003F000000003F00000 -0003F000000003F000000003F000000003F000000003F000000003F000000003F0000000 -03F000000003F000000003F000000003F000000003F000000003F000000003F000000003 -F000000003F000000003F000000003F000000003F000000003F000000003F000000003F0 -00000003F000000003F000000003F000000003F000000003F000000003F000000003F000 -000003F000180003F0007E0003F0007E0003F000FF0003F000FF0003F000FF0007E000FE -000FE0007F001FE0007FC07FC0003FFFFF80001FFFFF00000FFFFE000003FFF80000007F -C0000022347BB22C>I<7FFC007FF8FFFE00FFFCFFFE00FFFCFFFE00FFFC7FFC007FF807 -C0001F8007C0003F8007C0007F0007C0007E0007C000FC0007C001F80007C003F80007C0 -07F00007C007E00007C00FC00007C01F800007C03F800007C07F000007C07E000007C0FC -000007C1F8000007C3F8000007C7FC000007C7FC000007CFFE000007DFBE000007FFBF00 -0007FF1F000007FE1F800007FC0FC00007F80FC00007F807E00007F003E00007E003F000 -07C001F00007C001F80007C000FC0007C000FC0007C0007E0007C0003E0007C0003F0007 -C0001F0007C0001F8007C0000FC007C0000FC007C00007E07FFC001FFCFFFE003FFEFFFE -003FFEFFFE003FFE7FFC001FFC27337EB22C>I<7FFFE00000FFFFF00000FFFFF00000FF -FFF000007FFFE0000003F000000003F000000003F000000003F000000003F000000003F0 -00000003F000000003F000000003F000000003F000000003F000000003F000000003F000 -000003F000000003F000000003F000000003F000000003F000000003F000000003F00000 -0003F000000003F000000003F000000003F000000003F000000003F000000003F0000000 -03F000000003F000000003F000000003F000000003F000000003F00000F003F00001F803 -F00001F803F00001F803F00001F803F00001F803F00001F803F00001F803F00001F87FFF -FFFFF8FFFFFFFFF8FFFFFFFFF8FFFFFFFFF87FFFFFFFF025337DB22C>I<7FE0000FFCFF -F0001FFEFFF0001FFEFFF8003FFE7FF8003FFC0FF8003FE00FBC007BE00FBC007BE00FBC -007BE00FBC007BE00F9E00F3E00F9E00F3E00F9E00F3E00F9F01F3E00F9F01F3E00F8F01 -E3E00F8F01E3E00F8F83E3E00F8F83E3E00F8783C3E00F87C7C3E00F87C7C3E00F83C783 -E00F83C783E00F83EF83E00F83EF83E00F81EF03E00F81EF03E00F81FF03E00F80FE03E0 -0F80FE03E00F80FE03E00F807C03E00F803803E00F800003E00F800003E00F800003E00F -800003E00F800003E00F800003E00F800003E00F800003E00F800003E00F800003E00F80 -0003E00F800003E07FF0001FFCFFF8003FFEFFF8003FFEFFF8003FFE7FF0001FFC27337E -B22C>I<7FF0007FFCFFF800FFFEFFF800FFFEFFFC00FFFE7FFC007FFC07FE0007C007DE -0007C007DE0007C007DF0007C007CF0007C007CF0007C007CF8007C007C78007C007C7C0 -07C007C7C007C007C3C007C007C3E007C007C3E007C007C1E007C007C1F007C007C1F007 -C007C0F007C007C0F807C007C0F807C007C07C07C007C07C07C007C07C07C007C03E07C0 -07C03E07C007C01E07C007C01F07C007C01F07C007C00F07C007C00F87C007C00F87C007 -C00787C007C007C7C007C007C7C007C003C7C007C003E7C007C001E7C007C001E7C007C0 -01F7C007C000F7C007C000F7C007C000FFC07FFC007FC0FFFE007FC0FFFE003FC0FFFE00 -3FC07FFC001F8027337EB22C>I<007FFF000003FFFFE0000FFFFFF8001FFFFFFC003FFF -FFFE003FE003FE003F8000FE007F00007F007F00007F007E00003F007E00003F007E0000 -3F00FE00003F80FC00001F80FC00001F80FC00001F80FC00001F80FC00001F80FC00001F -80FC00001F80FC00001F80FC00001F80FC00001F80FC00001F80FC00001F80FC00001F80 -FC00001F80FC00001F80FC00001F80FC00001F80FC00001F80FC00001F80FC00001F80FC -00001F80FC00001F80FC00001F80FC00001F80FC00001F80FC00001F80FE00003F80FE00 -003F807E00003F007E00003F007E00003F007F00007F007F00007F003F8000FE003FF007 -FE003FFFFFFE001FFFFFFC000FFFFFF80003FFFFE000007FFF000021357BB32C>I<7FFF -FFC000FFFFFFF800FFFFFFFC00FFFFFFFF007FFFFFFF8003F000FFC003F0003FC003F000 -0FE003F00007F003F00007F003F00003F003F00003F803F00001F803F00001F803F00001 -F803F00001F803F00001F803F00001F803F00003F803F00003F003F00007F003F00007F0 -03F0000FE003F0003FC003F000FFC003FFFFFF8003FFFFFF0003FFFFFC0003FFFFF80003 -FFFFC00003F000000003F000000003F000000003F000000003F000000003F000000003F0 -00000003F000000003F000000003F000000003F000000003F000000003F000000003F000 -000003F000000003F00000007FFF800000FFFFC00000FFFFC00000FFFFC000007FFF8000 -0025337EB22C>I<007FFF000003FFFFE0000FFFFFF8001FFFFFFC003FFFFFFE003FF007 -FE003F8000FE007F00007F007F00007F007E00003F007E00003F007E00003F00FE00003F -80FC00001F80FC00001F80FC00001F80FC00001F80FC00001F80FC00001F80FC00001F80 -FC00001F80FC00001F80FC00001F80FC00001F80FC00001F80FC00001F80FC00001F80FC -00001F80FC00001F80FC00001F80FC00001F80FC00001F80FC00001F80FC00001F80FC00 -001F80FC00001F80FC00001F80FC00001F80FC01F01F80FC03F81F80FE03F83F807E01FC -3F007E01FC3F007E00FE3F007F00FE7F007F007F7F003F807FFE003FF03FFE003FFFFFFE -001FFFFFFC000FFFFFF80003FFFFE000007FFFE000000007F000000007F000000003F800 -000003F800000001FC00000001FC00000000FE00000000FE000000007F000000007F0000 -00003E0021407BB32C>I<7FFFFC000000FFFFFF800000FFFFFFE00000FFFFFFF800007F -FFFFFC000007E007FE000007E001FE000007E0007F000007E0003F800007E0001F800007 -E0001F800007E0000FC00007E0000FC00007E0000FC00007E0000FC00007E0000FC00007 -E0000FC00007E0001F800007E0001F800007E0003F800007E0007F000007E001FE000007 -E007FE000007FFFFFC000007FFFFF8000007FFFFE0000007FFFFF0000007FFFFF8000007 -E007FC000007E001FE000007E000FE000007E0007F000007E0003F000007E0003F000007 -E0003F000007E0003F000007E0003F000007E0003F000007E0003F000007E0003F000007 -E0003F0F0007E0003F1F8007E0003F1F8007E0003F1F8007E0003F1F8007E0003F1F807F -FE001FBF80FFFF001FFF00FFFF000FFF00FFFF000FFE007FFE0007FC0000000001F00029 -347EB22C>I<001FF8070000FFFF0F8001FFFFCF8007FFFFFF800FFFFFFF801FF01FFF80 -3FC003FF803F8001FF807F0000FF807E00007F80FE00003F80FC00003F80FC00001F80FC -00001F80FC00001F80FC00001F80FE00000F007E000000007F000000007F800000003FE0 -0000001FFC0000001FFFC000000FFFFC000003FFFFC00001FFFFF000007FFFF8000007FF -FC0000007FFE00000007FF00000000FF800000003F800000001FC00000001FC00000000F -E00000000FE078000007E0FC000007E0FC000007E0FC000007E0FC000007E0FC000007E0 -FE00000FC0FE00000FC0FF00001F80FF80003F80FFE0007F00FFFE01FF00FFFFFFFE00FF -FFFFFC00F9FFFFF000F83FFFC0007007FF000023357CB32C>I<7FFFFFFFFCFFFFFFFFFE -FFFFFFFFFEFFFFFFFFFEFFFFFFFFFEFC007E007EFC007E007EFC007E007EFC007E007EFC -007E007EFC007E007EFC007E007E78007E003C00007E000000007E000000007E00000000 -7E000000007E000000007E000000007E000000007E000000007E000000007E000000007E -000000007E000000007E000000007E000000007E000000007E000000007E000000007E00 -0000007E000000007E000000007E000000007E000000007E000000007E000000007E0000 -00007E000000007E000000007E000000007E000000007E000000007E000000007E000000 -007E0000003FFFFC00003FFFFC00007FFFFE00003FFFFC00003FFFFC0027337EB22C>I< -7FFF803FFFC0FFFFC07FFFE0FFFFC07FFFE0FFFFC07FFFE07FFF803FFFC003F00001F800 -03F00001F80003F00001F80003F00001F80003F00001F80003F00001F80003F00001F800 -03F00001F80003F00001F80003F00001F80003F00001F80003F00001F80003F00001F800 -03F00001F80003F00001F80003F00001F80003F00001F80003F00001F80003F00001F800 -03F00001F80003F00001F80003F00001F80003F00001F80003F00001F80003F00001F800 -03F00001F80003F00001F80003F00001F80003F00001F80003F00001F80003F00001F800 -03F00001F80003F00001F80003F80003F80001F80003F00001F80003F00001FC0007F000 -00FC0007E00000FE000FE000007F001FC000003F803F8000003FE0FF8000001FFFFF0000 -000FFFFE00000003FFF800000001FFF0000000003F8000002B3480B22C>I<7FFC007FFC -FFFE00FFFEFFFE00FFFEFFFE00FFFE7FFC007FFC0FC00007E00FE0000FE007E0000FC007 -E0000FC007E0000FC007F0001FC003F0001F8003F0001F8003F0001F8003F8003F8001F8 -003F0001F8003F0001F8003F0001FC007F0000FC007E0000FC007E0000FC007E0000FC00 -7E00007E00FC00007E00FC00007E00FC00007E00FC00003F01F800003F01F800003F01F8 -00003F01F800001F83F000001F83F000001F83F000001F83F000000F83E000000FC7E000 -000FC7E000000FC7E0000007C7C0000007C7C0000007EFC0000007EFC0000003EF800000 -03EF80000003FF80000003FF80000001FF00000001FF00000001FF00000001FF00000000 -FE000027347EB22C>I<7FF00007FF00FFF8000FFF80FFF8000FFF80FFF8000FFF807FF0 -0007FF001F0000007C001F0000007C001F0000007C001F0000007C000F800000F8000F80 -0000F8000F800000F8000F800000F8000F800000F8000F800000F8000F800000F80007C0 -0001F00007C00001F00007C00001F00007C00001F00007C03E01F00007C07F01F00007C0 -7F01F00007C07F01F00003E0FF83E00003E0FF83E00003E0F783E00003E0F783E00003E1 -F7C3E00003E1F7C3E00003E1F7C3E00001E1E3C3C00001E1E3C3C00001F1E3C7C00001F3 -E3E7C00001F3E3E7C00001F3E3E7C00001F3C1E7C00001F3C1E7C00000F3C1E7800000F3 -C1E7800000F7C1F7800000F780F7800000F780F7800000F780F7800000FF80FF8000007F -80FF0000007F007F0000007F007F0000007F007F0000007F007F0000003E003E00002934 -7FB22C>I<3FFF03FFE07FFF07FFF07FFF87FFF07FFF07FFF03FFF03FFE001F800FE0001 -FC00FE0000FC01FC0000FE01FC00007E01F800007F03F800003F03F000003F87F000001F -87E000001FCFE000000FCFC000000FFFC0000007FF80000007FF80000003FF00000003FF -00000001FE00000001FE00000000FC00000000FC00000001FE00000001FE00000003FF00 -000003FF00000007FF80000007FFC000000FCFC000000FCFE000001FC7E000001F87F000 -003F83F000003F03F800007F01F800007E01FC0000FE00FC0000FC00FE0001FC007E0001 -F8007F0003F8003F0003F0003F8003F0001F807FFE00FFFC7FFF01FFFCFFFF01FFFE7FFF -01FFFC7FFE00FFFC27337EB22C>I<7FFC007FFCFFFE00FFFEFFFE00FFFEFFFE00FFFE7F -FC007FFC07F0000FC007F0001FC003F0001F8003F8003F8001F8003F8001FC007F0000FC -007F0000FE007E00007E00FE00007F00FC00003F01FC00003F81F800001F81F800001F83 -F000000FC3F000000FC7F0000007E7E0000007E7E0000003E7C0000003EFC0000001FF80 -000001FF80000001FF00000000FF00000000FE000000007E000000007E000000007E0000 -00007E000000007E000000007E000000007E000000007E000000007E000000007E000000 -007E000000007E000000007E000000007E000000007E000000007E00000007FFE000000F -FFF000000FFFF000000FFFF0000007FFE00027337EB22C>I<3FFFFFFFC07FFFFFFFE07F -FFFFFFE07FFFFFFFE07FFFFFFFE07E00001FC07E00003F807E00003F807E00007F007E00 -007E007E0000FE007E0001FC003C0001F800000003F800000007F000000007F00000000F -E00000001FC00000001FC00000003F800000007F000000007F00000000FE00000001FC00 -000001FC00000003F800000007F000000007F00000000FE00000001FC00000001FC00000 -003F800000007F000000007F00000000FE00000001FC00000001FC00000003F80003C003 -F00007E007F00007E00FE00007E00FC00007E01FC00007E03F800007E03F800007E07F00 -0007E0FFFFFFFFE0FFFFFFFFE0FFFFFFFFE0FFFFFFFFE07FFFFFFFC023337CB22C>I<7F -FFFCFFFFFEFFFFFEFFFFFEFFFFFCFC0000FC0000FC0000FC0000FC0000FC0000FC0000FC -0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC -0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC -0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC -0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FC0000FF -FFFCFFFFFEFFFFFEFFFFFE7FFFFC17416FB92C>I<7800000000F800000000FC00000000 -FC00000000FE000000007E000000007F000000003F000000003F800000001F800000001F -C00000000FC00000000FE000000007E000000007E000000007F000000003F000000003F8 -00000001F800000001FC00000000FC00000000FE000000007E000000007F000000003F00 -0000003F800000001F800000001F800000001FC00000000FC00000000FE000000007E000 -000007F000000003F000000003F800000001F800000001FC00000000FC00000000FC0000 -0000FE000000007E000000007F000000003F000000003F800000001F800000001FC00000 -000FC00000000FE000000007E000000007F000000003F000000003F000000003F8000000 -01F800000001FC00000000FC00000000FE000000007E000000007F000000003F00000000 -3F800000001F800000001F800000000F80000000070021417BB92C>I<7FFFFCFFFFFEFF -FFFEFFFFFE7FFFFE00007E00007E00007E00007E00007E00007E00007E00007E00007E00 -007E00007E00007E00007E00007E00007E00007E00007E00007E00007E00007E00007E00 -007E00007E00007E00007E00007E00007E00007E00007E00007E00007E00007E00007E00 -007E00007E00007E00007E00007E00007E00007E00007E00007E00007E00007E00007E00 -007E00007E00007E00007E00007E00007E00007E00007E00007E00007E7FFFFEFFFFFEFF -FFFEFFFFFE7FFFFC17417DB92C>I<000E0000003F800000FFE00003FFF8000FFFFE001F -FFFF007FF1FFC0FFE0FFE0FF803FE0FE000FE07C0007C0300001801B0C78B22C>I<7FFF -FFFF00FFFFFFFF80FFFFFFFF80FFFFFFFF80FFFFFFFF807FFFFFFF0021067B7D2C>I<00 -7000F801F803F807F00FE01FC01F803F003E007E007C007C00FC00F800F800F800F800FF -80FFC0FFE0FFE07FE07FE03FE01FC00F800D1B71B82C>I<01FFF0000007FFFE00001FFF -FF80001FFFFFE0003FFFFFF0003FC01FF8003FC007F8003FC001FC001F8000FC00060000 -FE000000007E000000007E000000007E000000FFFE00001FFFFE0000FFFFFE0003FFFFFE -000FFFFFFE001FFF807E003FF8007E007FC0007E007F00007E00FE00007E00FC00007E00 -FC00007E00FC00007E00FC00007E00FE00007E007F0000FE007F8003FE003FE01FFE001F -FFFFFFFC0FFFFFFFFE07FFFFBFFE01FFFE1FFE003FF007FC27247CA32C>I<7FF0000000 -FFF8000000FFF8000000FFF80000007FF800000001F800000001F800000001F800000001 -F800000001F800000001F800000001F800000001F800000001F800000001F800000001F8 -1FE00001F8FFF80001FBFFFE0001FFFFFF0001FFFFFF8001FFF07FC001FF801FE001FF00 -07F001FE0003F801FC0003F801FC0001FC01F80000FC01F80000FC01F80000FE01F80000 -7E01F800007E01F800007E01F800007E01F800007E01F800007E01F800007E01F800007E -01F80000FE01FC0000FC01FC0000FC01FC0001F801FE0003F801FF0007F001FF000FF001 -FF801FE001FFE07FC001FFFFFF8001FFFFFF0001FBFFFE0001F8FFF80000F03FC0002733 -7FB22C>I<0003FFE000001FFFF800007FFFFE0001FFFFFE0003FFFFFF0007FE00FF000F -F000FF001FE000FF001FC0007E003F800018003F000000007F000000007E000000007E00 -000000FC00000000FC00000000FC00000000FC00000000FC00000000FC00000000FC0000 -0000FC000000007E000000007E000000007F000000003F00000F003F80001F801FC0001F -801FE0003F800FF0007F0007FE03FF0003FFFFFE0001FFFFFC00007FFFF800001FFFE000 -0003FF000021247AA32C>I<00000FFE0000001FFF0000001FFF0000001FFF0000000FFF -000000003F000000003F000000003F000000003F000000003F000000003F000000003F00 -0000003F000000003F000000003F000007F83F00003FFE3F0000FFFFBF0001FFFFFF0003 -FFFFFF0007FC0FFF000FF003FF001FE001FF001FC000FF003F80007F003F00007F007E00 -003F007E00003F00FE00003F00FC00003F00FC00003F00FC00003F00FC00003F00FC0000 -3F00FC00003F00FC00003F00FC00003F00FE00003F007E00007F007E00007F007F0000FF -003F8000FF003F8001FF001FC003FF000FF007FF0007FC1FFF0003FFFFFFFC01FFFFBFFE -00FFFF3FFE003FFC3FFE000FF01FFC27337DB22C>I<0003FE0000001FFFC000007FFFF0 -0001FFFFF80003FFFFFC0007FE03FE000FF800FF001FE0003F801FC0003F803F80001FC0 -3F00000FC07F00000FC07E00000FE07E000007E0FC000007E0FFFFFFFFE0FFFFFFFFE0FF -FFFFFFE0FFFFFFFFE0FFFFFFFFC0FC00000000FE000000007E000000007E000000007F00 -0000003F000003C03F800007E01FC00007E00FF0000FE007F8003FC007FF00FFC001FFFF -FF8000FFFFFF00003FFFFC00000FFFF0000001FF800023247CA32C>I<00000FF8000000 -3FFE000000FFFF000001FFFF800003FFFF800007FC7F800007F07F80000FE03F00000FC0 -3F00000FC00000000FC00000000FC00000000FC00000000FC00000000FC000007FFFFFFE -00FFFFFFFF00FFFFFFFF00FFFFFFFF007FFFFFFE00000FC00000000FC00000000FC00000 -000FC00000000FC00000000FC00000000FC00000000FC00000000FC00000000FC0000000 -0FC00000000FC00000000FC00000000FC00000000FC00000000FC00000000FC00000000F -C00000000FC00000000FC00000000FC00000000FC00000000FC00000000FC00000000FC0 -0000000FC000003FFFFFF0007FFFFFF8007FFFFFF8007FFFFFF8003FFFFFF00021337DB2 -2C>I<00000003F80007F80FFC001FFE3FFE007FFFFFFF01FFFFFFFF03FFFFFE7F03FC0F -F87F07F003F83E0FE001FC1C0FC000FC001FC000FE001F80007E001F80007E001F80007E -001F80007E001F80007E001F80007E001FC000FE000FC000FC000FE001FC0007F003F800 -03FC0FF00007FFFFF00007FFFFE0000FFFFF80000F9FFE00000F87F800000F800000000F -800000000F800000000FC000000007E000000007FFFFF00003FFFFFE0007FFFFFF800FFF -FFFFE01FFFFFFFF03FC0001FF87F000003FC7E000000FC7C0000007CFC0000007EF80000 -003EF80000003EF80000003EF80000003EFC0000007E7E000000FC7F800003FC3FE0000F -F81FFC007FF00FFFFFFFE003FFFFFF8001FFFFFF00003FFFF8000007FFC00028387EA42C ->I<7FF000000000FFF800000000FFF800000000FFF8000000007FF80000000001F80000 -000001F80000000001F80000000001F80000000001F80000000001F80000000001F80000 -000001F80000000001F80000000001F80000000001F81FE0000001F87FFC000001F9FFFE -000001FBFFFF000001FFFFFF000001FFF03F800001FFC01F800001FF801FC00001FF000F -C00001FE000FC00001FC000FC00001FC000FC00001F8000FC00001F8000FC00001F8000F -C00001F8000FC00001F8000FC00001F8000FC00001F8000FC00001F8000FC00001F8000F -C00001F8000FC00001F8000FC00001F8000FC00001F8000FC00001F8000FC00001F8000F -C00001F8000FC00001F8000FC00001F8000FC00001F8000FC0007FFFE0FFFF00FFFFF1FF -FF80FFFFF1FFFF80FFFFF1FFFF807FFFE0FFFF0029337FB22C>I<00070000001FC00000 -1FC000003FE000003FE000003FE000001FC000001FC00000070000000000000000000000 -000000000000000000000000000000000000007FFFC0007FFFE000FFFFE0007FFFE0007F -FFE0000007E0000007E0000007E0000007E0000007E0000007E0000007E0000007E00000 -07E0000007E0000007E0000007E0000007E0000007E0000007E0000007E0000007E00000 -07E0000007E0000007E0000007E0000007E0000007E0000007E0000007E0000007E0007F -FFFFFCFFFFFFFEFFFFFFFEFFFFFFFE7FFFFFFC1F3479B32C>I<00000E0000003F800000 -3F8000007FC000007FC000007FC000003F8000003F8000000E0000000000000000000000 -00000000000000000000000000000000000001FFFF8003FFFFC003FFFFC003FFFFC001FF -FFC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC00000 -0FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC00000 -0FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC00000 -0FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC000000FC00000 -0FC000000FC000000FC000001FC03C001F807E003F80FF003F00FF007F00FF01FE00FFFF -FC007FFFF8007FFFF0001FFFE00007FF00001A467CB32C>I<7FE0000000FFF0000000FF -F0000000FFF00000007FF000000001F000000001F000000001F000000001F000000001F0 -00000001F000000001F000000001F000000001F000000001F000000001F01FFFF001F03F -FFF801F03FFFF801F03FFFF801F01FFFF001F000FE0001F001FC0001F003F80001F007F0 -0001F00FE00001F01FC00001F03F800001F07F000001F0FE000001F1FC000001F3FC0000 -01F7FE000001FFFF000001FFFF000001FF9F800001FF0FC00001FE0FE00001FC07E00001 -F803F00001F001F80001F001FC0001F000FC0001F0007E0001F0003F0001F0003F8001F0 -001F807FFFC0FFFCFFFFE1FFFEFFFFE1FFFEFFFFE1FFFE7FFFC0FFFC27337EB22C>I<7F -FFE00000FFFFF00000FFFFF00000FFFFF000007FFFF000000003F000000003F000000003 -F000000003F000000003F000000003F000000003F000000003F000000003F000000003F0 -00000003F000000003F000000003F000000003F000000003F000000003F000000003F000 -000003F000000003F000000003F000000003F000000003F000000003F000000003F00000 -0003F000000003F000000003F000000003F000000003F000000003F000000003F0000000 -03F000000003F000000003F000000003F000000003F000000003F000000003F000000003 -F000000003F000000003F000007FFFFFFF80FFFFFFFFC0FFFFFFFFC0FFFFFFFFC07FFFFF -FF8022337BB22C>I<7F83F007E0007FCFFC1FF800FFDFFE3FFC007FFFFEFFFC007FFFFF -FFFE0007FE1FFC3E0007FC1FF83F0007F80FF01F0007F00FE01F0007E00FC01F0007E00F -C01F0007E00FC01F0007C00F801F0007C00F801F0007C00F801F0007C00F801F0007C00F -801F0007C00F801F0007C00F801F0007C00F801F0007C00F801F0007C00F801F0007C00F -801F0007C00F801F0007C00F801F0007C00F801F0007C00F801F0007C00F801F0007C00F -801F0007C00F801F0007C00F801F007FFC3FF87FF07FFC7FF8FFF0FFFE7FFCFFF87FFC7F -F8FFF07FFC3FF87FF02D2481A32C>I<7FF01FE00000FFF87FFC0000FFF9FFFE0000FFFB -FFFF00007FFFFFFF000001FFF03F800001FFC01F800001FF801FC00001FF000FC00001FE -000FC00001FC000FC00001FC000FC00001F8000FC00001F8000FC00001F8000FC00001F8 -000FC00001F8000FC00001F8000FC00001F8000FC00001F8000FC00001F8000FC00001F8 -000FC00001F8000FC00001F8000FC00001F8000FC00001F8000FC00001F8000FC00001F8 -000FC00001F8000FC00001F8000FC00001F8000FC0007FFFE0FFFF00FFFFF1FFFF80FFFF -F1FFFF80FFFFF1FFFF807FFFE0FFFF0029247FA32C>I<0007FC0000001FFF0000007FFF -C00001FFFFF00003FFFFF80007FC07FC000FF001FE001FE000FF001F80003F003F80003F -803F00001F807E00000FC07E00000FC07E00000FC0FC000007E0FC000007E0FC000007E0 -FC000007E0FC000007E0FC000007E0FC000007E0FE00000FE07E00000FC07E00000FC07F -00001FC03F00001F803F80003F801FC0007F001FE000FF000FF001FE0007FC07FC0003FF -FFF80001FFFFF000007FFFC000001FFF00000007FC000023247CA32C>I<7FF01FE000FF -F8FFF800FFFBFFFE00FFFFFFFF007FFFFFFF8001FFF07FC001FF801FE001FF0007F001FE -0003F801FC0003F801FC0001FC01F80000FC01F80000FC01F80000FE01F800007E01F800 -007E01F800007E01F800007E01F800007E01F800007E01F800007E01F800007E01F80000 -FE01FC0000FC01FC0000FC01FC0001F801FE0003F801FF0007F001FF000FF001FF801FE0 -01FFE07FC001FFFFFF8001FFFFFF0001FBFFFE0001F8FFF80001F83FC00001F800000001 -F800000001F800000001F800000001F800000001F800000001F800000001F800000001F8 -00000001F800000001F800000001F800000001F80000007FFFE00000FFFFF00000FFFFF0 -0000FFFFF000007FFFE0000027367FA32C>I<0003FC078000001FFF0FC000007FFFCFC0 -0001FFFFEFC00003FFFFFFC00007FE07FFC0000FF001FFC0001FE000FFC0001FC0007FC0 -003F80003FC0003F00003FC0007F00001FC0007E00001FC0007E00000FC000FC00000FC0 -00FC00000FC000FC00000FC000FC00000FC000FC00000FC000FC00000FC000FC00000FC0 -00FC00000FC000FE00000FC0007E00001FC0007E00001FC0003F00003FC0003F80003FC0 -001FC0007FC0001FE000FFC0000FF003FFC00007FC0FFFC00003FFFFFFC00001FFFFEFC0 -00007FFF8FC000003FFF0FC0000007F80FC0000000000FC0000000000FC0000000000FC0 -000000000FC0000000000FC0000000000FC0000000000FC0000000000FC0000000000FC0 -000000000FC0000000000FC0000000000FC0000000000FC000000003FFFF00000007FFFF -80000007FFFF80000007FFFF80000003FFFF0029367DA32C>I<7FFE003FC0FFFF01FFF0 -FFFF07FFF8FFFF1FFFFC7FFF3FFFFC003F7FE1FC003FFF01FC003FFC00F8003FF8007000 -3FF00000003FE00000003FE00000003FC00000003F800000003F800000003F800000003F -000000003F000000003F000000003F000000003F000000003F000000003F000000003F00 -0000003F000000003F000000003F000000003F000000003F000000003F000000003F0000 -007FFFFFE000FFFFFFF000FFFFFFF000FFFFFFF0007FFFFFE00026247EA32C>I<007FF8 -7003FFFFF80FFFFFF81FFFFFF83FFFFFF87FC00FF87E0003F8FC0001F8F80001F8F80001 -F8F80001F8FC0000F07F0000007FF000003FFFC0001FFFFE000FFFFF8003FFFFE0007FFF -F80001FFFC000007FC000000FE7800007FFC00003FFC00001FFE00001FFE00001FFF0000 -3FFF80003EFFC000FEFFF007FCFFFFFFFCFFFFFFF8FFFFFFE0F8FFFF80701FFC0020247A -A32C>I<001E000000003F000000003F000000003F000000003F000000003F000000003F -000000003F000000003F000000003F0000007FFFFFFF00FFFFFFFF80FFFFFFFF80FFFFFF -FF807FFFFFFF00003F000000003F000000003F000000003F000000003F000000003F0000 -00003F000000003F000000003F000000003F000000003F000000003F000000003F000000 -003F000000003F000000003F000000003F000000003F0003C0003F0007E0003F0007E000 -3F0007E0003F0007E0003F0007E0003F800FE0001F801FC0001FE07FC0000FFFFF80000F -FFFF000003FFFE000001FFF80000003FE000232E7EAD2C>I<7FF003FF8000FFF807FFC0 -00FFF807FFC000FFF807FFC0007FF803FFC00001F8000FC00001F8000FC00001F8000FC0 -0001F8000FC00001F8000FC00001F8000FC00001F8000FC00001F8000FC00001F8000FC0 -0001F8000FC00001F8000FC00001F8000FC00001F8000FC00001F8000FC00001F8000FC0 -0001F8000FC00001F8000FC00001F8000FC00001F8000FC00001F8000FC00001F8000FC0 -0001F8001FC00001F8001FC00001F8003FC00001FC007FC00000FE03FFC00000FFFFFFFF -00007FFFFFFF80003FFFFFFF80001FFFCFFF800003FE07FF0029247FA32C>I<7FFF01FF -FCFFFF01FFFEFFFF83FFFEFFFF01FFFE7FFF01FFFC03E0000F8003E0000F8003F0001F80 -01F0001F0001F0001F0001F8003F0000F8003E0000F8003E0000FC007E00007C007C0000 -7C007C00007E00FC00003E00F800003E00F800003F01F800001F01F000001F01F000001F -83F000000F83E000000F83E000000FC7E0000007C7C0000007C7C0000007EFC0000003EF -80000003EF80000003FF80000001FF00000001FF00000000FE000000007C000027247EA3 -2C>I<7FFF007FFF007FFF80FFFF00FFFF80FFFF807FFF80FFFF007FFF007FFF0007C000 -01F00007C00001F00007C00001F00007C00001F00007C00001F00007C00001F00003E000 -03E00003E00003E00003E00003E00003E03E03E00003E07F03E00003E07F03E00001F07F -07C00001F0FF87C00001F0FF87C00001F0F787C00001F0F787C00001F1F7C7C00000F1F7 -C7800000F9E3CF800000F9E3CF800000FBE3EF800000FBE3EF800000FBE3EF8000007BC1 -EF0000007FC1FF0000007FC1FF0000007F80FF0000007F80FF0000003F80FE0000001F00 -7C000029247FA32C>I<3FFF03FFF07FFF87FFF87FFF87FFF87FFF87FFF83FFF03FFF000 -FC007E0000FC00FC00007E01F800003F01F000001F83F000001F87E000000FCFC0000007 -EF80000003FF80000001FF00000001FE00000000FC000000007C00000000FE00000001FE -00000001FF00000003EF80000007CFC000000FC7C000000F83E000001F01F000003F01F8 -00007E00F800007C007C0000F8007E0001F8003F007FFF01FFFC7FFF83FFFCFFFF83FFFE -7FFF83FFFC7FFF01FFFC27247EA32C>I<7FFF01FFFCFFFF81FFFEFFFF83FFFEFFFF81FF -FE7FFF01FFFC03E0000F8001F0000F8001F0001F8001F8001F0000F8001F0000F8003F00 -00FC003E00007C003E00007E007E00003E007C00003E007C00003F00FC00001F00F80000 -1F00F800000F81F800000F81F000000F81F0000007C1F0000007C3E0000007C3E0000003 -E3E0000003E7C0000001E7C0000001F7C0000001F780000000FF80000000FF80000000FF -000000007F000000007F000000003E000000003E000000007E000000007C000000007C00 -000000FC00000000F800000000F800000C01F800003F01F000007F83F000007F87E00000 -7E0FE000007E1FC000007FFF8000003FFF0000001FFE0000000FFC00000007E000000027 -367EA32C>I<3FFFFFFFE07FFFFFFFF07FFFFFFFF07FFFFFFFF07FFFFFFFF07E00001FE0 -7E00003FC07E00007F807E0000FF007E0001FE003C0003FC00000007F80000000FF00000 -001FE00000003FC00000007F80000000FF00000001FC00000003F80000000FF00000001F -E00000003FC00000007F80000000FF00000001FE0001E003FC0003F007F80003F00FF000 -03F01FE00003F03FC00003F07F800003F0FFFFFFFFF0FFFFFFFFF0FFFFFFFFF0FFFFFFFF -F07FFFFFFFE024247DA32C>I<000000FF00000007FF8000001FFF8000007FFF800000FF -FF000001FFC0000001FE00000003F800000003F000000003F000000003F000000003F000 -000003F000000003F000000003F000000003F000000003F000000003F000000003F00000 -0003F000000003F000000003F000000003F000000003F000000003F000000003F0000000 -03F000000007F00000001FE0000000FFE000007FFFC00000FFFF800000FFFE000000FFFF -8000007FFFC0000000FFE00000001FE000000007F000000003F000000003F000000003F0 -00000003F000000003F000000003F000000003F000000003F000000003F000000003F000 -000003F000000003F000000003F000000003F000000003F000000003F000000003F00000 -0003F000000003F000000003F800000001FE00000001FFC0000000FFFF0000007FFF8000 -001FFF80000007FF80000000FF0021417BB92C>I<78FCFCFCFCFCFCFCFCFCFCFCFCFCFC -FCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFCFC -FCFCFCFCFCFCFCFCFCFCFCFCFC7806416DB92C>I<7FC0000000FFF8000000FFFE000000 -FFFF8000007FFFC0000000FFE00000001FE000000007F000000003F000000003F0000000 -03F000000003F000000003F000000003F000000003F000000003F000000003F000000003 -F000000003F000000003F000000003F000000003F000000003F000000003F000000003F0 -00000003F000000003F000000003F800000001FE00000001FFC0000000FFFF0000007FFF -8000001FFF8000007FFF800000FFFF000001FFC0000001FE00000003F800000003F00000 -0003F000000003F000000003F000000003F000000003F000000003F000000003F0000000 -03F000000003F000000003F000000003F000000003F000000003F000000003F000000003 -F000000003F000000003F000000003F000000007F00000001FE0000000FFE000007FFFC0 -0000FFFF800000FFFE000000FFF80000007FC000000021417BB92C>I<00F8007003FE00 -F80FFF01F81FFF87F83FFFCFF07F9FFFE0FF0FFFC0FC07FF80F803FE007000F8001D0A79 -B22C>I E /FB 105[42 27[42 46 42 69 46 51 28 37 32 1[51 -46 51 74 28 51 28 28 51 46 32 42 51 37 51 42 10[65 65 -55 51 60 69 51 69 69 83 51 2[32 69 69 46 51 69 60 55 -65 1[37 5[42 42 42 42 42 42 42 42 42 42 25 21 28 21 50 -39[51 51 2[{ TeXBase1Encoding ReEncodeFont }64 83.333337 -/Palatino-Bold rf /FC 133[37 42 42 60 42 46 28 32 32 -38 42 37 46 65 23 37 23 23 42 42 23 32 42 34 38 37 3[28 -1[28 1[55 3[65 51 46 2[51 65 1[78 3[28 65 1[46 51 65 -1[51 60 1[42 3[21 21 7[42 42 1[25 21 28 21 2[28 28 23 -65 2[42 31[45 44 2[{ TeXBase1Encoding ReEncodeFont }58 -83.333337 /Palatino-Italic rf /FD 104[83 42 1[42 42 24[42 -46 43 69 47 50 27 35 33 46 50 45 48 73 24 46 19 24 48 -46 28 40 51 37 46 42 3[28 1[28 55 55 55 83 60 65 51 44 -55 65 50 65 69 79 51 60 28 28 69 63 46 51 64 59 51 65 -1[37 1[50 1[21 21 42 42 42 42 42 42 42 42 42 42 50 21 -28 21 50 32 28 28 23 65 2[42 1[23 29[50 50 2[{ - TeXBase1Encoding ReEncodeFont }86 83.333337 /Palatino-Roman -rf /FE 134[115 103 172 115 126 69 92 80 1[126 115 126 -184 69 126 1[69 126 115 80 103 126 92 1[103 12[138 126 -149 1[126 172 172 207 3[80 5[149 1[161 17[61 2[52 41[126 -2[{ TeXBase1Encoding ReEncodeFont }35 207.333362 /Palatino-Bold -rf /FF 137[66 1[40 53 47 2[66 73 106 40 2[40 73 2[60 -73 2[60 13[73 3[100 10[100 86 80 19[30 46[{ - TeXBase1Encoding ReEncodeFont }19 119.999948 /Palatino-Bold -rf /FG 140[39 36 2[50 2[27 3[53 2[44 1[41 1[46 26[51 -16[46 4[46 1[23 46[{ TeXBase1Encoding ReEncodeFont }12 -91.666666 /Palatino-Roman rf /FH 138[104 1[76 66 3[104 +.167 SlantFont TeXBase1Encoding ReEncodeFont}11 74.7198 +/Palatino-Roman rf +%DVIPSBitmapFont: Fm cmsy7 7 2 +/Fm 2 4 df0 D<1338A50060130C00F8133E00FC137E00FE13FE +383FBBF83807FFC000011300EA007C48B4FC000713C0383FBBF838FE38FE00FC137E00F8 +133E0060130C00001300A517197B9A22>3 D E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fn cmr10 10 7 +/Fn 7 94 df<12C07E12707E7E7E120F6C7E6C7EA26C7E6C7EA21378A2137C133C133E13 +1EA2131F7FA21480A3EB07C0A6EB03E0B2EB07C0A6EB0F80A31400A25B131EA2133E133C +137C1378A25BA2485A485AA2485A48C7FC120E5A5A5A5A5A13527CBD20>41 +D<15301578B3A6007FB812F8B912FCA26C17F8C80078C8FCB3A6153036367BAF41>43 +D48 DI<007FB812F8B912FCA26C17F8CCFCAE007FB812F8B912FCA26C17F836167B9F41> +61 D91 D93 D E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fo cmmi10 10 15 +/Fo 15 121 df<133F14C0EB07F06D7E801301A26D7EA3147FA36E7EA36E7EA36E7EA36E +7EA36E7EA36E7EA26E7EA214014A7E5C4A7E91381E3F80143C14784A6C7E1301EB03E049 +486C7EEB0F80EB1F00496D7E137E5B48486D7E485A485A000F6E7E485A485A48C87E12FE +167F4816800070151F293B7CB930>21 DI<121C127FEAFF80A5EA7F00121C090979 +8817>58 D<121C127FEAFF80A213C0A3127F121C1200A412011380A2120313005A120612 +0E5A5A5A12600A19798817>II<126012FCB4FCEA7FC0EA1FF0EA07FCEA01FF38007FC0EB1FF0EB07FCEB01FF +9038007FC0EC1FF0EC07FCEC01FF9138007FC0ED1FF0ED07FCED01FF9238007FC0EE1FF0 +EE07FCEE01FF9338007F80EF1FC0A2EF7F80933801FF00EE07FCEE1FF0EE7FC04B48C7FC +ED07FCED1FF0ED7FC04A48C8FCEC07FCEC1FF0EC7FC04948C9FCEB07FCEB1FF0EB7FC048 +48CAFCEA07FCEA3FF0EA7FC048CBFC12FC1270323279AD41>62 D<92391FE00380DBFFFC +130002036D5A91390FE01F8F91393F0007DF027EEB01FE02F81300495A4948147E177C49 +48143C495AA2011F153891C8FCA3491530A28094C7FC80806D7E14FEECFFE06D13FE6DEB +FFC06D14F06D806D80021F7F02037FEC003F03037F1500167F163F161FA3120C160FA200 +1C151F94C7FCA3003C153EA25E003E5D127E007F4A5A6D495A6DEB0FC0D8F9F0495AD8F0 +FE01FEC8FC39E03FFFF8010F13E0D8C00190C9FC313D7CBA33>83 +D<16F8ED03FEED0F8792381F0F80ED3E3F167F157CA215FC1700161C4A48C7FCA414035D +A414075DA20107B512F0A39026000FE0C7FC5DA4141F5DA4143F92C8FCA45C147EA514FE +5CA413015CA4495AA45C1307A25C121E123F387F8F80A200FF90C9FC131E12FEEA7C3CEA +7878EA1FF0EA07C0294C7CBA29>102 D<14E0EB03F8A21307A314F0EB01C090C7FCAB13 +F8EA03FEEA070F000E1380121C121812381230EA701F1260133F00E0130012C05BEA007E +A213FE5B1201A25B12035BA20007131813E01438000F133013C01470EB806014E014C013 +81EB838038078700EA03FEEA00F815397EB71D>105 D<150FED3F80A2157FA31600151C +92C7FCABEC0F80EC3FE0ECF0F0903801C0F849487E14005B130E130C131CEB1801133801 +305BA2EB0003A25DA21407A25DA2140FA25DA2141FA25DA2143FA292C7FCA25CA2147EA2 +14FEA25CA21301001E5B123F387F83F0A238FF87E0495A00FE5BD87C1FC8FCEA707EEA3F +F8EA0FC0214981B722>I109 DI<90390F8003F090 +391FE00FFC903939F03C1F903A70F8700F80903AE0FDE007C09038C0FF80030013E00001 +491303018015F05CEA038113015CA2D800031407A25CA20107140FA24A14E0A2010F141F +17C05CEE3F80131FEE7F004A137E16FE013F5C6E485A4B5A6E485A90397F700F80DA383F +C7FC90387E1FFCEC07E001FEC9FCA25BA21201A25BA21203A25B1207B512C0A32C3583A4 +2A>112 D<01F8EB03C0D803FEEB07E0D8070F130F000E018013F0121C12180038140700 +301403D8701F130112601500D8E03F14E000C090C7FC5BEA007E16C013FE5B1501000115 +805B150316001203495B1506150E150C151C151815385D00015C6D485A6C6C485AD97E0F +C7FCEB1FFEEB07F024267EA428>118 D<903907E001F090391FF807FC9039783E0E0F90 +39E01F1C1FD801C09038383F803A03800FF07F0100EBE0FF5A000E4A1300000C157E021F +133C001C4AC7FC1218A2C7123FA292C8FCA25CA2147EA214FEA24A130CA20101141C001E +1518003F5BD87F81143801835C00FF1560010714E03AFE0E7C01C0D87C1C495A2778383E +0FC7FC391FF00FFC3907C003F029267EA42F>120 D E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fp cmmi7 7 4 +/Fp 4 111 df<133EEA07FEA2EA007CA213FCA25BA21201A25BA2120314FCEBE3FF9038 +EF0780D807FC13C0EBF00313E0A2EA0FC014071380A2121FEC0F801300A248EB1F00A200 +3E1406143E127EEC7C0C127C151800FCEB3C30157048EB1FE00070EB0F801F297CA727> +104 D<130E131F5BA2133E131C90C7FCA7EA03E0487EEA0C78EA187C1230A212605B12C0 +A2EA01F0A3485AA2485AA2EBC180EA0F81A2381F0300A213066C5A131CEA07F06C5A1128 +7DA617>I<133EEA07FEA2EA007CA213FCA25BA21201A25BA21203EC07809038E01FC0EC +38600007EB61E014C3EBC187EBC307D80FC613C09038CC038001B8C7FC13E0487E13FEEB +3F80EB0FC0486C7E1303003E1460A2127EECC0C0127CECC18012FC903801E30038F800FE +0070137C1B297CA723>107 D<3907801FC0390FE07FF03918F0E0F83930F1807CEBFB00 +D860FE133C5B5B00C1147C5B1201A248485BA34A5AEA07C01660EC03E0A23A0F8007C0C0 +A2EDC180913803C300D81F0013C7EC01FE000EEB00F8231B7D9929>110 +D E +%EndDVIPSBitmapFont +/Fq 167[35 4[28 3[42 5[18 73[{TeXBase1Encoding ReEncodeFont}4 +53.134 /Palatino-Roman rf /Fr 203[25 25 25 25 49[{ +TeXBase1Encoding ReEncodeFont}4 49.8132 /Palatino-Roman +rf /Fs 190[45 11[29 29 29 29 29 49[{TeXBase1Encoding ReEncodeFont}6 +58.1154 /Palatino-Roman rf +%DVIPSBitmapFont: Ft cmtt12 12 9 +/Ft 9 115 df<007FB612FEA2B8FCA36C15FEA228077BA133>45 +D99 DIII<14E0EB03F8A2497EA36D5AA2EB00E091C8FCAA383FFFF8487FA47EEA00 +01B3AD007FB612C0B712E016F0A216E06C15C0243E78BD33>105 +D<4AB4FC263FFC0713C0267FFE1F13F000FF017F7F91B5FC6CB67E6CEC07FEC6EBF801EC +F0004A7F4A7F5CA291C7FCA35BB3A43B3FFFF80FFFFC486D4813FEB56C4813FFA26C496C +13FE6C496C13FC302C7FAB33>110 DI114 D E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fu cmitt10 10 14 +/Fu 14 121 df<153815FC14011407EC0FF8EC1FE0EC7FC0ECFF00495A495A495A495A5C +495A495A49C7FC137E13FE485A5B12035B485AA2485AA2121F5B123F90C8FCA35A127EA3 +12FE5AAB127C127EA3123E123FA26C7EA26C7E7F6C7E120313FC12016C7E137C131C1E42 +6DB92C>40 D<14E0497E80806D7E147FEC3F80141FEC0FC0A2EC07E0A2EC03F0A3EC01F8 +A61400A31401A7140315F0A3140715E0A2140F15C0141F1580A2EC3F005C147E14FE5C13 +01495A495AA2495A495A495A49C7FC13FEEA03FC485A485AEA3FE0485A48C8FC5A12F812 +701D427AB92C>I46 D<903807FFFE497FA36D5BD9007FC7FC147EA214FEA25CA21301A25CA21303A25C +A21307A25CA2130FA25CA2131FA25CA2133FA291C8FCA25B161E017E143FA201FE147F16 +7E5BA2000115FE16FC007FB6FCA2B7FC6C15F8A228337EB22C>76 +D97 D99 D<147F903803FFC0010F13F0013F13F84913FCEBFFC13801FE004848137E485AD80F +E013FE15FC485A383F800190380007F848133F90B512F015E01580B5EAFE0014F000FCC8 +FCA6127E151C007F143E6C6C13FEEBC00F6CB5FC6C14FC6C14F0000114C039007FFE001F +2475A32C>101 D104 +D +109 D<3901F007F03907F81FFC390FFC7FFE486CB5FC48B6128090383FFE1F14F8007E13 +F014E0EB7FC012FE00FC1380140049133FC6481400A348485B157EA24913FE0003ECFC18 +167EEBF00115F8000715FE020313FC01E013F015F1000F15F8EDF3F001C013FF6E13E016 +C0496C13806CC7EA3E0027247AA32C>I<14FE903807FF80011F13E04913F090B5FC48EB +83F83903FE01FCEBF800485A4848137E485AA2485A90C7FC5A127EA215FE12FE4814FCA2 +140115F81403EC07F0A2EC0FE0007EEB1FC0EC3F80007F13FFD83F8313006CB45A14F86C +5B000313C0C648C7FC1F2476A32C>I115 DI<90391FC01F809039FFF07FE0489038 +F9FFF8000790B5FC4815FCD81FF013F03A3FC07FE07E9039803FC0FED87F001381007E14 +8300FE140348EC01FC16F891387F00F0C71400147EA214FEA25CA201011418001E157E00 +3F5B127F018314FE00FF15FC01031301D8FE07EB03F839FC0FFC073A7E1FFE1FF0007FB6 +12E06C15C0023F1300390FFC1FFE3903F007F027247AA32C>120 +D E +%EndDVIPSBitmapFont +/Fv 107[33 33 25[37 34 55 38 40 22 28 26 1[40 36 39 59 +19 37 1[19 39 37 22 32 41 29 37 33 8[44 66 48 52 41 35 +44 1[40 52 55 63 41 1[22 22 55 1[37 41 51 47 41 52 1[29 +3[17 17 1[33 33 1[33 33 33 33 33 2[17 22 17 2[22 22 18 +36[40 2[{TeXBase1Encoding ReEncodeFont}63 66.4176 /Palatino-Roman +rf +%DVIPSBitmapFont: Fw cmsy10 10 12 +/Fw 12 107 df<007FB81280B912C0A26C17803204799641>0 D14 DI<007FB812F8B912FCA26C17F8CCFCAE007FB812F8B912FCA26C17F8 +CCFCAE007FB812F8B912FCA26C17F836287BA841>17 D20 D<181EA4181F84A28518 +0785727EA2727E727E85197E85F11F80F10FC0F107F0007FBA12FCBCFCA26C19FCCCEA07 +F0F10FC0F11F80F13F00197E61614E5A4E5AA24E5A61180F96C7FCA260181EA4482C7BAA +53>33 D<1430A31478A314FCA2497EA2497E497FA2497F90381F7BE090383E79F09038FC +78FCD801F8137ED807F0EB3F80D83FE0EB1FF0D8FF80EB07FCD8FE00130100F8EC007C00 +C0150CC71400B3B3AD1430264A7EB92A>I<173CA2173E171E171F8384717E170384717E +717E187C007FB812FEBAFC856C84CBEA03F0727EF000FEF13F80F11FE0F107F8F101FFA2 +F107F8F11FE0F13F80F1FE00F001F84E5A007FB912C0BA5A96C7FC6C5FCB127C604D5A4D +5A6017074D5A95C8FC5F171E173E173CA248307BAC53>41 D<91381FFFFE91B6FC130301 +0F14FED91FF0C7FCEB7F8001FEC8FCEA01F8485A485A485A5B48C9FCA2123EA25AA21278 +12F8A25AA2B712FE16FFA216FE00F0C9FCA27EA21278127CA27EA27EA26C7E7F6C7E6C7E +6C7EEA00FEEB7F80EB1FF06DB512FE010314FF1300021F13FE283279AD37>50 +D102 D<12FCEAFFC0EA07F0EA01FCEA007E7F80131F +80130FB3A7801307806D7E6D7EEB007EEC1FF0EC07F8EC1FF0EC7E00495A495A495A5C13 +0F5CB3A7131F5C133F91C7FC137E485AEA07F0EAFFC000FCC8FC1D537ABD2A>I<126012 +F0B3B3B3B3A91260045377BD17>106 D E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fx cmr7 7 5 +/Fx 5 117 df<140EB3A2B812E0A3C7000EC8FCB3A22B2B7DA333>43 +D<13381378EA01F8121F12FE12E01200B3AB487EB512F8A215267BA521>49 +D<13FF000313E0380E03F0381800F848137C48137E00787F12FC6CEB1F80A4127CC7FC15 +005C143E147E147C5C495A495A5C495A010EC7FC5B5B903870018013E0EA018039030003 +0012065A001FB5FC5A485BB5FCA219267DA521>I104 D<13C0A41201A312031207120F121FB512E0A23807C000AC1430A73803E0 +60A23801F0C03800FF80EB3F0014257FA31A>116 D E +%EndDVIPSBitmapFont +/Fy 134[55 50 83 55 61 33 44 39 61 61 55 61 89 33 61 +1[33 61 55 39 50 61 44 61 50 11[78 66 61 72 1[61 83 83 +100 61 2[39 83 1[55 61 83 72 66 78 7[50 50 50 50 50 50 +50 50 50 50 29 25 33 42[61 2[{TeXBase1Encoding ReEncodeFont}55 +99.6264 /Palatino-Bold rf /Fz 139[57 1[67 1[105 7[105 +2[86 3[86 29[124 9[86 86 86 86 86 86 86 86 86 86 48[{ +TeXBase1Encoding ReEncodeFont}17 172.188 /Palatino-Bold +rf +%DVIPSBitmapFont: FA cmtt10 10 94 +/FA 94 127 df<121C127FEAFF80B1EA7F00AF123EC7FCA8121C127FA2EAFF80A3EA7F00 +A2121C09346FB32C>33 D<003C131E007F137F481480A66C1400A6007E7FA6003E133EA3 +003C131E001C131C191977B32C>I<010F133C90381F807EA8013F13FE4A5AA4007FB612 +F0B712F8A4003F15F03A007E01F800A5EBFE0301FC5BA6003FB612F0B712F8A46C15F03A +01F807E000A30003130F01F05BA86C486C5A25337DB22C>IIIII<143814FC13011303EB07F8EB0F +F0EB1FC0EB3F80EB7F0013FE485A485A5B12075B120F5B485AA2123F90C7FCA25A127EA3 +12FE5AAC7E127EA3127F7EA27F121FA26C7E7F12077F12037F6C7E6C7E137FEB3F80EB1F +C0EB0FF0EB07F8EB03FC130113001438164272B92C>I<127012FC7E7E6C7E6C7EEA0FE0 +6C7E6C7E6C7E6C7E137F7F1480131F14C0130FEB07E0A214F01303A214F81301A314FC13 +00AC130114F8A3130314F0A2130714E0A2EB0FC0131F1480133F14005B13FE485A485A48 +5A485AEA3FC0485A48C7FC5A5A1270164279B92C>II<147814FCAF007FB612F0B712F8A46C15F0C700FCC7FC +AF147825267DAB2C>II<007FB6FCB712 +80A46C150021067B9B2C>I<121FEA3F80EA7FC0EAFFE0A5EA7FC0EA3F80EA1F000B0B70 +8A2C>I<1507ED0F80151FA2153F16005D157E15FE5D14015D14035DA214075D140F5D14 +1F5D143F92C7FC5C147E14FE5CA213015C13035C13075C130F5C131F5CA2133F91C8FC5B +137E13FE5B12015B12035B12075BA2120F5B121F5B123F90C9FC5A127E12FE5AA25A1278 +21417BB92C>II<1307497EA2131FA2 +133F137F13FF5A1207127FB5FC13DF139FEA7C1F1200B3AE007FB512E0B612F0A36C14E0 +1C3477B32C>IIII<000FB512 +FE4880A35D0180C8FCADEB83FE90389FFF8090B512E015F8819038FE03FE9038F000FF01 +C07F49EB3F8090C7121F6C15C0C8120FA2ED07E0A4123C127EB4FC150F16C0A248141F00 +7EEC3F80007FEC7F006C6C5B6D485A391FF80FFC6CB55A6C5C000114C06C6C90C7FCEB0F +F823347CB22C>II<1278B712 +C016E0A316C000FCC7EA3F80ED7F0015FE00785CC712014A5A4A5A5D140F5D4A5A143F92 +C7FC5C147E14FE5C13015CA2495AA213075CA3495AA4495AA5133F91C8FCAA131E23357C +B32C>III<121FEA3F80EA7FC0EAFFE0A5EA7FC0EA3F80 +EA1F00C7FCAE121FEA3F80EA7FC0EAFFE0A5EA7FC0EA3F80EA1F000B2470A32C>II<1507ED1F80153F15FF14034A1300EC1FFC4A5AECFFE0491380010790C7FCEB0FFCEB +3FF8EB7FE048485A4890C8FCEA0FFEEA1FF8EA7FF0EAFFC05BA27FEA7FF0EA1FF8EA0FFE +EA03FF6C13C06C6C7EEB3FF8EB0FFC6DB4FC01017F6D13E0EC3FF86E7EEC07FF6E138014 +00153F151FED0700212A7BAD2C>I<007FB612F0B712F8A4003F15F0CAFCA8003FB612F0 +B712F8A46C15F025147DA22C>I<127012FC7E6C7E13E06C7EEA1FFC6C7E3803FF80C67F +EB7FF0EB1FF8EB0FFEEB03FF6D13C06D6C7EEC3FF8EC0FFC6EB4FC0201138080A25C0207 +1300EC0FFCEC3FF8EC7FE049485A4990C7FCEB0FFEEB1FF8EB7FF0EBFFC000035BD80FFE +C8FC485AEA7FF0485A138048C9FC5A1270212A7BAD2C>III<14FE497EA4497FA2 +14EFA2130781A214C7A2010F7FA314C390381F83F0A590383F01F8A490387E00FCA54913 +7E90B512FEA34880A29038F8003FA34848EB1F80A4000715C049130FD87FFEEBFFFC6D5A +B514FE6C15FC497E27347EB32C>I<007FB512E015F8B612FE6C8016C03903F0003FED0F +E0ED07F01503A2ED01F8A6ED03F0A21507ED0FE0ED1FC0EDFF8090B612005D5D15FF16C0 +9039F0001FE0ED07F0ED03F81501ED00FCA216FE167EA616FE16FC1501ED03F8150FED3F +F0007FB612E016C0B712806CECFE0015F027337FB22C>I<02FF13700107EBE0F84913F9 +013F13FD4913FFEBFF813901FE007F4848131FD807F0130F1507485A491303485A150148 +C7FCA25A007EEC00F01600A212FE5AAB7E127EA3007F15F06CEC01F8A26C7EA26C6C1303 +6D14F06C6C130716E0D803FC131F6C6CEB3FC03A00FF81FF806DB512006D5B010F5B6D13 +F00100138025357DB32C>I<007FB5FCB612C015F0816C803907E003FEEC00FFED7F8015 +3FED1FC0ED0FE0A2150716F0150316F81501A4ED00FCACED01F8A3150316F0A2150716E0 +150FED1FC0153FED7F80EDFF00EC03FE007FB55AB65A5D15C06C91C7FC26337EB22C>I< +007FB612F0B712F8A37E3903F00001A7ED00F01600A4EC01E04A7EA490B5FCA5EBF003A4 +6E5A91C8FCA5163C167EA8007FB612FEB7FCA36C15FC27337EB22C>I<007FB612F8B712 +FCA37ED803F0C7FCA716781600A515F04A7EA490B5FCA5EBF001A46E5A92C7FCAD387FFF +E0B5FC805C7E26337EB22C>I<903901FC038090390FFF87C04913EF017F13FF90B6FC48 +13073803FC01497E4848137F4848133F49131F121F5B003F140F90C7FCA2127EED078092 +C7FCA212FE5AA8913803FFF84A13FCA27E007E6D13F89138000FC0A36C141FA27F121F6D +133F120F6D137F6C7E6C6C13FF6D5A3801FF076C90B5FC6D13EF011F13CF6DEB0780D901 +FCC7FC26357DB32C>II<007FB512F8B6 +12FCA36C14F839000FC000B3B3A5007FB512F8B612FCA36C14F81E3379B22C>I<0107B5 +12804914C0A36D148090390003F000B3AF1218127EA2B4FCA24A5A48130F007F131F9038 +C07FC06CB55A6C91C7FC6C5B000313F838007FC022347BB22C>II<387FFFE0B57EA36C5BD803F0C8FCB3AE16F0ED01 +F8A8007FB6FCB7FCA36C15F025337DB22C>IIII<007FB512C0B612F881 +15FF6C15802603F00013C0153FED0FE0ED07F0A2150316F81501A6150316F01507A2ED0F +E0ED3FC015FF90B61280160015FC5D15C001F0C8FCB0387FFF80B57EA36C5B25337EB22C +>II<387FFFFCB67E15E015F86C803907E007FE1401EC007F6F7E151FA26F7E +A64B5AA2153F4BC7FCEC01FE140790B55A5D15E081819038E007FCEC01FE1400157F81A8 +160FEE1F80A5D87FFEEB1FBFB5ECFF00815E6C486D5AC8EA01F029347EB22C>I<90381F +F80790B5EA0F804814CF000714FF5A381FF01F383FC003497E48C7FC007E147F00FE143F +5A151FA46CEC0F00007E91C7FC127F7FEA3FE0EA1FFCEBFFC06C13FC0003EBFFC06C14F0 +6C6C7F01077F9038007FFEEC07FF02001380153FED1FC0A2ED0FE0A20078140712FCA56C +EC0FC0A26CEC1F806D133F01E0EB7F009038FE01FF90B55A5D00F914F0D8F83F13C0D870 +0790C7FC23357CB32C>I<007FB612FCB712FEA43AFC007E007EA70078153CC71400B3AF +90383FFFFCA2497F6D5BA227337EB22C>I<3B7FFF803FFFC0B56C4813E0A36C496C13C0 +3B03F00001F800B3AF6D130300015DA26D130700005D6D130F017F495A6D6C485AECE0FF +6DB5C7FC6D5B010313F86D5B9038003F802B3480B22C>III<3A3FFF03FFE0484913F0148714076C6D13E03A01F800 +FE007F0000495A13FE017E5BEB7F03013F5B1487011F5B14CF010F5B14FF6D5BA26D90C7 +FCA26D5AA26D5AA2497EA2497EA2497F81EB0FCF81EB1FC7EC87F0EB3F83EC03F8EB7F01 +017E7FEBFE00497F0001147E49137F000380491480151FD87FFEEBFFFC6D5AB514FE6C15 +FC497E27337EB22C>II<003FB612C04815E0A4007EC7EA1FC0ED3F80A2ED7F00157E15FE4A5A +003C5CC712034A5AA24A5A4A5AA24A5A4AC7FCA214FE495AA2495A495AA2495A495AA249 +5A49C8FCA213FE485AA24848EB03C049EB07E01207485A5B121F485AA248C7FCB7FCA46C +15C023337CB22C>I<387FFFFCB512FEA314FC00FCC7FCB3B3B3B512FC14FEA36C13FC17 +416FB92C>I<127812F87EA27E127E127F7E7F121F7F120F7F1207A27F12037F12017F12 +007F137E137F7F80131FA280130F801307801303801301801300A280147E147F8081141F +81140F811407811403A281140181140081157E157F811680151FA2150FED070021417BB9 +2C>I<387FFFFCB512FEA37EC7127EB3B3B3387FFFFEB5FCA36C13FC17417DB92C>I<130E +EB3F80EBFFE0000313F8000F13FE487FD87FF113C0D8FFE013E0EB803F38FE000F007CEB +07C00030EB01801B0C78B22C>I<007FB6FCB71280A46C150021067B7D2C>I<137013F812 +011203EA07F0EA0FE0EA1FC01380EA3F00123E127E127CA212FC5AA4EAFF8013C013E0A2 +127FA2123FEA1FC0EA0F800D1B71B82C>I<3801FFF0000713FE001F6D7E15E048809038 +C01FF81407EC01FC381F80000006C77EC8127EA3ECFFFE131F90B5FC1203120F48EB807E +383FF800EA7FC090C7FC12FE5AA47E007F14FEEB8003383FE01F6CB612FC6C15FE6C14BF +0001EBFE1F3A003FF007FC27247CA32C>II<903803FFE0011F13F8017F13FE48B5 +FC48804848C6FCEA0FF0485A49137E4848131890C9FC5A127EA25AA8127EA2127F6C140F +6DEB1F806C7E6D133F6C6CEB7F003907FE03FF6CB55A6C5C6C6C5B011F13E0010390C7FC +21247AA32C>II< +EB03FE90381FFFC0017F13F048B57E48803907FE03FE390FF800FFD81FE0EB3F805B4848 +EB1FC090C7120F5A007E15E015075AB7FCA416C000FCC9FC7E127EA2127F6CEC03C06DEB +07E06C7ED80FF0130F6C6CEB3FC001FF13FF000190B512806C1500013F13FC010F13F001 +01138023247CA32C>IIII<1307EB1FC0A2497EA36D5AA20107C7FC90C8FCA738 +7FFFC080B5FC7EA2EA0007B3A8007FB512FCB612FEA36C14FC1F3479B32C>I<140EEC3F +80A2EC7FC0A3EC3F80A2EC0E0091C7FCA748B512804814C0A37EC7120FB3B3A2141F003C +1480007E133FB414005CEB01FEEBFFFC6C5B5C001F5B000790C7FC1A467CB32C>II<38 +7FFFE0B57EA37EEA0003B3B3A5007FB61280B712C0A36C158022337BB22C>I<3A7F83F0 +07E09039CFFC1FF83AFFDFFE3FFCD87FFF13FF91B57E3A07FE1FFC3E01FCEBF83F496C48 +7E01F013E001E013C0A301C01380B33B7FFC3FF87FF0027F13FFD8FFFE6D13F8D87FFC49 +13F0023F137F2D2481A32C>I<397FF01FE039FFF87FFC9038F9FFFE01FB7F6CB6FC0001 +9038F03F80ECC01F02807FEC000F5B5BA25BB3267FFFE0B5FCB500F11480A36C01E01400 +29247FA32C>II<397FF01FE039FFF8FFF801FB13FE90B6FC6C158000019038F07F +C09138801FE091380007F049EB03F85BED01FC491300A216FE167EA816FE6D14FCA2ED01 +F86D13036DEB07F0150F9138801FE09138E07FC091B51280160001FB5B01F813F8EC3FC0 +91C8FCAD387FFFE0B57EA36C5B27367FA32C>I<903903FC078090391FFF0FC0017F13CF +48B512EF4814FF3807FE07380FF00148487E49137F4848133F90C7FC48141F127E150F5A +A87E007E141FA26C143F7F6C6C137F6D13FF380FF0033807FC0F6CB6FC6C14EF6C6C138F +6D130FEB07F890C7FCAD0203B5FC4A1480A36E140029367DA32C>II<90387FF8700003B512F8120F5A5A +387FC00F387E00034813015AA36CEB00F0007F140013F0383FFFC06C13FE6CEBFF800003 +14E0C66C13F8010113FCEB0007EC00FE0078147F00FC143F151F7EA26C143F6D133E6D13 +FE9038F007FC90B5FC15F815E000F8148039701FFC0020247AA32C>I<131E133FA9007F +B6FCB71280A36C1500D8003FC8FCB1ED03C0ED07E0A5EC800F011FEB1FC0ECE07F6DB512 +80160001035B6D13F89038003FE0232E7EAD2C>I<3A7FF003FF80486C487FA3007F7F00 +01EB000FB3A3151FA2153F6D137F3900FE03FF90B7FC6D15807F6D13CF902603FE071300 +29247FA32C>I<3A7FFF01FFFCB514FE148314016C15FC3A03E0000F80A26D131F000115 +00A26D5B0000143EA26D137E017C137CA2017E13FC013E5BA2EB3F01011F5BA21483010F +5BA214C701075BA214EF01035BA214FF6D90C7FCA26D5A147C27247EA32C>II<3A3FFF03FFF048018713F8A36C010313F03A00 +FC007E005D90387E01F8013F5BEB1F83EC87E090380FCFC0903807EF80EB03FF6D90C7FC +5C6D5A147C14FE130180903803EF80903807CFC0EB0FC7EC83E090381F01F0013F7FEB7E +00017C137C49137E0001803A7FFF01FFFC1483B514FE6C15FC140127247EA32C>I<3A7F +FF01FFFCB5008113FE148314816C010113FC3A03E0000F806C7E151F6D140012005D6D13 +3E137C017E137E013E137CA2013F13FC6D5BA2EB0F815DA2EB07C1ECC3E0A2EB03E3ECE7 +C0130114F75DEB00FFA292C7FC80A2143EA2147E147CA214FC5CA2EA0C01003F5BEA7F83 +EB87E0EA7E0F495A387FFF806C90C8FC6C5A6C5AEA07E027367EA32C>I<003FB612E048 +15F0A4007EC7EA1FE0ED3FC0ED7F80EDFF004A5A003C495AC7485A4A5A4A5A4A5A4A5A4A +C7FCEB01FC495AEB0FF0495A495A495A49C8FC4848EB01E04848EB03F0485A485A485A48 +5A485AB7FCA46C15E024247DA32C>I<15FF02071380141F147F91B512004913C04AC7FC +EB03F85CB31307EB1FE013FF007F5BB55A49C8FC6D7E6C7FC67F131FEB07F01303B380EB +01FEECFFC06D13FF6E1380141F14070200130021417BB92C>I<127812FCB3B3B3A91278 +06416DB92C>II<01F81370D803FE13F8380FFF0148138748EBCFF0 +397F9FFFE0D8FF0F13C0D8FC07138039F803FE00387000F81D0A79B22C>I +E +%EndDVIPSBitmapFont +/FB 105[42 27[42 46 42 69 46 51 28 37 32 51 51 46 51 +74 28 51 28 28 51 46 32 42 51 37 51 42 9[83 65 65 55 +51 60 69 51 69 69 83 51 2[32 69 69 46 51 69 60 55 65 +1[37 5[42 42 42 42 42 42 42 42 42 42 25 21 28 21 50 39[51 +51 2[{TeXBase1Encoding ReEncodeFont}66 83.022 /Palatino-Bold +rf /FC 133[37 42 42 60 42 46 28 32 32 38 42 37 46 65 +23 37 23 23 42 42 23 32 42 34 38 37 3[28 1[28 1[55 3[65 +51 46 1[65 51 65 65 78 2[28 28 65 1[46 51 65 1[51 60 +1[42 3[21 21 7[42 42 1[25 21 28 21 2[28 28 23 65 2[42 +31[45 44 2[{TeXBase1Encoding ReEncodeFont}61 83.022 /Palatino-Italic +rf /FD 104[83 42 1[42 42 24[42 46 43 69 47 50 27 35 33 +46 50 45 48 73 24 46 19 24 48 46 28 40 51 37 46 42 3[28 +1[28 55 55 55 83 60 65 51 44 55 65 50 65 69 79 51 60 +28 28 69 63 46 51 64 59 51 65 62 37 1[50 1[21 21 42 42 +42 42 42 42 42 42 42 42 50 21 28 21 50 32 28 28 23 65 +2[42 1[23 29[50 50 2[{TeXBase1Encoding ReEncodeFont}87 +83.022 /Palatino-Roman rf /FE 134[115 103 172 115 126 +69 92 80 1[126 115 126 184 69 126 1[69 126 115 80 103 +126 92 1[103 12[138 126 149 1[126 172 172 207 3[80 5[149 +1[161 17[61 1[69 52 41[126 2[{TeXBase1Encoding ReEncodeFont}36 +206.559 /Palatino-Bold rf /FF 137[66 1[40 53 47 2[66 +73 106 40 2[40 73 2[60 73 2[60 13[73 3[100 10[100 86 +80 19[30 46[{TeXBase1Encoding ReEncodeFont}19 119.552 +/Palatino-Bold rf /FG 140[39 36 2[50 2[27 3[53 2[44 1[41 +1[46 26[51 16[46 2[46 1[46 1[23 46[{TeXBase1Encoding ReEncodeFont}13 +91.3242 /Palatino-Roman rf /FH 138[104 1[76 66 3[104 1[57 3[104 1[66 85 1[76 1[85 13[104 123 4[170 77[{ - TeXBase1Encoding ReEncodeFont }13 170.833325 /Palatino-Bold +TeXBase1Encoding ReEncodeFont}13 170.195 /Palatino-Bold rf end %%EndProlog %%BeginSetup %%Feature: *Resolution 600dpi TeXDict begin -%%PaperSize: Letter +%%PaperSize: A4 %%EndSetup %%Page: 1 1 1 0 bop 75 1114 a FH(Scsh)41 b(Reference)i(Manual)p 75 -1183 3900 34 v 2608 1283 a FG(For)22 b(scsh)g(r)n(elease)g(0.5)75 +1183 3900 34 v 2539 1283 a FG(For)23 b(scsh)f(r)n(elease)f(0.5.2)75 4280 y FF(Olin)29 b(Shivers)g(and)h(Brian)f(D.)g(Carlstrom)p 75 4350 3900 17 v eop %%Page: 2 2 @@ -1983,195 +1138,227 @@ g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f (.)g(.)g(.)h(.)124 b(40)805 2480 y(3.4)86 b(Pr)o(ocesses)41 b(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f (.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)124 -b(51)996 2607 y(3.4.1)98 b(Pr)o(ocess)20 b(objects)i(and)e(pr)o(ocess)g +b(52)996 2607 y(3.4.1)98 b(Pr)o(ocess)20 b(objects)i(and)e(pr)o(ocess)g (r)o(eaping)68 b(.)41 b(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)124 -b(54)996 2735 y(3.4.2)98 b(Pr)o(ocess)20 b(waiting)49 +b(55)996 2735 y(3.4.2)98 b(Pr)o(ocess)20 b(waiting)49 b(.)41 b(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.) -g(.)g(.)h(.)f(.)g(.)g(.)h(.)124 b(57)996 2862 y(3.4.3)98 +g(.)g(.)h(.)f(.)g(.)g(.)h(.)124 b(58)996 2862 y(3.4.3)98 b(Analysing)21 b(pr)o(ocess)g(status)f(codes)45 b(.)c(.)h(.)f(.)g(.)g -(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)124 b(58)805 2989 +(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)124 b(59)805 2989 y(3.5)86 b(Pr)o(ocess)21 b(state)49 b(.)41 b(.)h(.)f(.)g(.)g(.)h(.)f(.) g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h -(.)f(.)g(.)g(.)h(.)124 b(59)805 3116 y(3.6)86 b(User)20 +(.)f(.)g(.)g(.)h(.)124 b(60)805 3116 y(3.6)86 b(User)20 b(and)h(gr)o(oup)f(database)f(access)32 b(.)41 b(.)g(.)h(.)f(.)g(.)h(.) f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)124 b(61)805 3244 y(3.7)86 b(Accessing)21 b(command-line)g(ar)o(guments)52 b(.)41 b(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)124 -b(61)805 3371 y(3.8)86 b(System)21 b(parameters)63 b(.)41 +b(62)805 3371 y(3.8)86 b(System)21 b(parameters)63 b(.)41 b(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f -(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)124 b(63)805 3498 y(3.9)86 +(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)124 b(64)805 3498 y(3.9)86 b(Signal)21 b(system)72 b(.)42 b(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.) g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h -(.)124 b(63)805 3626 y(3.10)44 b(T)-5 b(ime)83 b(.)41 +(.)124 b(64)805 3626 y(3.10)44 b(T)-5 b(ime)83 b(.)41 b(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h (.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)124 -b(67)996 3753 y(3.10.1)56 b(T)-8 b(erminology)31 b(.)41 +b(68)996 3753 y(3.10.1)56 b(T)-8 b(erminology)31 b(.)41 b(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f -(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)124 b(67)996 3880 y(3.10.2)56 +(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)124 b(68)996 3880 y(3.10.2)56 b(Basic)20 b(data)g(types)34 b(.)41 b(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f (.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)124 -b(68)996 4007 y(3.10.3)56 b(T)-5 b(ime)21 b(zones)h(.)41 +b(69)996 4007 y(3.10.3)56 b(T)-5 b(ime)21 b(zones)h(.)41 b(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h -(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)124 b(69)996 4135 +(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)124 b(70)996 4135 y(3.10.4)56 b(Pr)o(ocedur)o(es)24 b(.)41 b(.)g(.)h(.)f(.)g(.)g(.)h(.)f (.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.) -h(.)124 b(69)805 4262 y(3.1)-5 b(1)49 b(Envir)o(onment)22 +h(.)124 b(70)805 4262 y(3.1)-5 b(1)49 b(Envir)o(onment)22 b(variables)51 b(.)41 b(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g -(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)124 b(73)996 +(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)124 b(74)996 4389 y(3.1)-5 b(1.1)61 b(Path)21 b(lists)g(and)g(colon)g(lists)53 b(.)41 b(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.) -g(.)h(.)124 b(75)996 4516 y(3.1)-5 b(1.2)61 b FA($USER)p +g(.)h(.)124 b(76)996 4516 y(3.1)-5 b(1.2)61 b FA($USER)p FD(,)18 b FA($HOME)p FD(,)h(and)h FA($PATH)34 b FD(.)41 b(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h -(.)124 b(76)805 4644 y(3.12)44 b(T)-8 b(erminal)21 b(device)f(contr)o +(.)124 b(77)805 4644 y(3.12)44 b(T)-8 b(erminal)21 b(device)f(contr)o (ol)k(.)41 b(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.) -f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)124 b(76)996 4771 y(3.12.1)56 +f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)124 b(77)996 4771 y(3.12.1)56 b(Portability)21 b(acr)o(oss)f(OS)h(variants)38 b(.)j(.)g(.)h(.)f(.)g -(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)124 b(77)996 +(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)124 b(78)996 4898 y(3.12.2)56 b(Miscellaneous)21 b(pr)o(ocedur)o(es)40 b(.)h(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h -(.)124 b(77)2077 5147 y(iv)p eop +(.)124 b(78)2077 5147 y(iv)p eop %%Page: 5 5 5 4 bop 681 614 a FD(3.12.3)55 b(The)21 b(tty-info)g(r)o(ecor)o(d)e (type)61 b(.)42 b(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g -(.)g(.)h(.)f(.)g(.)125 b(77)681 742 y(3.12.4)55 b(Using)22 +(.)g(.)h(.)f(.)g(.)125 b(78)681 740 y(3.12.4)55 b(Using)22 b(tty-info)f(r)o(ecor)o(ds)66 b(.)41 b(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h -(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)125 b(79)681 -869 y(3.12.5)55 b(Other)21 b(terminal-device)f(pr)o(ocedur)o(es)64 +(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)125 b(80)681 +866 y(3.12.5)55 b(Other)21 b(terminal-device)f(pr)o(ocedur)o(es)64 b(.)41 b(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)125 -b(80)681 997 y(3.12.6)55 b(Contr)o(ol)22 b(terminals,)e(sessions,)i -(and)f(terminal)f(pr)o(ocess)h(gr)o(oups)126 b(81)681 -1124 y(3.12.7)55 b(Pseudo-terminals)40 b(.)i(.)f(.)g(.)g(.)h(.)f(.)g(.) +b(81)681 993 y(3.12.6)55 b(Contr)o(ol)22 b(terminals,)e(sessions,)i +(and)f(terminal)f(pr)o(ocess)h(gr)o(oups)126 b(82)681 +1119 y(3.12.7)55 b(Pseudo-terminals)40 b(.)i(.)f(.)g(.)g(.)h(.)f(.)g(.) g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)125 -b(82)365 1335 y FB(4)83 b(Networking)2195 b(89)490 1462 +b(83)365 1328 y FB(4)83 b(Networking)2195 b(90)490 1454 y FD(4.1)86 b(High-level)21 b(interface)34 b(.)41 b(.)g(.)g(.)h(.)f(.)g (.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.) -f(.)g(.)125 b(89)490 1590 y(4.2)86 b(Sockets)54 b(.)41 +f(.)g(.)125 b(90)490 1580 y(4.2)86 b(Sockets)54 b(.)41 b(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g (.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)125 -b(90)490 1717 y(4.3)86 b(Socket)20 b(addr)o(esses)81 +b(91)490 1706 y(4.3)86 b(Socket)20 b(addr)o(esses)81 b(.)42 b(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.) -f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)125 b(91)490 -1845 y(4.4)86 b(Socket)20 b(primitives)65 b(.)42 b(.)f(.)g(.)g(.)h(.)f +f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)125 b(92)490 +1832 y(4.4)86 b(Socket)20 b(primitives)65 b(.)42 b(.)f(.)g(.)g(.)h(.)f (.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.) -h(.)f(.)g(.)125 b(92)490 1972 y(4.5)86 b(Performing)21 +h(.)f(.)g(.)125 b(93)490 1958 y(4.5)86 b(Performing)21 b(input)g(and)g(output)g(on)g(sockets)39 b(.)i(.)g(.)h(.)f(.)g(.)g(.)h -(.)f(.)g(.)g(.)h(.)f(.)g(.)125 b(94)490 2099 y(4.6)86 +(.)f(.)g(.)g(.)h(.)f(.)g(.)125 b(95)490 2084 y(4.6)86 b(Socket)20 b(options)44 b(.)d(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h (.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.) -125 b(95)490 2227 y(4.7)86 b(Database-information)20 +125 b(96)490 2210 y(4.7)86 b(Database-information)20 b(entries)67 b(.)41 b(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h -(.)f(.)g(.)g(.)h(.)f(.)g(.)125 b(96)365 2438 y FB(5)83 -b(Strings)20 b(and)f(characters)1821 b(98)490 2565 y +(.)f(.)g(.)g(.)h(.)f(.)g(.)125 b(97)365 2420 y FB(5)83 +b(Strings)20 b(and)f(characters)1821 b(99)490 2546 y FD(5.1)86 b(String)21 b(manipulation)j(.)41 b(.)g(.)g(.)h(.)f(.)g(.)g (.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.) -g(.)125 b(98)681 2693 y(5.1.1)97 b(Regular)21 b(expr)o(essions)72 -b(.)41 b(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.) -g(.)h(.)f(.)g(.)125 b(98)681 2820 y(5.1.2)97 b(Other)21 -b(string)h(manipulation)f(facilities)78 b(.)42 b(.)f(.)g(.)g(.)h(.)f(.) -g(.)g(.)h(.)f(.)g(.)83 b(101)681 2947 y(5.1.3)97 b(Manipulating)21 -b(\002le-names)29 b(.)42 b(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h -(.)f(.)g(.)g(.)h(.)f(.)g(.)83 b(102)490 3075 y(5.2)j(ASCII)20 -b(encoding)56 b(.)41 b(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g -(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)83 -b(108)490 3202 y(5.3)j(Character)19 b(sets)60 b(.)41 -b(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h -(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)83 b(108)681 -3330 y(5.3.1)97 b(Cr)o(eating)20 b(character)g(sets)38 -b(.)j(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h -(.)f(.)g(.)83 b(108)681 3457 y(5.3.2)97 b(Querying)22 -b(character)d(sets)65 b(.)42 b(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g -(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)83 b(109)681 3584 y(5.3.3)97 -b(Character)20 b(set)g(algebra)34 b(.)41 b(.)g(.)h(.)f(.)g(.)g(.)h(.)f -(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)83 -b(109)681 3712 y(5.3.4)97 b(Standar)o(d)19 b(character)g(sets)83 +g(.)125 b(99)681 2672 y(5.1.1)97 b(Manipulating)21 b(\002le-names)29 b(.)42 b(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.) -f(.)g(.)83 b(109)365 3923 y FB(6)g(Reading)19 b(delimited)e(strings) -1634 b(1)m(1)m(1)365 4134 y(7)83 b(A)-6 b(wk,)20 b(record)h(I/O,)f(and) -g(\002eld)f(parsing)1328 b(1)m(14)490 4261 y FD(7.1)86 -b(Recor)o(d)20 b(I/O)h(and)g(\002eld)f(parsing)68 b(.)41 -b(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f -(.)g(.)88 b(1)-5 b(14)681 4389 y(7.1.1)97 b(Reading)21 -b(r)o(ecor)o(ds)j(.)41 b(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.) -h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)88 b(1)-5 -b(15)681 4516 y(7.1.2)97 b(Parsing)21 b(\002elds)62 b(.)41 -b(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h -(.)f(.)g(.)g(.)h(.)f(.)g(.)88 b(1)-5 b(15)681 4644 y(7.1.3)97 -b(Field)21 b(r)o(eaders)f(.)41 b(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.) -g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)88 -b(1)-5 b(18)681 4771 y(7.1.4)97 b(Forwar)o(d-pr)o(ogr)o(ess)19 -b(guarantees)h(and)g(empty-string)i(matches)99 b(1)-5 -b(19)681 4898 y(7.1.5)97 b(Reader)20 b(limitations)74 -b(.)41 b(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.) -g(.)g(.)h(.)f(.)g(.)83 b(121)1774 5147 y(v)p eop +f(.)g(.)125 b(99)681 2798 y(5.1.2)97 b(Other)21 b(string)h +(manipulation)f(facilities)78 b(.)42 b(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h +(.)f(.)g(.)83 b(105)490 2924 y(5.2)j(ASCII)20 b(encoding)56 +b(.)41 b(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.) +h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)83 b(106)490 +3050 y(5.3)j(Character)19 b(sets)60 b(.)41 b(.)g(.)h(.)f(.)g(.)g(.)h(.) +f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g +(.)h(.)f(.)g(.)83 b(106)681 3176 y(5.3.1)97 b(Cr)o(eating)20 +b(character)g(sets)38 b(.)j(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g +(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)83 b(107)681 3302 y(5.3.2)97 +b(Querying)22 b(character)d(sets)65 b(.)42 b(.)f(.)g(.)g(.)h(.)f(.)g(.) +h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)83 b(108)681 +3428 y(5.3.3)97 b(Character)o(-set)19 b(algebra)28 b(.)41 +b(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h +(.)f(.)g(.)83 b(108)681 3554 y(5.3.4)97 b(Standar)o(d)19 +b(character)g(sets)83 b(.)42 b(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g +(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)83 b(109)681 3680 y(5.3.5)97 +b(Linear)o(-update)19 b(character)o(-set)f(operations)76 +b(.)41 b(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)88 b(1)-5 +b(10)365 3890 y FB(6)83 b(Pattern-matching)16 b(strings)k(with)g +(regular)g(expressions)730 b(1)m(12)490 4016 y FD(6.1)86 +b(Summary)20 b(SRE)h(syntax)33 b(.)41 b(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g +(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)88 +b(1)-5 b(13)490 4142 y(6.2)86 b(Examples)32 b(.)41 b(.)h(.)f(.)g(.)g(.) +h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g +(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)88 b(1)-5 b(17)490 +4268 y(6.3)86 b(A)20 b(short)i(tutorial)72 b(.)41 b(.)h(.)f(.)g(.)g(.)h +(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.) +g(.)h(.)f(.)g(.)88 b(1)-5 b(17)490 4394 y(6.4)86 b(Choices)40 +b(.)h(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g +(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)88 +b(1)-5 b(19)681 4520 y(6.4.1)97 b(Embedding)21 b(r)o(egexps)f(within)i +(Scheme)e(pr)o(ograms)67 b(.)41 b(.)g(.)h(.)f(.)g(.)83 +b(128)490 4646 y(6.5)j(Regexp)20 b(functions)65 b(.)42 +b(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g +(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)83 b(129)681 4772 +y(6.5.1)97 b(Obsolete,)21 b(depr)o(ecated)e(pr)o(ocedur)o(es)41 +b(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)83 +b(129)681 4898 y(6.5.2)97 b(Standar)o(d)19 b(pr)o(ocedur)o(es)g(and)h +(syntax)57 b(.)41 b(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.) +83 b(129)1774 5147 y(v)p eop %%Page: 6 6 -6 5 bop 805 614 a FD(7.2)86 b(A)-6 b(wk)30 b(.)41 b(.)g(.)g(.)h(.)f(.)g -(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.) -g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)83 b(121)996 -739 y(7.2.1)98 b(Examples)78 b(.)41 b(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g -(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.) -83 b(124)681 946 y FB(8)f(Miscellaneous)18 b(routines)1731 -b(127)805 1071 y FD(8.1)86 b(Integer)21 b(bitwise)g(ops)65 -b(.)41 b(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.) -h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)83 b(127)805 1196 -y(8.2)j(List)21 b(pr)o(ocedur)o(es)70 b(.)41 b(.)g(.)g(.)h(.)f(.)g(.)g -(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.) -g(.)g(.)h(.)83 b(127)805 1320 y(8.3)j(T)-8 b(op)21 b(level)56 -b(.)42 b(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.) -f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)83 -b(127)681 1528 y FB(9)f(Running)20 b(scsh)2096 b(129)805 -1652 y FD(9.1)86 b(Scsh)21 b(command-line)g(switches)84 -b(.)41 b(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.) -g(.)g(.)h(.)83 b(130)996 1777 y(9.1.1)98 b(Scripts)20 -b(and)h(pr)o(ograms)g(.)42 b(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.) -h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)83 b(130)996 1901 -y(9.1.2)98 b(Inserting)21 b(interpr)o(eter)f(triggers)h(into)g(scsh)h -(pr)o(ograms)39 b(.)i(.)g(.)g(.)h(.)83 b(130)996 2026 -y(9.1.3)98 b(Module)20 b(system)58 b(.)41 b(.)g(.)g(.)h(.)f(.)g(.)g(.)h -(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)83 -b(131)996 2150 y(9.1.4)98 b(Switches)50 b(.)41 b(.)g(.)g(.)h(.)f(.)g(.) -g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f -(.)g(.)g(.)h(.)83 b(132)996 2275 y(9.1.5)98 b(The)21 -b(meta)f(ar)o(gument)27 b(.)41 b(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.) -g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)83 b(136)996 -2399 y(9.1.6)98 b(Examples)78 b(.)41 b(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g -(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.) -83 b(138)996 2524 y(9.1.7)98 b(Pr)o(ocess)20 b(exit)h(values)60 -b(.)41 b(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.) -h(.)f(.)g(.)g(.)h(.)83 b(140)805 2648 y(9.2)j(The)21 -b(scsh)g(virtual)g(machine)35 b(.)41 b(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g -(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)83 -b(141)996 2773 y(9.2.1)98 b(VM)20 b(ar)o(guments)71 b(.)41 -b(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g -(.)h(.)f(.)g(.)g(.)h(.)83 b(141)996 2897 y(9.2.2)98 b(Inserting)21 -b(interpr)o(eter)f(triggers)h(into)g(heap)g(images)48 -b(.)42 b(.)f(.)g(.)g(.)h(.)83 b(142)996 3022 y(9.2.3)98 -b(Inserting)21 b(a)g(double-level)f(trigger)g(into)i(Scheme)e(pr)o -(ograms)70 b(.)83 b(143)805 3147 y(9.3)j(Compiling)22 -b(scsh)g(pr)o(ograms)65 b(.)41 b(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.) -g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)83 b(143)805 -3271 y(9.4)j(Statically)20 b(linking)i(heap)f(images)38 -b(.)j(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g -(.)g(.)h(.)83 b(144)805 3396 y(9.5)j(Standar)o(d)19 b(\002le)i -(locations)71 b(.)41 b(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g -(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)83 b(146)681 -3603 y FB(10)40 b(Changes)20 b(from)h(previous)f(releases)1407 -b(148)805 3728 y FD(10.1)44 b(Changes)21 b(fr)o(om)f(the)h(pr)o(evious) -g(r)o(elease)54 b(.)42 b(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.) -f(.)g(.)g(.)h(.)83 b(148)805 3852 y(10.2)44 b(Changes)21 -b(fr)o(om)f(the)h(penultimate)g(r)o(elease)57 b(.)41 -b(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)83 -b(149)996 3977 y(10.2.1)56 b(New)21 b(featur)o(es)67 +6 5 bop 805 614 a FD(6.6)86 b(The)21 b(r)o(egexp)e(ADT)30 +b(.)41 b(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.) +g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)83 b(136)805 +742 y(6.7)j(Syntax-hacking)21 b(tools)60 b(.)42 b(.)f(.)g(.)g(.)h(.)f +(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.) +h(.)83 b(138)681 953 y FB(7)f(Reading)19 b(delimited)f(strings)1628 +b(140)681 1164 y(8)82 b(A)-6 b(wk,)20 b(record)h(I/O,)g(and)e(\002eld)h +(parsing)1325 b(143)805 1291 y FD(8.1)86 b(Recor)o(d)20 +b(I/O)i(and)e(\002eld)h(parsing)68 b(.)41 b(.)g(.)g(.)h(.)f(.)g(.)h(.)f +(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)83 b(143)996 +1419 y(8.1.1)98 b(Reading)21 b(r)o(ecor)o(ds)j(.)41 b(.)g(.)g(.)h(.)f +(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.) +h(.)83 b(144)996 1546 y(8.1.2)98 b(Parsing)21 b(\002elds)61 b(.)42 b(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.) -f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)83 b(149)996 4101 y(10.2.2)56 -b(Incompatible)21 b(impr)o(ovements)82 b(.)41 b(.)g(.)h(.)f(.)g(.)g(.)h -(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)83 b(150)996 4226 -y(10.2.3)56 b(Backwar)o(ds-compatible)19 b(impr)o(ovements)38 -b(.)j(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)83 b(153)681 -4433 y FB(1)m(1)43 b(T)-9 b(odo)2427 b(154)2077 5147 -y FD(vi)p eop -%%Page: 1 7 -1 6 bop 365 1276 a Fz(Chapter)45 b(1)365 1730 y FE(Introduction)365 +f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)83 b(144)996 1674 y(8.1.3)98 +b(Field)21 b(r)o(eaders)e(.)41 b(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.) +f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)83 +b(148)996 1801 y(8.1.4)98 b(Forwar)o(d-pr)o(ogr)o(ess)19 +b(guarantees)g(and)i(empty-string)g(matches)95 b(148)996 +1928 y(8.1.5)j(Reader)20 b(limitations)73 b(.)41 b(.)h(.)f(.)g(.)g(.)h +(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)83 +b(150)805 2056 y(8.2)j(A)-6 b(wk)30 b(.)41 b(.)g(.)g(.)h(.)f(.)g(.)h(.) +f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g +(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)83 b(150)996 2183 +y(8.2.1)98 b(Examples)78 b(.)41 b(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g +(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)83 +b(153)805 2310 y(8.3)j(Backwar)o(ds)19 b(compatibility)38 +b(.)j(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g +(.)h(.)f(.)g(.)g(.)h(.)83 b(155)681 2522 y FB(9)f(Miscellaneous)18 +b(routines)1731 b(156)805 2649 y FD(9.1)86 b(Integer)21 +b(bitwise)g(ops)65 b(.)41 b(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g +(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)83 +b(156)805 2776 y(9.2)j(List)21 b(pr)o(ocedur)o(es)70 +b(.)41 b(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.) +g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)83 b(156)805 +2904 y(9.3)j(T)-8 b(op)21 b(level)56 b(.)42 b(.)f(.)g(.)h(.)f(.)g(.)g +(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.) +g(.)g(.)h(.)f(.)g(.)g(.)h(.)83 b(156)681 3115 y FB(10)40 +b(Running)20 b(scsh)2096 b(158)805 3242 y FD(10.1)44 +b(Scsh)21 b(command-line)g(switches)84 b(.)41 b(.)g(.)g(.)h(.)f(.)g(.)h +(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)83 +b(159)996 3370 y(10.1.1)56 b(Scripts)20 b(and)h(pr)o(ograms)g(.)42 +b(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g +(.)g(.)h(.)83 b(159)996 3497 y(10.1.2)56 b(Inserting)21 +b(interpr)o(eter)f(triggers)h(into)g(scsh)h(pr)o(ograms)39 +b(.)i(.)g(.)g(.)h(.)83 b(159)996 3624 y(10.1.3)56 b(Module)20 +b(system)58 b(.)41 b(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.) +g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)83 b(160)996 +3752 y(10.1.4)56 b(Switches)50 b(.)41 b(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f +(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.) +h(.)83 b(161)996 3879 y(10.1.5)56 b(The)21 b(meta)f(ar)o(gument)27 +b(.)41 b(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.) +h(.)f(.)g(.)g(.)h(.)83 b(165)996 4007 y(10.1.6)56 b(Examples)78 +b(.)41 b(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.) +g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)83 b(167)996 +4134 y(10.1.7)56 b(Pr)o(ocess)20 b(exit)h(values)60 b(.)41 +b(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f +(.)g(.)g(.)h(.)83 b(169)805 4261 y(10.2)44 b(The)21 b(scsh)g(virtual)g +(machine)35 b(.)41 b(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.) +h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)83 b(170)996 4389 +y(10.2.1)56 b(VM)20 b(ar)o(guments)71 b(.)41 b(.)g(.)g(.)h(.)f(.)g(.)g +(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)83 +b(170)996 4516 y(10.2.2)56 b(Inserting)21 b(interpr)o(eter)f(triggers)h +(into)g(heap)g(images)48 b(.)42 b(.)f(.)g(.)g(.)h(.)83 +b(171)996 4644 y(10.2.3)56 b(Inserting)21 b(a)g(double-level)f(trigger) +g(into)i(Scheme)e(pr)o(ograms)70 b(.)83 b(172)805 4771 +y(10.3)44 b(Compiling)22 b(scsh)g(pr)o(ograms)65 b(.)41 +b(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f +(.)g(.)g(.)h(.)83 b(172)805 4898 y(10.4)44 b(Statically)20 +b(linking)i(heap)f(images)38 b(.)j(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g +(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)83 b(173)2077 +5147 y(vi)p eop +%%Page: 7 7 +7 6 bop 490 614 a FD(10.5)44 b(Standar)o(d)18 b(\002le)j(locations)71 +b(.)41 b(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.) +h(.)f(.)g(.)g(.)h(.)f(.)g(.)83 b(175)365 822 y FB(1)m(1)44 +b(Changes)19 b(from)i(previous)f(releases)1407 b(177)490 +946 y FD(1)-5 b(1.1)49 b(Changes)21 b(fr)o(om)f(the)h(pr)o(evious)f(r)o +(elease)55 b(.)41 b(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h +(.)f(.)g(.)83 b(177)490 1071 y(1)-5 b(1.2)49 b(Changes)21 +b(fr)o(om)f(the)h(penultimate)g(r)o(elease)56 b(.)42 +b(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)83 +b(178)681 1196 y(1)-5 b(1.2.1)60 b(New)21 b(featur)o(es)68 +b(.)41 b(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)h(.)f(.)g(.) +g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)83 b(178)681 1320 y(1)-5 +b(1.2.2)60 b(Incompatible)21 b(impr)o(ovements)82 b(.)41 +b(.)h(.)f(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)83 +b(179)681 1445 y(1)-5 b(1.2.3)60 b(Backwar)o(ds-compatible)19 +b(impr)o(ovements)39 b(.)i(.)g(.)g(.)h(.)f(.)g(.)g(.)h(.)f(.)g(.)83 +b(182)365 1652 y FB(12)41 b(T)-9 b(odo)2426 b(183)1750 +5147 y FD(vii)p eop +%%Page: 8 8 +8 7 bop 2053 5147 a FD(viii)p eop +%%Page: 1 9 +1 8 bop 365 1276 a Fz(Chapter)45 b(1)365 1730 y FE(Introduction)365 2200 y FD(This)32 b(is)g(the)f(r)o(efer)o(ence)d(manual)j(for)g(scsh,)j (a)d(Unix)g(shell)h(that)f(is)g(embedded)f(within)365 2300 y(Scheme.)c(Scsh)21 b(is)h(a)e(Scheme)h(system)h(designed)f(for)g @@ -2209,8 +1396,8 @@ b(,)16 b(the)g(Scheme)g(Shell)g(home)h(page,)f(and)365 (containing)g(just)h(this)f(manual)g(in)g(Postscript)365 4898 y(form,)21 b(for)f(those)i(who)f(simply)h(wish)g(to)f(r)o(ead)e (about)i(the)g(system.)1777 5147 y(1)p eop -%%Page: 2 8 -2 7 bop 805 614 a FD(However)-6 b(,)25 b(nothing)h(is)e(certain)g(for)g +%%Page: 2 10 +2 9 bop 805 614 a FD(However)-6 b(,)25 b(nothing)h(is)e(certain)g(for)g (long)h(on)g(the)f(Net.)36 b(Pr)o(obably)23 b(the)h(best)h(way)f(to)681 714 y(get)h(a)f(copy)h(of)g(scsh)g(is)g(to)h(use)e(a)h(network)g(r)o (esour)o(ce-discovery)e(tool,)k(such)e(as)f(ar)o(chie,)681 @@ -2218,17 +1405,17 @@ b(,)16 b(the)g(Scheme)g(Shell)g(home)h(page,)f(and)365 b(T)-8 b(ake)26 b(the)h(set)f(of)g(sites)h(storing)h(the)e(most)681 913 y(r)o(ecent)20 b(r)o(elease)f(of)i(scsh,)g(choose)g(one)g(close)g (to)h(your)f(site,)f(and)h(download)g(the)g(tar)f(\002le.)681 -1194 y Fy(1.2)99 b(Building)26 b(scsh)681 1409 y FD(Scsh)35 -b(curr)o(ently)g(r)o(uns)h(on)f(a)g(fairly)g(lar)o(ge)f(set)h(of)g -(Unix)h(systems,)j(including)d(Linux,)681 1509 y(NetBSD,)28 -b(SunOS,)h(Solaris,)i(AIX,)e(NeXTSTEP)-11 b(,)29 b(Irix,)i(and)e -(HP-UX.)g(W)-8 b(e)29 b(use)h(the)f(Gnu)681 1609 y(pr)o(oject's)38 -b(autocon\002g)i(tool)f(to)g(generate)f(self-con\002guring)h(shell)g -(scripts)g(that)f(cus-)681 1708 y(tomise)24 b(the)h(scsh)f(Make\002le)f -(for)h(dif)o(fer)o(ent)d(OS)j(variants.)35 b(This)24 -b(means)g(that)g(if)g(you)g(use)681 1808 y(one)30 b(of)g(the)g(common)i -(Unix)e(implementations,)j(building)e(scsh)f(should)h(r)o(equir)o(e)e -(ex-)681 1907 y(actly)20 b(the)h(following)h(steps:)938 +1194 y Fy(1.2)99 b(Building)26 b(scsh)681 1409 y FD(Scsh)16 +b(curr)o(ently)g(r)o(uns)g(on)h(a)f(fairly)g(lar)o(ge)f(set)h(of)g +(Unix)g(systems,)i(including)f(Linux,)g(NetB-)681 1509 +y(SD,)f(SunOS,)h(Solaris,)g(AIX,)g(NeXTSTEP)-11 b(,)16 +b(Irix,)i(and)e(HP-UX.)h(W)-8 b(e)17 b(use)g(the)g(Gnu)h(pr)o(oject's) +681 1609 y(autocon\002g)f(tool)h(to)f(generate)f(self-con\002guring)h +(shell)h(scripts)e(that)h(customise)h(the)e(scsh)681 +1708 y(Make\002le)22 b(for)h(dif)o(fer)o(ent)e(OS)i(variants.)32 +b(This)23 b(means)g(that)h(if)e(you)i(use)f(one)h(of)f(the)g(com-)681 +1808 y(mon)c(Unix)e(implementations,)j(building)e(scsh)h(should)g(r)o +(equir)o(e)d(exactly)i(the)g(following)681 1907 y(steps:)938 2050 y FA(gunzip)41 b(scsh.tar.gz)162 b FC(Uncompr)o(ess)20 b(the)g(r)o(elease)i(tar)e(\002le.)938 2149 y FA(untar)42 b(xfv)g(scsh.tar)163 b FC(Unpack)19 b(the)h(sour)o(ce)h(code.)938 @@ -2247,9 +1434,9 @@ y(If)26 b(you)h(don't)g(have)f(the)h(patience)f(to)h(do)f(this,)j(you)e (can)f(start)g(up)g(a)g(Scheme)g(shell)681 3498 y(immediately)21 b(after)e(the)i(initial)g(make)g(by)g(simply)g(saying)888 3638 y FA(./scshvm)41 b(-o)h(./scshvm)f(-i)h(scsh/scsh.image)681 -3778 y FD(See)20 b(chapter)g(9)g(for)g(full)h(details)g(on)g -(installation)h(locations)f(and)g(startup)f(options.)805 -3904 y(It)i(is)f(not)i(too)f(dif)o(\002cult)f(to)g(port)h(scsh)g(to)g +3778 y FD(See)20 b(chapter)g(10)f(for)i(full)g(details)f(on)h +(installation)h(locations)g(and)e(startup)h(options.)805 +3904 y(It)h(is)f(not)i(too)f(dif)o(\002cult)f(to)g(port)h(scsh)g(to)g (another)f(Unix)g(platform)g(if)h(your)f(OS)h(is)f(not)681 4004 y(supported)e(by)g(the)h(curr)o(ent)e(r)o(elease.)24 b(See)18 b(the)i(r)o(elease)e(notes)i(for)f(mor)o(e)g(details)g(on)h @@ -2263,29 +1450,29 @@ b(is)g(primarily)g(designed)g(for)g(the)g(writing)h(of)f(shell)h b(the)27 b(curr)o(ent)681 4898 y(r)o(elease)22 b(lacks)h(job)h(contr)o (ol,)h(command-line)f(editing,)g(a)f(terse,)g(convenient)i(command)2092 5147 y(2)p eop -%%Page: 3 9 -3 8 bop 365 614 a FD(syntax,)36 b(and)c(it)i(does)e(not)i(r)o(ead)d(in) -j(an)e(initialisation)i(\002le)f(analogous)h(to)f FA(.login)d -FD(or)365 714 y FA(.profile)p FD(.)42 b(W)-8 b(e)28 b(hope)g(to)f(addr) -o(ess)f(all)h(of)h(these)f(issues)h(in)g(futur)o(e)e(r)o(eleases;)j(we) -f(even)365 814 y(have)22 b(designs)i(for)e(several)g(of)h(these)f -(featur)o(es;)g(but)h(the)g(system)g(as-r)o(eleased)d(does)j(not)365 -913 y(curr)o(ently)e(pr)o(ovide)e(these)i(featur)o(es.)490 -1049 y(In)h(the)g(curr)o(ent)g(r)o(elease,)e(the)j(system)g(has)f(some) -g(r)o(ough)h(edges.)29 b(It)22 b(is)g(quite)h(slow)g(to)365 -1148 y(start)28 b(up\227loading)h(the)f(initial)h(image)f(into)h(the)f -(Scheme)g(48)g(virtual)f(machine)i(takes)365 1248 y(about)19 -b(a)f(cpu)g(second.)25 b(This)19 b(can)g(be)f(\002xed)g(with)h(the)g -(static)f(heap)g(linker)h(pr)o(ovided)f(with)365 1347 -y(this)k(r)o(elease.)490 1483 y(This)c(manual)f(is)g(very)-9 -b(,)17 b(very)g(r)o(ough.)25 b(At)16 b(some)i(point,)h(we)e(hope)g(to)h -(polish)g(it)g(up,)f(\002n-)365 1582 y(ish)22 b(it)g(of)o(f,)f(and)g(r) -o(e-typeset)f(it)i(using)g(markup,)f(so)h(we)f(can)h(generate)e(html,)j -(info)e(nodes,)365 1682 y(and)30 b(T)573 1701 y(E)613 -1682 y(X)g(output)g(fr)o(om)f(the)h(single)h(sour)o(ce)e(without)i -(having)f(to)g(deal)f(with)h(T)-8 b(exinfo.)365 1782 -y(But)21 b(it's)g(all)g(ther)o(e)f(is,)h(for)f(now)-8 -b(.)365 2087 y Fy(1.4)99 b(Naming)25 b(conventions)365 +%%Page: 3 11 +3 10 bop 365 614 a FD(syntax,)36 b(and)c(it)i(does)e(not)i(r)o(ead)d +(in)j(an)e(initialisation)i(\002le)f(analogous)h(to)f +FA(.login)d FD(or)365 714 y FA(.profile)p FD(.)42 b(W)-8 +b(e)28 b(hope)g(to)f(addr)o(ess)f(all)h(of)h(these)f(issues)h(in)g +(futur)o(e)e(r)o(eleases;)j(we)f(even)365 814 y(have)22 +b(designs)i(for)e(several)g(of)h(these)f(featur)o(es;)g(but)h(the)g +(system)g(as-r)o(eleased)d(does)j(not)365 913 y(curr)o(ently)e(pr)o +(ovide)e(these)i(featur)o(es.)490 1049 y(In)h(the)g(curr)o(ent)g(r)o +(elease,)e(the)j(system)g(has)f(some)g(r)o(ough)h(edges.)29 +b(It)22 b(is)g(quite)h(slow)g(to)365 1148 y(start)28 +b(up\227loading)h(the)f(initial)h(image)f(into)h(the)f(Scheme)g(48)g +(virtual)f(machine)i(takes)365 1248 y(about)19 b(a)f(cpu)g(second.)25 +b(This)19 b(can)g(be)f(\002xed)g(with)h(the)g(static)f(heap)g(linker)h +(pr)o(ovided)f(with)365 1347 y(this)k(r)o(elease.)490 +1483 y(This)c(manual)f(is)g(very)-9 b(,)17 b(very)g(r)o(ough.)25 +b(At)16 b(some)i(point,)h(we)e(hope)g(to)h(polish)g(it)g(up,)f(\002n-) +365 1582 y(ish)22 b(it)g(of)o(f,)f(and)g(r)o(e-typeset)f(it)i(using)g +(markup,)f(so)h(we)f(can)h(generate)e(html,)j(info)e(nodes,)365 +1682 y(and)30 b(T)573 1701 y(E)613 1682 y(X)g(output)g(fr)o(om)f(the)h +(single)h(sour)o(ce)e(without)i(having)f(to)g(deal)f(with)h(T)-8 +b(exinfo.)365 1782 y(But)21 b(it's)g(all)g(ther)o(e)f(is,)h(for)f(now) +-8 b(.)365 2087 y Fy(1.4)99 b(Naming)25 b(conventions)365 2315 y FD(Scsh)18 b(follows)h(a)f(general)f(naming)i(scheme)f(that)g (consistently)i(employs)f(a)e(set)i(of)f(abbr)o(e-)365 2414 y(viations.)40 b(This)26 b(is)f(intended)g(to)h(make)f(it)g @@ -2295,26 +1482,27 @@ b(.)365 2087 y Fy(1.4)99 b(Naming)25 b(conventions)365 b(,\224)31 b(a)e(small)i(integer)f(used)g(in)h(Unix)f(to)g(r)o(epr)o (esent)f(I/O)573 2822 y(channels.)365 3003 y FA(...*)40 b FD(A)26 b(given)h(bit)g(of)g(functionality)h(sometimes)f(comes)h(in)f -(two)g(r)o(elated)e(forms,)j(the)573 3102 y(\002rst)f(being)f(a)g -FC(special)h(form)f FD(that)g(contains)h(a)f(body)h(of)f(Scheme)g(code) -h(to)f(be)h(exe-)573 3202 y(cuted)f(in)h(some)g(context,)i(and)d(the)h -(other)f(being)h(a)g FC(pr)o(ocedur)o(e)e FD(that)i(takes)f(a)g(pr)o -(o-)573 3302 y(cedural)c(ar)o(gument)h(\(a)f(\223thunk\224\))h(to)h(be) -f(called)f(in)i(the)g(same)f(context.)33 b(The)23 b(pr)o(o-)573 -3401 y(cedur)o(e)e(variant)g(is)i(named)f(by)g(taking)h(the)f(name)h -(of)f(the)g(special)g(form,)h(and)f(ap-)573 3501 y(pending)f(an)g -(asterisk.)k(For)c(example:)756 3681 y FA(;;;)42 b(Special)f(form:)756 -3781 y(\(with-cwd)e("/etc")843 3881 y(\(for-each)h(print-file)f -(\(directory-files)o(\)\))843 3980 y(\(display)h("All)i(done"\)\))756 -4179 y(;;;)g(Procedure:)756 4279 y(\(with-cwd*)d("/etc")843 -4379 y(\(lambda)h(\(\))930 4478 y(\(for-each)g(print-file)f -(\(directory-files\))o(\))930 4578 y(\(display)h("All)i(done"\)\)\))365 -4799 y FC(action)p FA(/)p FC(modi\002er)e FD(The)e(in\002x)h(\223)p -FA(/)p FD(\224)e(is)h(pr)o(onounced)g(\223with,\224)43 -b(as)37 b(in)i FA(exec/env)p FD(\227\223exec)573 4898 -y(with)21 b(envir)o(onment.\224)1777 5147 y(3)p eop -%%Page: 4 10 -4 9 bop 681 614 a FA(call/...)38 b FD(Pr)o(ocedur)o(es)30 +(two)g(r)o(elated)e(forms,)j(the)573 3102 y(\002rst)18 +b(being)h(a)f FC(special)g(form)g FD(that)g(contains)h(a)f(body)h(of)f +(Scheme)g(code)g(to)h(be)f(execut-)573 3202 y(ed)j(in)i(some)f +(context,)g(and)g(the)g(other)g(being)g(a)f FC(pr)o(ocedur)o(e)g +FD(that)h(takes)g(a)f(pr)o(ocedu-)573 3302 y(ral)e(ar)o(gument)h(\(a)f +(\223thunk\224\))h(to)g(be)g(called)f(in)i(the)f(same)g(context.)25 +b(The)c(pr)o(ocedur)o(e)573 3401 y(variant)g(is)h(named)f(by)g(taking)h +(the)g(name)g(of)f(the)h(special)f(form,)h(and)f(appending)573 +3501 y(an)f(asterisk.)26 b(For)21 b(example:)756 3681 +y FA(;;;)42 b(Special)f(form:)756 3781 y(\(with-cwd)e("/etc")843 +3881 y(\(for-each)h(print-file)f(\(directory-files)o(\)\))843 +3980 y(\(display)h("All)i(done"\)\))756 4179 y(;;;)g(Procedure:)756 +4279 y(\(with-cwd*)d("/etc")843 4379 y(\(lambda)h(\(\))930 +4478 y(\(for-each)g(print-file)f(\(directory-files\))o(\))930 +4578 y(\(display)h("All)i(done"\)\)\))365 4799 y FC(action)p +FA(/)p FC(modi\002er)e FD(The)e(in\002x)h(\223)p FA(/)p +FD(\224)e(is)h(pr)o(onounced)g(\223with,\224)43 b(as)37 +b(in)i FA(exec/env)p FD(\227\223exec)573 4898 y(with)21 +b(envir)o(onment.\224)1777 5147 y(3)p eop +%%Page: 4 12 +4 11 bop 681 614 a FA(call/...)38 b FD(Pr)o(ocedur)o(es)30 b(that)i(call)g(their)g(ar)o(gument)g(on)g(some)h(computed)f(value)f (ar)o(e)888 714 y(usually)21 b(named)f(\223)p FA(call/...)p FD(,\224)c FC(e.g.)o FD(,)k FA(\(call/fdes)40 b FC(port)j(pr)o(oc)o @@ -2334,11 +1522,11 @@ b(These)22 b(forms)g(set)g(the)g(pr)o(ocess)f(envir)o(onment)h(body)-9 b(,)888 1481 y(execute)22 b(their)i(body)f(or)g(thunk,)h(and)f(then)g (r)o(eturn)g(after)e(r)o(esetting)i(the)g(envir)o(on-)888 1581 y(ment)f(to)f(its)g(original)g(state.)681 1750 y -FA(create-)38 b FD(Pr)o(ocedur)o(es)d(that)i(cr)o(eate)e(objects)i(in)g -(the)g(\002le)g(system)g(\(\002les,)j(dir)o(ectories,)888 -1849 y(temp)21 b(\002les,)g(\002fos,)g FC(etc.)p FD(\),)f(begin)h(with) -g FA(create-...)p FD(.)681 2019 y FA(delete-)38 b FD(Pr)o(ocedur)o(es) -24 b(that)g(delete)g(objects)h(fr)o(om)g(the)f(\002le)h(system)h +FA(create-)38 b FD(Pr)o(ocedur)o(es)15 b(that)i(cr)o(eate)d(objects)j +(in)g(the)g(\002le)f(system)h(\(\002les,)g(dir)o(ectories,)f(tem-)888 +1849 y(p)21 b(\002les,)g(\002fos,)g FC(etc.)p FD(\),)e(begin)i(with)h +FA(create-...)p FD(.)681 2019 y FA(delete-)38 b FD(Pr)o(ocedur)o(es)24 +b(that)g(delete)g(objects)h(fr)o(om)g(the)f(\002le)h(system)h (\(\002les,)f(dir)o(ectories,)888 2118 y(temp)c(\002les,)g(\002fos,)g FC(etc.)p FD(\),)f(begin)h(with)g FA(delete-...)p FD(.)702 2287 y FC(r)o(ecord)o FA(:)p FC(\002eld)62 b FD(Pr)o(ocedur)o(es)22 @@ -2370,8 +1558,8 @@ e(dif)o(fers)g(fr)o(om)g(R4RS)h(Scheme)f(in)h(the)g(following)i(ways:) (eserved)d(by)j FA(read)e FD(and)h(is)g(signi\002cant)i(on)f(symbol)888 4756 y(comparison.)e(This)21 b(means)1071 4898 y FA(\(run)42 b(\(less)f(Readme\)\))2092 5147 y FD(4)p eop -%%Page: 5 11 -5 10 bop 573 614 a FD(displays)21 b(the)g(right)g(\002le.)490 +%%Page: 5 13 +5 12 bop 573 614 a FD(displays)21 b(the)g(right)g(\002le.)490 798 y Fw(\017)41 b FD(\223)p FA(-)p FD(\224)16 b(and)h(\223)p FA(+)p FD(\224)e(ar)o(e)h(allowed)h(to)h(begin)g(symbols.)25 b(So)17 b(the)h(following)h(ar)o(e)c(legitimate)573 897 @@ -2396,9 +1584,9 @@ y FA(#!/usr/local/bin)o(/s)o(csh)37 b(-s)365 3281 y FD(The)30 b(Unix)g(operating)g(system)g(tr)o(eats)f(sour)o(ce)g(\002les)h (beginning)h(with)g(the)f(headers)f(of)365 3381 y(this)23 b(form)f(specially;)h(they)f(can)g(be)g(dir)o(ectly)f(executed)g(by)h -(the)g(operating)g(system)h(\(see)365 3480 y(chapter)32 -b(9)g(for)h(information)h(on)f(how)h(to)f(use)f(this)i(featur)o(e\).)59 -b(The)33 b(scsh)g(interpr)o(eter)365 3580 y(ignor)o(es)c(this)g +(the)g(operating)g(system)h(\(see)365 3480 y(chapter)29 +b(10)g(for)h(information)g(on)h(how)f(to)g(use)g(this)h(featur)o(e\).) +50 b(The)30 b(scsh)g(interpr)o(eter)365 3580 y(ignor)o(es)f(this)g (special)f(header)f(by)i(tr)o(eating)f FA(#!)f FD(as)i(a)e(comment)j (marker)e(similar)g(to)h FA(;)p FD(.)365 3679 y(When)18 b(the)g(scsh)g(r)o(eader)d(encounters)j FA(#!)p FD(,)f(it)h(skips)g @@ -2418,8 +1606,8 @@ b(ar)o(e)365 4799 y(two)22 b(kinds)f(of)g(her)o(e-string,)f(character)o (-delimited)e(and)i(line-delimited;)h(they)g(ar)o(e)e(both)365 4898 y(intr)o(oduced)h(by)h(the)g FA(#<)f FD(sequence.)1777 5147 y(5)p eop -%%Page: 6 12 -6 11 bop 681 614 a FB(Character)o(-delimited)15 b(here-strings)681 +%%Page: 6 14 +6 13 bop 681 614 a FB(Character)o(-delimited)15 b(here-strings)681 821 y FD(A)20 b FC(character-delimited)f FD(her)o(e-string)h(has)h(the) g(form)888 988 y FA(#<)p Fu(x)p FA(...stuff...)p Fu(x)681 1155 y FD(wher)o(e)i FC(x)g FD(is)h(any)f(single)h(character)e @@ -2452,8 +1640,8 @@ b(the)g(same)f(thing)i(as)888 4489 y FA("Hello,)41 b(world.")805 b(as)g(long,)i(multi-line)f FA(format)29 b FD(strings,)36 b(or)d(ar)o(guments)f(to)h(Unix)f(pr)o(o-)681 4898 y(grams,)20 b FC(e.g.)p FD(,)2092 5147 y(6)p eop -%%Page: 7 13 -7 12 bop 573 614 a FA(;;)43 b(Free)f(up)g(some)g(disk)g(space)g(for)g +%%Page: 7 15 +7 14 bop 573 614 a FA(;;)43 b(Free)f(up)g(some)g(disk)g(space)g(for)g (my)h(netnews)d(files.)573 714 y(\(run)i(\(csh)g(-c)g(#<)g FC([fdes])g (\002le-name)p FA(\))209 b(;)43 b(Open)f(file)g(create/truncate.)888 3822 y(\(<<)h FC([fdes])g(object)p FA(\))280 b(;)43 b(Use)g @@ -2643,15 +1831,16 @@ b(;)43 b(0,1,2)f(dup'd)f(from)h(standard)f(ports.)681 4368 y FD(The)26 b(input)h(r)o(edir)o(ections)e(default)g(to)h(\002le)h (descriptor)f(0;)i(the)e(output)h(r)o(edir)o(ections)e(de-)681 4468 y(fault)20 b(to)h(\002le)g(descriptor)f(1.)805 4599 -y(The)42 b(subforms)g(of)f(a)g(r)o(edir)o(ection)g(ar)o(e)f(implicitly) -i(backquoted,)47 b(and)41 b(symbols)681 4699 y(stand)e(for)h(their)g -(print-names.)82 b(So)40 b FA(\(>)i(,x\))d FD(means)h(\223output)g(to)g -(the)g(\002le)f(named)681 4799 y(by)h(Scheme)f(variable)g -FA(x)p FD(,\224)44 b(and)39 b FA(\(<)k(/usr/shivers/.lo)o(gi)o(n\))34 -b FD(means)40 b(\223r)o(ead)d(fr)o(om)681 4898 y FA(/usr/shivers/.lo)o -(gi)o(n)p FD(.\224)2071 5147 y(10)p eop -%%Page: 11 17 -11 16 bop 490 614 a FD(Her)o(e)19 b(ar)o(e)h(two)h(mor)o(e)g(examples)f +y(The)32 b(subforms)f(of)h(a)f(r)o(edir)o(ection)f(ar)o(e)g(implicitly) +i(backquoted,)i(and)d(symbols)h(s-)681 4699 y(tand)42 +b(for)g(their)h(print-names.)90 b(So)42 b FA(\(>)h(,x\))e +FD(means)i(\223output)f(to)h(the)g(\002le)f(named)681 +4799 y(by)e(Scheme)f(variable)g FA(x)p FD(,\224)44 b(and)39 +b FA(\(<)k(/usr/shivers/.lo)o(gi)o(n\))34 b FD(means)40 +b(\223r)o(ead)d(fr)o(om)681 4898 y FA(/usr/shivers/.lo)o(gi)o(n)p +FD(.\224)2071 5147 y(10)p eop +%%Page: 11 19 +11 18 bop 490 614 a FD(Her)o(e)19 b(ar)o(e)h(two)h(mor)o(e)g(examples)f (of)h(i/o)g(r)o(edir)o(ection:)1318 800 y FA(\(<)43 b(,\(vector-ref)38 b(fv)43 b(i\)\))1318 900 y(\(>>)f(2)h(/tmp/buf\))365 1083 y FD(These)j(two)g(r)o(edir)o(ections)e(cause)h(the)h(\002le)f @@ -2705,17 +1894,17 @@ b(example,)365 4799 y(many)27 b(Scheme)e(implementations)j(pr)o(ovide)d 4898 y(lect)36 b(characters)f(sent)h(to)g(them)g(into)h(memory)g(buf)o (fers.)69 b(The)36 b(accumulated)f(string)1758 5147 y(1)-5 b(1)p eop -%%Page: 12 18 -12 17 bop 681 614 a FD(can)41 b(later)h(be)f(r)o(etrieved)g(fr)o(om)g +%%Page: 12 20 +12 19 bop 681 614 a FD(can)41 b(later)h(be)f(r)o(etrieved)g(fr)o(om)g (the)h(port)g(as)g(a)g(string.)90 b(If)41 b(a)h(user)f(wer)o(e)h(to)g -(bind)681 714 y FA(\(current-output-)o(po)o(rt\))24 b -FD(to)32 b(such)g(a)f(port,)j(it)d(would)h(be)f(impossible)i(to)e -(associate)681 814 y(\002le)26 b(descriptor)g(1)g(with)g(this)h(port,)h -(as)e(it)g(cannot)h(be)e(r)o(epr)o(esented)f(in)j(Unix.)42 -b(So,)27 b(if)f(the)681 913 y(user)j(subsequently)i(forked)e(of)o(f)g -(some)h(other)g(pr)o(ogram)f(as)g(a)g(subpr)o(ocess,)i(that)f(pr)o(o-) -681 1013 y(gram)20 b(would)i(of)e(course)h(not)h(see)e(the)h(Scheme)f -(string)i(port)f(as)f(its)h(standar)o(d)e(output.)805 +(bind)681 714 y FA(\(current-output-)o(po)o(rt\))11 b +FD(to)19 b(such)g(a)f(port,)g(it)h(would)g(be)f(impossible)h(to)g +(associate)f(\002le)681 814 y(descriptor)26 b(1)f(with)i(this)g(port,)h +(as)e(it)g(cannot)h(be)f(r)o(epr)o(esented)e(in)j(Unix.)41 +b(So,)28 b(if)e(the)g(us-)681 913 y(er)c(subsequently)h(forked)f(of)o +(f)g(some)h(other)f(pr)o(ogram)g(as)g(a)g(subpr)o(ocess,)g(that)h(pr)o +(ogram)681 1013 y(would)e(of)g(course)g(not)g(see)g(the)f(Scheme)h +(string)g(port)g(as)g(its)g(standar)o(d)e(output.)805 1157 y(T)-8 b(o)32 b(keep)f(stdio)h(synced)g(with)g(the)f(values)g(of)h (Scheme's)f(curr)o(ent)g(i/o)h(ports,)i(use)681 1257 y(the)25 b(special)g(r)o(edir)o(ection)f FA(stdports)p @@ -2769,8 +1958,8 @@ b(T)-8 b(o)24 b(aid)g(this)h(purpose,)g(scsh)g(r)o(eads)e(symbols)681 4729 y(in)e(a)f(case-sensitive)h(manner)-6 b(,)20 b(so)h(that)g(you)g (can)g(say)888 4898 y FA(\(more)42 b(Readme\))2071 5147 y FD(12)p eop -%%Page: 13 19 -13 18 bop 365 614 a FD(and)21 b(get)f(the)h(right)h(\002le.)490 +%%Page: 13 21 +13 20 bop 365 614 a FD(and)21 b(get)f(the)h(right)h(\002le.)490 739 y(A)31 b FC(connect-list)g FD(is)h(a)g(speci\002cation)g(of)f(how)i (two)f(pr)o(ocesses)g(ar)o(e)e(to)i(be)g(wir)o(ed)f(to-)365 839 y(gether)22 b(by)h(pipes.)30 b(It)22 b(has)g(the)h(form)f @@ -2841,8 +2030,8 @@ b Fw(\021)83 b FA(\(fork)41 b(\()p Fo(\025)e FA(\(\))k(\(exec-epf)d(.)j FC(epf)p FA(\)\)\))756 4868 y(\(run)e(.)j FC(epf)o FA(\))83 b Fw(\021)g FA(\(wait)41 b(\(&)i(.)g FC(epf)p FA(\)\))1756 5147 y FD(13)p eop -%%Page: 14 20 -14 19 bop 681 614 a FB(2.3.1)81 b(Procedures)19 b(and)h(special)f +%%Page: 14 22 +14 21 bop 681 614 a FB(2.3.1)81 b(Procedures)19 b(and)h(special)f (forms)681 931 y FD(It)33 b(is)g(a)f(general)g(design)i(principle)e(in) i(scsh)f(that)g(all)g(functionality)g(made)f(available)681 1030 y(thr)o(ough)25 b(special)e(syntax)i(is)f(also)h(available)e(in)i @@ -2890,8 +2079,8 @@ y(stdout)22 b(in)f(some)g(form)g(or)g(another)-6 b(.)25 b(The)c(subpr)o(ocess)g(r)o(uns)g(with)h(\002le)e(descriptor)888 4898 y(1)h(and)f(the)h(curr)o(ent)f(output)h(port)g(bound)g(to)g(a)f (pipe.)2071 5147 y(14)p eop -%%Page: 15 21 -15 20 bop 805 636 a FA(run/port)227 b FD(V)-8 b(alue)18 +%%Page: 15 23 +15 22 bop 805 636 a FA(run/port)227 b FD(V)-8 b(alue)18 b(is)h(a)f(port)g(open)h(on)f(pr)o(ocess's)g(stdout.)25 b(Re-)1384 736 y(turns)d(immediately)e(after)g(forking)h(child.)805 885 y FA(run/file)227 b FD(V)-8 b(alue)22 b(is)f(name)h(of)f(a)g(temp)g @@ -2906,107 +2095,112 @@ b FD(Reads)33 b(a)g(single)g(object)h(fr)o(om)e(pr)o(ocess')h(stdout) 1384 1732 y(with)44 b FA(read)p FD(.)88 b(Returns)44 b(as)e(soon)h(as)f(the)h(r)o(ead)1384 1831 y(completes.)805 1981 y FA(run/sexps)183 b FD(Repeatedly)25 b(r)o(eads)f(objects)i(fr)o -(om)f(pr)o(ocess')g(std-)1384 2081 y(out)41 b(with)g -FA(read)p FD(.)83 b(Returns)41 b(accumulated)f(list)1384 -2180 y(upon)22 b(eof.)609 2333 y(The)37 b(delimiting)g(newlines)g(ar)o -(e)e(not)i(included)g(in)f(the)h(strings)g(r)o(eturned)e(by)573 -2432 y FA(run/strings)p FD(.)573 2561 y(These)17 b(special)g(forms)h +(om)f(pr)o(ocess')g(std-)1384 2081 y(out)20 b(with)f +FA(read)p FD(.)k(Returns)d(accumulated)d(list)j(up-)1384 +2180 y(on)i(eof.)609 2340 y(The)37 b(delimiting)g(newlines)g(ar)o(e)e +(not)i(included)g(in)f(the)h(strings)g(r)o(eturned)e(by)573 +2440 y FA(run/strings)p FD(.)573 2575 y(These)17 b(special)g(forms)h (just)g(expand)f(into)h(calls)f(to)h(the)f(following)i(analogous)f(pr)o -(o-)573 2661 y(cedur)o(es.)365 2840 y FA(\(run/port*)40 +(o-)573 2675 y(cedur)o(es.)365 2875 y FA(\(run/port*)40 b FC(thunk)p FA(\))86 b Fw(\000)-14 b(!)87 b FC(port)1321 -b FD(pr)o(ocedur)o(e)365 2939 y FA(\(run/file*)40 b FC(thunk)p +b FD(pr)o(ocedur)o(e)365 2975 y FA(\(run/file*)40 b FC(thunk)p FA(\))86 b Fw(\000)-14 b(!)87 b FC(string)1257 b FD(pr)o(ocedur)o(e)365 -3039 y FA(\(run/string*)39 b FC(thunk)p FA(\))86 b Fw(\000)-14 -b(!)87 b FC(string)1170 b FD(pr)o(ocedur)o(e)365 3138 +3074 y FA(\(run/string*)39 b FC(thunk)p FA(\))86 b Fw(\000)-14 +b(!)87 b FC(string)1170 b FD(pr)o(ocedur)o(e)365 3174 y FA(\(run/strings*)39 b FC(thunk)p FA(\))86 b Fw(\000)-14 b(!)87 b FC(string)21 b(list)999 b FD(pr)o(ocedur)o(e)365 -3238 y FA(\(run/sexp*)40 b FC(thunk)p FA(\))86 b Fw(\000)-14 -b(!)87 b FC(object)1268 b FD(pr)o(ocedur)o(e)365 3338 +3274 y FA(\(run/sexp*)40 b FC(thunk)p FA(\))86 b Fw(\000)-14 +b(!)87 b FC(object)1268 b FD(pr)o(ocedur)o(e)365 3373 y FA(\(run/sexps*)39 b FC(thunk)p FA(\))87 b Fw(\000)-14 b(!)87 b FC(object)21 b(list)1097 b FD(pr)o(ocedur)o(e)573 -3471 y(For)21 b(example,)f FA(\(run/port)40 b(.)j FC(epf)p -FA(\))20 b FD(expands)g(into)756 3609 y FA(\(run/port*)39 +3517 y(For)21 b(example,)f FA(\(run/port)40 b(.)j FC(epf)p +FA(\))20 b FD(expands)g(into)756 3663 y FA(\(run/port*)39 b(\()p Fo(\025)g FA(\(\))j(\(exec-epf)e(.)j FC(epf)p -FA(\)\)\).)490 3827 y FD(The)35 b(following)i(pr)o(ocedur)o(es)d(ar)o +FA(\)\)\).)490 3904 y FD(The)35 b(following)i(pr)o(ocedur)o(es)d(ar)o (e)g(also)i(of)f(utility)i(for)e(generally)g(parsing)h(input)365 -3927 y(str)o(eams)20 b(in)i(scsh:)365 4068 y FA(\(port->string)39 +4004 y(str)o(eams)20 b(in)i(scsh:)365 4156 y FA(\(port->string)39 b FC(port)p FA(\))86 b Fw(\000)-15 b(!)88 b FC(string)1186 -b FD(pr)o(ocedur)o(e)365 4167 y FA(\(port->sexp-list)37 +b FD(pr)o(ocedur)o(e)365 4256 y FA(\(port->sexp-list)37 b FC(port)p FA(\))86 b Fw(\000)-14 b(!)87 b FC(list)1153 -b FD(pr)o(ocedur)o(e)365 4267 y FA(\(port->string-lis)o(t)37 +b FD(pr)o(ocedur)o(e)365 4356 y FA(\(port->string-lis)o(t)37 b FC(port)p FA(\))87 b Fw(\000)-15 b(!)87 b FC(string)21 -b(list)842 b FD(pr)o(ocedur)o(e)365 4367 y FA(\(port->list)39 +b(list)842 b FD(pr)o(ocedur)o(e)365 4455 y FA(\(port->list)39 b FC(r)o(eader)21 b(port)p FA(\))86 b Fw(\000)-14 b(!)87 -b FC(list)1144 b FD(pr)o(ocedur)o(e)573 4500 y FA(Port->string)32 +b FC(list)1144 b FD(pr)o(ocedur)o(e)573 4599 y FA(Port->string)32 b FD(r)o(eads)37 b(the)g(port)h(until)g(eof,)k(then)c(r)o(eturns)f(the) -h(accumulated)573 4599 y(string.)46 b FA(Port->sexp-list)21 +h(accumulated)573 4699 y(string.)46 b FA(Port->sexp-list)21 b FD(r)o(epeatedly)k(r)o(eads)h(data)g(fr)o(om)h(the)h(port)f(until)h -(eof,)573 4699 y(then)g(r)o(eturns)f(the)h(accumulated)e(list)j(of)e -(items.)47 b FA(Port->string-lis)o(t)22 b FD(r)o(epeat-)573 -4799 y(edly)30 b(r)o(eads)f(newline-terminated)h(strings)h(fr)o(om)f -(the)g(port)h(until)g(eof,)h(then)f(r)o(e-)573 4898 y(turns)h(the)f -(accumulated)f(list)i(of)g(strings.)58 b(The)31 b(delimiting)i -(newlines)f(ar)o(e)e(not)1756 5147 y(15)p eop -%%Page: 16 22 -16 21 bop 888 614 a FD(part)39 b(of)h(the)g(r)o(eturned)e(strings.)83 -b FA(Port->list)35 b FD(generalises)40 b(these)g(two)g(pr)o(o-)888 -714 y(cedur)o(es.)70 b(It)35 b(uses)h FC(r)o(eader)g -FD(to)g(r)o(epeatedly)e(r)o(ead)g(objects)j(fr)o(om)e(a)h(port.)70 -b(It)36 b(ac-)888 814 y(cumulates)h(these)h(objects)f(into)h(a)f(list,) -k(which)d(is)f(r)o(eturned)f(upon)i(eof.)74 b(The)888 -913 y FA(port->string-list)20 b FD(and)26 b FA(port->sexp-list)21 -b FD(pr)o(ocedur)o(es)k(ar)o(e)g(trivial)i(to)g(de-)888 -1013 y(\002ne,)21 b(being)g(mer)o(ely)f FA(port->list)d -FD(curried)j(with)i(the)e(appr)o(opriate)f(parsers:)1071 -1212 y FA(\(port->string-li)o(st)37 b FC(port)o FA(\))44 -b Fw(\021)f FA(\(port->list)c(read-line)h FC(port)o FA(\))1071 -1312 y(\(port->sexp-list)124 b FC(port)o FA(\))44 b Fw(\021)f -FA(\(port->list)c(read)j FC(port)o FA(\))888 1512 y FD(The)21 -b(following)h(compositions)h(also)e(hold:)1071 1711 y -FA(run/string*)126 b Fw(\021)87 b FA(port->string)256 -b Fw(\016)44 b FA(run/port*)1071 1811 y(run/strings*)82 +(eof,)573 4799 y(then)18 b(r)o(eturns)f(the)h(accumulated)f(list)i(of)e +(items.)25 b FA(Port->string-list)11 b FD(r)o(epeated-)573 +4898 y(ly)23 b(r)o(eads)f(newline-terminated)g(strings)i(fr)o(om)f(the) +g(port)g(until)h(eof,)f(then)g(r)o(eturns)1756 5147 y(15)p +eop +%%Page: 16 24 +16 23 bop 888 614 a FD(the)27 b(accumulated)f(list)h(of)f(strings.)44 +b(The)27 b(delimiting)g(newlines)h(ar)o(e)d(not)i(part)f(of)888 +714 y(the)31 b(r)o(eturned)e(strings.)55 b FA(Port->list)27 +b FD(generalises)j(these)g(two)h(pr)o(ocedur)o(es.)53 +b(It)888 814 y(uses)28 b FC(r)o(eader)f FD(to)h(r)o(epeatedly)d(r)o +(ead)h(objects)i(fr)o(om)f(a)g(port.)45 b(It)27 b(accumulates)g(these) +888 913 y(objects)g(into)g(a)e(list,)j(which)f(is)f(r)o(eturned)f(upon) +h(eof.)41 b(The)26 b FA(port->string-lis)o(t)888 1013 +y FD(and)42 b FA(port->sexp-list)35 b FD(pr)o(ocedur)o(es)40 +b(ar)o(e)g(trivial)h(to)h(de\002ne,)47 b(being)42 b(mer)o(ely)888 +1112 y FA(port->list)17 b FD(curried)j(with)h(the)g(appr)o(opriate)e +(parsers:)1071 1270 y FA(\(port->string-li)o(st)37 b +FC(port)o FA(\))44 b Fw(\021)f FA(\(port->list)c(read-line)h +FC(port)o FA(\))1071 1369 y(\(port->sexp-list)124 b FC(port)o +FA(\))44 b Fw(\021)f FA(\(port->list)c(read)j FC(port)o +FA(\))888 1527 y FD(The)21 b(following)h(compositions)h(also)e(hold:) +1071 1684 y FA(run/string*)126 b Fw(\021)87 b FA(port->string)256 +b Fw(\016)44 b FA(run/port*)1071 1784 y(run/strings*)82 b Fw(\021)87 b FA(port->string-lis)o(t)37 b Fw(\016)44 -b FA(run/port*)1071 1910 y(run/sexp*)214 b Fw(\021)87 -b FA(read)608 b Fw(\016)44 b FA(run/port*)1071 2010 y(run/sexps*)170 +b FA(run/port*)1071 1883 y(run/sexp*)214 b Fw(\021)87 +b FA(read)608 b Fw(\016)44 b FA(run/port*)1071 1983 y(run/sexps*)170 b Fw(\021)87 b FA(port->sexp-list)124 b Fw(\016)44 b -FA(run/port*)681 2376 y(\(reduce-port)38 b FC(port)20 -b(r)o(eader)h(op)f(.)h(seeds)p FA(\))87 b Fw(\000)-14 -b(!)87 b FC(object)2488 2346 y Fm(\003)3170 2376 y FD(pr)o(ocedur)o(e) -888 2534 y(This)28 b(pr)o(ocedur)o(e)d(can)h(be)h(used)f(to)i(perform)e -(a)h(variety)f(of)h(iterative)f(operations)888 2633 y(over)32 -b(an)f(input)h(str)o(eam.)57 b(It)32 b(r)o(epeatedly)d(uses)j -FC(r)o(eader)f FD(to)h(r)o(ead)e(an)i(object)f(fr)o(om)888 -2733 y FC(port)p FD(.)40 b(If)25 b(the)h(\002rst)g(r)o(ead)e(r)o -(eturns)h(eof,)h(then)g(the)g(entir)o(e)f FA(reduce-port)c -FD(operation)888 2833 y(r)o(eturns)28 b(the)g(seeds)g(as)g(multiple)h -(values.)48 b(If)28 b(the)g(\002rst)h(r)o(ead)d(operation)j(r)o(eturns) -888 2932 y(some)20 b(other)g(value)e Fo(v)s FD(,)i(then)g -FC(op)e FD(is)i(applied)e(to)i Fo(v)j FD(and)18 b(the)i(seeds:)k -FA(\()p FC(op)43 b(v)g FA(.)g FC(seeds)q FA(\))p FD(.)888 -3032 y(This)18 b(should)g(r)o(eturn)f(a)f(new)i(set)f(of)g(seed)g -(values,)g(and)g(the)g(r)o(eduction)g(then)g(loops,)888 -3132 y(r)o(eading)k(a)f(new)i(value)f(fr)o(om)g(the)g(port,)g(and)g(so) -h(forth.)27 b(\(If)21 b(multiple)h(seed)e(values)888 -3231 y(ar)o(e)g(used,)g(then)h FC(op)f FD(must)i(r)o(eturn)e(multiple)h -(values.\))888 3381 y(For)g(example,)f FA(\(port->list)39 -b FC(r)o(eader)44 b(port)o FA(\))20 b FD(could)h(be)g(de\002ned)f(as) -1071 3559 y FA(\(reverse)40 b(\(reduce-port)f FC(port)k(r)o(eader)g -FA(cons)f('\(\)\)\))888 3786 y FD(An)25 b(imperative)f(way)g(to)h(look) -g(at)f FA(reduce-port)c FD(is)25 b(to)g(say)f(that)h(it)f(abstracts)g -(the)888 3886 y(idea)k(of)h(a)f(loop)h(over)g(a)f(str)o(eam)f(of)i -(values)f(r)o(ead)f(fr)o(om)h(some)h(port,)i(wher)o(e)d(the)888 -3986 y(seed)21 b(values)f(expr)o(ess)g(the)h(loop)g(state.)681 -4352 y Fy(2.4)99 b(More)24 b(complex)h(process)h(operations)681 -4599 y FD(The)21 b(pr)o(ocedur)o(es)e(and)h(special)g(forms)h(in)h(the) -f(pr)o(evious)f(section)h(pr)o(ovide)f(for)h(the)g(com-)681 +FA(run/port*)681 2235 y(\(port-fold)39 b FC(port)20 b(r)o(eader)h(op)f +(.)h(seeds)p FA(\))87 b Fw(\000)-14 b(!)87 b FC(object)2401 +2205 y Fm(\003)3170 2235 y FD(pr)o(ocedur)o(e)888 2367 +y(This)28 b(pr)o(ocedur)o(e)d(can)h(be)h(used)f(to)i(perform)e(a)h +(variety)f(of)h(iterative)f(operations)888 2467 y(over)19 +b(an)f(input)h(str)o(eam.)24 b(It)18 b(r)o(epeatedly)e(uses)j +FC(r)o(eader)g FD(to)f(r)o(ead)f(an)h(object)h(fr)o(om)f +FC(port)o FD(.)888 2567 y(If)25 b(the)h(\002rst)f(r)o(ead)f(r)o(eturns) +h(eof,)h(then)f(the)h(entir)o(e)e FA(port-fold)e FD(operation)k(r)o +(eturns)888 2666 y(the)17 b(seeds)g(as)f(multiple)h(values.)24 +b(If)16 b(the)h(\002rst)g(r)o(ead)e(operation)i(r)o(eturns)f(some)i +(other)888 2766 y(value)e Fo(v)s FD(,)i(then)f FC(op)f +FD(is)h(applied)e(to)i Fo(v)j FD(and)c(the)h(seeds:)23 +b FA(\()p FC(op)42 b(v)i FA(.)f FC(seeds)p FA(\))p FD(.)24 +b(This)17 b(should)888 2865 y(r)o(eturn)24 b(a)f(new)h(set)g(of)g(seed) +g(values,)g(and)f(the)h(r)o(eduction)g(then)g(loops,)i(r)o(eading)d(a) +888 2965 y(new)g(value)f(fr)o(om)f(the)i(port,)f(and)g(so)h(forth.)30 +b(\(If)21 b(multiple)i(seed)f(values)g(ar)o(e)f(used,)888 +3065 y(then)h FC(op)e FD(must)h(r)o(eturn)f(multiple)h(values.\))888 +3193 y(For)g(example,)f FA(\(port->list)39 b FC(r)o(eader)44 +b(port)o FA(\))20 b FD(could)h(be)g(de\002ned)f(as)1071 +3332 y FA(\(reverse)40 b(\(port-fold)g FC(port)j(r)o(eader)g +FA(cons)f('\(\)\)\))888 3499 y FD(An)31 b(imperative)g(way)g(to)h(look) +g(at)e FA(port-fold)e FD(is)j(to)h(say)f(that)g(it)h(abstracts)e(the) +888 3599 y(idea)e(of)h(a)f(loop)h(over)g(a)f(str)o(eam)f(of)i(values)f +(r)o(ead)f(fr)o(om)h(some)h(port,)i(wher)o(e)d(the)888 +3698 y(seed)21 b(values)f(expr)o(ess)g(the)h(loop)g(state.)1071 +3860 y Fl(Remark:)47 b Fk(This)15 b(pr)o(ocedur)o(e)d(was)k(formerly)c +(named)k Fj(reduce-port)41 b Fk(.)22 b(The)15 b(old)1071 +3951 y(binding)23 b(is)g(still)f(pr)o(ovided,)g(but)i(is)e(depr)o +(ecated)g(and)i(will)e(pr)o(obably)g(vanish)1071 4042 +y(in)d(a)g(futur)o(e)f(r)o(elease.)681 4385 y Fy(2.4)99 +b(More)24 b(complex)h(process)h(operations)681 4599 y +FD(The)21 b(pr)o(ocedur)o(es)e(and)h(special)g(forms)h(in)h(the)f(pr)o +(evious)f(section)h(pr)o(ovide)f(for)h(the)g(com-)681 4699 y(mon)27 b(case,)h(wher)o(e)e(the)g(pr)o(ogrammer)g(is)h(only)h (inter)o(ested)d(in)j(the)e(output)h(of)g(the)g(pr)o(o-)681 4799 y(cess.)37 b(These)24 b(special)g(forms)h(and)f(pr)o(ocedur)o(es)f (pr)o(ovide)h(mor)o(e)g(complicated)g(facilities)681 4898 y(for)c(manipulating)i(pr)o(ocesses.)2071 5147 y(16)p eop -%%Page: 17 23 -17 22 bop 365 614 a FB(2.4.1)81 b(Pids)20 b(and)g(ports)g(together)365 +%%Page: 17 25 +17 24 bop 365 614 a FB(2.4.1)81 b(Pids)20 b(and)g(ports)g(together)365 828 y FA(\(run/port+proc)38 b FC(.)21 b(epf)o FA(\))87 b Fw(\000)-14 b(!)87 b FC([port)20 b(pr)o(oc])1120 b FD(syntax)365 928 y FA(\(run/port+proc*)38 b FC(thunk)p @@ -3022,26 +2216,25 @@ b FD(pr)o(ocedur)o(e)573 1054 y(This)32 b(special)f(form)h(and)f(its)h b(pr)o(ocess)g(object)h(encapsulates)f(the)h(subpr)o(ocess')f(pr)o(o-) 573 1552 y(cess)e(id)f(and)h(exit)f(code;)g(it)h(is)g(the)g(value)g (passed)f(to)h(the)g FA(wait)e FD(system)i(call.)573 -1689 y(For)34 b(example,)i(to)e(uncompr)o(ess)g(a)f(tech)h(r)o(eport,)h -(r)o(eading)e(the)h(uncompr)o(essed)573 1788 y(data)21 -b(into)i(scsh,)g(and)f(also)g(be)g(able)f(to)i(track)f(the)g(exit)g -(status)g(of)g(the)h(decompr)o(es-)573 1888 y(sion)f(pr)o(ocess,)e(use) -g(the)h(following:)756 2062 y FA(\(receive)40 b(\(port)h(child\))g -(\(run/port+proc)d(\(zcat)k(tr91-145.tex.Z\))o(\))843 -2161 y(\(let*)f(\(\(paper)g(\(port->string)d(port\)\))1148 -2261 y(\(status)i(\(wait)i(child\)\)\))930 2361 y FD(.)12 -b(.)g(.)g(use)21 b FA(paper)p FD(,)e FA(status)p FD(,)f(and)i -FA(child)f FD(her)o(e.)12 b(.)g(.)g FA(\)\))573 2535 -y FD(Note)23 b(that)g(you)g(must)h FC(\002rst)f FD(do)g(the)g -FA(port->string)18 b FD(and)k FC(then)g FD(do)h(the)g(wait\227the)573 -2634 y(other)33 b(way)f(ar)o(ound)g(may)h(lock)g(up)g(when)g(the)g -(zcat)f(\002lls)h(up)g(its)g(output)g(pipe)573 2734 y(buf)o(fer)-6 -b(.)365 3018 y FB(2.4.2)81 b(Multiple)19 b(stream)g(capture)365 -3209 y FD(Occasionally)-9 b(,)46 b(the)40 b(pr)o(ogrammer)g(may)h(want) -f(to)h(captur)o(e)e(multiple)i(distinct)g(out-)365 3308 -y(put)35 b(str)o(eams)e(fr)o(om)h(a)g(pr)o(ocess.)66 -b(For)35 b(instance,)i(he)e(may)f(wish)h(to)g(r)o(ead)e(the)h(stdout) -365 3408 y(and)e(stderr)g(str)o(eams)g(into)h(two)g(distinct)g +1689 y(For)e(example,)f(to)i(uncompr)o(ess)f(a)f(tech)h(r)o(eport,)f(r) +o(eading)g(the)h(uncompr)o(essed)g(da-)573 1788 y(ta)g(into)i(scsh,)f +(and)g(also)g(be)f(able)h(to)g(track)f(the)h(exit)g(status)g(of)f(the)h +(decompr)o(ession)573 1888 y(pr)o(ocess,)g(use)h(the)g(following:)756 +2062 y FA(\(receive)40 b(\(port)h(child\))g(\(run/port+proc)d(\(zcat)k +(tr91-145.tex.Z\))o(\))843 2161 y(\(let*)f(\(\(paper)g(\(port->string)d +(port\)\))1148 2261 y(\(status)i(\(wait)i(child\)\)\))930 +2361 y FD(.)12 b(.)g(.)g(use)21 b FA(paper)p FD(,)e FA(status)p +FD(,)f(and)i FA(child)f FD(her)o(e.)12 b(.)g(.)g FA(\)\))573 +2535 y FD(Note)23 b(that)g(you)g(must)h FC(\002rst)f +FD(do)g(the)g FA(port->string)18 b FD(and)k FC(then)g +FD(do)h(the)g(wait\227the)573 2634 y(other)33 b(way)f(ar)o(ound)g(may)h +(lock)g(up)g(when)g(the)g(zcat)f(\002lls)h(up)g(its)g(output)g(pipe)573 +2734 y(buf)o(fer)-6 b(.)365 3018 y FB(2.4.2)81 b(Multiple)19 +b(stream)g(capture)365 3209 y FD(Occasionally)-9 b(,)46 +b(the)40 b(pr)o(ogrammer)g(may)h(want)f(to)h(captur)o(e)e(multiple)i +(distinct)g(out-)365 3308 y(put)35 b(str)o(eams)e(fr)o(om)h(a)g(pr)o +(ocess.)66 b(For)35 b(instance,)i(he)e(may)f(wish)h(to)g(r)o(ead)e(the) +h(stdout)365 3408 y(and)e(stderr)g(str)o(eams)g(into)h(two)g(distinct)g (strings.)61 b(This)33 b(is)g(accomplished)f(with)h(the)365 3508 y FA(run/collecting)15 b FD(form)21 b(and)f(its)i(analogous)f(pr)o (ocedur)o(e,)d FA(run/collecting*)p FD(.)365 3661 y FA @@ -3068,8 +2261,8 @@ FA(ls)f FD(pr)o(o-)573 4799 y(cess')31 b(exit)g(status,)j(and)d(two)h b(\002les)573 4898 y(ar)o(e)17 b(deleted)h(befor)o(e)g FA(run/collecting)13 b FD(r)o(eturns,)19 b(so)g(when)h(the)f(ports)g (ar)o(e)f(closed,)1756 5147 y(17)p eop -%%Page: 18 24 -18 23 bop 888 614 a FD(they)28 b(vanish.)45 b(The)27 +%%Page: 18 26 +18 25 bop 888 614 a FD(they)28 b(vanish.)45 b(The)27 b FA(fds)f FD(list)i(of)g(\002le)f(descriptors)g(is)h(implicitly)g (backquoted)f(by)888 714 y(the)21 b(special-form)f(version.)888 914 y(For)h(example,)f(if)h(Kaiming)g(has)g(his)h(mailbox)f(pr)o @@ -3092,29 +2285,29 @@ b(Then,)21 b(outputs)g(a)f(megabyte)h(of)g(data)e(to)i(stdout.)967 FA(\))p FD(\224)e(to)j(stderr)-6 b(,)19 b(and)i(exits.)888 3702 y(Our)e(scsh)h(pr)o(ogrammer)e(decides)g(to)i(r)o(un)f FA(myprog)d FD(with)k(stdout)g(and)e(stderr)g(r)o(edi-)888 -3802 y(r)o(ected)23 b FC(via)g(Unix)g(pipes)h FD(to)g(the)g(ports)h -FA(port1)c FD(and)j FA(port2)p FD(,)e(r)o(espectively)-9 -b(.)34 b(He)24 b(gets)888 3902 y(into)19 b(tr)o(ouble)f(when)h(he)f -(subsequently)h(says)f FA(\(read)42 b(port2\))p FD(.)22 -b(The)c(Scheme)g FA(read)888 4001 y FD(r)o(outine)h(r)o(eads)f(the)h -(open)g(par)o(en,)f(and)g(then)i(hangs)f(in)g(a)g FA(read\(\))d -FD(system)k(call)e(try-)888 4101 y(ing)31 b(to)f(r)o(ead)d(a)i -(matching)i(close)f(par)o(en.)50 b(But)30 b(befor)o(e)e -FA(myprog)f FD(sends)j(the)g(close)888 4200 y(par)o(en)d(down)h(the)f -(stderr)g(pipe,)i(it)e(\002rst)h(tries)g(to)f(write)h(a)f(megabyte)g -(of)g(data)g(to)888 4300 y(the)j(stdout)h(pipe.)53 b(However)-6 -b(,)31 b(Scheme)f(is)g(not)h(r)o(eading)e(that)h(pipe\227it's)g(stuck) -888 4400 y(waiting)37 b(for)f(input)g(on)h(stderr)-6 -b(.)71 b(So)36 b(the)g(stdout)g(pipe)g(quickly)h(\002lls)g(up,)i(and) -888 4499 y FA(myprog)26 b FD(hangs,)k(waiting)f(for)f(the)g(pipe)g(to)h -(drain.)47 b(The)28 b FA(myprog)e FD(child)i(is)h(stuck)888 -4599 y(in)i(a)e(stdout/)p FA(port1)g FD(write;)35 b(the)30 -b(Scheme)g(par)o(ent)f(is)h(stuck)g(in)h(a)e(stderr/)p -FA(port2)888 4699 y FD(r)o(ead.)24 b(Deadlock.)888 4898 -y(Her)o(e's)c(a)h(concr)o(ete)f(example)g(that)g(does)h(exactly)f(the)h -(above:)2071 5147 y(18)p eop -%%Page: 19 25 -19 24 bop 756 614 a FA(\(receive)40 b(\(status)g(port1)i(port2\))1148 +3802 y(r)o(ected)23 b FC(via)h(Unix)g(pipes)g FD(to)h(the)g(ports)f +FA(port1)f FD(and)h FA(port2)p FD(,)f(r)o(espectively)-9 +b(.)35 b(He)24 b(get-)888 3902 y(s)32 b(into)g(tr)o(ouble)f(when)h(he)g +(subsequently)g(says)g FA(\(read)41 b(port2\))p FD(.)55 +b(The)31 b(Scheme)888 4001 y FA(read)26 b FD(r)o(outine)i(r)o(eads)e +(the)h(open)h(par)o(en,)g(and)f(then)h(hangs)g(in)g(a)f +FA(read\(\))e FD(system)888 4101 y(call)h(trying)g(to)h(r)o(ead)d(a)h +(matching)i(close)f(par)o(en.)40 b(But)26 b(befor)o(e)e +FA(myprog)g FD(sends)i(the)888 4200 y(close)d(par)o(en)f(down)h(the)g +(stderr)f(pipe,)h(it)g(\002rst)g(tries)f(to)h(write)g(a)f(megabyte)g +(of)h(da-)888 4300 y(ta)32 b(to)g(the)g(stdout)g(pipe.)58 +b(However)-6 b(,)34 b(Scheme)e(is)g(not)g(r)o(eading)f(that)h +(pipe\227it's)888 4400 y(stuck)22 b(waiting)f(for)g(input)g(on)h +(stderr)-6 b(.)25 b(So)20 b(the)h(stdout)h(pipe)e(quickly)i(\002lls)g +(up,)e(and)888 4499 y FA(myprog)f FD(hangs,)j(waiting)h(for)e(the)h +(pipe)f(to)h(drain.)27 b(The)22 b FA(myprog)d FD(child)j(is)g(stuck)g +(in)888 4599 y(a)e(stdout/)p FA(port1)f FD(write;)h(the)h(Scheme)f(par) +o(ent)f(is)i(stuck)f(in)h(a)f(stderr/)p FA(port2)e FD(r)o(ead.)888 +4699 y(Deadlock.)888 4898 y(Her)o(e's)i(a)h(concr)o(ete)f(example)g +(that)g(does)h(exactly)f(the)h(above:)2071 5147 y(18)p +eop +%%Page: 19 27 +19 26 bop 756 614 a FA(\(receive)40 b(\(status)g(port1)i(port2\))1148 714 y(\(run/collecting)37 b(\(1)43 b(2\))1322 814 y(\(begin)1409 913 y(;;)g(Write)f(an)g(open)g(paren)g(to)h(stderr.)1409 1013 y(\(run)f(\(echo)g("\("\))g(\(=)g(1)i(2\)\))1409 @@ -3162,8 +2355,8 @@ FA(\))87 b Fw(\000)-14 b(!)87 b FC(boolean)1514 b FD(syntax)573 573 4898 y(turn)d(tr)o(ue)g(if)f(some)i(pr)o(oc)e(completes)h (successfully;)g(otherwise)g FA(#f)p FD(.)1756 5147 y(19)p eop -%%Page: 20 26 -20 25 bop 681 614 a FA(\(&&)42 b FC(pf)920 641 y Fx(1)978 +%%Page: 20 28 +20 27 bop 681 614 a FA(\(&&)42 b FC(pf)920 641 y Fx(1)978 614 y FC(.)12 b(.)g(.)g(pfn)p FA(\))87 b Fw(\000)-14 b(!)87 b FC(boolean)1514 b FD(syntax)888 756 y(Run)23 b(each)f(pr)o(oc)g(until)h(one)g(fails)e(\()p FC(i.e.)p @@ -3207,8 +2400,8 @@ FC(\002lter)g FD(will)h(never)e(be)h(applied)888 4194 y(to)i(a)g(string)g(longer)g(than)g FC(bu\003en)i FD(chars.)i(The)20 b(default)g FC(bu\003en)i FD(value)e(is)h(1024.)2071 5147 y(20)p eop -%%Page: 21 27 -21 26 bop 365 1276 a Fz(Chapter)45 b(3)365 1731 y FE(System)51 +%%Page: 21 29 +21 28 bop 365 1276 a Fz(Chapter)45 b(3)365 1731 y FE(System)51 b(Calls)365 2226 y FD(Scsh)24 b(pr)o(ovides)f(\(almost\))g(complete)g (access)g(to)h(the)g(basic)f(Unix)g(kernel)h(services:)30 b(pr)o(o-)365 2326 y(cesses,)18 b(\002les,)h(signals)f(and)f(so)h @@ -3249,8 +2442,8 @@ b(r)o(etry)-9 b(.)365 4845 y FA(\(errno-error)39 b FC(errno)22 b(syscall)e(.)h(data)p FA(\))85 b Fw(\000)-14 b(!)87 b FC(no)21 b(r)o(eturn)g(value)423 b FD(pr)o(ocedur)o(e)1756 5147 y(21)p eop -%%Page: 22 28 -22 27 bop 888 614 a FD(Raises)30 b(a)f(Unix)h(err)o(or)e(exception)i +%%Page: 22 30 +22 29 bop 888 614 a FD(Raises)30 b(a)f(Unix)h(err)o(or)e(exception)i (for)f(Unix)h(err)o(or)e(number)i FC(errno)q FD(.)52 b(The)29 b FC(syscall)888 714 y FD(and)f FC(data)f FD(ar)o(guments)g (ar)o(e)g(packaged)g(up)h(in)g(the)g(exception)g(packet)f(passed)h(to) @@ -3304,8 +2497,8 @@ FD(forms)g(ar)o(e)e(integer)i(expr)o(essions.)40 b(They)888 4898 y(ar)o(e)25 b(evaluated)g(and)g(compar)o(ed)g(to)h(the)h(err)o(or) 6 b('s)25 b(errno)h(value.)41 b(An)26 b FA(else)e FD(clause)2071 5147 y(22)p eop -%%Page: 23 29 -23 28 bop 573 614 a FD(matches)23 b(any)g(errno)h(value.)32 +%%Page: 23 31 +23 30 bop 573 614 a FD(matches)23 b(any)g(errno)h(value.)32 b(Note)24 b(that)f(the)h FC(errno)g FD(and)f FC(data)f FD(variables)g(ar)o(e)g(lexi-)573 714 y(cally)e(visible)h(to)h(the)f (err)o(or)e(clauses.)573 892 y(Example:)756 1149 y FA(\(with-errno-han) @@ -3345,8 +2538,8 @@ b(,)365 4407 y(and)29 b(generate)f(an)g(interactive)g(br)o(eakpoint)g FA(\(fork\))p FD(,)e(the)h(child)g(r)o(esets)g(to)g(script)g(mode.)36 b(This)365 4898 y(can)21 b(be)f(overridden)g(if)h(the)g(pr)o(ogrammer)f (wishes.)1756 5147 y(23)p eop -%%Page: 24 30 -24 29 bop 681 614 a Fy(3.2)99 b(I/O)681 834 y FB(3.2.1)81 +%%Page: 24 32 +24 31 bop 681 614 a Fy(3.2)99 b(I/O)681 834 y FB(3.2.1)81 b(Standard)18 b(R4RS)i(I/O)h(procedures)681 1022 y FD(In)29 b(scsh,)j(most)d(standar)o(d)f(R4RS)h(i/o)h(operations)f(\(such)g(as)g FA(display)d FD(or)j FA(read-char)p FD(\))681 1121 y(work)22 @@ -3409,8 +2602,8 @@ b(!)87 b FC(value\(s\))21 b(of)f(body)339 b FD(syntax)888 (sugar)g(for)f(the)h FA(with-current-)888 4898 y(input-port*)17 b FD(pr)o(ocedur)o(e)h(and)j(friends.)2071 5147 y(24)p eop -%%Page: 25 31 -25 30 bop 365 614 a FA(\(set-current-inpu)o(t-)o(por)o(t!)37 +%%Page: 25 33 +25 32 bop 365 614 a FA(\(set-current-inpu)o(t-)o(por)o(t!)37 b FC(port)p FA(\))86 b Fw(\000)-14 b(!)87 b FC(unde\002ned)580 b FD(pr)o(ocedur)o(e)365 714 y FA(\(set-current-outp)o(ut)o(-po)o(rt)o (!)38 b FC(port)p FA(\))86 b Fw(\000)-15 b(!)88 b FC(unde\002ned)536 @@ -3418,55 +2611,55 @@ b FD(pr)o(ocedur)o(e)365 814 y FA(\(set-error-output)o(-p)o(ort)o(!)37 b FC(port)p FA(\))86 b Fw(\000)-14 b(!)87 b FC(unde\002ned)624 b FD(pr)o(ocedur)o(e)573 958 y(These)21 b(pr)o(ocedur)o(es)f(alter)h (the)g(dynamic)h(binding)g(of)g(the)f(curr)o(ent)g(I/O)h(port)f(pr)o -(o-)573 1057 y(cedur)o(es)e(to)i(new)h(values.)365 1257 +(o-)573 1058 y(cedur)o(es)e(to)i(new)h(values.)365 1260 y FA(\(close)41 b FC(fd/port)p FA(\))86 b Fw(\000)-15 -b(!)88 b FC(boolean)1355 b FD(pr)o(ocedur)o(e)573 1401 +b(!)88 b FC(boolean)1355 b FD(pr)o(ocedur)o(e)573 1405 y(Close)21 b(the)g(port)g(or)g(\002le)f(descriptor)-6 -b(.)573 1537 y(If)27 b FC(fd/port)g FD(is)h(a)g(\002le)g(descriptor)-6 +b(.)573 1541 y(If)27 b FC(fd/port)g FD(is)h(a)g(\002le)g(descriptor)-6 b(,)29 b(and)e(it)h(has)g(a)g(port)g(allocated)f(to)h(it,)i(the)e(port) -g(is)573 1636 y(shifted)c(to)h(a)e(new)i(\002le)f(descriptor)g(cr)o +g(is)573 1641 y(shifted)c(to)h(a)e(new)i(\002le)f(descriptor)g(cr)o (eated)e(with)k FA(\(dup)41 b(fd/port\))21 b FD(befor)o(e)i(clos-)573 -1736 y(ing)c FA(fd/port)p FD(.)i(The)e(port)f(then)g(has)h(its)f(r)o +1740 y(ing)c FA(fd/port)p FD(.)i(The)e(port)f(then)g(has)h(its)f(r)o (evealed)e(count)j(set)f(to)h(zer)o(o.)k(This)c(r)o(e\003ects)573 -1836 y(the)k(design)h(criteria)e(that)i(ports)f(ar)o(e)f(not)i +1840 y(the)k(design)h(criteria)e(that)i(ports)f(ar)o(e)f(not)i (associated)f(with)h(\002le)f(descriptors,)h(but)573 -1935 y(with)d(open)g(\002les.)573 2071 y(T)-8 b(o)19 +1940 y(with)d(open)g(\002les.)573 2076 y(T)-8 b(o)19 b(close)f(a)g(\002le)g(descriptor)-6 b(,)18 b(and)g(any)g(associated)g -(port)g(it)h(might)g(have,)f(you)h(must)573 2171 y(instead)h(say)h(one) -g(of)g(\(as)f(appr)o(opriate\):)756 2343 y FA(\(close)41 -b(\(fdes->inport)81 b(fd\)\))756 2442 y(\(close)41 b(\(fdes->outport)c -(fd\)\))573 2650 y FD(The)26 b(pr)o(ocedur)o(e)e(r)o(eturns)h(tr)o(ue)h +(port)g(it)h(might)g(have,)f(you)h(must)573 2176 y(instead)h(say)h(one) +g(of)g(\(as)f(appr)o(opriate\):)756 2349 y FA(\(close)41 +b(\(fdes->inport)81 b(fd\)\))756 2449 y(\(close)41 b(\(fdes->outport)c +(fd\)\))573 2659 y FD(The)26 b(pr)o(ocedur)o(e)e(r)o(eturns)h(tr)o(ue)h (if)g(it)h(closed)f(an)g(open)g(port.)41 b(If)26 b(the)g(port)g(was)g -(al-)573 2750 y(r)o(eady)19 b(closed,)i(it)g(r)o(eturns)f(false;)g -(this)h(is)g(not)h(an)e(err)o(or)-6 b(.)365 2949 y FA +(al-)573 2759 y(r)o(eady)19 b(closed,)i(it)g(r)o(eturns)f(false;)g +(this)h(is)g(not)h(an)e(err)o(or)-6 b(.)365 2961 y FA (\(stdports->stdio\))80 b Fw(\000)-14 b(!)87 b FC(unde\002ned)1111 -b FD(pr)o(ocedur)o(e)365 3049 y FA(\(stdio->stdports\))80 +b FD(pr)o(ocedur)o(e)365 3060 y FA(\(stdio->stdports\))80 b Fw(\000)-14 b(!)87 b FC(unde\002ned)1111 b FD(pr)o(ocedur)o(e)573 -3193 y(These)30 b(two)h(pr)o(ocedur)o(es)e(ar)o(e)g(used)h(to)h(synchr) -o(onise)g(Unix')g(standar)o(d)d(I/O)j(\002le)573 3293 +3205 y(These)30 b(two)h(pr)o(ocedur)o(es)e(ar)o(e)g(used)h(to)h(synchr) +o(onise)g(Unix')g(standar)o(d)d(I/O)j(\002le)573 3305 y(descriptors)20 b(and)h(Scheme's)f(curr)o(ent)g(I/O)i(ports.)573 -3428 y FA(\(stdports->stdio)o(\))14 b FD(causes)21 b(the)f(standar)o(d) +3441 y FA(\(stdports->stdio)o(\))14 b FD(causes)21 b(the)f(standar)o(d) f(I/O)j(\002le)e(descriptors)h(\(0,)e(1,)h(and)g(2\))573 -3528 y(to)h(take)f(their)h(values)f(fr)o(om)g(the)h(curr)o(ent)f(I/O)h +3541 y(to)h(take)f(their)h(values)f(fr)o(om)g(the)h(curr)o(ent)f(I/O)h (ports.)26 b(It)20 b(is)h(exactly)f(equivalent)h(to)573 -3628 y(the)g(series)f(of)h(r)o(edir)o(ections:)1486 3598 -y Fs(1)756 3800 y FA(\(dup)41 b(\(current-input-po)o(rt\))80 -b(0\))756 3899 y(\(dup)41 b(\(current-output-p)o(ort)o(\))c(1\))756 -3999 y(\(dup)k(\(error-output-por)o(t\))124 b(2\))573 -4171 y(stdio->stdports)32 b FD(causes)37 b(the)h(bindings)h(of)f(the)g -(curr)o(ent)g(I/O)g(ports)g(to)h(be)573 4270 y(changed)28 +3640 y(the)g(series)f(of)h(r)o(edir)o(ections:)1486 3610 +y Fs(1)756 3814 y FA(\(dup)41 b(\(current-input-po)o(rt\))80 +b(0\))756 3913 y(\(dup)41 b(\(current-output-p)o(ort)o(\))c(1\))756 +4013 y(\(dup)k(\(error-output-por)o(t\))124 b(2\))573 +4186 y(stdio->stdports)32 b FD(causes)37 b(the)h(bindings)h(of)f(the)g +(curr)o(ent)g(I/O)g(ports)g(to)h(be)573 4286 y(changed)28 b(to)h(ports)f(constr)o(ucted)h(over)f(the)g(standar)o(d)f(I/O)i -(\002le)g(descriptors.)48 b(It)573 4370 y(is)21 b(exactly)f(equivalent) -h(to)g(the)g(series)g(of)f(assignments)756 4542 y FA(\(set-current-in)o -(pu)o(t-p)o(or)o(t!)81 b(\(fdes->inport)h(0\)\))756 4641 +(\002le)g(descriptors.)48 b(It)573 4385 y(is)21 b(exactly)f(equivalent) +h(to)g(the)g(series)g(of)f(assignments)756 4559 y FA(\(set-current-in)o +(pu)o(t-p)o(or)o(t!)81 b(\(fdes->inport)h(0\)\))756 4658 y(\(set-current-ou)o(tp)o(ut-)o(po)o(rt!)37 b(\(fdes->outport)h(1\)\)) -756 4741 y(\(set-error-outp)o(ut)o(-po)o(rt)o(!)125 b(\(fdes->outport) +756 4758 y(\(set-error-outp)o(ut)o(-po)o(rt)o(!)125 b(\(fdes->outport) 38 b(2\)\))p 365 4819 1146 4 v 456 4875 a Fr(1)485 4898 -y Fv(Why)16 b(not)g Fj(move->fdes)p Fv(?)24 b(Because)16 +y Fv(Why)16 b(not)g Fi(move->fdes)p Fv(?)24 b(Because)16 b(the)g(curr)o(ent)g(output)g(port)h(and)e(err)o(or)i(port)g(might)e (be)h(the)g(same)g(port.)1756 5147 y FD(25)p eop -%%Page: 26 32 -26 31 bop 888 614 a FD(However)-6 b(,)57 b(you)51 b(ar)o(e)d(mor)o(e)i +%%Page: 26 34 +26 33 bop 888 614 a FD(However)-6 b(,)57 b(you)51 b(ar)o(e)d(mor)o(e)i (likely)h(to)f(\002nd)g(the)g(dynamic-extent)g(variant,)888 714 y FA(with-stdio-ports*)o FD(,)15 b(below)-8 b(,)21 b(to)g(be)g(of)f(use)h(in)g(general)g(pr)o(ogramming.)681 @@ -3523,8 +2716,8 @@ FD(.)681 4387 y FB(3.2.4)81 b(Revealed)18 b(ports)j(and)e(\002le)h 4898 y(Unix,)h(open)f(\002les)g(ar)o(e)e(part)g(of)i(the)f(pr)o(ocess)g (envir)o(onment,)k(and)30 b(ar)o(e)g(r)o(efer)o(enced)f(by)2071 5147 y(26)p eop -%%Page: 27 33 -27 32 bop 365 614 a FD(small)29 b(integers)g(called)f +%%Page: 27 35 +27 34 bop 365 614 a FD(small)29 b(integers)g(called)f FC(\002le)h(descriptors)p FD(.)49 b(Open)29 b(\002le)g(descriptors)f (ar)o(e)f(the)i(fundamen-)365 714 y(tal)e(way)h(i/o)g(r)o(edir)o (ections)e(ar)o(e)g(passed)h(to)g(subpr)o(ocesses,)i(since)e(\002le)h @@ -3591,8 +2784,8 @@ e(collection.)27 b(It)20 b(is)h(an)g(integer)f(semaphor)o(e.)365 4898 y(If)25 b(it)g(is)h(zer)o(o,)e(the)i(port's)f(\002le)g(descriptor) g(can)g(be)g(closed)g(when)g(the)h(port)f(is)g(collected.)1756 5147 y(27)p eop -%%Page: 28 34 -28 33 bop 681 614 a FD(Essentially)-9 b(,)31 b(the)f +%%Page: 28 36 +28 35 bop 681 614 a FD(Essentially)-9 b(,)31 b(the)f FC(r)o(evealed)e FD(\002eld)i(r)o(e\003ects)e(whether)i(or)f(not)h(the) f(port's)h(\002le)f(descriptor)681 714 y(has)21 b(escaped)e(to)i(the)g (Scheme)g(user)-6 b(.)25 b(If)c(the)g(Scheme)f(user)h(doesn't)g(know)h @@ -3614,11 +2807,11 @@ FA(fdes->input-por)o(t)p FD(,)f FA(port->fdes)c FD(ar)o(e)681 (descriptors)f(and)g(ports.)101 b(When)681 1710 y FA(port->fdes)31 b FD(r)o(eveals)j(a)h(port's)h(\002le)f(descriptor)-6 b(,)38 b(it)e(incr)o(ements)f(the)h(port's)f FC(r)o(evealed)681 -1810 y FD(\002eld.)119 b(When)53 b(the)f(user)g(is)h(thr)o(ough)f(with) -h(the)g(\002le)f(descriptor)-6 b(,)59 b(he)52 b(can)g(call)681 -1910 y FA(\(release-port-ha)o(nd)o(le)37 b FC(port)o -FA(\))p FD(,)65 b(which)58 b(decr)o(ements)d(the)i(count.)133 -b(The)57 b(func-)681 2009 y(tion)44 b FA(\(call/fdes)39 +1810 y FD(\002eld.)119 b(When)52 b(the)g(user)g(is)g(thr)o(ough)h(with) +f(the)g(\002le)g(descriptor)-6 b(,)59 b(he)52 b(can)g(cal-)681 +1910 y(l)c FA(\(release-port-h)o(and)o(le)37 b FC(port)o +FA(\))p FD(,)54 b(which)49 b(decr)o(ements)e(the)h(count.)107 +b(The)48 b(func-)681 2009 y(tion)c FA(\(call/fdes)39 b(fd/port)i FC(pr)o(oc)o FA(\))i FD(automates)g(this)h(pr)o(otocol.)94 b FA(call/fdes)40 b FD(uses)681 2109 y FA(dynamic-wind)18 b FD(to)23 b(enfor)o(ce)e(the)i(pr)o(otocol.)32 b(If)22 @@ -3672,8 +2865,8 @@ b(is,)j(the)d(actual)g(\002le)g(descriptor)g(on)h(top)g(of)f(which)i(a) e(port)g(is)h(con-)681 4898 y(str)o(ucted)e(can)f(be)h(shifted)g(ar)o (ound)f(underneath)h(the)g(port)g(by)h(the)f(scsh)g(kernel)g(when)2071 5147 y(28)p eop -%%Page: 29 35 -29 34 bop 365 614 a FD(necessary)-9 b(.)35 b(This)25 +%%Page: 29 37 +29 36 bop 365 614 a FD(necessary)-9 b(.)35 b(This)25 b(is)g(important,)g(because)e(when)i(the)g(user)f(is)g(setting)h(up)f (\002le)h(descrip-)365 714 y(tors)e(prior)f(to)h(a)e FA(exec\(2\))p FD(,)f(he)i(may)g(explicitly)h(use)f(a)g(\002le)g @@ -3735,8 +2928,8 @@ b(Y)-8 b(ou)31 b(may)365 4435 y(safely)20 b(skim)i(or)f(completely)g b FD(A)20 b(\002le)h(port)g(is)g(associated)f(with)i(an)e(open)h (\002le,)g(not)g(a)g(particular)e(\002le)i(descriptor)-6 b(.)1756 5147 y(29)p eop -%%Page: 30 36 -30 35 bop 805 614 a Fw(\017)41 b FD(The)16 b(association)h(between)f(a) +%%Page: 30 38 +30 37 bop 805 614 a Fw(\017)41 b FD(The)16 b(association)h(between)f(a) g(\002le)g(port)h(and)e(a)h(particular)f(\002le)h(descriptor)g(is)g (never)888 714 y(changed)31 b FC(except)g FD(when)h(the)g(\002le)f (descriptor)h(is)f(explicitly)h(closed.)58 b(\223Closing\224)888 @@ -3800,8 +2993,8 @@ b(This)25 b(operation)f(r)o(esets)f FC(fd/port)o FD('s)888 (a)g(port)h(alr)o(eady)d(using)888 4861 y FC(tar)o(get-fd)n FD(,)k(it)g(is)g(\002rst)g(r)o(elocated)e(to)i(some)h(other)f(\002le)g (descriptor)-6 b(.)2071 5147 y(30)p eop -%%Page: 31 37 -31 36 bop 365 614 a FB(3.2.6)81 b(Unix)20 b(I/O)365 828 +%%Page: 31 39 +31 38 bop 365 614 a FB(3.2.6)81 b(Unix)20 b(I/O)365 828 y FA(\(dup)42 b FC(fd/port)19 b([newfd])p FA(\))86 b Fw(\000)-14 b(!)87 b FC(fd/port)1185 b FD(pr)o(ocedur)o(e)365 927 y FA(\(dup->inport)39 b FC(fd/port)19 b([newfd])p @@ -3870,14 +3063,14 @@ e(seek-)573 4243 y(able;)c(this)h(is)g(dependent)e(on)i(the)g(OS)f (implementation.)25 b(The)19 b(r)o(eturn)e(value)h(is)g(the)573 4334 y(r)o(esulting)j(position)h(of)f(the)g(I/O)g(cursor)g(in)g(the)g (I/O)g(str)o(eam.)756 4499 y Fl(Oops:)74 b Fk(The)25 -b(curr)o(ent)f(implementation)h(doesn't)f(handle)h Fi(offset)f +b(curr)o(ent)f(implementation)h(doesn't)f(handle)h Fh(offset)f Fk(ar)o(guments)756 4591 y(that)c(ar)o(e)e(not)h(immediate)f(integers)g -(\()p Fi(i.e.)o Fk(,)g(r)o(epr)o(esentable)f(in)i(30)g(bits\).)365 +(\()p Fh(i.e.)o Fk(,)g(r)o(epr)o(esentable)f(in)i(30)g(bits\).)365 4848 y FA(\(tell)42 b FC(fd/port)p FA(\))85 b Fw(\000)-14 b(!)87 b FC(integer)1414 b FD(pr)o(ocedur)o(e)1756 5147 y(31)p eop -%%Page: 32 38 -32 37 bop 888 614 a FD(Returns)24 b(the)f(position)h(of)f(the)g(I/O)g +%%Page: 32 40 +32 39 bop 888 614 a FD(Returns)24 b(the)f(position)h(of)f(the)g(I/O)g (cursor)g(in)g(the)g(the)g(I/O)g(str)o(eam.)31 b(Not)23 b(all)g(\002le)888 714 y(descriptors)29 b(or)g(ports)h(support)f (cursor)o(-r)o(eporting;)j(this)e(is)g(dependent)e(on)i(the)888 @@ -3940,8 +3133,8 @@ g(for)g(the)g(pr)o(ogrammer)-6 b(.)888 4799 y(Pr)o(ogrammers)29 b(that)f(manipulate)h(this)h(\003ag)e(should)i(be)f(awar)o(e)e(of)h (these)h(extra,)888 4898 y(automatic)21 b(operations.)2071 5147 y(32)p eop -%%Page: 33 39 -33 38 bop 1158 601 a FD(Allowed)21 b(operations)272 b +%%Page: 33 41 +33 40 bop 1158 601 a FD(Allowed)21 b(operations)272 b FA(Status)41 b(flag)p 1108 634 1999 4 v 488 701 a FB(Open+Get+Set)97 b FD(These)21 b(\003ags)g(can)f(be)h(used)1158 800 y(in)g FA(open-file)p FD(,)1158 900 y FA(fdes-status)p FD(,)16 @@ -3961,123 +3154,123 @@ FD(.)2158 1099 y FA(open/read)2158 1199 y(open/write)2158 y(by)i FA(fdes-status)16 b FD(and)1158 1996 y FA(set-fdes-status)f FD(calls.)2158 1597 y FA(open/create)2158 1697 y(open/exclusive)2158 1797 y(open/no-control-)o(tt)o(y)2158 1896 y(open/truncate)365 -2166 y FD(T)-8 b(able)38 b(3.1:)60 b(Status)38 b(\003ags)g(for)g -FA(open-file)p FD(,)h FA(fdes-status)34 b FD(and)k FA(set-fdes-status)p -FD(.)365 2266 y(Only)23 b(P)t Fv(O)t(S)t(I)t(X)g FD(\003ags)d(ar)o(e)e -(guaranteed)h(to)h(be)f(pr)o(esent;)h(your)g(operating)f(system)i(may)e -(de-)365 2365 y(\002ne)25 b(others.)37 b(The)24 b FA(open/access-mask) -18 b FD(value)24 b(is)g(not)i(an)e(actual)f(\003ag,)j(but)e(a)g(bit)g -(mask)365 2465 y(used)j(to)g(select)g(the)f(\002eld)h(for)g(the)g -FA(open/read)p FD(,)d FA(open/write)e FD(and)27 b FA(open/read+write) -365 2565 y FD(bits.)365 2965 y FA(\(fdes-status)39 b -FC(fd/port)p FA(\))85 b Fw(\000)-14 b(!)87 b FC(integer)1109 -b FD(pr)o(ocedur)o(e)365 3064 y FA(\(set-fdes-status)37 -b FC(fd/port)19 b(integer)p FA(\))88 b Fw(\000)-15 b(!)87 -b FC(unde\002ned)584 b FD(pr)o(ocedur)o(e)573 3205 y(These)20 -b(pr)o(ocedur)o(es)f(allow)i(r)o(eading)e(and)i(writing)g(of)f(an)h -(open)g(\002le's)g(status)f(\003ags)573 3305 y(\(table)g(3.1\).)573 -3438 y(Note)j(that)h(this)g(\002le-descriptor)f(state)g(is)h(shar)o(ed) -e(between)h(\002le)h(descriptors)f(cr)o(e-)573 3537 y(ated)h(by)h -FA(dup)p FD(\227if)e(you)j(cr)o(eate)d(port)i FC(b)g -FD(by)g(applying)g FA(dup)f FD(to)h(port)g FC(a)p FD(,)g(and)g(change) -573 3637 y FC(b)p FD('s)c(status)g(\003ags,)g(you)g(will)h(also)f(have) -f(changed)g FC(a)p FD('s)h(status)g(\003ags.)365 3927 +2166 y FD(T)-8 b(able)20 b(3.1:)k(Status)c(\003ags)g(for)g +FA(open-file)p FD(,)d FA(fdes-status)e FD(and)20 b FA(set-fdes-status)p +FD(.)f(On-)365 2265 y(ly)k(P)t Fv(O)t(S)t(I)t(X)g FD(\003ags)d(ar)o(e)f +(guaranteed)g(to)h(be)g(pr)o(esent;)f(your)h(operating)g(system)h(may)f +(de\002ne)365 2365 y(others.)30 b(The)22 b FA(open/access-mas)o(k)16 +b FD(value)21 b(is)i(not)f(an)g(actual)f(\003ag,)h(but)g(a)g(bit)g +(mask)g(used)365 2464 y(to)f(select)g(the)g(\002eld)g(for)f(the)h +FA(open/read)p FD(,)c FA(open/write)f FD(and)21 b FA(open/read+write)14 +b FD(bits.)365 2876 y FA(\(fdes-status)39 b FC(fd/port)p +FA(\))85 b Fw(\000)-14 b(!)87 b FC(integer)1109 b FD(pr)o(ocedur)o(e) +365 2976 y FA(\(set-fdes-status)37 b FC(fd/port)19 b(integer)p +FA(\))88 b Fw(\000)-15 b(!)87 b FC(unde\002ned)584 b +FD(pr)o(ocedur)o(e)573 3115 y(These)20 b(pr)o(ocedur)o(es)f(allow)i(r)o +(eading)e(and)i(writing)g(of)f(an)h(open)g(\002le's)g(status)f(\003ags) +573 3215 y(\(table)g(3.1\).)573 3347 y(Note)j(that)h(this)g +(\002le-descriptor)f(state)g(is)h(shar)o(ed)e(between)h(\002le)h +(descriptors)f(cr)o(e-)573 3446 y(ated)h(by)h FA(dup)p +FD(\227if)e(you)j(cr)o(eate)d(port)i FC(b)g FD(by)g(applying)g +FA(dup)f FD(to)h(port)g FC(a)p FD(,)g(and)g(change)573 +3546 y FC(b)p FD('s)c(status)g(\003ags,)g(you)g(will)h(also)f(have)f +(changed)g FC(a)p FD('s)h(status)g(\003ags.)365 3834 y FA(\(pipe\))85 b Fw(\000)-14 b(!)87 b FC([rport)20 -b(wport)o(])1475 b FD(pr)o(ocedur)o(e)573 4068 y(Returns)21 +b(wport)o(])1475 b FD(pr)o(ocedur)o(e)573 3973 y(Returns)21 b(two)h(ports,)e(the)h(r)o(ead)e(and)i(write)g(end-points)g(of)f(a)h -(Unix)f(pipe.)365 4359 y FA(\(read-string)39 b FC(nbytes)21 +(Unix)f(pipe.)365 4261 y FA(\(read-string)39 b FC(nbytes)21 b([fd/port])p FA(\))85 b Fw(\000)-15 b(!)87 b FC(string)21 -b(or)g FA(#f)648 b FD(pr)o(ocedur)o(e)365 4458 y FA(\(read-string!)39 +b(or)g FA(#f)648 b FD(pr)o(ocedur)o(e)365 4360 y FA(\(read-string!)39 b FC(str)20 b([fd/port)f(start)i(end])p FA(\))86 b Fw(\000)-14 b(!)87 b FC(nr)o(ead)21 b(or)f FA(#f)428 b FD(pr)o(ocedur)o(e)573 -4599 y(These)28 b(calls)f(r)o(ead)f(exactly)i(as)f(much)i(data)d(as)i -(you)g(r)o(equested,)h(unless)f(ther)o(e)f(is)573 4699 +4500 y(These)28 b(calls)f(r)o(ead)f(exactly)i(as)f(much)i(data)d(as)i +(you)g(r)o(equested,)h(unless)f(ther)o(e)f(is)573 4599 y(not)33 b(enough)h(data)e(\(eof\).)61 b FA(read-string!)28 b FD(r)o(eads)k(the)h(data)e(into)j(string)g FC(str)f -FD(at)573 4799 y(the)21 b(indices)g(in)h(the)f(half-open)g(interval)g +FD(at)573 4699 y(the)21 b(indices)g(in)h(the)f(half-open)g(interval)g Fn([)p FC(start)p Fo(;)14 b FC(end)o Fn(\))p FD(;)22 -b(the)f(default)f(interval)h(is)g(the)573 4898 y(whole)30 +b(the)f(default)f(interval)h(is)g(the)573 4799 y(whole)30 b(string:)42 b FC(start)c Fn(=)f(0)29 b FD(and)f FC(end)38 b Fn(=)g FA(\(string-length)g FC(string)o FA(\))p FD(.)50 -b(They)29 b(will)1756 5147 y(33)p eop -%%Page: 34 40 -34 39 bop 888 614 a FD(persistently)29 b(r)o(etry)e(on)i(partial)e(r)o -(eads)g(and)h(when)h(interr)o(upted)f(until)g(\(1\))f(err)o(or)-6 -b(,)888 714 y(\(2\))24 b(eof,)h(or)g(\(3\))e(the)i(input)g(r)o(equest)g -(is)g(completely)g(satis\002ed.)37 b(Partial)24 b(r)o(eads)f(can)888 -814 y(occur)e(when)g(r)o(eading)f(fr)o(om)g(an)h(intermittent)h(sour)o -(ce,)e(such)h(as)f(a)h(pipe)f(or)h(tty)-9 b(.)888 944 -y FA(read-string)21 b FD(r)o(eturns)k(the)h(string)g(r)o(ead;)g -FA(read-string!)21 b FD(r)o(eturns)k(the)h(number)888 -1044 y(of)f(characters)e(r)o(ead.)36 b(They)25 b(both)h(r)o(eturn)e +b(They)29 b(will)573 4898 y(persistently)g(r)o(etry)e(on)i(partial)e(r) +o(eads)g(and)g(when)i(interr)o(upted)f(until)h(\(1\))e(err)o(or)-6 +b(,)1756 5147 y(33)p eop +%%Page: 34 42 +34 41 bop 888 614 a FD(\(2\))24 b(eof,)h(or)g(\(3\))e(the)i(input)g(r)o +(equest)g(is)g(completely)g(satis\002ed.)37 b(Partial)24 +b(r)o(eads)f(can)888 714 y(occur)e(when)g(r)o(eading)f(fr)o(om)g(an)h +(intermittent)h(sour)o(ce,)e(such)h(as)f(a)h(pipe)f(or)h(tty)-9 +b(.)888 851 y FA(read-string)21 b FD(r)o(eturns)k(the)h(string)g(r)o +(ead;)g FA(read-string!)21 b FD(r)o(eturns)k(the)h(number)888 +950 y(of)f(characters)e(r)o(ead.)36 b(They)25 b(both)h(r)o(eturn)e (false)g(at)g(eof.)37 b(A)25 b(r)o(equest)f(to)h(r)o(ead)e(zer)o(o)888 -1143 y(bytes)e(r)o(eturns)f(immediately)-9 b(,)21 b(with)g(no)h(eof)e -(check.)888 1274 y(The)g(values)e(of)i FC(start)f FD(and)g +1050 y(bytes)e(r)o(eturns)f(immediately)-9 b(,)21 b(with)g(no)h(eof)e +(check.)888 1187 y(The)g(values)e(of)i FC(start)f FD(and)g FC(end)g FD(must)h(specify)f(a)f(well-de\002ned)h(interval)g(in)h -FC(str)p FD(,)f FC(i.e.)p FD(,)888 1373 y Fn(0)k Fw(\024)g +FC(str)p FD(,)f FC(i.e.)p FD(,)888 1286 y Fn(0)k Fw(\024)g FC(start)f Fw(\024)h FC(end)g Fw(\024)g FA(\(string-length)37 -b FC(str)q FA(\))o FD(.)888 1504 y(Any)26 b(partially-r)o(ead)d(data)i +b FC(str)q FA(\))o FD(.)888 1423 y(Any)26 b(partially-r)o(ead)d(data)i (is)h(included)f(in)h(the)g(err)o(or)f(exception)h(packet.)39 -b(Err)o(or)888 1604 y(r)o(eturns)21 b(on)g(non-blocking)h(input)g(ar)o -(e)d(consider)o(ed)h(an)h(err)o(or)-6 b(.)681 1787 y +b(Err)o(or)888 1523 y(r)o(eturns)21 b(on)g(non-blocking)h(input)g(ar)o +(e)d(consider)o(ed)h(an)h(err)o(or)-6 b(.)681 1725 y FA(\(read-string/par)o(ti)o(al)37 b FC(nbytes)21 b([fd/port])p FA(\))85 b Fw(\000)-15 b(!)88 b FC(string)20 b(or)h FA(#f)299 -b FD(pr)o(ocedur)o(e)681 1887 y FA(\(read-string!/pa)o(rt)o(ial)37 +b FD(pr)o(ocedur)o(e)681 1825 y FA(\(read-string!/pa)o(rt)o(ial)37 b FC(str)20 b([fd/port)f(start)h(end])p FA(\))83 b Fw(\000)-14 b(!)84 b FC(nr)o(ead)20 b(or)h FA(#f)86 b FD(pr)o(ocedur)o(e)888 -2024 y(These)36 b(ar)o(e)d(atomic)j(best-ef)o(fort/forwar)o(d-pr)o(ogr) +1970 y(These)36 b(ar)o(e)d(atomic)j(best-ef)o(fort/forwar)o(d-pr)o(ogr) o(ess)31 b(calls.)69 b(Best)35 b(ef)o(fort:)54 b(they)888 -2123 y(may)31 b(r)o(ead)e(less)i(than)g(you)h(r)o(equest)e(if)h(ther)o -(e)f(is)h(a)f(lesser)h(amount)h(of)e(data)g(im-)888 2223 +2069 y(may)31 b(r)o(ead)e(less)i(than)g(you)h(r)o(equest)e(if)h(ther)o +(e)f(is)h(a)f(lesser)h(amount)h(of)e(data)g(im-)888 2169 y(mediately)d(available)e(\()p FC(e.g.)o FD(,)i(because)f(you)h(ar)o(e) e(r)o(eading)h(fr)o(om)g(a)g(pipe)h(or)f(a)g(tty\).)888 -2322 y(Forwar)o(d)c(pr)o(ogr)o(ess:)28 b(if)23 b(no)g(data)e(is)i +2269 y(Forwar)o(d)c(pr)o(ogr)o(ess:)28 b(if)23 b(no)g(data)e(is)i (immediately)g(available)e(\()p FC(e.g.)o FD(,)i(empty)g(pipe\),)888 -2422 y(they)i(will)g(block.)35 b(Ther)o(efor)o(e,)23 -b(if)h(you)h(r)o(equest)e(an)h Fo(n)29 b(>)g Fn(0)24 -b FD(byte)g(r)o(ead,)f(while)h(you)888 2522 y(may)32 -b(not)f(get)h(everything)f(you)h(asked)e(for)-6 b(,)34 -b(you)d(will)h(always)f(get)g(something)888 2621 y(\(barring)20 -b(eof\).)888 2752 y(Ther)o(e)25 b(is)h(one)g(case)f(in)h(which)h(the)f -(forwar)o(d-pr)o(ogr)o(ess)d(guarantee)h(is)i(cancelled:)888 -2851 y(when)20 b(the)f(pr)o(ogrammer)e(explicitly)i(sets)g(the)g(port)g -(to)g(non-blocking)i(i/o.)k(In)19 b(this)888 2951 y(case,)31 -b(if)f(no)g(data)f(is)h(immediately)f(available,)i(the)e(pr)o(ocedur)o -(e)f(will)i(not)h(block,)888 3051 y(but)21 b(will)h(immediately)e(r)o -(eturn)g(a)h(zer)o(o-byte)e(r)o(ead.)888 3181 y FA(read-string/parti)o -(al)37 b FD(r)o(eads)42 b(the)i(data)f(into)h(a)g(fr)o(eshly)f -(allocated)g(string,)888 3281 y(which)24 b(it)f(r)o(eturns)f(as)h(its)g -(value.)31 b FA(read-string!/par)o(ti)o(al)16 b FD(r)o(eads)22 -b(the)h(data)e(into)888 3380 y(string)30 b FC(str)e FD(at)g(the)h -(indices)g(in)g(the)f(half-open)g(interval)g Fn([)p FC(start)p -Fo(;)14 b FC(end)p Fn(\))p FD(;)32 b(the)d(default)888 -3480 y(interval)18 b(is)h(the)g(whole)g(string:)25 b -FC(start)e Fn(=)f(0)c FD(and)g FC(end)23 b Fn(=)g FA(\(string-length)38 -b FC(string)p FA(\))o FD(.)888 3580 y(The)20 b(values)e(of)i -FC(start)f FD(and)g FC(end)g FD(must)h(specify)f(a)f(well-de\002ned)h -(interval)g(in)h FC(str)p FD(,)f FC(i.e.)p FD(,)888 3679 -y Fn(0)30 b Fw(\024)g FC(start)g Fw(\024)g FC(end)g Fw(\024)g -FA(\(string-length)38 b FC(str)p FA(\))p FD(.)f(It)25 -b(r)o(eturns)f(the)g(number)h(of)g(bytes)888 3779 y(r)o(ead.)888 -3909 y(A)c(r)o(equest)f(to)h(r)o(ead)e(zer)o(o)h(bytes)h(r)o(eturns)f -(immediatedly)-9 b(,)20 b(with)i(no)f(eof)g(check.)888 -4040 y(In)26 b(sum,)i(ther)o(e)c(ar)o(e)h(only)h(thr)o(ee)f(ways)h(you) -g(can)f(get)h(a)f(zer)o(o-byte)f(r)o(ead:)34 b(\(1\))24 -b(you)888 4139 y(r)o(equest)k(one,)h(\(2\))d(you)i(turn)g(on)g -(non-blocking)h(i/o,)h(or)e(\(3\))e(you)i(try)g(to)g(r)o(ead)d(at)888 -4239 y(eof.)888 4370 y(These)g(ar)o(e)e(the)i(r)o(outines)f(to)h(use)g -(for)f(non-blocking)i(input.)38 b(They)24 b(ar)o(e)g(also)g(use-)888 -4469 y(ful)k(when)h(you)f(wish)h(to)f(ef)o(\002ciently)g(pr)o(ocess)f -(data)g(in)h(lar)o(ge)f(blocks,)j(and)e(your)888 4569 -y(algorithm)20 b(is)f(insensitive)h(to)f(the)g(block)g(size)g(of)g(any) -f(particular)g(r)o(ead)f(operation.)681 4753 y FA(\(select)84 -b FC(rvec)21 b(wvec)f(evec)h([timeout])p FA(\))85 b Fw(\000)-14 -b(!)87 b FC([rvec')20 b(wvec')h(evec'])308 b FD(pr)o(ocedur)o(e)681 -4852 y FA(\(select!)40 b FC(rvec)21 b(wvec)f(evec)h([timeout])p -FA(\))85 b Fw(\000)-14 b(!)87 b FC([nr)21 b(nw)g(ne])562 -b FD(pr)o(ocedur)o(e)2071 5147 y(34)p eop -%%Page: 35 41 -35 40 bop 573 614 a FD(The)26 b FA(select)e FD(pr)o(ocedur)o(e)h +2368 y(they)28 b(will)h(block.)47 b(Ther)o(efor)o(e,)27 +b(if)h(you)g(r)o(equest)g(an)f Fo(n)36 b(>)g Fn(0)27 +b FD(byte)h(r)o(ead,)g(while)g(y-)888 2468 y(ou)22 b(may)e(not)i(get)f +(everything)g(you)g(asked)g(for)-6 b(,)20 b(you)h(will)h(always)f(get)f +(something)888 2567 y(\(barring)g(eof\).)888 2704 y(Ther)o(e)25 +b(is)h(one)g(case)f(in)h(which)h(the)f(forwar)o(d-pr)o(ogr)o(ess)d +(guarantee)h(is)i(cancelled:)888 2804 y(when)20 b(the)f(pr)o(ogrammer)e +(explicitly)i(sets)g(the)g(port)g(to)g(non-blocking)i(i/o.)k(In)19 +b(this)888 2903 y(case,)31 b(if)f(no)g(data)f(is)h(immediately)f +(available,)i(the)e(pr)o(ocedur)o(e)f(will)i(not)h(block,)888 +3003 y(but)21 b(will)h(immediately)e(r)o(eturn)g(a)h(zer)o(o-byte)e(r)o +(ead.)888 3140 y FA(read-string/parti)o(al)37 b FD(r)o(eads)42 +b(the)i(data)f(into)h(a)g(fr)o(eshly)f(allocated)g(string,)888 +3239 y(which)24 b(it)f(r)o(eturns)f(as)h(its)g(value.)31 +b FA(read-string!/par)o(ti)o(al)16 b FD(r)o(eads)22 b(the)h(data)e +(into)888 3339 y(string)30 b FC(str)e FD(at)g(the)h(indices)g(in)g(the) +f(half-open)g(interval)g Fn([)p FC(start)p Fo(;)14 b +FC(end)p Fn(\))p FD(;)32 b(the)d(default)888 3439 y(interval)18 +b(is)h(the)g(whole)g(string:)25 b FC(start)e Fn(=)f(0)c +FD(and)g FC(end)23 b Fn(=)g FA(\(string-length)38 b FC(string)p +FA(\))o FD(.)888 3538 y(The)20 b(values)e(of)i FC(start)f +FD(and)g FC(end)g FD(must)h(specify)f(a)f(well-de\002ned)h(interval)g +(in)h FC(str)p FD(,)f FC(i.e.)p FD(,)888 3638 y Fn(0)30 +b Fw(\024)g FC(start)g Fw(\024)g FC(end)g Fw(\024)g FA(\(string-length) +38 b FC(str)p FA(\))p FD(.)f(It)25 b(r)o(eturns)f(the)g(number)h(of)g +(bytes)888 3737 y(r)o(ead.)888 3874 y(A)c(r)o(equest)f(to)h(r)o(ead)e +(zer)o(o)h(bytes)h(r)o(eturns)f(immediatedly)-9 b(,)20 +b(with)i(no)f(eof)g(check.)888 4011 y(In)26 b(sum,)i(ther)o(e)c(ar)o(e) +h(only)h(thr)o(ee)f(ways)h(you)g(can)f(get)h(a)f(zer)o(o-byte)f(r)o +(ead:)34 b(\(1\))24 b(you)888 4110 y(r)o(equest)k(one,)h(\(2\))d(you)i +(turn)g(on)g(non-blocking)h(i/o,)h(or)e(\(3\))e(you)i(try)g(to)g(r)o +(ead)d(at)888 4210 y(eof.)888 4347 y(These)g(ar)o(e)e(the)i(r)o +(outines)f(to)h(use)g(for)f(non-blocking)i(input.)38 +b(They)24 b(ar)o(e)g(also)g(use-)888 4446 y(ful)k(when)h(you)f(wish)h +(to)f(ef)o(\002ciently)g(pr)o(ocess)f(data)g(in)h(lar)o(ge)f(blocks,)j +(and)e(your)888 4546 y(algorithm)20 b(is)f(insensitive)h(to)f(the)g +(block)g(size)g(of)g(any)f(particular)g(r)o(ead)f(operation.)681 +4748 y FA(\(select)84 b FC(rvec)21 b(wvec)f(evec)h([timeout])p +FA(\))85 b Fw(\000)-14 b(!)87 b FC([rvec')20 b(wvec')h(evec'])308 +b FD(pr)o(ocedur)o(e)681 4848 y FA(\(select!)40 b FC(rvec)21 +b(wvec)f(evec)h([timeout])p FA(\))85 b Fw(\000)-14 b(!)87 +b FC([nr)21 b(nw)g(ne])562 b FD(pr)o(ocedur)o(e)2071 +5147 y(34)p eop +%%Page: 35 43 +35 42 bop 573 614 a FD(The)26 b FA(select)e FD(pr)o(ocedur)o(e)h (allows)i(a)e(pr)o(ocess)h(to)h(block)g(and)f(wait)g(for)g(events)h(on) 573 714 y(multiple)c(I/O)g(channels.)31 b(The)23 b FC(rvec)f FD(and)g FC(evec)h FD(ar)o(guments)f(ar)o(e)f(vectors)i(of)f(input)573 @@ -4125,7 +3318,7 @@ b(.)57 b(As)31 b(a)573 3220 y(convenience,)24 b(the)g(vectors)g(passed) f(in)h(to)g FA(select!)d FD(ar)o(e)h(allowed)i(to)g(contain)g FA(#f)573 3319 y FD(values)c(as)h(well)g(as)f(integers)h(and)g(ports.) 756 3506 y Fl(Remark:)56 b Fk(I)20 b(have)h(found)f(the)g -Fh(select!)i Fk(interface)e(to)g(be)h(the)f(mor)o(e)f(useful)g(of)756 +Fj(select!)i Fk(interface)e(to)g(be)h(the)f(mor)o(e)f(useful)g(of)756 3598 y(the)25 b(two.)44 b(After)24 b(the)i(system)f(call,)h(it)g (allows)f(you)f(to)i(check)f(a)h(speci\002c)f(I/O)756 3689 y(channel)20 b(in)f(constant)h(time.)365 3917 y @@ -4150,118 +3343,118 @@ b FC(start)59 b Fn(=)f(0)39 b FD(and)573 4898 y FC(end)26 b Fn(=)f FA(\(string-length)38 b FC(string)p FA(\))p FD(.)30 b(The)22 b(values)g(of)h FC(start)f FD(and)g FC(end)g FD(must)h(specify)1756 5147 y(35)p eop -%%Page: 36 42 -36 41 bop 888 614 a FD(a)17 b(well-de\002ned)f(interval)g(in)i +%%Page: 36 44 +36 43 bop 888 614 a FD(a)17 b(well-de\002ned)f(interval)g(in)i FC(str)p FD(,)f FC(i.e.)p FD(,)g Fn(0)23 b Fw(\024)g FC(start)f Fw(\024)h FC(end)g Fw(\024)g FA(\(string-length)37 b FC(str)q FA(\))o FD(.)888 714 y(A)21 b(zer)o(o-byte)e(write)i(r)o (eturns)f(immediately)-9 b(,)20 b(with)i(no)f(err)o(or)-6 -b(.)888 849 y(Output)28 b(to)f(buf)o(fer)o(ed)d(ports:)38 +b(.)888 854 y(Output)28 b(to)f(buf)o(fer)o(ed)d(ports:)38 b FA(write-string)p FD('s)22 b(ef)o(forts)k(end)g(as)h(soon)h(as)e(all) -h(the)888 949 y(data)g(has)h(been)f(placed)g(in)h(the)g(output)g(buf)o +h(the)888 954 y(data)g(has)h(been)f(placed)g(in)h(the)g(output)g(buf)o (fer)-6 b(.)45 b(Err)o(ors)27 b(and)g(tr)o(ue)h(output)g(may)888 -1048 y(not)22 b(happen)e(until)i(a)e(later)g(time,)h(of)g(course.)681 -1294 y FA(\(write-string/pa)o(rt)o(ial)37 b FC(string)19 +1053 y(not)22 b(happen)e(until)i(a)e(later)g(time,)h(of)g(course.)681 +1309 y FA(\(write-string/pa)o(rt)o(ial)37 b FC(string)19 b([fd/port)f(start)h(end])p FA(\))74 b Fw(\000)-14 b(!)75 -b FC(nwritten)87 b FD(pr)o(ocedur)o(e)888 1437 y(This)62 +b FC(nwritten)87 b FD(pr)o(ocedur)o(e)888 1457 y(This)62 b(r)o(outine)e(is)h(the)g(atomic)g(best-ef)o(fort/forwar)o(d-pr)o(ogr)o -(ess)c(analog)k(to)888 1537 y FA(write-string)p FD(.)c(It)32 +(ess)c(analog)k(to)888 1557 y FA(write-string)p FD(.)c(It)32 b(r)o(eturns)g(the)h(number)g(of)g(bytes)f(written,)k(which)e(may)e(be) -888 1637 y(less)c(than)g(you)h(asked)e(for)-6 b(.)46 +888 1656 y(less)c(than)g(you)h(asked)e(for)-6 b(.)46 b(Partial)27 b(writes)h(can)g(occur)f(when)i(\(1\))d(we)i(write)g(of)o -(f)888 1736 y(the)23 b(physical)g(end)f(of)g(the)h(media,)f(\(2\))f +(f)888 1756 y(the)23 b(physical)g(end)f(of)g(the)h(media,)f(\(2\))f (the)h(write)h(is)g(interrr)o(upted,)f(or)g(\(3\))f(the)i(\002le)888 -1836 y(descriptor)e(is)g(set)g(for)f(non-blocking)j(i/o.)888 -1971 y(If)g(the)h(\002le)g(descriptor)f(is)h(not)g(set)f(up)h(for)f -(non-blocking)i(i/o,)g(then)f(a)f(successful)888 2071 +1855 y(descriptor)e(is)g(set)g(for)f(non-blocking)j(i/o.)888 +1996 y(If)g(the)h(\002le)g(descriptor)f(is)h(not)g(set)f(up)h(for)f +(non-blocking)i(i/o,)g(then)f(a)f(successful)888 2095 y(r)o(eturn)d(fr)o(om)h(these)f(pr)o(ocedur)o(es)f(makes)i(a)f(forwar)o -(d)f(pr)o(ogr)o(ess)h(guarantee\227that)888 2170 y(is,)h(a)f(partial)g +(d)f(pr)o(ogr)o(ess)h(guarantee\227that)888 2195 y(is,)h(a)f(partial)g (write)h(took)h(place)e(of)g(at)h(least)f(one)h(byte:)988 -2341 y Fw(\017)41 b FD(If)23 b(we)g(ar)o(e)f(at)g(the)i(end)f(of)g +2375 y Fw(\017)41 b FD(If)23 b(we)g(ar)o(e)f(at)g(the)i(end)f(of)g (physical)g(media,)g(and)g(no)h(write)f(takes)g(place,)f(an)1071 -2441 y(err)o(or)e(exception)g(is)i(raised.)i(So)d(a)f(r)o(eturn)g -(implies)i(we)e(wr)o(ote)h FC(something)p FD(.)988 2576 +2475 y(err)o(or)e(exception)g(is)i(raised.)i(So)d(a)f(r)o(eturn)g +(implies)i(we)e(wr)o(ote)h FC(something)p FD(.)988 2615 y Fw(\017)41 b FD(If)28 b(the)h(call)f(is)h(interr)o(upted)f(after)f(a) h(partial)g(transfer)-6 b(,)29 b(it)g(r)o(eturns)f(immedi-)1071 -2675 y(ately)-9 b(.)30 b(But)22 b(if)g(the)g(call)g(is)h(interr)o +2715 y(ately)-9 b(.)30 b(But)22 b(if)g(the)g(call)g(is)h(interr)o (upted)f(befor)o(e)f(any)i(data)e(transfer)-6 b(,)21 -b(then)i(the)1071 2775 y(write)e(is)g(r)o(etried.)888 -2946 y(If)e(we)g(r)o(equest)g(a)g(zer)o(o-byte)f(write,)h(then)g(the)h +b(then)i(the)1071 2814 y(write)e(is)g(r)o(etried.)888 +2995 y(If)e(we)g(r)o(equest)g(a)g(zer)o(o-byte)f(write,)h(then)g(the)h (call)f(immediately)g(r)o(eturns)g(0.)24 b(If)19 b(the)888 -3045 y(\002le)24 b(descriptor)g(is)g(set)g(for)f(non-blocking)i(i/o,)h +3094 y(\002le)24 b(descriptor)g(is)g(set)g(for)f(non-blocking)i(i/o,)h (then)e(the)g(call)f(may)h(r)o(eturn)f(0)g(if)h(it)888 -3145 y(was)f(unable)f(to)h(immediately)f(write)h(anything)g(\()p +3194 y(was)f(unable)f(to)h(immediately)f(write)h(anything)g(\()p FC(e.g.)o FD(,)g(full)f(pipe\).)30 b(Barring)22 b(these)888 -3245 y(two)c(cases,)g(a)f(write)g(either)h(r)o(eturns)f +3294 y(two)c(cases,)g(a)f(write)g(either)h(r)o(eturns)f FC(nwritten)23 b Fo(>)f Fn(0)p FD(,)c(or)f(raises)h(an)f(err)o(or)f -(exception.)888 3380 y(Non-blocking)36 b(i/o)f(is)g(only)g(available)e +(exception.)888 3434 y(Non-blocking)36 b(i/o)f(is)g(only)g(available)e (on)i(\002le)f(descriptors)g(and)g(unbuf)o(fer)o(ed)888 -3479 y(ports.)26 b(Doing)21 b(non-blocking)h(i/o)e(to)h(a)e(buf)o(fer)o -(ed)e(port)j(is)h(not)f(well-de\002ned,)f(and)888 3579 +3533 y(ports.)26 b(Doing)21 b(non-blocking)h(i/o)e(to)h(a)e(buf)o(fer)o +(ed)e(port)j(is)h(not)f(well-de\002ned,)f(and)888 3633 y(is)i(an)g(err)o(or)f(\(the)g(pr)o(oblem)h(is)g(the)g(subsequent)g -(\003ush)h(operation\).)681 3985 y FB(3.2.7)81 b(Buf)o(fered)20 -b(I/O)681 4172 y FD(Scheme)30 b(48)f(ports)i(use)f(buf)o(fer)o(ed)e +(\003ush)h(operation\).)681 4068 y FB(3.2.7)81 b(Buf)o(fered)20 +b(I/O)681 4265 y FD(Scheme)30 b(48)f(ports)i(use)f(buf)o(fer)o(ed)e (I/O\227data)i(is)g(transferr)o(ed)f(to)h(or)h(fr)o(om)f(the)g(OS)h(in) -681 4272 y(blocks.)43 b(Scsh)26 b(pr)o(ovides)g(contr)o(ol)h(of)g(this) +681 4364 y(blocks.)43 b(Scsh)26 b(pr)o(ovides)g(contr)o(ol)h(of)g(this) g(mechanism:)37 b(the)27 b(pr)o(ogrammer)f(may)g(for)o(ce)681 -4372 y(saved-up)f(output)i(data)f(to)h(be)f(transferr)o(ed)f(to)i(the)g -(OS)g(when)g(he)g(chooses,)i(and)d(may)681 4471 y(also)31 +4464 y(saved-up)f(output)i(data)f(to)h(be)f(transferr)o(ed)f(to)i(the)g +(OS)g(when)g(he)g(chooses,)i(and)d(may)681 4564 y(also)31 b(choose)h(which)h(I/O)e(buf)o(fering)g(policy)g(to)h(employ)g(for)f(a) -g(given)g(port)h(\(or)f(turn)681 4571 y(buf)o(fering)20 -b(of)o(f)f(completely\).)805 4699 y(It)24 b(can)g(be)f(useful)h(to)g +g(given)g(port)h(\(or)f(turn)681 4663 y(buf)o(fering)20 +b(of)o(f)f(completely\).)805 4799 y(It)24 b(can)g(be)f(useful)h(to)g (turn)g(I/O)g(buf)o(fering)f(of)o(f)g(in)h(some)g(cases,)g(for)f -(example)g(when)681 4799 y(an)16 b(I/O)i(str)o(eam)e(is)h(to)g(be)f -(shar)o(ed)g(by)h(multiple)g(subpr)o(ocesses.)24 b(For)17 -b(this)h(r)o(eason,)e(scsh)i(al-)681 4898 y(locates)k(an)g(unbuf)o(fer) -o(ed)f(port)h(for)g(\002le)h(descriptor)f(0)g(at)g(start-up)g(time.)31 -b(Because)21 b(shells)2071 5147 y(36)p eop -%%Page: 37 43 -37 42 bop 365 614 a FD(fr)o(equently)31 b(shar)o(e)e(stdin)i(with)h -(subpr)o(ocesses,)g(if)f(the)f(shell)i(does)e(buf)o(fer)o(ed)e(r)o -(eads,)j(it)365 714 y(might)e(\223steal\224)d(input)j(intended)e(for)h -(a)f(subpr)o(ocess.)46 b(For)28 b(this)g(r)o(eason,)h(all)e(shells,)j -(in-)365 814 y(cluding)20 b(sh,)h(csh,)f(and)f(scsh,)h(r)o(ead)e(stdin) -i(unbuf)o(fer)o(ed.)j(Applications)d(that)g(can)f(tolerate)365 -913 y(buf)o(fer)o(ed)d(input)j(on)g(stdin)g(can)g(r)o(eset)e -FA(\(current-input-po)o(rt)o(\))12 b FD(to)19 b(block)g(buf)o(fering)f -(for)365 1013 y(higher)k(performance.)365 1169 y FA(\(set-port-bufferi) -o(ng)37 b FC(port)20 b(policy)g([size])p FA(\))86 b Fw(\000)-14 -b(!)87 b FC(unde\002ned)377 b FD(pr)o(ocedur)o(e)573 -1316 y(This)21 b(pr)o(ocedur)o(e)d(allows)k(the)e(pr)o(ogrammer)g(to)h -(assign)g(a)f(particular)f(I/O)i(buf)o(fer)o(-)573 1416 -y(ing)30 b(policy)h(to)f(a)g(port,)i(and)d(to)i(choose)f(the)g(size)g -(of)g(the)g(associated)f(buf)o(fer)-6 b(.)52 b(It)573 -1516 y(may)20 b(only)h(be)f(used)g(on)g(new)h(ports,)f +(example)g(when)681 4898 y(an)h(I/O)i(str)o(eam)e(is)h(to)g(be)g(shar)o +(ed)e(by)i(multiple)g(subpr)o(ocesses.)38 b(For)25 b(this)g(r)o(eason,) +g(scsh)2071 5147 y(36)p eop +%%Page: 37 45 +37 44 bop 365 614 a FD(allocates)18 b(an)f(unbuf)o(fer)o(ed)f(port)i +(for)f(\002le)h(descriptor)f(0)h(at)f(start-up)g(time.)25 +b(Because)16 b(shell-)365 714 y(s)26 b(fr)o(equently)f(shar)o(e)f +(stdin)i(with)g(subpr)o(ocesses,)g(if)f(the)h(shell)g(does)f(buf)o(fer) +o(ed)e(r)o(eads,)h(it)365 814 y(might)29 b(\223steal\224)d(input)j +(intended)e(for)h(a)f(subpr)o(ocess.)46 b(For)28 b(this)g(r)o(eason,)h +(all)e(shells,)j(in-)365 913 y(cluding)20 b(sh,)h(csh,)f(and)f(scsh,)h +(r)o(ead)e(stdin)i(unbuf)o(fer)o(ed.)j(Applications)d(that)g(can)f +(tolerate)365 1013 y(buf)o(fer)o(ed)d(input)j(on)g(stdin)g(can)g(r)o +(eset)e FA(\(current-input-po)o(rt)o(\))12 b FD(to)19 +b(block)g(buf)o(fering)f(for)365 1112 y(higher)k(performance.)365 +1264 y FA(\(set-port-bufferi)o(ng)37 b FC(port)20 b(policy)g([size])p +FA(\))86 b Fw(\000)-14 b(!)87 b FC(unde\002ned)377 b +FD(pr)o(ocedur)o(e)573 1407 y(This)21 b(pr)o(ocedur)o(e)d(allows)k(the) +e(pr)o(ogrammer)g(to)h(assign)g(a)f(particular)f(I/O)i(buf)o(fer)o(-) +573 1507 y(ing)30 b(policy)h(to)f(a)g(port,)i(and)d(to)i(choose)f(the)g +(size)g(of)g(the)g(associated)f(buf)o(fer)-6 b(.)52 b(It)573 +1607 y(may)20 b(only)h(be)f(used)g(on)g(new)h(ports,)f FC(i.e.)p FD(,)g(befor)o(e)f(I/O)h(is)h(performed)e(on)h(the)h(port.) -573 1615 y(Ther)o(e)f(ar)o(e)f(thr)o(ee)h(buf)o(fering)g(policies)h -(that)g(may)f(be)h(chosen:)805 1771 y FA(bufpol/block)161 +573 1706 y(Ther)o(e)f(ar)o(e)f(thr)o(ee)h(buf)o(fering)g(policies)h +(that)g(may)f(be)h(chosen:)805 1852 y FA(bufpol/block)161 b FD(General)21 b(block)g(buf)o(fering)f(\(general)g(default\))805 -1870 y FA(bufpol/line)205 b FD(Line)21 b(buf)o(fering)f(\(tty)h -(default\))805 1970 y FA(bufpol/none)205 b FD(Dir)o(ect)21 -b(I/O\227no)h(buf)o(fering)573 2123 y(The)27 b(line)h(buf)o(fering)f +1952 y FA(bufpol/line)205 b FD(Line)21 b(buf)o(fering)f(\(tty)h +(default\))805 2051 y FA(bufpol/none)205 b FD(Dir)o(ect)21 +b(I/O\227no)h(buf)o(fering)573 2194 y(The)27 b(line)h(buf)o(fering)f (policy)h(\003ushes)h(output)f(whenever)f(a)g(newline)h(is)g(output;) -573 2222 y(whenever)18 b(the)h(buf)o(fer)d(is)j(full;)g(or)g(whenever)f +573 2294 y(whenever)18 b(the)h(buf)o(fer)d(is)j(full;)g(or)g(whenever)f (an)g(input)h(is)g(r)o(ead)d(fr)o(om)i(stdin.)26 b(Line)573 -2322 y(buf)o(fering)20 b(is)h(the)g(default)e(for)i(ports)g(open)g(on)g -(terminal)g(devices.)573 2461 y(The)30 b FC(size)h FD(ar)o(gument)e(r)o +2393 y(buf)o(fering)20 b(is)h(the)g(default)e(for)i(ports)g(open)g(on)g +(terminal)g(devices.)573 2528 y(The)30 b FC(size)h FD(ar)o(gument)e(r)o (equests)i(an)f(I/O)g(buf)o(fer)f(of)h FC(size)h FD(bytes.)54 -b(If)29 b(not)i(given,)i(a)573 2561 y(r)o(easonable)22 +b(If)29 b(not)i(given,)i(a)573 2628 y(r)o(easonable)22 b(default)g(is)h(used;)g(if)g(given)g(and)g(zer)o(o,)f(buf)o(fering)g -(is)h(turned)g(of)o(f)f(\()p FC(i.e.)p FD(,)573 2660 +(is)h(turned)g(of)o(f)f(\()p FC(i.e.)p FD(,)573 2727 y FC(size)h Fn(=)g(0)d FD(for)h(any)g(policy)g(is)g(equivalent)g(to)g -FC(policy)h Fn(=)h FA(bufpol/none)-5 b FD(\).)365 2970 +FC(policy)h Fn(=)h FA(bufpol/none)-5 b FD(\).)365 3025 y FA(\(force-output)39 b FC([fd/port])p FA(\))84 b Fw(\000)-14 b(!)87 b FC(unde\002ned)915 b FD(pr)o(ocedur)o(e)573 -3118 y(This)27 b(pr)o(ocedur)o(e)e(does)i(nothing)i(when)f(applied)e -(to)h(an)g(integer)g(\002le)g(descriptor)573 3218 y(or)18 +3168 y(This)27 b(pr)o(ocedur)o(e)e(does)i(nothing)i(when)f(applied)e +(to)h(an)g(integer)g(\002le)g(descriptor)573 3268 y(or)18 b(unbuf)o(fer)o(ed)e(port.)25 b(It)18 b(\003ushes)h(buf)o(fer)o(ed)d (output)j(when)g(applied)e(to)h(a)g(buf)o(fer)o(ed)573 -3317 y(port,)i(and)h(raises)f(a)g(write-err)o(or)g(exception)h(on)g -(err)o(or)-6 b(.)24 b(Returns)e(no)f(value.)365 3627 +3367 y(port,)i(and)h(raises)f(a)g(write-err)o(or)g(exception)h(on)g +(err)o(or)-6 b(.)24 b(Returns)e(no)f(value.)365 3664 y FA(\(flush-all-ports\))80 b Fw(\000)-14 b(!)87 b FC(unde\002ned)1111 -b FD(pr)o(ocedur)o(e)573 3775 y(This)21 b(pr)o(ocedur)o(e)e(\003ushes)j +b FD(pr)o(ocedur)o(e)573 3808 y(This)21 b(pr)o(ocedur)o(e)e(\003ushes)j (all)e(open)h(output)h(ports)f(with)g(buf)o(fer)o(ed)d(data.)365 -4205 y FB(3.2.8)81 b(File)20 b(locking)365 4400 y FD(Scsh)i(pr)o +4213 y FB(3.2.8)81 b(File)20 b(locking)365 4400 y FD(Scsh)i(pr)o (ovides)h(P)t Fv(O)t(S)t(I)t(X)j FD(advisory)c(\002le)g(locking.)30 b FC(Advisory)21 b FD(locks)h(ar)o(e)f(locks)h(that)g(can)g(be)365 4500 y(checked)i(by)g(user)g(code,)h(but)f(do)g(not)h(af)o(fect)e @@ -4274,13 +3467,13 @@ b FC(Advisory)21 b FD(locks)h(ar)o(e)f(locks)h(that)g(can)g(be)365 b(Using)17 b(advisory)e(locks)i(r)o(equir)o(es)e(cooperation)365 4898 y(amongst)22 b(the)f(agents)g(accessing)f(the)h(shar)o(ed)f(r)o (esour)o(ce.)1756 5147 y(37)p eop -%%Page: 38 44 -38 43 bop 888 614 a Fl(Remark:)94 b Fk(Unfortunately)-8 +%%Page: 38 46 +38 45 bop 888 614 a Fl(Remark:)94 b Fk(Unfortunately)-8 b(,)24 b(P)t Fg(O)t(S)t(I)t(X)f Fk(\002le)f(locks)f(ar)o(e)g (associated)h(with)g(actual)h(\002les,)888 706 y(not)d(with)f (associated)f(open)h(\002le)f(descriptors.)j(Once)e(a)g(pr)o(ocess)d (locks)i(a)h(\002le,)f(using)888 797 y(some)f(\002le)g(descriptor)e -Fi(fd)q Fk(,)i(the)h(next)f(time)h Fi(any)f Fk(\002le)g(descriptor)e(r) +Fh(fd)q Fk(,)i(the)h(next)f(time)h Fh(any)f Fk(\002le)g(descriptor)e(r) o(efer)o(encing)h(that)j(\002le)888 888 y(is)e(closed,)f(all)i (associated)f(locks)f(ar)o(e)h(r)o(eleased.)j(This)d(sever)o(ely)e (limits)i(the)h(utility)f(of)890 980 y(P)t Fg(O)t(S)t(I)t(X)i @@ -4290,7 +3483,7 @@ Fk(advisory)d(\002le)i(locks,)e(and)j(we'd)e(r)o(ecommend)f(caution)j b(P)t Fg(O)t(S)t(I)t(X)e Fk(\002le)888 1162 y(locking)18 b(as)h(\223completely)f(stupid.\224)888 1270 y(Scsh)i(moves)e(Scheme)h (ports)g(fr)o(om)e(\002le)i(descriptor)e(to)i(\002le)g(descriptor)e -(with)i Fh(dup\(\))888 1361 y Fk(and)c Fh(close\(\))h +(with)i Fj(dup\(\))888 1361 y Fk(and)c Fj(close\(\))h Fk(as)f(r)o(equir)o(ed)c(by)j(the)h(r)o(untime,)h(so)d(it)i(is)f (impossible)f(to)h(keep)f(\002le)i(locks)888 1452 y(open)25 b(acr)o(oss)e(one)i(of)f(these)h(shifts.)40 b(Hence)25 @@ -4300,8 +3493,8 @@ Fk(advisory)888 1544 y(\002le)17 b(locking)g(dir)o(ectly)e(on)j(raw)f b(,)15 b(ther)o(e)i(ar)o(e)f(no)888 1635 y(facilities)i(for)g(locking)g (Scheme)h(ports.)888 1742 y(Note)g(that)h(once)f(a)g(Scheme)g(port)g (is)f(r)o(evealed)f(in)i(scsh,)f(the)i(r)o(untime)f(will)f(not)h(shift) -888 1834 y(the)i(port)e(ar)o(ound)h(with)h Fh(dup\(\))g -Fk(and)f Fh(close\(\))p Fk(.)29 b(This)19 b(means)i(the)f +888 1834 y(the)i(port)e(ar)o(ound)h(with)h Fj(dup\(\))g +Fk(and)f Fj(close\(\))p Fk(.)29 b(This)19 b(means)i(the)f (\002le-locking)f(pr)o(o-)888 1925 y(cedur)o(es)e(can)j(then)g(be)f (applied)e(to)i(the)h(port's)d(associated)i(\002le)f(descriptor)-6 b(.)888 2032 y(NeXTSTEP)21 b(users)e(should)i(also)f(note)i(that)h @@ -4337,8 +3530,8 @@ FA(start)f FD(value)h(is)h(an)g(of)o(fset)f(fr)o(om)g(the)h(end)g(of)f FA(len)g FD(\002elds;)888 4898 y(if)33 b FA(len)e FD(is)i(zer)o(o,)h (it)f(means)g(\223in\002nity)-9 b(,\224)36 b(that)c(is,)k(the)d(r)o (egion)f(extends)h(fr)o(om)f(the)2071 5147 y(38)p eop -%%Page: 39 45 -39 44 bop 573 614 a FD(starting)24 b(point)h(thr)o(ough)f(the)g(end)g +%%Page: 39 47 +39 46 bop 573 614 a FD(starting)24 b(point)h(thr)o(ough)f(the)g(end)g (of)g(the)g(\002le,)g(even)g(as)f(the)h(\002le)g(is)h(extended)d(by)573 714 y(subsequent)f(write)g(operations.)490 866 y Fw(\017)41 b FD(The)21 b FA(proc)e FD(\002eld)i(gives)g(the)g(pr)o(ocess)g(object) @@ -4404,14 +3597,14 @@ FC(e.g.)o FD(,)i(thr)o(owing)f(to)g(a)573 4441 y(saved)j(continuation)j FD(.)f(The)28 b FA(with-region-loc)o(k)21 b FD(special)27 b(form)g(is)g(equivalent)573 4865 y(syntactic)21 b(sugar)-6 b(.)1756 5147 y(39)p eop -%%Page: 40 46 -40 45 bop 681 614 a Fy(3.3)99 b(File)25 b(system)681 +%%Page: 40 48 +40 47 bop 681 614 a Fy(3.3)99 b(File)25 b(system)681 828 y FD(Besides)30 b(the)h(following)h(pr)o(ocedur)o(es,)g(which)f (allow)g(access)g(to)g(the)g(computer)6 b('s)31 b(\002le)681 928 y(system,)j(scsh)d(also)g(pr)o(ovides)f(a)g(set)h(of)g(pr)o(ocedur) o(es)e(which)j(manipulate)e(\002le)h FC(names)p FD(.)681 1028 y(These)20 b(string-pr)o(ocessing)i(pr)o(ocedur)o(es)d(ar)o(e)g -(documented)i(in)g(section)g(5.1.3.)681 1168 y FA(\(create-director)o +(documented)i(in)g(section)g(5.1.1.)681 1168 y FA(\(create-director)o (y)37 b FC(fname)21 b([perms)f(override?])p FA(\))87 b Fw(\000)-15 b(!)87 b FC(unde\002ned)207 b FD(pr)o(ocedur)o(e)681 1268 y FA(\(create-fifo)38 b FC(fname)21 b([perms)g(override?])p @@ -4436,8 +3629,8 @@ FA(#o777)e FD(\(but)h(is)i(masked)e(by)h(the)g(curr)o(ent)f(umask\).) 1071 2783 y Fl(Remark:)50 b Fk(Curr)o(ently)-8 b(,)16 b(if)h(you)g(try)h(to)f(cr)o(eate)h(a)g(har)o(d)f(or)g(symbolic)g(link) g(fr)o(om)g(a)1071 2874 y(\002le)k(to)h(itself,)f(you)f(will)h(err)o -(or)f(out)h(with)h Fi(override?)h Fk(false,)e(and)h(simply)e(delete) -1071 2965 y(your)k(\002le)h(with)h Fi(override?)h Fk(tr)o(ue.)42 +(or)f(out)h(with)h Fh(override?)h Fk(false,)e(and)h(simply)e(delete) +1071 2965 y(your)k(\002le)h(with)h Fh(override?)h Fk(tr)o(ue.)42 b(Catching)27 b(this)e(will)g(r)o(equir)o(e)e(some)h(sort)h(of)1071 3057 y(tr)o(ue-name)19 b(pr)o(ocedur)o(e,)d(which)k(I)f(curr)o(ently)e (do)i(not)g(have.)681 3391 y FA(\(delete-director)o(y)37 @@ -4463,22 +3656,22 @@ y(Return)22 b(the)e(\002lename)h(r)o(efer)o(enced)d(by)j(symbolic)h b FC(old-fname)20 b(new-fname)h([override?])p FA(\))86 b Fw(\000)-15 b(!)88 b FC(unde\002ned)129 b FD(pr)o(ocedur)o(e)2071 5147 y(40)p eop -%%Page: 41 47 -41 46 bop 573 614 a FD(If)34 b(you)g(override)f(an)h(existing)h +%%Page: 41 49 +41 48 bop 573 614 a FD(If)34 b(you)g(override)f(an)h(existing)h (object,)j(then)c FC(old-fname)f FD(and)h FC(new-fname)g FD(must)573 714 y(type-match\227either)26 b(both)h(dir)o(ectories,)g (or)g(both)g(non-dir)o(ectories.)43 b(This)27 b(is)g(r)o(e-)573 814 y(quir)o(ed)20 b(by)h(the)g(semantics)g(of)g(Unix)f FA(rename\(\))p FD(.)756 977 y Fl(Remark:)186 b Fk(Ther)o(e)37 b(is)f(an)j(unfortunate)f(atomicity)g(pr)o(oblem)e(with)i(the)756 -1069 y Fh(rename-file)c Fk(pr)o(ocedur)o(e:)48 b(if)31 +1069 y Fj(rename-file)c Fk(pr)o(ocedur)o(e:)48 b(if)31 b(you)h(specify)f(no-override,)i(but)g(cr)o(eate)f(\002le)756 -1160 y Fh(new-fname)21 b Fk(sometime)d(between)j Fh(rename-file)p +1160 y Fj(new-fname)21 b Fk(sometime)d(between)j Fj(rename-file)p Fk('s)g(existence)e(check)g(and)h(the)756 1251 y(actual)i(r)o(ename)g (operation,)g(your)e(\002le)i(will)f(be)h(clobber)o(ed)f(with)h -Fh(old-fname)p Fk(.)756 1343 y(Ther)o(e)33 b(is)g(no)i(way)f(to)h +Fj(old-fname)p Fk(.)756 1343 y(Ther)o(e)33 b(is)g(no)i(way)f(to)h (\002x)f(this)g(pr)o(oblem,)j(given)d(the)h(semantics)f(of)g(Unix)756 -1434 y Fh(rename\(\))p Fk(;)20 b(at)f(least)g(it)f(is)h(highly)f +1434 y Fj(rename\(\))p Fk(;)20 b(at)f(least)g(it)f(is)h(highly)f (unlikely)f(to)i(occur)f(in)h(practice.)365 1773 y FA(\(set-file-mode) 38 b FC(fname/fd/port)19 b(mode)p FA(\))86 b Fw(\000)-14 b(!)87 b FC(unde\002ned)503 b FD(pr)o(ocedur)o(e)365 @@ -4530,8 +3723,8 @@ FD(pr)o(ocedur)o(e)573 4574 y(The)21 b(speci\002ed)f(\002le)h(is)g(tr)o 4854 y FA(\(file-info)40 b FC(fname/fd/port)19 b([chase?])p FA(\))85 b Fw(\000)-14 b(!)87 b FC(\002le-info-r)o(ecord)417 b FD(pr)o(ocedur)o(e)1756 5147 y(41)p eop -%%Page: 42 48 -42 47 bop 888 614 a FD(The)32 b FA(file-info)d FD(pr)o(ocedur)o(e)h(r)o +%%Page: 42 50 +42 49 bop 888 614 a FD(The)32 b FA(file-info)d FD(pr)o(ocedur)o(e)h(r)o (eturns)h(a)h(r)o(ecor)o(d)e(str)o(uctur)o(e)i(containing)h(every-)888 714 y(thing)25 b(ther)o(e)d(is)i(to)g(know)g(about)g(a)f(\002le.)33 b(If)23 b(the)h FC(chase?)f FD(\003ag)g(is)h(tr)o(ue)f(\(the)h @@ -4561,10 +3754,10 @@ y(size)260 b(;)43 b(Size)f(of)h(file,)e(in)i(bytes.)1158 2907 y FD(The)21 b(uid)g(\002eld)f(of)h(a)f(\002le-info)h(r)o(ecor)o(d) e(is)j(accessed)d(with)j(the)f(pr)o(ocedur)o(e)1071 3061 y FA(\(file-info:uid)38 b(x\))888 3216 y FD(and)44 b(similarly)h(for)f -(the)h(other)f(\002elds.)97 b(The)44 b FA(type)f FD(\002eld)h(is)g(a)g -(symbol;)57 b(all)888 3315 y(other)37 b(\002elds)f(ar)o(e)f(integers.) -72 b(A)36 b(\002le-info)g(r)o(ecor)o(d)e(is)j(discriminated)f(with)h -(the)888 3415 y FA(file-info?)17 b FD(pr)o(edicate.)888 +(the)g(other)g(\002elds.)96 b(The)44 b FA(type)e FD(\002eld)i(is)h(a)e +(symbol;)57 b(al-)888 3315 y(l)32 b(other)g(\002elds)f(ar)o(e)g +(integers.)58 b(A)31 b(\002le-info)h(r)o(ecor)o(d)d(is)j(discriminated) +g(with)g(the)888 3415 y FA(file-info?)17 b FD(pr)o(edicate.)888 3555 y(The)35 b(following)i(pr)o(ocedur)o(es)c(all)i(r)o(eturn)g (selected)f(information)i(about)f(a)g(\002le;)888 3654 y(they)29 b(ar)o(e)e(built)h(on)h(top)g(of)f FA(file-info)p @@ -4579,49 +3772,49 @@ FD(gid)1121 4611 y FA(file-size)706 b FD(size)1121 4711 y FA(file-last-access)398 b FD(atime)1121 4810 y FA(file-last-mod)530 b FD(mtime)1121 4910 y FA(file-last-status)o(-c)o(han)o(ge)93 b FD(ctime)2071 5147 y(42)p eop -%%Page: 43 49 -43 48 bop 573 614 a FD(Example:)756 769 y FA(;;)42 b(All)h(my)f(files)g +%%Page: 43 51 +43 50 bop 573 614 a FD(Example:)756 769 y FA(;;)42 b(All)h(my)f(files)g (in)h(/usr/tmp:)756 869 y(\(filter)d(\()p Fo(\025)f FA(\(f\))j(\(=)h (\(file-owner)c(f\))k(\(user-uid\)\)\))1104 969 y(\(directory-files)37 -b("/usr/tmp"\)\)\))756 1154 y Fl(Remark:)114 b Fh(file-info)36 -b Fk(was)f(named)g Fh(file-attributes)j Fk(in)d(r)o(eleases)d(of)756 +b("/usr/tmp"\)\)\))756 1154 y Fl(Remark:)114 b Fj(file-info)36 +b Fk(was)f(named)g Fj(file-attributes)j Fk(in)d(r)o(eleases)d(of)756 1246 y(scsh)h(prior)e(to)i(r)o(elease)f(0.4.)66 b(W)-7 -b(e)33 b(changed)h(the)g(name)f(to)h Fh(file-info)h Fk(for)756 +b(e)33 b(changed)h(the)g(name)f(to)h Fj(file-info)h Fk(for)756 1337 y(consistency)27 b(with)h(the)g(other)g(information-r)o(etrieval)e -(pr)o(ocedur)o(es)f(in)i(scsh:)756 1428 y Fh(user-info)p -Fk(,)k Fh(group-info)p Fk(,)h Fh(host-info)p Fk(,)f Fh(network-info)42 -b Fk(,)29 b Fh(service-info)p Fk(,)756 1520 y(and)19 -b Fh(protocol-info)p Fk(.)756 1622 y(The)f Fh(file-attributes)k +(pr)o(ocedur)o(es)f(in)i(scsh:)756 1428 y Fj(user-info)p +Fk(,)k Fj(group-info)p Fk(,)h Fj(host-info)p Fk(,)f Fj(network-info)42 +b Fk(,)29 b Fj(service-info)p Fk(,)756 1520 y(and)19 +b Fj(protocol-info)p Fk(.)756 1622 y(The)f Fj(file-attributes)k Fk(binding)d(is)f(still)f(supported)h(in)g(the)h(curr)o(ent)g(r)o (elease)756 1713 y(of)f(scsh,)g(but)i(is)e(depr)o(ecated,)f(and)i(may)g (go)f(away)h(in)g(a)g(futur)o(e)f(r)o(elease.)365 2043 y FA(\(file-directory?)37 b FC(fname/fd/port)19 b([chase?])p FA(\))85 b Fw(\000)-14 b(!)87 b FC(boolean)398 b FD(pr)o(ocedur)o(e)365 -2142 y FA(\(file-fifo?)39 b FC(fname/fd/port)19 b([chase?])p +2143 y FA(\(file-fifo?)39 b FC(fname/fd/port)19 b([chase?])p FA(\))85 b Fw(\000)-14 b(!)87 b FC(boolean)616 b FD(pr)o(ocedur)o(e)365 2242 y FA(\(file-regular?)38 b FC(fname/fd/port)19 b([chase?])p FA(\))85 b Fw(\000)-14 b(!)87 b FC(boolean)485 b FD(pr)o(ocedur)o(e)365 2342 y FA(\(file-socket?)39 b FC(fname/fd/port)18 b([chase?])p FA(\))86 b Fw(\000)-15 b(!)88 b FC(boolean)528 b FD(pr)o(ocedur)o(e)365 -2441 y FA(\(file-special?)38 b FC(fname/fd/port)19 b([chase?])p +2442 y FA(\(file-special?)38 b FC(fname/fd/port)19 b([chase?])p FA(\))85 b Fw(\000)-14 b(!)87 b FC(boolean)485 b FD(pr)o(ocedur)o(e)365 2541 y FA(\(file-symlink?)38 b FC(fname/fd/port)p FA(\))85 b Fw(\000)-14 b(!)87 b FC(boolean)779 b FD(pr)o(ocedur)o(e)573 2671 y(These)19 b(pr)o(ocedur)o(es)f(ar)o(e)g(\002le-type)h(pr)o (edicates)f(that)h(test)h(the)f(type)h(of)f(a)g(given)h(\002le.)573 2771 y(They)j(ar)o(e)f(applied)h(to)h(the)f(same)g(ar)o(guments)g(to)h -(which)g FA(file-info)c FD(is)k(applied;)573 2870 y(the)30 +(which)g FA(file-info)c FD(is)k(applied;)573 2871 y(the)30 b(sole)g(exception)g(is)h FA(file-symlink?)p FD(,)c(which)j(does)g(not) h(take)f(the)g(optional)573 2970 y FC(chase?)20 b FD(second)h(ar)o (gument.)573 3247 y(For)g(example,)756 3386 y FA(\(file-directory)o(?) 37 b("/usr/dalbertz"\))168 b Fn(=)-14 b Fw(\))218 b FA(#t)365 3616 y(\(file-not-readabl)o(e?)37 b FC(fname)p FA(\))87 b Fw(\000)-15 b(!)88 b FC(boolean)813 b FD(pr)o(ocedur)o(e)365 -3715 y FA(\(file-not-writabl)o(e?)37 b FC(fname)p FA(\))87 +3716 y FA(\(file-not-writabl)o(e?)37 b FC(fname)p FA(\))87 b Fw(\000)-15 b(!)88 b FC(boolean)813 b FD(pr)o(ocedur)o(e)365 3815 y FA(\(file-not-executa)o(bl)o(e?)37 b FC(fname)p FA(\))87 b Fw(\000)-14 b(!)87 b FC(boolean)726 b FD(pr)o(ocedur)o(e)573 -3945 y(Returns:)756 4060 y(V)-8 b(alue)501 b(meaning)p +3946 y(Returns:)756 4060 y(V)-8 b(alue)501 b(meaning)p 756 4108 1909 4 v 756 4213 a FA(#f)621 b FD(Access)21 b(permitted)756 4362 y FA('search-denied)93 b FD(Can't)21 b(stat\227a)f(pr)o(otected)g(dir)o(ectory)1465 4462 y(is)h(blocking)h @@ -4629,6203 +3822,7940 @@ b(stat\227a)f(pr)o(otected)g(dir)o(ectory)1465 4462 y(is)h(blocking)h b(denied.)756 4746 y FA('no-directory)137 b FD(Some)21 b(dir)o(ectory)f(doesn't)h(exist.)756 4895 y FA('nonexistent)181 b FD(File)21 b(doesn't)h(exist.)1756 5147 y(43)p eop -%%Page: 44 50 -44 49 bop 911 614 a FD(A)22 b(\002le)g(is)h(consider)o(ed)f(writeable)g +%%Page: 44 52 +44 51 bop 911 614 a FD(A)22 b(\002le)g(is)h(consider)o(ed)f(writeable)g (if)g(either)g(\(1\))g(it)g(exists)h(and)f(is)h(writeable)f(or)g(\(2\)) 888 714 y(it)j(doesn't)g(exist)f(and)g(the)g(dir)o(ectory)f(is)i (writeable.)35 b(Since)24 b(symlink)i(permission)888 814 y(bits)21 b(ar)o(e)f(ignor)o(ed)g(by)h(the)g(\002lesystem,)g(these) -g(calls)g(do)g(not)g(take)f(a)h FC(chase?)f FD(\003ag.)1071 -989 y Fl(Oops:)103 b Fh(file-not-writeable?)36 b Fk(does)31 -b(not)h(curr)o(ently)f(do)g(the)i(dir)o(ectory)1071 1081 -y(check.)681 1341 y FA(\(file-readable?)k FC(fname)p -FA(\))87 b Fw(\000)-14 b(!)87 b FC(boolean)987 b FD(pr)o(ocedur)o(e)681 -1440 y FA(\(file-writable?)37 b FC(fname)p FA(\))87 b -Fw(\000)-14 b(!)87 b FC(boolean)987 b FD(pr)o(ocedur)o(e)681 -1540 y FA(\(file-executable)o(?)37 b FC(fname)p FA(\))87 -b Fw(\000)-14 b(!)87 b FC(boolean)900 b FD(pr)o(ocedur)o(e)888 -1681 y(These)86 b(pr)o(ocedur)o(es)e(ar)o(e)h(the)h(logical)g(negation) -g(of)g(the)g(pr)o(eceding)888 1781 y FA(file-not-...?)16 -b FD(pr)o(ocedur)o(es.)681 1974 y FA(\(file-not-exists)o(?)37 +g(calls)g(do)g(not)g(take)f(a)h FC(chase?)f FD(\003ag.)888 +943 y(Note)27 b(that)g(these)g(pr)o(ocedur)o(es)e(use)i(the)f(pr)o +(ocess')h FC(effective)g FD(user)f(and)g(gr)o(oup)h(ids)888 +1043 y(for)g(permission)h(checking.)45 b(P)t Fv(O)t(S)t(I)t(X)30 +b FD(de\002nes)d(an)f FA(access\(\))e FD(function)j(that)g(uses)888 +1143 y(the)j(pr)o(ocess')g(r)o(eal)e(uid)i(and)f(gids.)53 +b(This)30 b(is)h(handy)e(for)h(setuid)g(pr)o(ograms)f(that)888 +1242 y(would)23 b(like)g(to)g(\002nd)g(out)g(if)f(the)g(actual)g(user)g +(has)h(speci\002c)f(rights;)i(scsh)f(ought)h(to)888 1342 +y(pr)o(ovide)c(this)i(functionality)f(\(but)g(doesn't)g(at)f(the)h +(curr)o(ent)f(time\).)888 1472 y(Ther)o(e)f(ar)o(e)g(several)g(pr)o +(oblems)g(with)i(these)f(pr)o(ocedur)o(es.)j(First,)d(ther)o(e's)g(an)f +(atom-)888 1571 y(icity)j(issue.)k(In)c(between)e(checking)i +(permissions)g(for)f(a)f(\002le)i(and)e(then)i(trying)f(an)888 +1671 y(operation)h(on)f(the)h(\002le,)f(another)g(pr)o(ocess)g(could)g +(change)g(the)h(permissions,)g(so)g(a)888 1770 y(r)o(eturn)i(value)f +(fr)o(om)h(these)h(functions)g(guarantees)e(nothing.)38 +b(Second,)24 b(the)g(code)888 1870 y(special-cases)c(permission)i +(checking)g(when)g(the)f(uid)g(is)h(r)o(oot\227if)f(the)g(\002le)g +(exists,)888 1970 y(r)o(oot)30 b(is)f(assumed)g(to)h(have)f(the)g(r)o +(equested)f(permission.)52 b(However)-6 b(,)31 b(not)f(even)888 +2069 y(r)o(oot)20 b(can)f(write)h(a)f(\002le)h(that)g(is)g(on)g(a)g(r)o +(ead-only)e(\002le)i(system,)g(such)h(as)e(a)g(CD)h(ROM.)888 +2169 y(In)26 b(this)g(case,)f FA(file-not-writabl)o(e?)18 +b FD(will)26 b(lie,)g(saying)g(that)f(r)o(oot)g(has)g(write)g(ac-)888 +2269 y(cess,)j(when)f(in)g(fact)e(the)i(opening)g(the)g(\002le)f(for)h +(write)f(access)g(will)h(fail.)42 b(Finally)-9 b(,)888 +2368 y(write)20 b(permission)g(confounds)g(write)f(access)g(and)f(cr)o +(eate)g(access.)24 b(These)19 b(should)888 2468 y(be)i(disentangled.) +888 2598 y(Some)28 b(of)g(these)g(pr)o(oblems)g(could)g(be)f(avoided)g +(if)j(P)t Fv(O)t(S)t(I)t(X)h FD(had)d(a)f(r)o(eal-uid)f(vari-)888 +2697 y(ant)j(of)h(the)f FA(access\(\))d FD(call)j(we)g(could)g(use,)i +(but)e(the)h(atomicity)g(issue)f(is)h(still)g(a)888 2797 +y(pr)o(oblem.)43 b(In)26 b(the)h(\002nal)g(analysis,)h(the)e(only)i +(way)e(to)h(\002nd)g(out)g(if)f(you)h(have)f(the)888 +2896 y(right)20 b(to)f(perform)g(an)g(operation)g(on)h(a)f(\002le)g(is) +g(to)h(try)f(and)g(open)g(it)g(for)g(the)g(desir)o(ed)888 +2996 y(operation.)31 b(These)22 b(permission-checking)i(functions)f(ar) +o(e)e(mostly)i(intended)f(for)888 3096 y(script-writing,)f(wher)o(e)g +(loose)g(guarantees)f(ar)o(e)f(tolerated.)681 3277 y +FA(\(file-readable?)37 b FC(fname)p FA(\))87 b Fw(\000)-14 +b(!)87 b FC(boolean)987 b FD(pr)o(ocedur)o(e)681 3377 +y FA(\(file-writable?)37 b FC(fname)p FA(\))87 b Fw(\000)-14 +b(!)87 b FC(boolean)987 b FD(pr)o(ocedur)o(e)681 3476 +y FA(\(file-executable)o(?)37 b FC(fname)p FA(\))87 b +Fw(\000)-14 b(!)87 b FC(boolean)900 b FD(pr)o(ocedur)o(e)888 +3611 y(These)86 b(pr)o(ocedur)o(es)e(ar)o(e)h(the)h(logical)g(negation) +g(of)g(the)g(pr)o(eceding)888 3711 y FA(file-not-...?)37 +b FD(pr)o(ocedur)o(es.)87 b(Refer)42 b(to)g(them)h(for)e(a)h +(discussion)h(of)f(their)888 3811 y(pr)o(oblems)21 b(and)f +(limitations.)681 3992 y FA(\(file-not-exists)o(?)37 b FC(fname)21 b([chase?])p FA(\))85 b Fw(\000)-14 b(!)87 -b FC(object)664 b FD(pr)o(ocedur)o(e)888 2115 y(Returns:)1071 -2230 y FA(#f)622 b FD(Exists.)1071 2379 y FA(#t)g FD(Doesn't)22 -b(exist.)1071 2529 y FA('search-denied)94 b FD(Some)21 -b(pr)o(otected)e(dir)o(ectory)h(is)1781 2628 y(blocking)i(the)f(sear)o -(ch.)681 2853 y FA(\(file-exists?)38 b FC(fname)21 b([chase?])p -FA(\))85 b Fw(\000)-14 b(!)87 b FC(boolean)780 b FD(pr)o(ocedur)o(e)888 -2994 y(This)22 b(is)f(simply)g FA(\(not)42 b(\(file-not-exists?)37 -b FC(fname)43 b([chase?])o FA(\)\))681 3286 y(\(directory-files)37 -b FC([dir)20 b(dot\002les?])p FA(\))85 b Fw(\000)-14 -b(!)87 b FC(string)21 b(list)615 b FD(pr)o(ocedur)o(e)888 -3428 y(Return)19 b(the)f(list)g(of)g(\002les)g(in)h(dir)o(ectory)e -FC(dir)p FD(,)h(which)h(defaults)e(to)h(the)g(curr)o(ent)f(work-)888 -3528 y(ing)j(dir)o(ectory)-9 b(.)24 b(The)c FC(dot\002les?)e -FD(\003ag)i(\(default)e FA(#f)p FD(\))g(causes)h(dot)h(\002les)f(to)h -(be)f(included)888 3627 y(in)26 b(the)e(list.)39 b(Regar)o(dless)24 -b(of)g(the)h(value)f(of)h FC(dot\002les?)o FD(,)h(the)e(two)i(\002les)f -FA(.)f FD(and)h FA(..)e FD(ar)o(e)888 3727 y FC(never)f -FD(r)o(eturned.)888 3860 y(The)c(dir)o(ectory)f FC(dir)h -FD(is)g(not)g(pr)o(epended)e(to)j(each)e(\002le)h(name)g(in)g(the)g(r)o -(esult)f(list.)25 b(That)888 3960 y(is,)1071 4100 y FA -(\(directory-files)37 b("/etc"\))888 4240 y FD(r)o(eturns)1071 -4379 y FA(\("chown")j("exports")g("fstab")h(...\))888 -4519 y FC(not)1071 4659 y FA(\("/etc/chown")d("/etc/exports")g -("/etc/fstab")h(...\))888 4799 y FD(T)-8 b(o)36 b(use)e(the)h(\002les)h -(in)f(r)o(eturned)e(list,)39 b(the)c(pr)o(ogrammer)f(can)g(either)h -(manually)888 4898 y(pr)o(epend)20 b(the)h(dir)o(ectory:)2071 -5147 y(44)p eop -%%Page: 45 51 -45 50 bop 756 614 a FA(\(map)41 b(\()p Fo(\025)e FA(\(f\))k -(\(string-append)37 b(dir)43 b("/")f(f\)\))g(files\))573 -764 y FD(or)21 b(cd)f(to)h(the)g(dir)o(ectory)f(befor)o(e)g(using)h -(the)g(\002le)g(names:)756 940 y FA(\(with-cwd)39 b(dir)843 -1039 y(\(for-each)h(delete-file)f(\(directory-file)o(s\)\))o(\))573 -1215 y FD(or)21 b(use)g(the)f FA(glob)g FD(pr)o(ocedur)o(e,)e -(de\002ned)i(below)-8 b(.)573 1352 y(A)20 b(dir)o(ectory)g(list)i(can)e -(be)g(generated)g(by)h FA(\(run/strings)39 b(\(ls\)\))p -FD(,)18 b(but)j(this)g(is)h(un-)573 1452 y(r)o(eliable,)32 -b(as)e(\002lenames)h(with)g(whitespace)g(in)g(their)g(names)g(will)g -(be)g(split)g(into)573 1552 y(separate)19 b(entries.)26 -b(Using)21 b FA(directory-files)14 b FD(is)22 b(r)o(eliable.)365 -1757 y FA(\(glob)42 b FC(pat)733 1784 y Fx(1)791 1757 -y FC(.)12 b(.)g(.)g FA(\))87 b Fw(\000)-14 b(!)87 b FC(string)21 -b(list)1283 b FD(pr)o(ocedur)o(e)573 1903 y(Glob)27 b(each)f(pattern)g -(against)g(the)g(\002lesystem)h(and)f(r)o(eturn)g(the)h(sorted)f(list.) -43 b(Du-)573 2002 y(plicates)30 b(ar)o(e)g(not)i(r)o(emoved.)55 -b(Patterns)30 b(matching)i(nothing)h(ar)o(e)c(not)j(included)573 -2102 y(literally)-9 b(.)869 2072 y Fs(2)929 2102 y FD(C)21 -b(shell)h FA({a,b,c})d FD(patterns)i(ar)o(e)f(expanded.)26 -b(Backslash)21 b(quotes)h(char)o(-)573 2202 y(acters,)e(turning)h(of)o -(f)f(the)h(special)f(meaning)i(of)e FA({)p FD(,)g FA(})p -FD(,)h FA(*)p FD(,)f FA([)p FD(,)g FA(])p FD(,)g(and)g -FA(?)p FD(.)573 2339 y(Note)33 b(that)h(the)f(r)o(ules)h(of)f -(backslash)h(for)f(Scheme)g(strings)h(and)f(glob)h(patterns)573 -2439 y(work)e(together)h(to)f(r)o(equir)o(e)f(four)h(backslashes)g(in)g -(a)g(r)o(ow)g(to)g(specify)g(a)g(single)573 2538 y(literal)20 -b(backslash.)26 b(Fortunately)-9 b(,)20 b(this)i(should)f(be)g(a)f(rar) -o(e)f(occurr)o(ence.)573 2676 y(A)27 b(glob)h(subpattern)f(will)h(not)g -(match)f(against)h(dot)f(\002les)h(unless)g(the)f(\002rst)h(char)o(-) -573 2776 y(acter)k(of)i(the)f(subpattern)h(is)f(a)g(literal)h(\223)p -FA(.)p FD(\224.)62 b(Further)-6 b(,)36 b(a)d(dot)h(subpattern)f(will) -573 2875 y(not)g(match)f(the)h(\002les)f FA(.)g FD(or)g -FA(..)g FD(unless)h(it)f(is)h(a)f(constant)h(pattern,)h(as)e(in)h -FA(\(glob)573 2975 y("../*/*.c"\))p FD(.)20 b(So)g(a)f(dir)o(ectory's)g -(dot)h(\002les)g(can)f(be)h(r)o(eliably)e(generated)h(with)h(the)573 -3075 y(simple)h(glob)g(pattern)g FA(".*")p FD(.)573 3212 -y(Some)g(examples:)756 3362 y FA(\(glob)41 b("*.c")h("*.h"\))930 -3461 y(;;)h(All)f(the)g(C)h(and)g(#include)d(files)i(in)g(my)h -(directory.)756 3661 y(\(glob)e("*.c")h("*/*.c"\))930 -3760 y(;;)h(All)f(the)g(C)h(files)f(in)h(this)f(directory)e(and)930 -3860 y(;;)j(its)f(immediate)e(subdirectories.)756 4059 -y(\(glob)h("lexer/*.c")e("parser/*.c"\))756 4159 y(\(glob)i -("{lexer,parser}/)o(*.c)o("\))930 4258 y(;;)i(All)f(the)g(C)h(files)f -(in)h(the)f(lexer)g(and)g(parser)f(dirs.)756 4458 y(\(glob)g -("\\\\{lexer,parser)o(\\\\})o(/*)o(.c)o("\))930 4557 -y(;;)i(All)f(the)g(C)h(files)f(in)h(the)f(strange)930 -4657 y(;;)h(directory)c("{lexer,parser}".)p 365 4819 -1146 4 v 456 4875 a Fr(2)485 4898 y Fv(Why)16 b(bother)g(to)h(mention)f -(such)g(a)h(silly)h(possibility?)k(Because)17 b(that)f(is)h(what)f(sh)h -(does.)1756 5147 y FD(45)p eop -%%Page: 46 52 -46 51 bop 1071 614 a FA(\(glob)42 b("*\\\\*"\))1245 714 -y(;;)h(All)f(the)h(files)e(ending)g(in)i("*",)f(e.g.)1245 -814 y(;;)h(\("foo*")e("bar*"\))1071 1013 y(\(glob)h("*lexer*"\))1245 -1112 y(\("mylexer.c")d("lexer1.notes"\))1245 1212 y(;;)k(All)f(files)g -(containing)d(the)k(string)e("lexer".)1071 1411 y(\(glob)h("lexer"\)) -1245 1511 y(;;)h(Either)e(\("lexer"\))f(or)j(\(\).)888 -1650 y FD(If)21 b(the)h(\002rst)g(character)e(of)h(the)h(pattern)f -(\(after)f(expanding)h(braces\))f(is)i(a)f(slash,)h(the)888 -1749 y(sear)o(ch)c(begins)i(at)e(r)o(oot;)i(otherwise,)f(the)h(sear)o -(ch)e(begins)h(in)h(the)f(curr)o(ent)f(working)888 1849 -y(dir)o(ectory)-9 b(.)888 1980 y(If)19 b(the)g(last)g(character)f(of)h -(the)g(pattern)g(\(after)e(expanding)i(braces\))f(is)h(a)g(slash,)h -(then)888 2080 y(the)h(r)o(esult)g(matches)f(must)i(be)e(dir)o -(ectories,)g FC(e.g.)o FD(,)1071 2243 y FA(\(glob)42 -b("/usr/man/man?/)o("\))37 b Fn(=)-14 b Fw(\))1420 2342 -y FA(\("/usr/man/man1)o(/")37 b("/usr/man/man2/")g(...\))888 -2537 y FD(Globbing)29 b(can)e(sometimes)i(be)e(useful)g(when)h(we)f -(need)g(a)g(list)h(of)g(a)f(dir)o(ectory's)888 2636 y(\002les)32 -b(wher)o(e)e(each)h(element)g(in)g(the)g(list)h(includes)f(the)g -(pathname)g(for)g(the)g(\002le.)888 2736 y(Compar)o(e:)1071 -2899 y FA(\(directory-files)37 b("../include"\))h Fn(=)-14 -b Fw(\))1245 2999 y FA(\("cig.h")41 b("decls.h")e(...\))1071 -3198 y(\(glob)j("../include/*"\))37 b Fn(=)-14 b Fw(\))1245 -3298 y FA(\("../include/cig.)o(h")37 b("../include/decl)o(s.h)o(")g -(...\))681 3564 y(\(glob-quote)i FC(str)p FA(\))87 b -Fw(\000)-14 b(!)87 b FC(string)1319 b FD(pr)o(ocedur)o(e)888 -3702 y(Returns)29 b(a)f(constant)h(glob)g(pattern)e(that)i(exactly)e -(matches)h FC(str)q FD(.)48 b(All)28 b(wild-car)o(d)888 -3801 y(characters)20 b(in)h FC(str)g FD(ar)o(e)e(quoted)j(with)f(a)f -(backslash.)1071 3964 y FA(\(glob-quote)39 b("Any)j(*.c)g(files?"\)) -1245 4064 y Fn(=)-14 b Fw(\))44 b FA("Any)e(\\*.c)g(files\\?")681 -4330 y(\(file-match)d FC(r)o(oot)20 b(dot-\002les?)f(pat)1790 -4357 y Fx(1)1848 4330 y FC(pat)1954 4357 y Fx(2)2012 -4330 y FC(.)12 b(.)g(.)34 b(pat)2239 4357 y Fp(n)2284 -4330 y FA(\))87 b Fw(\000)-15 b(!)87 b FC(string)21 b(list)205 -b FD(pr)o(ocedur)o(e)888 4468 y FA(file-match)26 b FD(pr)o(ovides)j(a)g -(mor)o(e)h(powerful)f(\002le-matching)h(service,)i(at)d(the)h(ex-)888 -4568 y(pense)23 b(of)g(a)f(less)h(convenient)h(notation.)33 -b(It)23 b(is)g(intermediate)f(in)h(power)g(between)888 -4667 y(most)f(shell)f(matching)h(machinery)f(and)f(r)o(ecursive)g -FA(find\(1\))p FD(.)888 4799 y(Each)g(pattern)g(is)g(a)g(r)o(egexp.)k -(The)c(pr)o(ocedur)o(e)f(sear)o(ches)g(fr)o(om)h FC(r)o(oot)o -FD(,)g(matching)h(the)888 4898 y(\002rst-level)c(\002les)h(against)f -(pattern)g FC(pat)2091 4925 y Fx(1)2128 4898 y FD(,)h(the)f -(second-level)g(\002les)g(against)h FC(pat)3329 4925 -y Fx(2)3366 4898 y FD(,)f(and)2071 5147 y(46)p eop -%%Page: 47 53 -47 52 bop 573 614 a FD(so)23 b(forth.)33 b(The)23 b(list)g(of)g -(\002les)h(matching)f(the)h(whole)f(path)g(pattern)g(is)g(r)o(eturned,) -f(in)573 714 y(sorted)e(or)o(der)-6 b(.)25 b(The)20 b(matcher)h(uses)g -(Spencer)6 b('s)20 b(r)o(egular)g(expr)o(ession)g(package.)573 -839 y(The)h(\002les)h FA(.)f FD(and)g FA(..)g FD(ar)o(e)f(never)h -(matched.)27 b(Other)22 b(dot)f(\002les)h(ar)o(e)e(only)j(matched)e(if) -573 939 y(the)g FC(dot-\002les?)e FD(ar)o(gument)h(is)i -FA(#t)p FD(.)573 1065 y(A)j(given)g FC(pat)999 1092 y -Fp(i)1052 1065 y FD(pattern)f(is)i(matched)f(as)f(a)h(r)o(egexp,)g(so)g -(it)h(is)f(not)h(for)o(ced)e(to)h(match)573 1164 y(the)c(entir)o(e)f +b FC(object)664 b FD(pr)o(ocedur)o(e)888 4127 y(Returns:)1071 +4241 y FA(#f)622 b FD(Exists.)1071 4391 y FA(#t)g FD(Doesn't)22 +b(exist.)1071 4540 y FA('search-denied)94 b FD(Some)21 +b(pr)o(otected)e(dir)o(ectory)h(is)1781 4640 y(blocking)i(the)f(sear)o +(ch.)681 4853 y FA(\(file-exists?)38 b FC(fname)21 b([chase?])p +FA(\))85 b Fw(\000)-14 b(!)87 b FC(boolean)780 b FD(pr)o(ocedur)o(e) +2071 5147 y(44)p eop +%%Page: 45 53 +45 52 bop 573 614 a FD(This)21 b(is)g(simply)h FA(\(not)42 +b(\(file-not-exists)o(?)37 b FC(fname)44 b([chase?])o +FA(\)\))365 907 y(\(directory-files)37 b FC([dir)21 b(dot\002les?])p +FA(\))85 b Fw(\000)-14 b(!)87 b FC(string)21 b(list)615 +b FD(pr)o(ocedur)o(e)573 1048 y(Return)18 b(the)g(list)h(of)f(\002les)g +(in)g(dir)o(ectory)f FC(dir)p FD(,)h(which)h(defaults)e(to)h(the)g +(curr)o(ent)f(work-)573 1148 y(ing)j(dir)o(ectory)-9 +b(.)24 b(The)19 b FC(dot\002les?)g FD(\003ag)g(\(default)f +FA(#f)p FD(\))h(causes)g(dot)g(\002les)h(to)g(be)f(included)573 +1248 y(in)25 b(the)g(list.)38 b(Regar)o(dless)24 b(of)h(the)g(value)f +(of)h FC(dot\002les?)o FD(,)g(the)g(two)g(\002les)g FA(.)g +FD(and)f FA(..)g FD(ar)o(e)573 1347 y FC(never)d FD(r)o(eturned.)573 +1481 y(The)d(dir)o(ectory)f FC(dir)g FD(is)h(not)h(pr)o(epended)d(to)i +(each)f(\002le)h(name)g(in)g(the)g(r)o(esult)g(list.)25 +b(That)573 1580 y(is,)756 1720 y FA(\(directory-file)o(s)37 +b("/etc"\))573 1860 y FD(r)o(eturns)756 2000 y FA(\("chown")j +("exports")g("fstab")g(...\))573 2140 y FC(not)756 2280 +y FA(\("/etc/chown")e("/etc/exports")f("/etc/fstab")i(...\))573 +2420 y FD(T)-8 b(o)35 b(use)g(the)g(\002les)g(in)g(r)o(eturned)f(list,) +k(the)d(pr)o(ogrammer)f(can)h(either)f(manually)573 2519 +y(pr)o(epend)19 b(the)i(dir)o(ectory:)756 2659 y FA(\(map)41 +b(\()p Fo(\025)e FA(\(f\))k(\(string-append)37 b(dir)43 +b("/")f(f\)\))g(files\))573 2799 y FD(or)21 b(cd)f(to)h(the)g(dir)o +(ectory)f(befor)o(e)g(using)h(the)g(\002le)g(names:)756 +2966 y FA(\(with-cwd)39 b(dir)843 3066 y(\(for-each)h(delete-file)f +(\(directory-file)o(s\)\))o(\))573 3233 y FD(or)21 b(use)g(the)f +FA(glob)g FD(pr)o(ocedur)o(e,)e(de\002ned)i(below)-8 +b(.)573 3367 y(A)20 b(dir)o(ectory)g(list)i(can)e(be)g(generated)g(by)h +FA(\(run/strings)39 b(\(ls\)\))p FD(,)18 b(but)j(this)g(is)h(un-)573 +3466 y(r)o(eliable,)32 b(as)e(\002lenames)h(with)g(whitespace)g(in)g +(their)g(names)g(will)g(be)g(split)g(into)573 3566 y(separate)19 +b(entries.)26 b(Using)21 b FA(directory-files)14 b FD(is)22 +b(r)o(eliable.)365 3759 y FA(\(glob)42 b FC(pat)733 3786 +y Fx(1)791 3759 y FC(.)12 b(.)g(.)g FA(\))87 b Fw(\000)-14 +b(!)87 b FC(string)21 b(list)1283 b FD(pr)o(ocedur)o(e)573 +3900 y(Glob)27 b(each)f(pattern)g(against)g(the)g(\002lesystem)h(and)f +(r)o(eturn)g(the)h(sorted)f(list.)43 b(Du-)573 4000 y(plicates)30 +b(ar)o(e)g(not)i(r)o(emoved.)55 b(Patterns)30 b(matching)i(nothing)h +(ar)o(e)c(not)j(included)573 4100 y(literally)-9 b(.)869 +4070 y Fs(2)929 4100 y FD(C)21 b(shell)h FA({a,b,c})d +FD(patterns)i(ar)o(e)f(expanded.)26 b(Backslash)21 b(quotes)h(char)o(-) +573 4199 y(acters,)e(turning)h(of)o(f)f(the)h(special)f(meaning)i(of)e +FA({)p FD(,)g FA(})p FD(,)h FA(*)p FD(,)f FA([)p FD(,)g +FA(])p FD(,)g(and)g FA(?)p FD(.)573 4333 y(Note)33 b(that)h(the)f(r)o +(ules)h(of)f(backslash)h(for)f(Scheme)g(strings)h(and)f(glob)h +(patterns)573 4432 y(work)e(together)h(to)f(r)o(equir)o(e)f(four)h +(backslashes)g(in)g(a)g(r)o(ow)g(to)g(specify)g(a)g(single)573 +4532 y(literal)20 b(backslash.)26 b(Fortunately)-9 b(,)20 +b(this)i(should)f(be)g(a)f(rar)o(e)f(occurr)o(ence.)573 +4665 y(A)27 b(glob)h(subpattern)f(will)h(not)g(match)f(against)h(dot)f +(\002les)h(unless)g(the)f(\002rst)h(char)o(-)573 4765 +y(acter)k(of)i(the)f(subpattern)h(is)f(a)g(literal)h(\223)p +FA(.)p FD(\224.)62 b(Further)-6 b(,)36 b(a)d(dot)h(subpattern)f(will)p +365 4819 1146 4 v 456 4875 a Fr(2)485 4898 y Fv(Why)16 +b(bother)g(to)h(mention)f(such)g(a)h(silly)h(possibility?)k(Because)17 +b(that)f(is)h(what)f(sh)h(does.)1756 5147 y FD(45)p eop +%%Page: 46 54 +46 53 bop 888 614 a FD(not)33 b(match)g(the)f(\002les)h +FA(.)f FD(or)g FA(..)f FD(unless)i(it)g(is)f(a)g(constant)h(pattern,)h +(as)e(in)h FA(\(glob)888 714 y("../*/*.c"\))p FD(.)21 +b(So)e(a)h(dir)o(ectory's)f(dot)g(\002les)h(can)g(be)f(r)o(eliably)g +(generated)f(with)j(the)888 814 y(simple)h(glob)f(pattern)f +FA(".*")p FD(.)888 963 y(Some)h(examples:)1071 1139 y +FA(\(glob)42 b("*.c")f("*.h"\))1245 1238 y(;;)i(All)f(the)h(C)g(and)f +(#include)f(files)g(in)i(my)g(directory.)1071 1438 y(\(glob)f("*.c")f +("*/*.c"\))1245 1537 y(;;)i(All)f(the)h(C)g(files)e(in)i(this)f +(directory)e(and)1245 1637 y(;;)j(its)f(immediate)e(subdirectories.) +1071 1836 y(\(glob)i("lexer/*.c")d("parser/*.c"\))1071 +1936 y(\(glob)j("{lexer,parser})o(/*)o(.c")o(\))1245 +2035 y(;;)h(All)f(the)h(C)g(files)e(in)i(the)g(lexer)e(and)h(parser)g +(dirs.)1071 2235 y(\(glob)g("\\\\{lexer,parse)o(r\\)o(\\}/)o(*.)o(c"\)) +1245 2334 y(;;)h(All)f(the)h(C)g(files)e(in)i(the)g(strange)1245 +2434 y(;;)g(directory)d("{lexer,parser}")o(.)1071 2633 +y(\(glob)i("*\\\\*"\))1245 2733 y(;;)h(All)f(the)h(files)e(ending)g(in) +i("*",)f(e.g.)1245 2832 y(;;)h(\("foo*")e("bar*"\))1071 +3032 y(\(glob)h("*lexer*"\))1245 3131 y(\("mylexer.c")d +("lexer1.notes"\))1245 3231 y(;;)k(All)f(files)g(containing)d(the)k +(string)e("lexer".)1071 3430 y(\(glob)h("lexer"\))1245 +3530 y(;;)h(Either)e(\("lexer"\))f(or)j(\(\).)888 3706 +y FD(If)21 b(the)h(\002rst)g(character)e(of)h(the)h(pattern)f(\(after)f +(expanding)h(braces\))f(is)i(a)f(slash,)h(the)888 3806 +y(sear)o(ch)c(begins)i(at)e(r)o(oot;)i(otherwise,)f(the)h(sear)o(ch)e +(begins)h(in)h(the)f(curr)o(ent)f(working)888 3905 y(dir)o(ectory)-9 +b(.)888 4054 y(If)19 b(the)g(last)g(character)f(of)h(the)g(pattern)g +(\(after)e(expanding)i(braces\))f(is)h(a)g(slash,)h(then)888 +4154 y(the)h(r)o(esult)g(matches)f(must)i(be)e(dir)o(ectories,)g +FC(e.g.)o FD(,)1071 4352 y FA(\(glob)42 b("/usr/man/man?/)o("\))37 +b Fn(=)-14 b Fw(\))1420 4452 y FA(\("/usr/man/man1)o(/")37 +b("/usr/man/man2/")g(...\))888 4699 y FD(Globbing)29 +b(can)e(sometimes)i(be)e(useful)g(when)h(we)f(need)g(a)g(list)h(of)g(a) +f(dir)o(ectory's)888 4799 y(\002les)32 b(wher)o(e)e(each)h(element)g +(in)g(the)g(list)h(includes)f(the)g(pathname)g(for)g(the)g(\002le.)888 +4898 y(Compar)o(e:)2071 5147 y(46)p eop +%%Page: 47 55 +47 54 bop 756 614 a FA(\(directory-file)o(s)37 b("../include"\))i +Fn(=)-14 b Fw(\))930 714 y FA(\("cig.h")40 b("decls.h")g(...\))756 +913 y(\(glob)h("../include/*"\))c Fn(=)-14 b Fw(\))930 +1013 y FA(\("../include/cig)o(.h)o(")38 b("../include/dec)o(ls.)o(h")f +(...\))365 1353 y(\(glob-quote)i FC(str)p FA(\))87 b +Fw(\000)-14 b(!)87 b FC(string)1320 b FD(pr)o(ocedur)o(e)573 +1506 y(Returns)29 b(a)f(constant)g(glob)h(pattern)f(that)g(exactly)g +(matches)g FC(str)p FD(.)48 b(All)28 b(wild-car)o(d)573 +1606 y(characters)19 b(in)j FC(str)f FD(ar)o(e)e(quoted)i(with)h(a)e +(backslash.)756 1796 y FA(\(glob-quote)39 b("Any)i(*.c)i(files?"\))930 +1896 y Fn(=)-14 b Fw(\))43 b FA("Any)f(\\*.c)g(files\\?")365 +2236 y(\(file-match)d FC(r)o(oot)20 b(dot-\002les?)g(pat)1475 +2263 y Fx(1)1533 2236 y FC(pat)1639 2263 y Fx(2)1697 +2236 y FC(.)12 b(.)g(.)33 b(pat)1923 2263 y Fp(n)1968 +2236 y FA(\))87 b Fw(\000)-14 b(!)87 b FC(string)21 b(list)205 +b FD(pr)o(ocedur)o(e)573 2390 y Fw(f)p FD(Note)29 b(This)h(pr)o(ocedur) +o(e)e(is)i(depr)o(ecated,)f(and)g(will)i(pr)o(obably)d(either)i(go)g +(away)573 2489 y(or)24 b(be)g(substantially)h(alter)o(ed)e(in)i(a)e +(futur)o(e)h(r)o(elease.)34 b(New)25 b(code)f(should)h(not)g(call)573 +2589 y(this)k(pr)o(ocedur)o(e.)48 b(The)28 b(pr)o(oblem)h(is)g(that)f +(it)h(r)o(elies)f(upon)i(Posix-notation)g(r)o(egu-)573 +2688 y(lar)23 b(expr)o(essions;)i(the)e(r)o(est)g(of)h(scsh)g(has)f +(been)h(converted)f(over)g(to)h(the)g(new)g(SRE)573 2788 +y(notation.)p Fw(g)573 2933 y FA(file-match)h FD(pr)o(ovides)k(a)h(mor) +o(e)f(powerful)h(\002le-matching)g(service,)h(at)e(the)h(ex-)573 +3033 y(pense)23 b(of)f(a)h(less)g(convenient)h(notation.)32 +b(It)23 b(is)g(intermediate)g(in)g(power)g(between)573 +3132 y(most)f(shell)f(matching)g(machinery)g(and)g(r)o(ecursive)e +FA(find\(1\))p FD(.)573 3277 y(Each)h(pattern)f(is)i(a)f(r)o(egexp.)k +(The)c(pr)o(ocedur)o(e)e(sear)o(ches)h(fr)o(om)h FC(r)o(oot)o +FD(,)g(matching)h(the)573 3377 y(\002rst-level)c(\002les)g(against)h +(pattern)e FC(pat)1775 3404 y Fx(1)1812 3377 y FD(,)i(the)f +(second-level)g(\002les)h(against)f FC(pat)3013 3404 +y Fx(2)3050 3377 y FD(,)h(and)573 3476 y(so)23 b(forth.)33 +b(The)23 b(list)g(of)g(\002les)h(matching)f(the)h(whole)f(path)g +(pattern)g(is)g(r)o(eturned,)f(in)573 3576 y(sorted)e(or)o(der)-6 +b(.)25 b(The)20 b(matcher)h(uses)g(Spencer)6 b('s)20 +b(r)o(egular)g(expr)o(ession)g(package.)573 3721 y(The)h(\002les)h +FA(.)f FD(and)g FA(..)g FD(ar)o(e)f(never)h(matched.)27 +b(Other)22 b(dot)f(\002les)h(ar)o(e)e(only)j(matched)e(if)573 +3821 y(the)g FC(dot-\002les?)e FD(ar)o(gument)h(is)i +FA(#t)p FD(.)573 3965 y(A)j(given)g FC(pat)999 3992 y +Fp(i)1052 3965 y FD(pattern)f(is)i(matched)f(as)f(a)h(r)o(egexp,)g(so)g +(it)h(is)f(not)h(for)o(ced)e(to)h(match)573 4065 y(the)c(entir)o(e)f (\002le)h(name.)k FC(E.g.)o FD(,)c(pattern)f FA("t")f FD(matches)i(any)g(\002le)g(containing)h(a)e(\223t\224)g(in)573 -1264 y(its)27 b(name,)h(while)g(pattern)e FA("^t$")f +4165 y(its)27 b(name,)h(while)g(pattern)e FA("^t$")f FD(matches)i(only)h(a)e(\002le)h(whose)h(entir)o(e)e(name)h(is)573 -1363 y(\223)p FA(t)p FD(\224.)573 1489 y(The)21 b FC(pat)839 -1516 y Fp(i)887 1489 y FD(patterns)f(can)h(be)f(mor)o(e)h(general)f -(than)h(stated)f(above.)672 1640 y Fw(\017)42 b FD(A)c(single)i +4264 y(\223)p FA(t)p FD(\224.)573 4409 y(The)21 b FC(pat)839 +4436 y Fp(i)887 4409 y FD(patterns)f(can)h(be)f(mor)o(e)h(general)f +(than)h(stated)f(above.)672 4599 y Fw(\017)42 b FD(A)c(single)i (pattern)e(can)h(specify)f(multiple)i(levels)f(of)g(the)g(path)g(by)g -(em-)756 1740 y(bedding)27 b FA(/)g FD(characters)g(within)i(the)f +(em-)756 4699 y(bedding)27 b FA(/)g FD(characters)g(within)i(the)f (pattern.)46 b(For)28 b(example,)g(the)g(pattern)756 -1839 y FA("a/b/c")j FD(gives)j(a)g(match)g(equivalent)h(to)f(the)h -(list)f(of)h(patterns)e FA("a")43 b("b")756 1939 y("c")p -FD(.)672 2057 y Fw(\017)f FD(A)24 b FC(pat)951 2084 y -Fp(i)1004 2057 y FD(pattern)h(can)g(be)g(a)f(pr)o(ocedur)o(e,)g(which)j -(is)e(used)g(as)g(a)g(match)g(pr)o(edi-)756 2157 y(cate.)35 -b(It)25 b(will)g(be)f(r)o(epeatedly)e(called)i(with)h(a)f(candidate)f -(\002le-name)h(to)h(test.)756 2256 y(The)d(\002le-name)g(will)h(be)f -(the)h(entir)o(e)e(path)i(accumulated.)29 b(If)22 b(the)h(pr)o(ocedur)o -(e)756 2356 y(raises)h(an)h(err)o(or)f(condition,)j FA(file-match)20 -b FD(will)26 b(catch)e(the)i(err)o(or)d(and)i(tr)o(eat)756 -2456 y(it)19 b(as)f(a)h(failed)f(match.)25 b(This)19 -b(keeps)g FA(file-match)c FD(fr)o(om)j(being)h(blown)h(out)g(of)756 -2555 y(the)j(water)h(by)g(applying)g(tests)g(to)g(dangling)g(symlinks)i -(and)d(other)h(similar)756 2655 y(situations.)573 2806 -y(Some)d(examples:)911 2906 y FA(\(file-match)39 b("/usr/lib")g(#f)k -("m$")f("^tab"\))f Fn(=)-14 b Fw(\))1085 3005 y FA(\("/usr/lib/term/)o -(tab)o(30)o(0")37 b("/usr/lib/term/ta)o(b3)o(00)o(-12)o(")g(...\))911 -3205 y(\(file-match)i(".")j(#f)86 b("^lex|parse|codeg)o(en$)o(")37 -b("\\\\.c$"\))k Fn(=)-14 b Fw(\))1085 3304 y FA(\("lex/lex.c")39 -b("lex/lexinit.c")e("lex/test.c")1129 3404 y("parse/actions.)o(c")g -("parse/error.c")h(parse/test.c")1129 3504 y("codegen/io.c")f -("codegen/walk.c"\))911 3703 y(\(file-match)i(".")j(#f)86 -b("^lex|parse|codeg)o(en$)o(/\\)o(\\.c)o($")o(\))1129 -3802 y(;;)42 b(The)h(same.)911 4002 y(\(file-match)c(".")j(#f)86 -b(file-directory?\))1085 4101 y(;;)43 b(Return)e(all)h(subdirs)f(of)i -(the)f(current)f(directory.)911 4301 y(\(file-match)e("/")j(#f)86 -b(file-directory?\))37 b Fn(=)-14 b Fw(\))1085 4400 y -FA(\("/bin")41 b("/dev")g("/etc")g("/tmp")g("/usr"\))1085 -4500 y(;;)i(All)f(subdirs)f(of)i(root.)911 4699 y(\(file-match)c(".")j -(#f)86 b("\\\\.c"\))1085 4799 y(;;)43 b(All)f(the)h(C)g(files)e(in)i -(my)g(directory.)1756 5147 y FD(47)p eop -%%Page: 48 54 -48 53 bop 1226 614 a FA(\(define)41 b(\(ext)h(extension\))1313 -714 y(\()p Fo(\025)d FA(\(fn\))j(\(string-suffix?)37 -b(fn)43 b(extension\)\)\))1226 913 y(\(define)e(\(true)g(.)j(x\))e -(#t\))1226 1112 y(\(file-match)d(".")k(#f)86 b("./\\\\.c"\))1226 -1212 y(\(file-match)39 b(".")k(#f)86 b("")43 b("\\\\.c"\))1226 -1312 y(\(file-match)c(".")k(#f)86 b(true)42 b("\\\\.c"\))1226 -1411 y(\(file-match)d(".")k(#f)86 b(true)42 b(\(ext)g("c"\)\))1401 -1511 y(;;)g(All)h(the)f(C)h(files)f(of)g(all)h(my)g(immediate)c -(subdirs.)1226 1710 y(\(file-match)g(".")k(#f)f("lexer"\))f -Fn(=)-14 b Fw(\))1401 1810 y FA(\("mylexer.c")38 b("lexer.notes"\))1401 -1910 y(;;)k(Compare)f(with)h(\(glob)f("lexer"\),)f(above.)888 -2156 y FD(Note)32 b(that)g(when)g FC(r)o(oot)f FD(is)h(the)g(curr)o -(ent)f(working)i(dir)o(ectory)e(\()p FA(".")p FD(\),)h(when)h(it)f(is) -888 2255 y(converted)26 b(to)g(dir)o(ectory)f(form,)i(it)f(becomes)g -FA("")p FD(,)f(and)h(doesn't)g(show)h(up)f(in)g(the)888 -2355 y(r)o(esult)21 b(\002le-names.)888 2486 y(It)i(is)h(r)o(egr)o -(ettable)d(that)i(the)g(r)o(egexp)f(wild)h(car)o(d)e(char)-6 -b(,)23 b(\223)p FA(.)p FD(\224,)f(is)h(such)h(an)f(important)888 -2586 y(\002le)e(name)g(literal,)f(as)g(dot-\002le)h(pr)o(e\002x)f(and)g -(extension)i(delimiter)-6 b(.)681 2872 y FA(\(create-temp-fil)o(e)37 +4799 y FA("a/b/c")j FD(gives)j(a)g(match)g(equivalent)h(to)f(the)h +(list)f(of)h(patterns)e FA("a")43 b("b")756 4898 y("c")p +FD(.)1756 5147 y(47)p eop +%%Page: 48 56 +48 55 bop 988 614 a Fw(\017)41 b FD(A)25 b FC(pat)1267 +641 y Fp(i)1320 614 y FD(pattern)f(can)h(be)g(a)g(pr)o(ocedur)o(e,)f +(which)i(is)g(used)f(as)g(a)f(match)i(pr)o(edi-)1071 +714 y(cate.)36 b(It)24 b(will)h(be)f(r)o(epeatedly)f(called)g(with)i(a) +f(candidate)f(\002le-name)h(to)h(test.)1071 814 y(The)d(\002le-name)g +(will)i(be)e(the)g(entir)o(e)g(path)g(accumulated.)29 +b(If)22 b(the)h(pr)o(ocedur)o(e)1071 913 y(raises)i(an)f(err)o(or)g +(condition,)j FA(file-match)21 b FD(will)k(catch)g(the)g(err)o(or)f +(and)g(tr)o(eat)1071 1013 y(it)19 b(as)g(a)f(failed)g(match.)25 +b(This)20 b(keeps)e FA(file-match)d FD(fr)o(om)k(being)g(blown)h(out)f +(of)1071 1112 y(the)24 b(water)f(by)h(applying)g(tests)g(to)g(dangling) +h(symlinks)g(and)f(other)g(similar)1071 1212 y(situations.)888 +1411 y(Some)d(examples:)1226 1511 y FA(\(file-match)39 +b("/usr/lib")h(#f)i("m$")g("^tab"\))f Fn(=)-14 b Fw(\))1401 +1611 y FA(\("/usr/lib/term)o(/ta)o(b3)o(00)o(")38 b("/usr/lib/term/)o +(tab)o(30)o(0-1)o(2")f(...\))1226 1810 y(\(file-match)i(".")k(#f)86 +b("^lex|parse|code)o(gen)o($")37 b("\\\\.c$"\))j Fn(=)-14 +b Fw(\))1401 1910 y FA(\("lex/lex.c")38 b("lex/lexinit.c")g +("lex/test.c")1444 2009 y("parse/actions.c")f("parse/error.c")g +(parse/test.c")1444 2109 y("codegen/io.c")h("codegen/walk.c")o(\))1226 +2308 y(\(file-match)h(".")k(#f)86 b("^lex|parse|code)o(gen)o($/)o(\\\\) +o(.c$)o("\))1444 2408 y(;;)43 b(The)f(same.)1226 2607 +y(\(file-match)d(".")k(#f)86 b(file-directory?\))1401 +2707 y(;;)42 b(Return)f(all)i(subdirs)d(of)j(the)g(current)d +(directory.)1226 2906 y(\(file-match)f("/")k(#f)86 b(file-directory?\)) +37 b Fn(=)-14 b Fw(\))1401 3005 y FA(\("/bin")40 b("/dev")h("/etc")g +("/tmp")h("/usr"\))1401 3105 y(;;)g(All)h(subdirs)d(of)j(root.)1226 +3304 y(\(file-match)c(".")k(#f)86 b("\\\\.c"\))1401 3404 +y(;;)42 b(All)h(the)f(C)h(files)f(in)g(my)h(directory.)1226 +3603 y(\(define)e(\(ext)h(extension\))1313 3703 y(\()p +Fo(\025)d FA(\(fn\))j(\(string-suffix?)37 b(fn)43 b(extension\)\)\)) +1226 3902 y(\(define)e(\(true)g(.)j(x\))e(#t\))1226 4101 +y(\(file-match)d(".")k(#f)86 b("./\\\\.c"\))1226 4201 +y(\(file-match)39 b(".")k(#f)86 b("")43 b("\\\\.c"\))1226 +4301 y(\(file-match)c(".")k(#f)86 b(true)42 b("\\\\.c"\))1226 +4400 y(\(file-match)d(".")k(#f)86 b(true)42 b(\(ext)g("c"\)\))1401 +4500 y(;;)g(All)h(the)f(C)h(files)f(of)g(all)h(my)g(immediate)c +(subdirs.)1226 4699 y(\(file-match)g(".")k(#f)f("lexer"\))f +Fn(=)-14 b Fw(\))1401 4799 y FA(\("mylexer.c")38 b("lexer.notes"\))1401 +4898 y(;;)k(Compare)f(with)h(\(glob)f("lexer"\),)f(above.)2071 +5147 y FD(48)p eop +%%Page: 49 57 +49 56 bop 573 760 a FD(Note)32 b(that)f(when)i FC(r)o(oot)e +FD(is)h(the)g(curr)o(ent)f(working)i(dir)o(ectory)e(\()p +FA(".")p FD(\),)h(when)g(it)g(is)573 860 y(converted)25 +b(to)h(dir)o(ectory)f(form,)i(it)f(becomes)g FA("")p +FD(,)g(and)f(doesn't)i(show)f(up)g(in)g(the)573 959 y(r)o(esult)20 +b(\002le-names.)573 1105 y(It)j(is)g(r)o(egr)o(ettable)e(that)i(the)g +(r)o(egexp)f(wild)h(car)o(d)f(char)-6 b(,)22 b(\223)p +FA(.)p FD(\224,)g(is)i(such)f(an)g(important)573 1204 +y(\002le)e(name)f(literal,)h(as)f(dot-\002le)h(pr)o(e\002x)e(and)i +(extension)g(delimiter)-6 b(.)365 1533 y FA(\(create-temp-file)37 b FC([pr)o(e\002x])p FA(\))85 b Fw(\000)-14 b(!)87 b -FC(string)905 b FD(pr)o(ocedur)o(e)888 3010 y FA(Create-temp-file)12 -b FD(cr)o(eates)k(a)i(new)g(temporary)g(\002le)g(and)g(r)o(eturn)f(its) -i(name.)24 b(The)888 3110 y(optional)32 b(ar)o(gument)e(speci\002es)h -(the)f(\002lename)h(pr)o(e\002x)f(to)h(use,)i(and)d(defaults)g(to)888 -3209 y FA("/usr/tmp/)p FC(pid)-5 b FA(")p FD(,)20 b(wher)o(e)f -FC(pid)h FD(is)g(the)h(curr)o(ent)e(pr)o(ocess')h(id.)25 -b(The)20 b(pr)o(ocedur)o(e)e(gen-)888 3309 y(erates)j(a)h(sequence)g -(of)g(\002lenames)g(that)g(have)f FC(pr)o(e\002x)g FD(as)h(a)f(common)i -(pr)o(e\002x,)e(look-)888 3408 y(ing)28 b(for)e(a)h(\002lename)g(that)g -(doesn't)g(alr)o(eady)e(exist)i(in)g(the)g(\002le)g(system.)45 -b(When)27 b(it)888 3508 y(\002nds)g(one,)h(it)e(cr)o(eates)f(it,)i -(with)g(permission)g FA(#o600)e FD(and)g(r)o(eturns)h(the)g -(\002lename.)888 3608 y(\(The)33 b(\002le)g(permission)i(can)d(be)h -(changed)g(to)g(a)g(mor)o(e)g(permissive)g(permission)888 -3707 y(with)22 b FA(set-file-mode)15 b FD(after)20 b(being)h(cr)o -(eated\).)888 3839 y(This)31 b(\002le)e(is)h(guaranteed)f(to)h(be)f -(brand)g(new)-8 b(.)53 b(No)30 b(other)g(pr)o(ocess)f(will)i(have)e(it) -888 3938 y(open.)c(This)18 b(pr)o(ocedur)o(e)d(does)i(not)h(simply)g(r) -o(eturn)e(a)h(\002lename)g(that)g(is)h(very)e(likely)888 -4038 y(to)32 b(be)f(unused.)57 b(It)31 b(r)o(eturns)g(a)g(\002lename)g -(that)g(de\002nitely)h(did)f(not)h(exist)f(at)g(the)888 -4138 y(moment)22 b FA(create-temp-file)14 b FD(cr)o(eated)19 -b(it.)888 4269 y(It)j(is)g(not)g(necessary)g(for)f(the)h(pr)o(ocess')f -(pid)h(to)g(be)f(a)g(part)g(of)h(the)g(\002lename)f(for)h(the)888 -4368 y(uniqueness)i(guarantees)e(to)h(hold.)31 b(The)23 -b(pid)f(component)i(of)f(the)f(default)g(pr)o(e\002x)888 -4468 y(simply)32 b(serves)e(to)i(scatter)e(the)g(name)h(sear)o(ches)f -(into)h(sparse)g(r)o(egions,)i(so)e(that)888 4568 y(collisions)i(ar)o -(e)d(less)h(likely)h(to)f(occur)-6 b(.)56 b(This)31 b(speeds)g(things)h -(up,)h(but)e(does)g(not)888 4667 y(af)o(fect)19 b(corr)o(ectness.)888 -4799 y(Security)33 b(note:)51 b(doing)34 b(i/o)g(to)f(\002les)h(cr)o -(eated)d(this)j(way)f(in)g FA(/usr/tmp/)d FD(is)j(not)888 -4898 y(necessarily)18 b(secur)o(e.)23 b(General)17 b(users)g(have)g -(write)g(access)g(to)g FA(/usr/tmp/)p FD(,)d(so)k(even)2071 -5147 y(48)p eop -%%Page: 49 55 -49 54 bop 573 614 a FD(if)18 b(an)h(attacker)e(cannot)i(access)f(the)h -(new)g(temp)f(\002le,)h(he)g(can)f(delete)g(it)h(and)f(r)o(eplace)573 -714 y(it)32 b(with)h(one)f(of)g(his)h(own.)60 b(A)32 +FC(string)905 b FD(pr)o(ocedur)o(e)573 1687 y FA(Create-temp-file)11 +b FD(cr)o(eates)17 b(a)g(new)i(temporary)e(\002le)i(and)e(r)o(eturn)h +(its)g(name.)25 b(The)573 1787 y(optional)31 b(ar)o(gument)f +(speci\002es)h(the)g(\002lename)g(pr)o(e\002x)e(to)i(use,)i(and)d +(defaults)g(to)573 1887 y FA("/usr/tmp/)p FC(pid)-5 b +FA(")p FD(,)19 b(wher)o(e)h FC(pid)f FD(is)i(the)f(curr)o(ent)f(pr)o +(ocess')h(id.)25 b(The)c(pr)o(ocedur)o(e)d(gen-)573 1986 +y(erates)j(a)g(sequence)h(of)g(\002lenames)g(that)g(have)g +FC(pr)o(e\002x)f FD(as)g(a)h(common)h(pr)o(e\002x,)e(look-)573 +2086 y(ing)27 b(for)g(a)f(\002lename)h(that)g(doesn't)g(alr)o(eady)e +(exist)i(in)h(the)f(\002le)g(system.)44 b(When)27 b(it)573 +2185 y(\002nds)f(one,)i(it)f(cr)o(eates)d(it,)k(with)f(permission)g +FA(#o600)d FD(and)i(r)o(eturns)f(the)i(\002lename.)573 +2285 y(\(The)33 b(\002le)g(permission)h(can)f(be)g(changed)f(to)i(a)e +(mor)o(e)h(permissive)g(permission)573 2385 y(with)21 +b FA(set-file-mode)16 b FD(after)j(being)i(cr)o(eated\).)573 +2530 y(This)30 b(\002le)g(is)g(guaranteed)e(to)i(be)g(brand)f(new)-8 +b(.)53 b(No)30 b(other)g(pr)o(ocess)f(will)h(have)f(it)573 +2630 y(open.)24 b(This)18 b(pr)o(ocedur)o(e)d(does)i(not)h(simply)g(r)o +(eturn)f(a)f(\002lename)i(that)f(is)g(very)g(likely)573 +2730 y(to)31 b(be)g(unused.)58 b(It)31 b(r)o(eturns)g(a)f(\002lename)i +(that)f(de\002nitely)g(did)g(not)h(exist)g(at)e(the)573 +2829 y(moment)22 b FA(create-temp-fil)o(e)15 b FD(cr)o(eated)k(it.)573 +2975 y(It)j(is)g(not)g(necessary)f(for)h(the)f(pr)o(ocess')h(pid)f(to)h +(be)g(a)f(part)g(of)g(the)h(\002lename)g(for)f(the)573 +3074 y(uniqueness)j(guarantees)e(to)g(hold.)32 b(The)23 +b(pid)f(component)i(of)e(the)h(default)f(pr)o(e\002x)573 +3174 y(simply)31 b(serves)g(to)g(scatter)f(the)h(name)g(sear)o(ches)e +(into)j(sparse)e(r)o(egions,)j(so)f(that)573 3274 y(collisions)h(ar)o +(e)c(less)j(likely)f(to)g(occur)-6 b(.)56 b(This)32 b(speeds)e(things)j +(up,)g(but)e(does)g(not)573 3373 y(af)o(fect)19 b(corr)o(ectness.)573 +3519 y(Security)32 b(note:)51 b(doing)34 b(i/o)g(to)g(\002les)f(cr)o +(eated)e(this)j(way)f(in)h FA(/usr/tmp/)29 b FD(is)34 +b(not)573 3618 y(necessarily)17 b(secur)o(e.)23 b(General)17 +b(users)h(have)e(write)i(access)e(to)i FA(/usr/tmp/)p +FD(,)c(so)k(even)573 3718 y(if)g(an)h(attacker)e(cannot)i(access)f(the) +h(new)g(temp)f(\002le,)h(he)g(can)f(delete)g(it)h(and)f(r)o(eplace)573 +3818 y(it)32 b(with)h(one)f(of)g(his)h(own.)60 b(A)32 b(subsequent)g(open)h(of)f(this)g(\002lename)g(will)h(then)573 -814 y(give)21 b(you)g(his)g(\002le,)g(to)g(which)h(he)f(has)g(access)f +3917 y(give)21 b(you)g(his)g(\002le,)g(to)g(which)h(he)f(has)g(access)f (rights.)26 b(Ther)o(e)20 b(ar)o(e)f(several)h(ways)h(to)573 -913 y(defeat)e(this)j(attack,)652 1083 y(1.)41 b(Use)32 -b FA(temp-file-itera)o(te)p FD(,)d(below)-8 b(,)36 b(to)d(r)o(eturn)f -(the)h(\002le)g(descriptor)f(allo-)756 1182 y(cated)23 -b(when)j(the)f(\002le)g(is)g(opened.)38 b(This)25 b(will)h(work)f(if)g -(the)g(\002le)g(only)h(needs)756 1282 y(to)21 b(be)f(opened)h(once.)652 -1416 y(2.)41 b(If)23 b(the)g(\002le)h(needs)f(to)h(be)f(opened)g(twice) +4017 y(defeat)e(this)j(attack,)652 4209 y(1.)41 b(Use)19 +b FA(temp-file-iterate)o FD(,)14 b(below)-8 b(,)21 b(to)g(r)o(eturn)e +(the)h(\002le)h(descriptor)e(allocat-)756 4308 y(ed)24 +b(when)i(the)g(\002le)f(is)h(opened.)39 b(This)26 b(will)g(work)g(if)g +(the)f(\002le)h(only)g(needs)f(to)756 4408 y(be)20 b(opened)g(once.)652 +4553 y(2.)41 b(If)23 b(the)g(\002le)h(needs)f(to)h(be)f(opened)g(twice) h(or)f(mor)o(e,)h(cr)o(eate)d(it)j(in)g(a)f(pr)o(otected)756 -1516 y(dir)o(ectory)-9 b(,)19 b FC(e.g.)o FD(,)i FA($HOME)p -FD(.)652 1651 y(3.)41 b(Ensur)o(e)21 b(that)g FA(/usr/tmp)e +4653 y(dir)o(ectory)-9 b(,)19 b FC(e.g.)o FD(,)i FA($HOME)p +FD(.)652 4799 y(3.)41 b(Ensur)o(e)21 b(that)g FA(/usr/tmp)e FD(has)i(its)i(sticky)f(bit)g(set.)28 b(This)22 b(r)o(equir)o(es)f -(system)i(ad-)756 1750 y(ministrator)e(privileges.)573 -1920 y(The)39 b(actual)f(default)f(pr)o(e\002x)h(used)h(is)g(contr)o -(olled)g(by)g(the)g(dynamic)g(variable)573 2019 y FA(*temp-file-templ)o -(at)o(e*)p FD(,)31 b(and)j(can)g(be)g(overridden)f(for)h(incr)o(eased)f -(security)-9 b(.)573 2119 y(See)20 b FA(temp-file-iterat)o(e)p -FD(.)365 2363 y FA(\(temp-file-iterat)o(e)37 b FC(maker)21 -b([template])p FA(\))85 b Fw(\000)-14 b(!)87 b FC(object)2302 -2333 y Fx(+)2855 2363 y FD(pr)o(ocedur)o(e)365 2463 y -FA(*temp-file-templa)o(te)o(*)1784 b FC(string)573 2606 -y FD(This)20 b(pr)o(ocedur)o(e)d(can)h(be)h(used)g(to)h(perform)e -(certain)h(atomic)g(transactions)h(on)f(the)573 2705 -y(\002le)i(system)g(involving)h(\002lenames.)k(Some)21 -b(examples:)672 2875 y Fw(\017)42 b FD(Linking)21 b(a)g(\002le)f(to)i -(a)e(fr)o(esh)g(backup)g(temp)h(name.)672 3009 y Fw(\017)42 -b FD(Cr)o(eating)19 b(and)i(opening)g(an)g(unused,)g(secur)o(e)e(temp)i -(\002le.)672 3144 y Fw(\017)42 b FD(Cr)o(eating)19 b(an)i(unused)g -(temporary)f(dir)o(ectory)-9 b(.)573 3313 y(This)41 b(pr)o(ocedur)o(e)d -(uses)j FC(template)f FD(to)g(generate)g(a)g(series)g(of)h(trial)f -(\002le)h(names.)573 3413 y FC(T)-9 b(emplate)19 b FD(is)j(a)e -FA(format)e FD(contr)o(ol)j(string,)g(and)g(defaults)f(to)756 -3555 y FA("/usr/tmp/)p FC(pid)-6 b FA(.~a")573 3698 y -FD(wher)o(e)21 b FC(pid)h FD(is)g(the)g(curr)o(ent)g(pr)o(ocess')f(pr)o -(ocess)h(id.)29 b(File)23 b(names)f(ar)o(e)f(generated)f(by)573 -3797 y(calling)g FA(format)d FD(to)j(instantiate)f(the)h(template's)f -FA(~a)g FD(\002eld)g(with)i(a)e(varying)g(string.)573 -3932 y FC(Maker)32 b FD(is)h(a)e(pr)o(ocedur)o(e)f(which)j(is)f -(serially)g(called)f(on)h(each)g(\002le)g(name)g(gener)o(-)573 -4031 y(ated.)k(It)24 b(must)i(r)o(eturn)d(at)h(least)h(one)g(value;)g -(it)g(may)g(r)o(eturn)e(multiple)i(values.)37 b(If)573 -4131 y(the)29 b(\002rst)g(r)o(eturn)f(value)g(is)h FA(#f)f -FD(or)g(if)h FC(maker)f FD(raises)h(the)g FA(errno/exist)24 -b FD(errno)k(ex-)573 4231 y(ception,)h FA(temp-file-itera)o(te)20 -b FD(will)28 b(loop,)h(generating)e(a)g(new)g(\002le)g(name)g(and)573 -4330 y(calling)18 b FC(maker)h FD(again.)24 b(If)18 b(the)g(\002rst)h -(r)o(eturn)e(value)h(is)h(tr)o(ue,)f(the)h(loop)g(is)f(terminated,)573 -4430 y(r)o(eturning)j(whatever)f(value\(s\))f FC(maker)i -FD(r)o(eturned.)573 4565 y(After)j(a)g(number)h(of)g(unsuccessful)h -(trials,)g FA(temp-file-itera)o(te)19 b FD(may)25 b(give)g(up)573 -4664 y(and)20 b(signal)h(an)g(err)o(or)-6 b(.)573 4799 -y(Thus,)21 b(if)g(we)h(ignor)o(e)f(its)g(optional)h FC(pr)o(e\002x)e -FD(ar)o(gument,)h FA(create-temp-file)14 b FD(could)573 -4898 y(be)20 b(de\002ned)h(as:)1756 5147 y(49)p eop -%%Page: 50 56 -50 55 bop 1071 614 a FA(\(define)41 b(\(create-temp-fi)o(le\))1158 -714 y(\(let)h(\(\(flags)f(\(bitwise-ior)d(open/create)h -(open/exclusive\)\)\))1245 814 y(\(temp-file-iterat)o(e)1420 -913 y(\()p Fo(\025)f FA(\(f\))1507 1013 y(\(close)j(\(open-output-fil)o -(e)d(f)43 b(flags)e(#o600\)\))1507 1112 y(f\)\)\)\))888 -1328 y FD(T)-8 b(o)22 b(r)o(ename)d(a)i(\002le)g(to)g(a)f(temporary)g -(name:)1071 1505 y FA(\(temp-file-itera)o(te)37 b(\()p -Fo(\025)i FA(\(backup\))1986 1605 y(\(create-hard-link)e(old-file)j -(backup\))1986 1705 y(backup\))1899 1804 y(".#temp.~a"\))f(;)k(Keep)f -(link)g(in)h(cwd.)1071 1904 y(\(delete-file)c(old-file\))888 -2081 y FD(Recall)26 b(that)f(scsh)h(r)o(eports)f(syscall)g(failur)o(e)f -(by)i(raising)f(an)h(err)o(or)e(exception,)i(not)888 -2181 y(by)i(r)o(eturning)f(an)f(err)o(or)h(code.)44 b(This)27 -b(is)h(critical)f(to)g(to)h(this)f(example\227the)g(pr)o(o-)888 -2280 y(grammer)j(can)g(assume)f(that)h(if)g(the)g FA(temp-file-iterate) -23 b FD(call)30 b(r)o(eturns,)h(it)f(r)o(e-)888 2380 -y(turns)d(successully)-9 b(.)44 b(So)27 b(the)g(following)h -FA(delete-file)22 b FD(call)k(can)h(be)f(r)o(eliably)g(in-)888 -2480 y(voked,)34 b(safe)c(in)h(the)h(knowledge)f(that)g(the)g(backup)g -(link)h(has)f(de\002nitely)g(been)888 2579 y(established.)888 -2718 y(T)-8 b(o)22 b(cr)o(eate)d(a)h(unique)i(temporary)e(dir)o -(ectory:)1071 2895 y FA(\(temp-file-itera)o(te)37 b(\()p -Fo(\025)i FA(\(dir\))i(\(create-directory)c(dir\))42 -b(dir\))1899 2994 y("/usr/tmp/tempdir)o(.~)o(a")o(\))888 -3171 y FD(Similar)22 b(operations)g(can)f(be)g(used)h(to)g(generate)f -(unique)h(symlinks)i(and)d(\002fos,)h(or)888 3271 y(to)f(r)o(eturn)f -(values)g(other)g(than)h(the)f(new)h(\002lename)f(\()p -FC(e.g.)o FD(,)g(an)g(open)h(\002le)f(descriptor)888 -3371 y(or)h(port\).)888 3509 y(The)i(default)e(template)h(is)g(in)h -(fact)e(taken)h(fr)o(om)g(the)g(value)g(of)g(the)h(dynamic)f(vari-)888 -3609 y(able)17 b FA(*temp-file-temp)o(lat)o(e*)o FD(,)12 +(system)i(ad-)756 4898 y(ministrator)e(privileges.)1756 +5147 y(49)p eop +%%Page: 50 58 +50 57 bop 888 614 a FD(The)39 b(actual)f(default)g(pr)o(e\002x)g(used)g +(is)i(contr)o(olled)f(by)f(the)h(dynamic)g(variable)888 +714 y FA(*temp-file-templa)o(te)o(*)p FD(,)31 b(and)j(can)g(be)g +(overridden)g(for)g(incr)o(eased)e(security)-9 b(.)888 +814 y(See)20 b FA(temp-file-iterate)o FD(.)681 1050 y +FA(\(temp-file-itera)o(te)37 b FC(maker)21 b([template])p +FA(\))85 b Fw(\000)-15 b(!)87 b FC(object)2617 1020 y +Fx(+)3170 1050 y FD(pr)o(ocedur)o(e)681 1150 y FA(*temp-file-templ)o +(at)o(e*)1783 b FC(string)888 1282 y FD(This)20 b(pr)o(ocedur)o(e)d +(can)i(be)g(used)g(to)g(perform)g(certain)f(atomic)i(transactions)f(on) +h(the)888 1381 y(\002le)h(system)h(involving)g(\002lenames.)k(Some)20 +b(examples:)988 1538 y Fw(\017)41 b FD(Linking)22 b(a)e(\002le)h(to)g +(a)f(fr)o(esh)g(backup)g(temp)h(name.)988 1662 y Fw(\017)41 +b FD(Cr)o(eating)20 b(and)g(opening)i(an)e(unused,)h(secur)o(e)f(temp)h +(\002le.)988 1786 y Fw(\017)41 b FD(Cr)o(eating)20 b(an)g(unused)h +(temporary)g(dir)o(ectory)-9 b(.)888 1943 y(This)41 b(pr)o(ocedur)o(e)e +(uses)i FC(template)e FD(to)i(generate)f(a)g(series)g(of)g(trial)h +(\002le)f(names.)888 2043 y FC(T)-9 b(emplate)20 b FD(is)h(a)f +FA(format)f FD(contr)o(ol)i(string,)g(and)f(defaults)g(to)1071 +2181 y FA("/usr/tmp/)p FC(pid)-5 b FA(.~a")888 2320 y +FD(wher)o(e)22 b FC(pid)f FD(is)h(the)h(curr)o(ent)e(pr)o(ocess')h(pr)o +(ocess)f(id.)30 b(File)22 b(names)g(ar)o(e)f(generated)g(by)888 +2419 y(calling)f FA(format)d FD(to)j(instantiate)g(the)f(template's)h +FA(~a)e FD(\002eld)i(with)g(a)f(varying)h(string.)888 +2548 y FC(Maker)27 b FD(is)f(a)g(pr)o(ocedur)o(e)e(which)j(is)f +(serially)g(called)g(on)g(each)g(\002le)g(name)g(generat-)888 +2647 y(ed.)48 b(It)29 b(must)g(r)o(eturn)f(at)g(least)g(one)h(value;)i +(it)e(may)f(r)o(eturn)g(multiple)h(values.)48 b(If)888 +2747 y(the)29 b(\002rst)g(r)o(eturn)f(value)g(is)h FA(#f)f +FD(or)h(if)f FC(maker)h FD(raises)f(the)h FA(errno/exist)24 +b FD(errno)29 b(ex-)888 2847 y(ception,)g FA(temp-file-iterat)o(e)21 +b FD(will)28 b(loop,)h(generating)e(a)f(new)h(\002le)h(name)e(and)888 +2946 y(calling)19 b FC(maker)f FD(again.)24 b(If)18 b(the)h(\002rst)f +(r)o(eturn)g(value)g(is)g(tr)o(ue,)h(the)f(loop)h(is)g(terminated,)888 +3046 y(r)o(eturning)i(whatever)f(value\(s\))g FC(maker)g +FD(r)o(eturned.)888 3174 y(After)k(a)h(number)g(of)g(unsuccessful)g +(trials,)h FA(temp-file-iterat)o(e)19 b FD(may)25 b(give)g(up)888 +3274 y(and)c(signal)g(an)f(err)o(or)-6 b(.)888 3402 y(Thus,)22 +b(if)f(we)g(ignor)o(e)g(its)h(optional)g FC(pr)o(e\002x)e +FD(ar)o(gument,)g FA(create-temp-file)15 b FD(could)888 +3502 y(be)21 b(de\002ned)f(as:)1071 3659 y FA(\(define)41 +b(\(create-temp-fi)o(le\))1158 3758 y(\(let)h(\(\(flags)f +(\(bitwise-ior)d(open/create)h(open/exclusive\)\)\))1245 +3858 y(\(temp-file-iterat)o(e)1420 3958 y(\()p Fo(\025)f +FA(\(f\))1507 4057 y(\(close)j(\(open-output-fil)o(e)d(f)43 +b(flags)e(#o600\)\))1507 4157 y(f\)\)\)\))888 4343 y +FD(T)-8 b(o)22 b(r)o(ename)d(a)i(\002le)g(to)g(a)f(temporary)g(name:) +1071 4500 y FA(\(temp-file-itera)o(te)37 b(\()p Fo(\025)i +FA(\(backup\))1986 4599 y(\(create-hard-link)e(old-file)j(backup\))1986 +4699 y(backup\))1899 4799 y(".#temp.~a"\))f(;)k(Keep)f(link)g(in)h +(cwd.)1071 4898 y(\(delete-file)c(old-file\))2071 5147 +y FD(50)p eop +%%Page: 51 59 +51 58 bop 573 614 a FD(Recall)25 b(that)g(scsh)h(r)o(eports)f(syscall)h +(failur)o(e)e(by)h(raising)h(an)f(err)o(or)g(exception,)h(not)573 +714 y(by)h(r)o(eturning)g(an)g(err)o(or)f(code.)44 b(This)28 +b(is)f(critical)g(to)h(to)f(this)h(example\227the)e(pr)o(o-)573 +814 y(grammer)j(can)h(assume)g(that)g(if)g(the)g FA(temp-file-itera)o +(te)24 b FD(call)29 b(r)o(eturns,)j(it)e(r)o(e-)573 913 +y(turns)d(successully)-9 b(.)44 b(So)26 b(the)h(following)h +FA(delete-file)23 b FD(call)j(can)g(be)h(r)o(eliably)e(in-)573 +1013 y(voked,)33 b(safe)d(in)i(the)f(knowledge)h(that)f(the)g(backup)f +(link)i(has)f(de\002nitely)h(been)573 1112 y(established.)573 +1265 y(T)-8 b(o)21 b(cr)o(eate)e(a)h(unique)i(temporary)e(dir)o +(ectory:)756 1471 y FA(\(temp-file-iter)o(at)o(e)38 b(\()p +Fo(\025)g FA(\(dir\))k(\(create-director)o(y)37 b(dir\))42 +b(dir\))1584 1570 y("/usr/tmp/tempd)o(ir.)o(~a)o("\))573 +1776 y FD(Similar)21 b(operations)h(can)g(be)f(used)g(to)h(generate)f +(unique)i(symlinks)g(and)e(\002fos,)h(or)573 1875 y(to)f(r)o(eturn)e +(values)h(other)h(than)f(the)h(new)f(\002lename)h(\()p +FC(e.g.)o FD(,)f(an)g(open)h(\002le)f(descriptor)573 +1975 y(or)h(port\).)573 2127 y(The)h(default)f(template)h(is)h(in)f +(fact)g(taken)g(fr)o(om)g(the)g(value)g(of)g(the)g(dynamic)h(vari-)573 +2227 y(able)16 b FA(*temp-file-templa)o(te)o(*)p FD(,)11 b(which)18 b(itself)f(defaults)f(to)h FA("/usr/tmp/)p -FC(pid)-5 b FA(.~a")p FD(,)888 3708 y(wher)o(e)17 b FC(pid)g -FD(is)h(the)g(scsh)g(pr)o(ocess')g(pid.)24 b(For)18 b(incr)o(eased)e -(security)-9 b(,)18 b(a)f(user)g(may)h(wish)888 3808 -y(to)i(change)f(the)g(template)f(to)i(use)f(a)f(dir)o(ectory)h(not)g -(allowing)h(world)g(write)f(access)888 3908 y(\()p FC(e.g.)o -FD(,)i(his)g(home)h(dir)o(ectory\).)681 4115 y FA(\(temp-file-chann)o -(el)o(\))81 b Fw(\000)-14 b(!)87 b FC([inp)20 b(outp])1013 -b FD(pr)o(ocedur)o(e)888 4262 y(This)26 b(pr)o(ocedur)o(e)e(can)h(be)g -(used)g(to)h(pr)o(ovide)f(an)g(interpr)o(ocess)g(communications)888 -4361 y(channel)30 b(with)g(arbitrary-sized)d(buf)o(fering.)49 -b(It)29 b(r)o(eturns)g(two)h(values,)h(an)e(input)888 -4461 y(port)17 b(and)f(an)h(output)g(port,)g(both)g(open)g(on)g(a)f -(new)h(temp)g(\002le.)24 b(The)17 b(temp)f(\002le)h(itself)888 -4561 y(is)27 b(deleted)e(fr)o(om)h(the)h(Unix)f(\002le)g(tr)o(ee)f -(befor)o(e)g FA(temp-file-channel)20 b FD(r)o(eturns,)27 -b(so)888 4660 y(the)d(\002le)g(is)h(essentially)f(unnamed,)g(and)g(its) -g(disk)g(storage)g(is)g(r)o(eclaimed)e(as)i(soon)888 -4760 y(as)d(the)g(two)g(ports)g(ar)o(e)e(closed.)888 -4898 y FA(Temp-file-channel)14 b FD(is)21 b(analogous)h(to)f -FA(port-pipe)c FD(with)k(two)h(exceptions:)2071 5147 -y(50)p eop -%%Page: 51 57 -51 56 bop 672 614 a Fw(\017)42 b FD(If)16 b(the)h(writer)f(pr)o(ocess)g -(gets)h(ahead)f(of)g(the)h(r)o(eader)e(pr)o(ocess,)i(it)f(will)i(not)f -(hang)756 714 y(waiting)i(for)f(some)i(small)f(pipe)g(buf)o(fer)e(to)i -(drain.)24 b(It)19 b(will)h(simply)f(buf)o(fer)e(the)756 -814 y(data)i(on)i(disk.)26 b(This)c(is)f(good.)672 949 -y Fw(\017)42 b FD(If)19 b(the)h(r)o(eader)d(pr)o(ocess)i(gets)h(ahead)f -(of)g(the)h(writer)g(pr)o(ocess,)f(it)h(will)g(also)g(not)756 -1049 y(hang)e(waiting)h(for)f(data)f(fr)o(om)g(the)i(writer)f(pr)o -(ocess.)24 b(It)18 b(will)h(simply)g(see)f(and)756 1148 -y(r)o(eport)h(an)i(end)g(of)f(\002le.)26 b(This)21 b(is)g(bad.)756 -1266 y(In)i(or)o(der)e(to)j(ensur)o(e)e(that)h(an)g(end-of-\002le)f(r)o -(eturned)f(to)j(the)f(r)o(eader)d(is)k(legit-)756 1365 -y(imate,)j(the)g(r)o(eader)e(and)i(writer)f(must)i(serialise)e(their)h -(i/o.)45 b(The)27 b(simplest)756 1465 y(way)20 b(to)i(do)f(this)h(is)f -(for)g(the)g(r)o(eader)e(to)i(delay)g(doing)g(input)h(until)g(the)f -(writer)756 1565 y(has)f(completely)i(\002nished)f(doing)g(output,)g -(or)g(exited.)365 1924 y Fy(3.4)99 b(Processes)365 2167 -y FA(\(exec)42 b FC(pr)o(og)19 b(ar)o(g1)h(.)12 b(.)g(.)g(ar)o(gn)p -FA(\))86 b Fw(\000)-14 b(!)87 b FC(no)21 b(r)o(eturn)g(value)759 -b FD(pr)o(ocedur)o(e)365 2266 y FA(\(exec-path)40 b FC(pr)o(og)19 -b(ar)o(g1)h(.)12 b(.)g(.)g(ar)o(gn)p FA(\))86 b Fw(\000)-14 -b(!)87 b FC(no)21 b(r)o(eturn)g(value)541 b FD(pr)o(ocedur)o(e)365 -2366 y FA(\(exec/env)40 b FC(pr)o(og)20 b(env)g(ar)o(g1)g(.)12 -b(.)g(.)g(ar)o(gn)p FA(\))86 b Fw(\000)-14 b(!)87 b FC(no)21 -b(r)o(eturn)g(value)444 b FD(pr)o(ocedur)o(e)365 2466 -y FA(\(exec-path/env)38 b FC(pr)o(og)20 b(env)g(ar)o(g1)g(.)12 -b(.)g(.)g(ar)o(gn)p FA(\))86 b Fw(\000)-14 b(!)87 b FC(no)21 -b(r)o(eturn)g(value)226 b FD(pr)o(ocedur)o(e)573 2591 -y(The)27 b FA(.../env)d FD(variants)i(take)h(an)g(envir)o(onment)g -(speci\002ed)g(as)g(a)f(string)p Fw(!)p FD(string)573 -2691 y(alist.)43 b(An)27 b(envir)o(onment)g(of)f FA(#t)g -FD(is)h(taken)f(to)h(mean)g(the)g(curr)o(ent)f(pr)o(ocess')g(envi-)573 -2791 y(r)o(onment)21 b(\()p FC(i.e.)p FD(,)f(the)h(value)f(of)h(the)g -(external)f(char)g FA(**environ)p FD(\).)573 2926 y([Rationale:)33 -b FA(#f)23 b FD(is)i(a)f(mor)o(e)g(convenient)h(marker)f(for)g(the)g -(curr)o(ent)g(envir)o(onment)573 3026 y(than)f FA(#t)p -FD(,)g(but)g(would)h(cause)f(an)g(ambiguity)g(on)h(Schemes)f(that)g -(identify)h FA(#f)e FD(and)573 3125 y FA(\(\))p FD(.])573 -3261 y(The)h(path-sear)o(ching)e(variants)i(sear)o(ch)e(the)i(dir)o -(ectories)f(in)h(the)g(list)h FA(exec-path-)573 3360 -y(list)29 b FD(for)i(the)h(pr)o(ogram.)56 b(A)31 b(path-sear)o(ch)e(is) -j(not)g(performed)e(if)h(the)g(pr)o(ogram)573 3460 y(name)26 -b(contains)h(a)f(slash)g(character)o(\227it)f(is)h(used)g(dir)o(ectly) --9 b(.)41 b(So)26 b(a)g(pr)o(ogram)g(with)573 3560 y(a)j(name)i(like)f -FA("bin/prog")c FD(always)k(executes)f(the)i(pr)o(ogram)e -FA(bin/prog)e FD(in)j(the)573 3659 y(curr)o(ent)20 b(working)i(dir)o -(ectory)-9 b(.)24 b(See)c FA($path)f FD(and)h FA(exec-path-list)p -FD(,)15 b(below)-8 b(.)573 3795 y(Note)24 b(that)g(ther)o(e)g(is)h(no)f -(analog)h(to)f(the)h(C)f(function)h FA(execv\(\))p FD(.)33 -b(T)-8 b(o)25 b(get)f(the)g(ef)o(fect)573 3894 y(just)d(do)756 -4039 y FA(\(apply)41 b(exec)h(prog)f(arglist\))573 4220 -y FD(All)20 b(of)g(these)g(pr)o(ocedur)o(es)f(\003ush)i(buf)o(fer)o(ed) -c(output)k(and)e(close)i(unr)o(evealed)d(ports)573 4319 -y(befor)o(e)23 b(executing)h(the)g(new)g(binary)-9 b(.)35 -b(T)-8 b(o)25 b(avoid)f(\003ushing)h(buf)o(fer)o(ed)d(output,)j(see)573 -4419 y FA(\045exec)19 b FD(below)-8 b(.)573 4554 y(Note)21 -b(that)h(the)f(C)g FA(exec\(\))e FD(pr)o(ocedur)o(e)h(allows)h(the)h -(zer)o(oth)f(element)g(of)g(the)h(ar)o(gu-)573 4654 y(ment)f(vector)g -(to)g(be)f(dif)o(fer)o(ent)f(fr)o(om)h(the)h(\002le)g(being)g -(executed,)e FC(e.g.)756 4799 y FA(char)41 b(*argv[])g(=)i({"-",)f -("-f",)f(0};)756 4898 y(exec\("/bin/csh")o(,)c(argv,)42 -b(envp\);)1756 5147 y FD(51)p eop -%%Page: 52 58 -52 57 bop 888 614 a FD(The)22 b(scsh)g FA(exec)p FD(,)d -FA(exec-path)p FD(,)f FA(exec/env)p FD(,)g(and)i FA(exec-path/env)c -FD(pr)o(ocedur)o(es)k(do)888 714 y(not)e(give)f(this)h +FC(pid)-5 b FA(.~a")p FD(,)573 2327 y(wher)o(e)17 b FC(pid)g +FD(is)h(the)f(scsh)i(pr)o(ocess')e(pid.)24 b(For)18 b(incr)o(eased)e +(security)-9 b(,)18 b(a)g(user)f(may)h(wish)573 2426 +y(to)h(change)g(the)g(template)g(to)g(use)g(a)g(dir)o(ectory)f(not)i +(allowing)g(world)f(write)g(access)573 2526 y(\()p FC(e.g.)o +FD(,)h(his)i(home)f(dir)o(ectory\).)365 2776 y FA(\(temp-file-channe)o +(l\))81 b Fw(\000)-15 b(!)88 b FC([inp)20 b(outp])1013 +b FD(pr)o(ocedur)o(e)573 2937 y(This)26 b(pr)o(ocedur)o(e)d(can)j(be)f +(used)g(to)h(pr)o(ovide)e(an)i(interpr)o(ocess)f(communications)573 +3036 y(channel)k(with)h(arbitrary-sized)d(buf)o(fering.)50 +b(It)29 b(r)o(eturns)g(two)g(values,)i(an)e(input)573 +3136 y(port)17 b(and)f(an)g(output)h(port,)g(both)h(open)f(on)g(a)f +(new)h(temp)f(\002le.)25 b(The)16 b(temp)h(\002le)g(itself)573 +3236 y(is)26 b(deleted)g(fr)o(om)g(the)g(Unix)g(\002le)h(tr)o(ee)e +(befor)o(e)g FA(temp-file-channe)o(l)20 b FD(r)o(eturns,)27 +b(so)573 3335 y(the)d(\002le)g(is)g(essentially)g(unnamed,)h(and)e(its) +h(disk)h(storage)e(is)h(r)o(eclaimed)f(as)g(soon)573 +3435 y(as)d(the)h(two)h(ports)f(ar)o(e)e(closed.)573 +3588 y FA(Temp-file-channe)o(l)c FD(is)21 b(analogous)g(to)g +FA(port-pipe)c FD(with)22 b(two)f(exceptions:)672 3793 +y Fw(\017)42 b FD(If)16 b(the)h(writer)f(pr)o(ocess)g(gets)h(ahead)f +(of)g(the)h(r)o(eader)e(pr)o(ocess,)i(it)f(will)i(not)f(hang)756 +3893 y(waiting)i(for)f(some)i(small)f(pipe)g(buf)o(fer)e(to)i(drain.)24 +b(It)19 b(will)h(simply)f(buf)o(fer)e(the)756 3992 y(data)i(on)i(disk.) +26 b(This)c(is)f(good.)672 4145 y Fw(\017)42 b FD(If)19 +b(the)h(r)o(eader)d(pr)o(ocess)i(gets)h(ahead)f(of)g(the)h(writer)g(pr) +o(ocess,)f(it)h(will)g(also)g(not)756 4244 y(hang)e(waiting)h(for)f +(data)f(fr)o(om)g(the)i(writer)f(pr)o(ocess.)24 b(It)18 +b(will)h(simply)g(see)f(and)756 4344 y(r)o(eport)h(an)i(end)g(of)f +(\002le.)26 b(This)21 b(is)g(bad.)756 4470 y(In)i(or)o(der)e(to)j +(ensur)o(e)e(that)h(an)g(end-of-\002le)f(r)o(eturned)f(to)j(the)f(r)o +(eader)d(is)k(legit-)756 4570 y(imate,)j(the)g(r)o(eader)e(and)i +(writer)f(must)i(serialise)e(their)h(i/o.)45 b(The)27 +b(simplest)756 4669 y(way)20 b(to)i(do)f(this)h(is)f(for)g(the)g(r)o +(eader)e(to)i(delay)g(doing)g(input)h(until)g(the)f(writer)756 +4769 y(has)f(completely)i(\002nished)f(doing)g(output,)g(or)g(exited.) +1756 5147 y(51)p eop +%%Page: 52 60 +52 59 bop 681 614 a Fy(3.4)99 b(Processes)681 859 y FA(\(exec)41 +b FC(pr)o(og)20 b(ar)o(g1)f(.)12 b(.)g(.)g(ar)o(gn)p +FA(\))87 b Fw(\000)-14 b(!)87 b FC(no)21 b(r)o(eturn)g(value)758 +b FD(pr)o(ocedur)o(e)681 959 y FA(\(exec-path)39 b FC(pr)o(og)20 +b(ar)o(g1)f(.)12 b(.)g(.)g(ar)o(gn)p FA(\))87 b Fw(\000)-14 +b(!)87 b FC(no)21 b(r)o(eturn)g(value)540 b FD(pr)o(ocedur)o(e)681 +1058 y FA(\(exec/env)40 b FC(pr)o(og)19 b(env)i(ar)o(g1)e(.)12 +b(.)g(.)g(ar)o(gn)p FA(\))87 b Fw(\000)-14 b(!)87 b FC(no)21 +b(r)o(eturn)g(value)443 b FD(pr)o(ocedur)o(e)681 1158 +y FA(\(exec-path/env)38 b FC(pr)o(og)19 b(env)i(ar)o(g1)e(.)12 +b(.)g(.)g(ar)o(gn)p FA(\))87 b Fw(\000)-14 b(!)87 b FC(no)21 +b(r)o(eturn)g(value)225 b FD(pr)o(ocedur)o(e)888 1284 +y(The)27 b FA(.../env)d FD(variants)j(take)f(an)h(envir)o(onment)h +(speci\002ed)e(as)h(a)g(string)p Fw(!)p FD(string)888 +1384 y(alist.)43 b(An)27 b(envir)o(onment)g(of)g FA(#t)f +FD(is)h(taken)f(to)h(mean)f(the)h(curr)o(ent)f(pr)o(ocess')g(envi-)888 +1484 y(r)o(onment)21 b(\()p FC(i.e.)p FD(,)g(the)f(value)h(of)f(the)h +(external)f(char)g FA(**environ)p FD(\).)888 1620 y([Rationale:)33 +b FA(#f)24 b FD(is)g(a)g(mor)o(e)g(convenient)i(marker)d(for)h(the)h +(curr)o(ent)e(envir)o(onment)888 1720 y(than)h FA(#t)p +FD(,)f(but)g(would)g(cause)g(an)g(ambiguity)h(on)g(Schemes)f(that)g +(identify)g FA(#f)f FD(and)888 1820 y FA(\(\))p FD(.])888 +1956 y(The)h(path-sear)o(ching)f(variants)g(sear)o(ch)g(the)h(dir)o +(ectories)f(in)h(the)g(list)g FA(exec-path-)888 2056 +y(list)30 b FD(for)h(the)g(pr)o(ogram.)56 b(A)31 b(path-sear)o(ch)f(is) +h(not)h(performed)e(if)h(the)h(pr)o(ogram)888 2156 y(name)26 +b(contains)h(a)f(slash)h(character)o(\227it)d(is)j(used)f(dir)o(ectly) +-9 b(.)41 b(So)26 b(a)g(pr)o(ogram)f(with)888 2255 y(a)30 +b(name)g(like)g FA("bin/prog")c FD(always)k(executes)g(the)g(pr)o +(ogram)f FA(bin/prog)e FD(in)k(the)888 2355 y(curr)o(ent)20 +b(working)i(dir)o(ectory)-9 b(.)25 b(See)19 b FA($path)g +FD(and)h FA(exec-path-list)p FD(,)15 b(below)-8 b(.)888 +2491 y(Note)25 b(that)f(ther)o(e)f(is)i(no)g(analog)f(to)h(the)f(C)g +(function)h FA(execv\(\))p FD(.)33 b(T)-8 b(o)25 b(get)f(the)h(ef)o +(fect)888 2591 y(just)d(do)1071 2739 y FA(\(apply)41 +b(exec)h(prog)g(arglist\))888 2923 y FD(All)20 b(of)g(these)h(pr)o +(ocedur)o(es)d(\003ush)j(buf)o(fer)o(ed)d(output)i(and)g(close)g(unr)o +(evealed)f(ports)888 3023 y(befor)o(e)k(executing)h(the)g(new)h(binary) +-9 b(.)35 b(T)-8 b(o)24 b(avoid)g(\003ushing)i(buf)o(fer)o(ed)21 +b(output,)k(see)888 3123 y FA(\045exec)19 b FD(below)-8 +b(.)888 3259 y(Note)22 b(that)f(the)h(C)f FA(exec\(\))e +FD(pr)o(ocedur)o(e)g(allows)j(the)f(zer)o(oth)g(element)h(of)f(the)g +(ar)o(gu-)888 3359 y(ment)h(vector)e(to)h(be)g(dif)o(fer)o(ent)d(fr)o +(om)j(the)g(\002le)f(being)h(executed,)f FC(e.g.)1071 +3507 y FA(char)42 b(*argv[])f(=)i({"-",)e("-f",)h(0};)1071 +3606 y(exec\("/bin/csh",)37 b(argv,)k(envp\);)888 3754 +y FD(The)22 b(scsh)g FA(exec)p FD(,)d FA(exec-path)p +FD(,)f FA(exec/env)p FD(,)g(and)i FA(exec-path/env)c +FD(pr)o(ocedur)o(es)k(do)888 3853 y(not)e(give)f(this)h (functionality\227element)g(0)e(of)h(the)g(ar)o(g)f(vector)h(is)h -(always)e(identical)888 814 y(to)31 b(the)f FA(prog)e +(always)e(identical)888 3953 y(to)31 b(the)f FA(prog)e FD(ar)o(gument.)52 b(In)30 b(the)g(rar)o(e)f(case)g(the)h(user)g -(wishes)g(to)h(dif)o(fer)o(entiate)888 913 y(these)26 +(wishes)g(to)h(dif)o(fer)o(entiate)888 4053 y(these)26 b(two)f(items,)i(he)e(can)g(use)g(the)h(low-level)f FA(\045exec)e -FD(and)i FA(exec-path-searc)o(h)888 1013 y FD(pr)o(ocedur)o(es.)f +FD(and)i FA(exec-path-searc)o(h)888 4152 y FD(pr)o(ocedur)o(es.)f (These)c(pr)o(ocedur)o(es)e(never)h(r)o(eturn)g(under)h(any)g(cir)o -(cumstances.)k(As)888 1112 y(with)e(any)f(other)g(system)g(call,)f(if)h +(cumstances.)k(As)888 4252 y(with)e(any)f(other)g(system)g(call,)f(if)h (ther)o(e)f(is)h(an)g(err)o(or)-6 b(,)19 b(they)i(raise)f(an)h -(exception.)681 1307 y FA(\(\045exec)41 b FC(pr)o(og)19 +(exception.)681 4454 y FA(\(\045exec)41 b FC(pr)o(og)19 b(ar)o(glist)h(env)p FA(\))87 b Fw(\000)-14 b(!)87 b -FC(unde\002ned)975 b FD(pr)o(ocedur)o(e)681 1406 y FA +FC(unde\002ned)975 b FD(pr)o(ocedur)o(e)681 4554 y FA (\(exec-path-searc)o(h)37 b FC(fname)21 b(pathlist)p FA(\))85 b Fw(\000)-14 b(!)87 b FC(string)21 b(or)g FA(#f)474 -b FD(pr)o(ocedur)o(e)888 1549 y(The)31 b FA(\045exec)d +b FD(pr)o(ocedur)o(e)888 4699 y(The)31 b FA(\045exec)d FD(pr)o(ocedur)o(e)h(is)i(the)f(low-level)h(interface)f(to)h(the)f -(system)i(call.)54 b(The)888 1648 y FC(ar)o(glist)27 +(system)i(call.)54 b(The)888 4799 y FC(ar)o(glist)27 b FD(parameter)e(is)j(a)e(list)i(of)f(ar)o(guments;)j FC(env)d FD(is)h(either)f(a)f(string)p Fw(!)p FD(string)j(al-)888 -1748 y(ist)e(or)e FA(#t)p FD(.)40 b(The)26 b(new)g(pr)o(ogram's)g +4898 y(ist)e(or)e FA(#t)p FD(.)40 b(The)26 b(new)g(pr)o(ogram's)g FA(argv[0])c FD(will)27 b(be)e(taken)h(fr)o(om)f FA(\(car)42 -b FC(ar)o(glist)p FA(\))p FD(,)888 1848 y FC(not)20 b -FD(fr)o(om)f FC(pr)o(og)o FD(.)25 b(An)20 b(envir)o(onment)g(of)g -FA(#t)f FD(means)h(the)g(curr)o(ent)f(pr)o(ocess')g(envir)o(on-)888 -1947 y(ment.)26 b FA(\045exec)19 b FD(does)i(not)g(\003ush)h(buf)o(fer) -o(ed)c(output)j(\(see)f FA(flush-all-ports)p FD(\).)888 -2081 y(All)33 b(exec)f(pr)o(ocedur)o(es,)i(including)f -FA(\045exec)p FD(,)h(coer)o(ce)e(the)g FA(prog)g FD(and)g -FA(arg)f FD(values)888 2181 y(to)h(strings)h(using)f(the)g(usual)g -(conversion)h(r)o(ules:)47 b(numbers)32 b(ar)o(e)e(converted)i(to)888 -2280 y(decimal)21 b(numerals,)f(and)h(symbols)h(converted)e(to)h(their) -g(print-names.)888 2414 y FA(exec-path-search)f FD(sear)o(ches)25 -b(the)i(dir)o(ectories)e(of)i FC(pathlist)e FD(looking)j(for)e(an)g -(oc-)888 2514 y(curr)o(ence)32 b(of)g(\002le)h FA(fname)p -FD(.)58 b(If)33 b(no)g(executable)e(\002le)i(is)f(found,)k(it)c(r)o -(eturns)g FA(#f)p FD(.)60 b(If)888 2614 y FA(fname)28 -b FD(contains)i(a)f(slash)h(character)-6 b(,)29 b(the)h(path)f(sear)o -(ch)g(is)g(short-cir)o(cuited,)i(but)888 2713 y(the)19 -b(pr)o(ocedur)o(e)e(still)i(checks)g(to)g(ensur)o(e)f(that)h(the)f -(\002le)h(exists)g(and)f(is)h(executable\227)888 2813 -y(if)30 b(not,)i(it)d(still)i(r)o(eturns)e FA(#f)p FD(.)51 -b(Users)29 b(of)g(this)h(pr)o(ocedur)o(e)e(should)i(be)f(awar)o(e)f -(that)888 2912 y(it)42 b(invites)f(a)f(potential)i(race)e(condition:)67 -b(between)41 b(checking)g(the)g(\002le)g(with)888 3012 -y FA(exec-path-search)25 b FD(and)30 b(executing)i(it)f(with)h -FA(\045exec)p FD(,)f(the)g(\002le's)h(status)f(might)888 -3112 y(change.)k(The)24 b(only)h(atomic)f(way)f(to)i(do)e(the)h(sear)o -(ch)f(is)h(to)h(loop)f(over)g(the)g(candi-)888 3211 y(date)f(\002le)i -(names,)f(exec'ing)h(each)e(one)i(and)e(looping)j(when)e(the)h(exec)e -(operation)888 3311 y(fails.)888 3445 y(See)d FA($path)f -FD(and)h FA(exec-path-list)p FD(,)15 b(below)-8 b(.)681 -3639 y FA(\(exit)41 b FC([status])p FA(\))86 b Fw(\000)-14 -b(!)87 b FC(no)21 b(r)o(eturn)g(value)1098 b FD(pr)o(ocedur)o(e)681 -3739 y FA(\(\045exit)41 b FC([status])p FA(\))86 b Fw(\000)-14 -b(!)87 b FC(no)21 b(r)o(eturn)g(value)1054 b FD(pr)o(ocedur)o(e)888 -3881 y(These)24 b(pr)o(ocedur)o(es)e(terminate)i(the)f(curr)o(ent)g(pr) -o(ocess)h(with)g(a)g(given)g(exit)f(status.)888 3981 -y(The)h(default)f(exit)g(status)h(is)g(0.)34 b(The)24 -b(low-level)g FA(\045exit)d FD(pr)o(ocedur)o(e)h(immediately)888 -4080 y(terminates)f(the)g(pr)o(ocess)f(without)i(\003ushing)h(buf)o -(fer)o(ed)18 b(output.)681 4274 y FA(\(call-terminally)37 -b FC(thunk)p FA(\))86 b Fw(\000)-14 b(!)87 b FC(no)21 -b(r)o(eturn)g(value)678 b FD(pr)o(ocedur)o(e)888 4417 -y FA(call-terminally)23 b FD(calls)29 b(its)h(thunk.)51 -b(When)30 b(the)f(thunk)h(r)o(eturns,)g(the)f(pr)o(ocess)888 -4516 y(exits.)d(Although)c FA(call-terminally)14 b FD(could)21 -b(be)f(implemented)h(as)1071 4658 y FA(\()p Fo(\025)39 -b FA(\(thunk\))h(\(thunk\))h(\(exit)h(0\)\))888 4799 -y FD(an)34 b(implementation)i(can)d(take)h(advantage)f(of)h(the)g(fact) -f(that)h(this)h(pr)o(ocedur)o(e)888 4898 y(never)23 b(r)o(eturns.)32 -b(For)23 b(example,)g(the)g(r)o(untime)h(can)f(start)g(with)h(a)e(fr)o -(esh)h(stack)f(and)2071 5147 y(52)p eop -%%Page: 53 59 -53 58 bop 573 614 a FD(also)23 b(start)g(with)h(a)e(fr)o(esh)g(dynamic) -h(envir)o(onment,)h(wher)o(e)f(shadowed)g(bindings)573 -714 y(ar)o(e)28 b(discar)o(ded.)49 b(This)30 b(can)f(allow)h(the)g(old) -f(stack)h(and)f(dynamic)g(envir)o(onment)573 814 y(to)i(be)g(collected) -g(\(assuming)h(this)g(data)e(is)h(not)h(r)o(eachable)d(thr)o(ough)j -(some)g(live)573 913 y(continuation\).)365 1240 y FA(\(suspend\))84 -b Fw(\000)-15 b(!)88 b FC(unde\002ned)1459 b FD(pr)o(ocedur)o(e)573 -1393 y(Suspend)20 b(the)h(curr)o(ent)f(pr)o(ocess)g(with)i(a)e(SIGST)o -(OP)g(signal.)365 1720 y FA(\(fork)42 b FC([thunk])p -FA(\))85 b Fw(\000)-14 b(!)87 b FC(pr)o(oc)20 b(or)h -FA(#f)1281 b FD(pr)o(ocedur)o(e)365 1820 y FA(\(\045fork)41 +b FC(ar)o(glist)p FA(\))p FD(,)2071 5147 y(52)p eop +%%Page: 53 61 +53 60 bop 573 614 a FC(not)19 b FD(fr)o(om)h FC(pr)o(og)n +FD(.)26 b(An)19 b(envir)o(onment)i(of)e FA(#t)g FD(means)h(the)g(curr)o +(ent)f(pr)o(ocess')h(envir)o(on-)573 714 y(ment.)26 b +FA(\045exec)18 b FD(does)j(not)h(\003ush)g(buf)o(fer)o(ed)c(output)j +(\(see)f FA(flush-all-ports)p FD(\))o(.)573 846 y(All)33 +b(exec)f(pr)o(ocedur)o(es,)h(including)h FA(\045exec)p +FD(,)f(coer)o(ce)f(the)h FA(prog)e FD(and)h FA(arg)g +FD(values)573 946 y(to)g(strings)g(using)h(the)f(usual)f(conversion)i +(r)o(ules:)48 b(numbers)32 b(ar)o(e)e(converted)h(to)573 +1045 y(decimal)20 b(numerals,)h(and)f(symbols)i(converted)e(to)i(their) +e(print-names.)573 1177 y FA(exec-path-search)g FD(sear)o(ches)25 +b(the)h(dir)o(ectories)g(of)g FC(pathlist)f FD(looking)j(for)f(an)f +(oc-)573 1277 y(curr)o(ence)31 b(of)i(\002le)f FA(fname)p +FD(.)59 b(If)32 b(no)h(executable)e(\002le)i(is)g(found,)i(it)e(r)o +(eturns)f FA(#f)p FD(.)60 b(If)573 1377 y FA(fname)27 +b FD(contains)j(a)f(slash)h(character)-6 b(,)30 b(the)f(path)h(sear)o +(ch)e(is)i(short-cir)o(cuited,)h(but)573 1476 y(the)19 +b(pr)o(ocedur)o(e)d(still)k(checks)e(to)i(ensur)o(e)e(that)g(the)h +(\002le)g(exists)g(and)f(is)h(executable\227)573 1576 +y(if)29 b(not,)j(it)e(still)g(r)o(eturns)f FA(#f)p FD(.)51 +b(Users)29 b(of)h(this)g(pr)o(ocedur)o(e)d(should)k(be)e(awar)o(e)f +(that)573 1675 y(it)41 b(invites)h(a)e(potential)h(race)f(condition:)67 +b(between)41 b(checking)h(the)f(\002le)g(with)573 1775 +y FA(exec-path-search)24 b FD(and)31 b(executing)g(it)g(with)h +FA(\045exec)p FD(,)g(the)f(\002le's)g(status)h(might)573 +1875 y(change.)j(The)23 b(only)i(atomic)f(way)g(to)g(do)g(the)g(sear)o +(ch)f(is)h(to)g(loop)h(over)e(the)h(candi-)573 1974 y(date)f(\002le)h +(names,)h(exec'ing)f(each)g(one)g(and)g(looping)h(when)g(the)f(exec)f +(operation)573 2074 y(fails.)573 2206 y(See)d FA($path)e +FD(and)j FA(exec-path-list)p FD(,)14 b(below)-8 b(.)365 +2394 y FA(\(exit)42 b FC([status])p FA(\))86 b Fw(\000)-14 +b(!)87 b FC(no)20 b(r)o(eturn)i(value)1098 b FD(pr)o(ocedur)o(e)365 +2494 y FA(\(\045exit)41 b FC([status])p FA(\))86 b Fw(\000)-14 +b(!)87 b FC(no)21 b(r)o(eturn)g(value)1055 b FD(pr)o(ocedur)o(e)573 +2633 y(These)24 b(pr)o(ocedur)o(es)e(terminate)h(the)h(curr)o(ent)f(pr) +o(ocess)g(with)i(a)e(given)h(exit)g(status.)573 2733 +y(The)g(default)e(exit)i(status)g(is)g(0.)34 b(The)23 +b(low-level)h FA(\045exit)e FD(pr)o(ocedur)o(e)f(immediately)573 +2833 y(terminates)g(the)f(pr)o(ocess)h(without)h(\003ushing)g(buf)o +(fer)o(ed)c(output.)365 3021 y FA(\(call-terminally)37 +b FC(thunk)p FA(\))87 b Fw(\000)-14 b(!)87 b FC(no)20 +b(r)o(eturn)i(value)678 b FD(pr)o(ocedur)o(e)573 3161 +y FA(call-terminally)23 b FD(calls)29 b(its)g(thunk.)52 +b(When)29 b(the)g(thunk)h(r)o(eturns,)h(the)e(pr)o(ocess)573 +3260 y(exits.)c(Although)d FA(call-terminally)15 b FD(could)21 +b(be)f(implemented)h(as)756 3399 y FA(\()p Fo(\025)38 +b FA(\(thunk\))j(\(thunk\))g(\(exit)g(0\)\))573 3537 +y FD(an)24 b(implementation)h(can)f(take)f(advantage)g(of)h(the)g(fact) +g(that)g(this)g(pr)o(ocedur)o(e)f(n-)573 3637 y(ever)j(r)o(eturns.)42 +b(For)27 b(example,)f(the)h(r)o(untime)g(can)g(start)f(with)h(a)f(fr)o +(esh)g(stack)g(and)573 3737 y(also)d(start)g(with)h(a)e(fr)o(esh)g +(dynamic)h(envir)o(onment,)h(wher)o(e)f(shadowed)g(bindings)573 +3836 y(ar)o(e)28 b(discar)o(ded.)49 b(This)30 b(can)f(allow)h(the)f +(old)h(stack)f(and)g(dynamic)g(envir)o(onmen-)573 3936 +y(t)d(to)h(be)f(collected)g(\(assuming)h(this)g(data)e(is)h(not)h(r)o +(eachable)e(thr)o(ough)i(some)g(live)573 4036 y(continuation\).)365 +4324 y FA(\(suspend\))84 b Fw(\000)-15 b(!)88 b FC(unde\002ned)1459 +b FD(pr)o(ocedur)o(e)573 4463 y(Suspend)20 b(the)h(curr)o(ent)f(pr)o +(ocess)g(with)i(a)e(SIGST)o(OP)g(signal.)365 4751 y FA(\(fork)42 +b FC([thunk])p FA(\))85 b Fw(\000)-14 b(!)87 b FC(pr)o(oc)20 +b(or)h FA(#f)1281 b FD(pr)o(ocedur)o(e)365 4851 y FA(\(\045fork)41 b FC([thunk])p FA(\))86 b Fw(\000)-14 b(!)87 b FC(pr)o(oc)19 -b(or)i FA(#f)1238 b FD(pr)o(ocedur)o(e)573 1973 y FA(fork)28 -b FD(with)j(no)g(ar)o(guments)f(is)h(like)f(C)g FA(fork\(\))p -FD(.)52 b(In)30 b(the)g(par)o(ent)g(pr)o(ocess,)h(it)g(r)o(e-)573 -2073 y(turns)19 b(the)g(child's)g FC(pr)o(ocess)g(object)g -FD(\(see)f(below)h(for)f(mor)o(e)h(information)h(on)f(pr)o(ocess)573 -2172 y(objects\).)26 b(In)21 b(the)g(child)f(pr)o(ocess,)h(it)g(r)o -(eturns)f FA(#f)p FD(.)573 2317 y FA(fork)h FD(with)j(an)f(ar)o(gument) -g(only)h(r)o(eturns)e(in)i(the)f(par)o(ent)f(pr)o(ocess,)h(r)o -(eturning)g(the)573 2417 y(child's)e(pr)o(ocess)f(object.)26 -b(The)21 b(child)g(pr)o(ocess)f(calls)h FC(thunk)f FD(and)g(then)i -(exits.)573 2562 y FA(fork)27 b FD(\003ushes)j(buf)o(fer)o(ed)c(output) -k(befor)o(e)d(forking,)k(and)e(sets)g(the)g(child)g(pr)o(ocess)573 -2661 y(to)e(non-interactive.)42 b FA(\045fork)25 b FD(does)h(not)i -(perform)e(this)h(bookkeeping;)j(it)d(simply)573 2761 -y(forks.)365 2988 y FA(\(fork/pipe)40 b FC([thunk])p -FA(\))85 b Fw(\000)-14 b(!)87 b FC(pr)o(oc)20 b(or)h -FA(#f)1063 b FD(pr)o(ocedur)o(e)365 3088 y FA(\(\045fork/pipe)39 -b FC([thunk])p FA(\))86 b Fw(\000)-15 b(!)88 b FC(pr)o(oc)19 -b(or)i FA(#f)1020 b FD(pr)o(ocedur)o(e)573 3241 y(Like)27 -b FA(fork)e FD(and)i FA(\045fork)p FD(,)f(but)i(the)f(par)o(ent)f(and)g -(child)i(communicate)f(via)g(a)g(pipe)573 3341 y(connecting)17 -b(the)g(par)o(ent's)e(stdin)i(to)g(the)f(child's)h(stdout.)24 -b(These)17 b(pr)o(ocedur)o(es)d(side-)573 3440 y(ef)o(fect)19 -b(the)i(par)o(ent)e(by)i(changing)h(his)f(stdin.)573 -3585 y(In)28 b(ef)o(fect,)f FA(fork/pipe)d FD(splices)j(a)g(pr)o(ocess) -g(into)i(the)e(data)g(str)o(eam)f(immediately)573 3685 -y(upstr)o(eam)35 b(of)g(the)h(curr)o(ent)e(pr)o(ocess.)70 -b(This)36 b(is)g(the)g(basic)f(function)h(for)f(cr)o(eat-)573 -3784 y(ing)j(pipelines.)75 b(Long)37 b(pipelines)h(ar)o(e)e(built)h(by) -g(performing)h(a)e(sequence)i(of)573 3884 y FA(fork/pipe)16 -b FD(calls.)25 b(For)20 b(example,)f(to)h(cr)o(eate)e(a)h(backgr)o -(ound)g(two-pr)o(ocess)h(pipe)f FA(a)573 3984 y(|)43 -b(b)p FD(,)20 b(we)h(write:)756 4174 y FA(\(fork)41 b(\()p -Fo(\025)e FA(\(\))k(\(fork/pipe)c(a\))k(\(b\)\)\))573 -4364 y FD(which)22 b(r)o(eturns)e(the)h(pr)o(ocess)f(object)h(for)g -FA(b)p FD('s)f(pr)o(ocess.)573 4509 y(T)-8 b(o)21 b(cr)o(eate)e(a)h -(backgr)o(ound)h(thr)o(ee-pr)o(ocess)e(pipe)h FA(a)43 -b(|)h(b)f(|)g(c)p FD(,)20 b(we)h(write:)756 4699 y FA(\(fork)41 -b(\()p Fo(\025)e FA(\(\))k(\(fork/pipe)c(a\))1279 4799 -y(\(fork/pipe)g(b\))1279 4898 y(\(c\)\)\))1756 5147 y -FD(53)p eop -%%Page: 54 60 -54 59 bop 888 614 a FD(which)22 b(r)o(eturns)e(the)h(pr)o(ocess)f -(object)i(for)e FA(c)p FD('s)h(pr)o(ocess.)888 749 y(Note)26 -b(that)f(these)g(pr)o(ocedur)o(es)e(af)o(fect)h(\002le)h(descriptors,)h -(not)g(ports.)39 b(That)25 b(is,)h(the)888 849 y(pipe)18 -b(is)g(allocated)f(connecting)j(the)e(child's)g(\002le)g(descriptor)g -(1)f(to)i(the)f(par)o(ent's)f(\002le)888 948 y(descriptor)i(0.)24 -b FC(Any)19 b(pr)o(evious)g(Scheme)f(port)h(built)g(over)g(these)g -(affected)g(\002le)g(descriptors)888 1048 y(is)h(shifted)e(to)g(a)h -(new)-5 b(,)19 b(unused)h(\002le)f(descriptor)f(with)g -FA(dup)g FC(befor)o(e)h(allocating)f(the)g(I/O)g(pipe.)888 -1148 y FD(This)h(means,)g(for)g(example,)f(that)g(the)h(ports)g(bound)f -(to)h FA(\(current-input-po)o(rt)o(\))888 1247 y FD(and)f -FA(\(current-output)o(-p)o(ort)o(\))11 b FD(in)19 b(either)e(pr)o -(ocess)g(ar)o(e)f(not)j(af)o(fected\227they)c(still)888 -1347 y(r)o(efer)21 b(to)h(the)g(same)g(I/O)h(sour)o(ces)f(and)f(sinks)i -(as)f(befor)o(e.)28 b(Remember)22 b(the)h(simple)888 -1446 y(scsh)17 b(r)o(ule:)23 b(Scheme)15 b(ports)h(ar)o(e)f(bound)h(to) -g(I/O)g(sour)o(ces)g(and)f(sinks,)j FC(not)d FD(particular)888 -1546 y(\002le)21 b(descriptors.)888 1681 y(If)k(the)g(child)h(pr)o +b(or)i FA(#f)1238 b FD(pr)o(ocedur)o(e)1756 5147 y(53)p +eop +%%Page: 54 62 +54 61 bop 888 614 a FA(fork)29 b FD(with)i(no)g(ar)o(guments)f(is)g +(like)h(C)f FA(fork\(\))p FD(.)51 b(In)31 b(the)f(par)o(ent)f(pr)o +(ocess,)j(it)e(r)o(e-)888 714 y(turns)20 b(the)e(child's)i +FC(pr)o(ocess)e(object)h FD(\(see)f(below)h(for)g(mor)o(e)f +(information)i(on)f(pr)o(ocess)888 814 y(objects\).)26 +b(In)21 b(the)g(child)g(pr)o(ocess,)f(it)h(r)o(eturns)f +FA(#f)p FD(.)888 946 y FA(fork)i FD(with)i(an)f(ar)o(gument)f(only)i(r) +o(eturns)f(in)h(the)f(par)o(ent)f(pr)o(ocess,)h(r)o(eturning)g(the)888 +1046 y(child's)f(pr)o(ocess)e(object.)26 b(The)20 b(child)h(pr)o(ocess) +g(calls)f FC(thunk)h FD(and)f(then)h(exits.)888 1179 +y FA(fork)28 b FD(\003ushes)h(buf)o(fer)o(ed)e(output)i(befor)o(e)f +(forking,)j(and)d(sets)h(the)g(child)g(pr)o(ocess)888 +1279 y(to)e(non-interactive.)43 b FA(\045fork)24 b FD(does)j(not)g +(perform)f(this)h(bookkeeping;)j(it)d(simply)888 1378 +y(forks.)681 1569 y FA(\(fork/pipe)39 b FC([thunk])p +FA(\))86 b Fw(\000)-15 b(!)88 b FC(pr)o(oc)19 b(or)i +FA(#f)1063 b FD(pr)o(ocedur)o(e)681 1669 y FA(\(\045fork/pipe)39 +b FC([thunk])p FA(\))85 b Fw(\000)-14 b(!)87 b FC(pr)o(oc)20 +b(or)h FA(#f)1019 b FD(pr)o(ocedur)o(e)888 1810 y(Like)27 +b FA(fork)f FD(and)g FA(\045fork)p FD(,)h(but)g(the)g(par)o(ent)f(and)h +(child)g(communicate)h(via)f(a)f(pipe)888 1910 y(connecting)18 +b(the)e(par)o(ent's)g(stdin)g(to)h(the)g(child's)f(stdout.)25 +b(These)16 b(pr)o(ocedur)o(es)f(side-)888 2009 y(ef)o(fect)k(the)i(par) +o(ent)f(by)h(changing)g(his)h(stdin.)888 2142 y(In)32 +b(ef)o(fect,)h FA(fork/pipe)28 b FD(splices)k(a)f(pr)o(ocess)g(into)i +(the)e(data)g(str)o(eam)g(immediate-)888 2242 y(ly)j(upstr)o(eam)e(of)g +(the)h(curr)o(ent)f(pr)o(ocess.)62 b(This)33 b(is)h(the)f(basic)f +(function)i(for)e(cr)o(e-)888 2341 y(ating)g(pipelines.)58 +b(Long)32 b(pipelines)g(ar)o(e)e(built)h(by)h(performing)f(a)g +(sequence)h(of)888 2441 y FA(fork/pipe)16 b FD(calls.)25 +b(For)20 b(example,)f(to)h(cr)o(eate)e(a)h(backgr)o(ound)h(two-pr)o +(ocess)f(pipe)g FA(a)888 2540 y(|)44 b(b)p FD(,)20 b(we)g(write:)1071 +2707 y FA(\(fork)42 b(\()p Fo(\025)c FA(\(\))43 b(\(fork/pipe)c(a\))k +(\(b\)\)\))888 2873 y FD(which)22 b(r)o(eturns)e(the)h(pr)o(ocess)f +(object)i(for)e FA(b)p FD('s)h(pr)o(ocess.)888 3005 y(T)-8 +b(o)22 b(cr)o(eate)d(a)h(backgr)o(ound)g(thr)o(ee-pr)o(ocess)f(pipe)i +FA(a)43 b(|)g(b)g(|)g(c)p FD(,)20 b(we)h(write:)1071 +3171 y FA(\(fork)42 b(\()p Fo(\025)c FA(\(\))43 b(\(fork/pipe)c(a\)) +1594 3271 y(\(fork/pipe)g(b\))1594 3371 y(\(c\)\)\))888 +3537 y FD(which)22 b(r)o(eturns)e(the)h(pr)o(ocess)f(object)i(for)e +FA(c)p FD('s)h(pr)o(ocess.)888 3670 y(Note)26 b(that)f(these)g(pr)o +(ocedur)o(es)e(af)o(fect)h(\002le)h(descriptors,)h(not)g(ports.)39 +b(That)25 b(is,)h(the)888 3769 y(pipe)18 b(is)g(allocated)f(connecting) +j(the)e(child's)g(\002le)g(descriptor)g(1)f(to)i(the)f(par)o(ent's)f +(\002le)888 3869 y(descriptor)i(0.)24 b FC(Any)19 b(pr)o(evious)g +(Scheme)f(port)h(built)g(over)g(these)g(affected)g(\002le)g +(descriptors)888 3968 y(is)h(shifted)e(to)g(a)h(new)-5 +b(,)19 b(unused)h(\002le)f(descriptor)f(with)g FA(dup)g +FC(befor)o(e)h(allocating)f(the)g(I/O)g(pipe.)888 4068 +y FD(This)h(means,)g(for)g(example,)f(that)g(the)h(ports)g(bound)f(to)h +FA(\(current-input-po)o(rt)o(\))888 4168 y FD(and)f FA +(\(current-output)o(-p)o(ort)o(\))11 b FD(in)19 b(either)e(pr)o(ocess)g +(ar)o(e)f(not)j(af)o(fected\227they)c(still)888 4267 +y(r)o(efer)21 b(to)h(the)g(same)g(I/O)h(sour)o(ces)f(and)f(sinks)i(as)f +(befor)o(e.)28 b(Remember)22 b(the)h(simple)888 4367 +y(scsh)17 b(r)o(ule:)23 b(Scheme)15 b(ports)h(ar)o(e)f(bound)h(to)g +(I/O)g(sour)o(ces)g(and)f(sinks,)j FC(not)d FD(particular)888 +4467 y(\002le)21 b(descriptors.)888 4599 y(If)k(the)g(child)h(pr)o (ocess)e(wishes)i(to)g(r)o(ebind)e(the)h(curr)o(ent)g(output)g(port)h -(to)f(the)g(pipe)888 1780 y(on)40 b(\002le)f(descriptor)f(1,)43 +(to)f(the)g(pipe)888 4699 y(on)40 b(\002le)f(descriptor)f(1,)43 b(it)c(can)f(do)h(this)g(using)h FA(with-current-out)o(put)o(-p)o(or)o -(t)888 1880 y FD(or)e(a)e(r)o(elated)f(form.)75 b(Similarly)-9 +(t)888 4799 y FD(or)e(a)e(r)o(elated)f(form.)75 b(Similarly)-9 b(,)41 b(if)36 b(the)i(par)o(ent)e(wishes)i(to)f(change)g(the)g(cur)o -(-)888 1980 y(r)o(ent)i(input)g(port)g(to)g(the)g(pipe)f(on)i(\002le)f -(descriptor)f(0,)k(it)d(can)g(do)g(this)g(using)888 2079 -y FA(set-current-input)o(-p)o(ort)o(!)17 b FD(or)23 b(a)f(r)o(elated)f -(form.)32 b(Her)o(e)21 b(is)j(an)e(example)g(show-)888 -2179 y(ing)g(how)f(to)h(set)e(up)h(the)g(I/O)g(ports)g(on)h(both)f -(sides)g(of)g(the)f(pipe:)1071 2349 y FA(\(fork/pipe)39 -b(\()p Fo(\025)g FA(\(\))1638 2448 y(\(with-current-o)o(utp)o(ut)o(-po) -o(rt)e(\(fdes->outport)h(1\))1725 2548 y(\(display)i("Hello,)h -(world.\\n"\)\)\)\))1071 2747 y(\(set-current-inp)o(ut-)o(po)o(rt)o(!)d -(\(fdes->inport)g(0\))1071 2847 y(\(read-line\))344 b(;)43 -b(Read)f(the)h(string)e(output)g(by)i(the)f(child.)888 -3017 y FD(None)27 b(of)g(this)g(is)h(necessary)e(when)h(the)g(I/O)g(is) -g(performed)f(by)h(an)f(exec'd)g(pr)o(o-)888 3116 y(gram)17 -b(in)g(the)g(child)g(or)g(par)o(ent)f(pr)o(ocess,)h(only)h(when)f(the)g -(pipe)g(will)g(be)g(r)o(efer)o(enced)888 3216 y(by)k(Scheme)g(code)f -(thr)o(ough)h(one)g(of)g(the)g(default)f(curr)o(ent)g(I/O)h(ports.)681 -3413 y FA(\(fork/pipe+)39 b FC(conns)21 b([thunk])p FA(\))85 -b Fw(\000)-14 b(!)87 b FC(pr)o(oc)20 b(or)h FA(#f)803 -b FD(pr)o(ocedur)o(e)681 3512 y FA(\(\045fork/pipe+)38 -b FC(conns)21 b([thunk])p FA(\))86 b Fw(\000)-14 b(!)87 -b FC(pr)o(oc)19 b(or)i FA(#f)760 b FD(pr)o(ocedur)o(e)888 -3655 y(Like)26 b FA(fork/pipe)p FD(,)d(but)i(the)h(pipe)g(connections)h -(between)e(the)h(child)g(and)f(par)o(ent)888 3755 y(ar)o(e)20 -b(speci\002ed)g(by)h(the)g(connection)h(list)f FC(conns)p -FD(.)26 b(See)20 b(the)1071 3898 y FA(\(|+)42 b FC(conns)i(pf)1537 -3925 y Fx(1)1618 3898 y FA(...)f FC(pf)1846 3925 y Fp(n)1891 -3898 y FA(\))888 4041 y FD(pr)o(ocess)21 b(form)f(for)h(a)f -(description)h(of)g(connection)h(lists.)681 4317 y FB(3.4.1)81 -b(Process)20 b(objects)f(and)h(process)g(reaping)681 -4503 y FD(Scsh)27 b(uses)g FC(pr)o(ocess)f(objects)i -FD(to)f(r)o(epr)o(esent)e(Unix)i(pr)o(ocesses.)44 b(They)27 -b(ar)o(e)e(cr)o(eated)g(by)i(the)681 4603 y FA(fork)19 -b FD(pr)o(ocedur)o(e,)f(and)j(have)f(the)h(following)h(exposed)e(str)o -(uctur)o(e:)888 4799 y FA(\(define-record)38 b(proc)1237 -4898 y(pid\))2071 5147 y FD(54)p eop -%%Page: 55 61 -55 60 bop 393 614 a FD(The)28 b(only)g(exposed)f(slot)i(in)f(a)f(pr)o -(oc)g(r)o(ecor)o(d)f(is)i(the)g(pr)o(ocess')f(pid,)i(the)f(integer)g -(id)f(as-)365 714 y(signed)20 b(by)f(Unix)g(to)g(the)g(pr)o(ocess.)25 -b(The)19 b(only)h(exported)e(primitive)h(pr)o(ocedur)o(es)e(for)i(ma-) -365 814 y(nipulating)j(pr)o(ocess)e(objects)i(ar)o(e)d +(-)888 4898 y(r)o(ent)i(input)g(port)g(to)g(the)g(pipe)f(on)i(\002le)f +(descriptor)f(0,)k(it)d(can)g(do)g(this)g(using)2071 +5147 y(54)p eop +%%Page: 55 63 +55 62 bop 573 614 a FA(set-current-inpu)o(t-)o(por)o(t!)16 +b FD(or)23 b(a)f(r)o(elated)g(form.)31 b(Her)o(e)22 b(is)h(an)g +(example)f(show-)573 714 y(ing)f(how)h(to)f(set)g(up)g(the)f(I/O)i +(ports)f(on)g(both)h(sides)e(of)h(the)g(pipe:)756 869 +y FA(\(fork/pipe)39 b(\()p Fo(\025)g FA(\(\))1322 969 +y(\(with-current-ou)o(tpu)o(t-)o(por)o(t)e(\(fdes->outport)h(1\))1409 +1069 y(\(display)j("Hello,)f(world.\\n"\)\)\)\))756 1268 +y(\(set-current-in)o(pu)o(t-p)o(or)o(t!)d(\(fdes->inport)h(0\))756 +1367 y(\(read-line\))344 b(;)43 b(Read)f(the)g(string)f(output)g(by)i +(the)f(child.)573 1523 y FD(None)27 b(of)g(this)g(is)g(necessary)f +(when)i(the)e(I/O)i(is)f(performed)e(by)i(an)g(exec'd)e(pr)o(o-)573 +1622 y(gram)16 b(in)i(the)f(child)g(or)g(par)o(ent)e(pr)o(ocess,)i +(only)h(when)g(the)f(pipe)f(will)i(be)e(r)o(efer)o(enced)573 +1722 y(by)21 b(Scheme)f(code)g(thr)o(ough)i(one)f(of)g(the)g(default)e +(curr)o(ent)h(I/O)i(ports.)365 1897 y FA(\(fork/pipe+)39 +b FC(conns)21 b([thunk])p FA(\))86 b Fw(\000)-15 b(!)88 +b FC(pr)o(oc)19 b(or)i FA(#f)804 b FD(pr)o(ocedur)o(e)365 +1996 y FA(\(\045fork/pipe+)39 b FC(conns)21 b([thunk])p +FA(\))85 b Fw(\000)-14 b(!)87 b FC(pr)o(oc)20 b(or)h +FA(#f)760 b FD(pr)o(ocedur)o(e)573 2127 y(Like)25 b FA(fork/pipe)p +FD(,)e(but)j(the)g(pipe)f(connections)i(between)f(the)g(child)f(and)h +(par)o(ent)573 2226 y(ar)o(e)19 b(speci\002ed)i(by)f(the)h(connection)h +(list)g FC(conns)p FD(.)j(See)20 b(the)756 2365 y FA(\(|+)42 +b FC(conns)i(pf)1222 2392 y Fx(1)1303 2365 y FA(...)e +FC(pf)1530 2392 y Fp(n)1576 2365 y FA(\))573 2504 y FD(pr)o(ocess)20 +b(form)h(for)g(a)f(description)h(of)g(connection)h(lists.)365 +2761 y FB(3.4.1)81 b(Process)20 b(objects)g(and)f(process)h(reaping)365 +2944 y FD(Scsh)27 b(uses)g FC(pr)o(ocess)g(objects)g +FD(to)h(r)o(epr)o(esent)d(Unix)i(pr)o(ocesses.)43 b(They)27 +b(ar)o(e)f(cr)o(eated)e(by)j(the)365 3043 y FA(fork)19 +b FD(pr)o(ocedur)o(e,)g(and)h(have)g(the)h(following)i(exposed)d(str)o +(uctur)o(e:)573 3213 y FA(\(define-record)38 b(proc)922 +3313 y(pid\))393 3482 y FD(The)28 b(only)g(exposed)f(slot)i(in)f(a)f +(pr)o(oc)g(r)o(ecor)o(d)f(is)i(the)g(pr)o(ocess')f(pid,)i(the)f +(integer)g(id)f(as-)365 3582 y(signed)20 b(by)f(Unix)g(to)g(the)g(pr)o +(ocess.)25 b(The)19 b(only)h(exported)e(primitive)h(pr)o(ocedur)o(es)e +(for)i(ma-)365 3681 y(nipulating)j(pr)o(ocess)e(objects)i(ar)o(e)d FA(proc?)g FD(and)h FA(proc:pid)p FD(.)j(Pr)o(ocess)e(objects)g(ar)o(e) -f(cr)o(eated)365 913 y(with)i(the)f FA(fork)e FD(pr)o(ocedur)o(e.)365 -1065 y FA(\(pid->proc)40 b FC(pid)20 b([pr)o(obe?])p +f(cr)o(eated)365 3781 y(with)i(the)f FA(fork)e FD(pr)o(ocedur)o(e.)365 +3920 y FA(\(pid->proc)40 b FC(pid)20 b([pr)o(obe?])p FA(\))85 b Fw(\000)-14 b(!)87 b FC(pr)o(oc)1111 b FD(pr)o(ocedur)o(e) -573 1208 y(This)24 b(pr)o(ocedur)o(e)e(maps)i(integer)g(Unix)g(pr)o +573 4050 y(This)24 b(pr)o(ocedur)o(e)e(maps)i(integer)g(Unix)g(pr)o (ocess)f(ids)i(to)f(scsh)g(pr)o(ocess)g(objects.)36 b(It)573 -1308 y(is)22 b(intended)f(for)h(use)f(in)h(interactive)f(and)h -(debugging)g(code,)f(and)g(is)h(depr)o(ecated)573 1407 +4150 y(is)22 b(intended)f(for)h(use)f(in)h(interactive)f(and)h +(debugging)g(code,)f(and)g(is)h(depr)o(ecated)573 4249 y(for)30 b(use)h(in)g(pr)o(oduction)g(code.)55 b(If)30 b(ther)o(e)g(is)h(no)h(pr)o(ocess)e(object)h(in)g(the)g(system)573 -1507 y(indexed)19 b(by)g(the)h(given)f(pid,)h FA(pid->proc)p +4349 y(indexed)19 b(by)g(the)h(given)f(pid,)h FA(pid->proc)p FD('s)c(action)j(is)h(determined)f(by)h(the)f FC(pr)o(obe?)573 -1607 y FD(parameter)g(\(default)g FA(#f)p FD(\):)p 1174 -1677 1455 4 v 1174 1777 4 100 v 1227 1747 a FC(pr)o(obe?)p -1666 1777 V 270 w FD(Return)p 2625 1777 V 1174 1780 1455 -4 v 1174 1796 V 1174 1896 4 100 v 1227 1866 a FA(#f)p -1666 1896 V 404 w FC(signal)i(err)o(or)g(condition.)p -2625 1896 V 1174 1899 1455 4 v 1174 1999 4 100 v 1227 -1969 a FA('create)p 1666 1999 V 184 w FD(Cr)o(eate)e(new)i(pr)o(oc)f -(object.)p 2625 1999 V 1174 2002 1455 4 v 1174 2102 4 -100 v 1227 2072 a(T)-7 b(r)o(ue)20 b(value)p 1666 2102 -V 103 w FA(#f)p 2625 2102 V 1174 2105 1455 4 v 490 2287 -a FD(Sometime)h(after)e(a)h(child)g(pr)o(ocess)g(terminates,)g(scsh)h -(will)g(perform)f(a)g FA(wait)f FD(system)365 2387 y(call)26 -b(on)g(the)g(child)g(in)g(backgr)o(ound,)g(caching)g(the)g(pr)o(ocess') -f(exit)g(status)h(in)g(the)g(child's)365 2486 y(pr)o(oc)34 -b(object.)65 b(This)34 b(is)g(called)f(\223r)o(eaping\224)f(the)i(pr)o -(ocess.)65 b(Once)34 b(the)g(child)g(has)g(been)365 2586 -y(waited,)g(the)e(Unix)g(kernel)g(can)f(fr)o(ee)g(the)h(storage)g -(allocated)f(for)g(the)h(dead)f(pr)o(ocess')365 2685 -y(exit)21 b(information,)i(so)f(pr)o(ocess)f(r)o(eaping)f(pr)o(events)h -(the)g(pr)o(ocess)g(table)g(fr)o(om)g(becoming)365 2785 -y(clutter)o(ed)h(with)i(un-waited)e(dead)g(child)h(pr)o(ocesses)f -(\(a.k.a.)31 b(\223zombies\224\).)g(This)23 b(can)g(be)365 -2885 y(especially)e(sever)o(e)f(if)h(the)g(scsh)h(pr)o(ocess)f(never)f -(waits)i(on)g(child)f(pr)o(ocesses)g(at)f(all;)h(if)g(the)365 -2984 y(pr)o(ocess)h(table)g(over\003ows)i(with)f(for)o(gotten)f -(zombies,)h(the)g(OS)f(may)g(be)h(unable)f(to)h(fork)365 -3084 y(further)d(pr)o(ocesses.)490 3212 y(Reaping)27 -b(a)g(child)g(pr)o(ocess)f(moves)i(its)f(exit)g(status)g(information)h -(fr)o(om)e(the)i(kernel)365 3311 y(into)j(the)f(scsh)h(pr)o(ocess,)h -(wher)o(e)d(it)i(is)f(cached)f(inside)i(the)f(child's)g(pr)o(ocess)g -(object.)54 b(If)365 3411 y(the)23 b(scsh)f(user)g(dr)o(ops)g(all)g -(pointers)g(to)h(the)f(pr)o(ocess)f(object,)i(it)f(will)h(simply)g(be)f -(garbage)365 3511 y(collected.)35 b(On)24 b(the)g(other)h(hand,)f(if)g -(the)g(scsh)g(pr)o(ogram)f(r)o(etains)g(a)h(pointer)g(to)g(the)g(pr)o -(o-)365 3610 y(cess)d(object,)g(it)f(can)h(use)f(scsh's)i -FA(wait)c FD(system)k(call)e(to)h(synchr)o(onise)g(with)h(the)e(child)h -(and)365 3710 y(r)o(etrieve)h(its)h(exit)g(status)g(multiple)g(times)g -(\(this)h(is)f(not)g(possible)h(with)f(simple)h(Unix)e(in-)365 -3809 y(teger)f(pids)f(in)i(C\227the)e(pr)o(ogrammer)g(can)h(only)g -(wait)g(on)h(a)e(pid)g(once\).)490 3937 y(Thus,)h(pr)o(ocess)g(objects) -g(allow)g(scsh)h(pr)o(ogrammer)e(to)h(do)g(two)h(things)g(not)g -(allowed)365 4037 y(in)g(other)f(pr)o(ogramming)g(envir)o(onments:)490 -4233 y Fw(\017)41 b FD(Subpr)o(ocesses)30 b(that)g(ar)o(e)f(never)i -(waited)f(on)h(ar)o(e)e(still)j(r)o(emoved)d(fr)o(om)i(the)f(pr)o(o-) -573 4333 y(cess)g(table,)i(and)e(their)g(associated)g(exit)g(status)g -(data)f(is)i(eventually)f(automati-)573 4432 y(cally)20 -b(garbage)g(collected.)490 4602 y Fw(\017)41 b FD(Subpr)o(ocesses)20 -b(can)g(be)h(waited)f(on)h(multiple)h(times.)490 4799 -y(However)-6 b(,)26 b(note)g(that)g(once)g(a)f(child)h(has)g(exited,)g -(if)f(the)h(scsh)g(pr)o(ogrammer)f(dr)o(ops)365 4898 -y(all)e(pointers)g(to)f(the)h(child's)g(pr)o(oc)f(object,)h(the)f -(child's)h(exit)g(status)f(will)h(be)g(r)o(eaped)d(and)1756 -5147 y(55)p eop -%%Page: 56 62 -56 61 bop 681 614 a FD(thr)o(own)17 b(away)-9 b(.)24 -b(This)17 b(is)h(the)f(intended)g(behaviour)-6 b(,)17 -b(and)f(it)h(means)h(that)e(integer)h(pids)g(ar)o(e)681 -714 y(not)24 b(enough)g(to)g(cause)f(a)g(pr)o(ocess's)g(exit)g(status)h -(to)f(be)h(r)o(etained)e(by)h(the)h(scsh)f(r)o(untime.)681 -814 y(\(This)e(is)g(because)f(it)h(is)g(clearly)f(impossible)i(to)f(GC) -g(data)e(r)o(efer)o(enced)f(by)j(integers.\))805 938 -y(As)32 b(a)f(convenience)i(for)f(interactive)f(use)h(and)f(debugging,) -k(all)d(pr)o(ocedur)o(es)e(that)681 1038 y(take)24 b(pr)o(ocess)g -(objects)h(will)g(also)g(accept)e(integer)h(Unix)h(pids)f(as)g(ar)o -(guments,)h(coer)o(cing)681 1137 y(them)k(to)h(the)f(corr)o(esponding)h -(pr)o(ocess)e(objects.)52 b(Since)28 b(integer)i(pr)o(ocess)e(ids)i(ar) -o(e)d(not)681 1237 y(r)o(eliable)c(ways)h(to)h(keep)f(a)g(child's)h -(exit)f(status)g(fr)o(om)g(being)h(r)o(eaped)d(and)i(garbage)f(col-)681 -1337 y(lected,)18 b(pr)o(ogrammers)g(ar)o(e)e(encouraged)i(to)h(use)f +4449 y FD(parameter)g(\(default)g FA(#f)p FD(\):)p 1174 +4511 1455 4 v 1174 4611 4 100 v 1227 4581 a FC(pr)o(obe?)p +1666 4611 V 270 w FD(Return)p 2625 4611 V 1174 4614 1455 +4 v 1174 4631 V 1174 4731 4 100 v 1227 4701 a FA(#f)p +1666 4731 V 404 w FC(signal)i(err)o(or)g(condition.)p +2625 4731 V 1174 4734 1455 4 v 1174 4834 4 100 v 1227 +4804 a FA('create)p 1666 4834 V 184 w FD(Cr)o(eate)e(new)i(pr)o(oc)f +(object.)p 2625 4834 V 1174 4837 1455 4 v 1174 4936 4 +100 v 1227 4907 a(T)-7 b(r)o(ue)20 b(value)p 1666 4936 +V 103 w FA(#f)p 2625 4936 V 1174 4940 1455 4 v 1756 5147 +a FD(55)p eop +%%Page: 56 64 +56 63 bop 805 739 a FD(Sometime)21 b(after)e(a)h(child)h(pr)o(ocess)f +(terminates,)g(scsh)h(will)g(perform)f(a)g FA(wait)e +FD(system)681 839 y(call)25 b(on)h(the)g(child)g(in)g(backgr)o(ound,)g +(caching)g(the)g(pr)o(ocess')f(exit)h(status)g(in)g(the)g(child's)681 +938 y(pr)o(oc)33 b(object.)65 b(This)35 b(is)f(called)f(\223r)o +(eaping\224)f(the)i(pr)o(ocess.)64 b(Once)34 b(the)g(child)g(has)g +(been)681 1038 y(waited,)g(the)e(Unix)g(kernel)f(can)h(fr)o(ee)e(the)i +(storage)g(allocated)f(for)h(the)g(dead)e(pr)o(ocess')681 +1137 y(exit)21 b(information,)h(so)g(pr)o(ocess)f(r)o(eaping)f(pr)o +(events)h(the)h(pr)o(ocess)f(table)f(fr)o(om)h(becoming)681 +1237 y(clutter)o(ed)g(with)j(un-waited)f(dead)e(child)i(pr)o(ocesses)g +(\(a.k.a.)30 b(\223zombies\224\).)h(This)24 b(can)e(be)681 +1337 y(especially)f(sever)o(e)e(if)i(the)h(scsh)g(pr)o(ocess)e(never)h +(waits)g(on)h(child)g(pr)o(ocesses)e(at)h(all;)g(if)g(the)681 +1436 y(pr)o(ocess)h(table)g(over\003ows)h(with)g(for)o(gotten)g +(zombies,)g(the)f(OS)h(may)f(be)g(unable)g(to)h(fork)681 +1536 y(further)d(pr)o(ocesses.)805 1660 y(Reaping)28 +b(a)e(child)h(pr)o(ocess)g(moves)g(its)h(exit)e(status)h(information)h +(fr)o(om)f(the)g(kernel)681 1760 y(into)k(the)f(scsh)h(pr)o(ocess,)g +(wher)o(e)f(it)g(is)h(cached)e(inside)h(the)g(child's)h(pr)o(ocess)f +(object.)53 b(If)681 1860 y(the)22 b(scsh)h(user)f(dr)o(ops)f(all)h +(pointers)h(to)f(the)g(pr)o(ocess)g(object,)g(it)h(will)g(simply)f(be)g +(garbage)681 1959 y(collected.)34 b(On)25 b(the)f(other)g(hand,)g(if)g +(the)g(scsh)h(pr)o(ogram)e(r)o(etains)g(a)g(pointer)i(to)f(the)g(pr)o +(o-)681 2059 y(cess)c(object,)h(it)g(can)f(use)h(scsh's)g +FA(wait)e FD(system)i(call)f(to)h(synchr)o(onise)h(with)f(the)g(child)f +(and)681 2159 y(r)o(etrieve)h(its)i(exit)g(status)g(multiple)g(times)h +(\(this)f(is)g(not)h(possible)f(with)h(simple)f(Unix)g(in-)681 +2258 y(teger)d(pids)h(in)g(C\227the)g(pr)o(ogrammer)f(can)g(only)i +(wait)f(on)g(a)f(pid)h(once\).)805 2383 y(Thus,)h(pr)o(ocess)e(objects) +i(allow)f(scsh)g(pr)o(ogrammer)f(to)i(do)f(two)g(things)i(not)e +(allowed)681 2482 y(in)g(other)g(pr)o(ogramming)g(envir)o(onments:)805 +2671 y Fw(\017)41 b FD(Subpr)o(ocesses)30 b(that)h(ar)o(e)e(never)h +(waited)g(on)h(ar)o(e)f(still)h(r)o(emoved)f(fr)o(om)g(the)h(pr)o(o-) +888 2771 y(cess)21 b(table,)e(and)h(their)g(associated)g(exit)g(status) +g(data)f(is)i(eventually)f(automatical-)888 2870 y(ly)h(garbage)f +(collected.)805 3035 y Fw(\017)41 b FD(Subpr)o(ocesses)20 +b(can)h(be)f(waited)g(on)i(multiple)f(times.)805 3224 +y(However)-6 b(,)27 b(note)f(that)f(once)h(a)g(child)g(has)f(exited,)h +(if)g(the)f(scsh)i(pr)o(ogrammer)e(dr)o(ops)681 3324 +y(all)d(pointers)h(to)g(the)g(child's)f(pr)o(oc)g(object,)h(the)g +(child's)g(exit)f(status)h(will)g(be)f(r)o(eaped)e(and)681 +3424 y(thr)o(own)d(away)-9 b(.)24 b(This)17 b(is)h(the)f(intended)g +(behaviour)-6 b(,)17 b(and)f(it)h(means)h(that)e(integer)h(pids)g(ar)o +(e)681 3523 y(not)24 b(enough)g(to)g(cause)f(a)g(pr)o(ocess's)g(exit)g +(status)h(to)f(be)h(r)o(etained)e(by)h(the)h(scsh)f(r)o(untime.)681 +3623 y(\(This)e(is)g(because)f(it)h(is)g(clearly)f(impossible)i(to)f +(GC)g(data)e(r)o(efer)o(enced)f(by)j(integers.\))805 +3747 y(As)32 b(a)f(convenience)i(for)f(interactive)f(use)h(and)f +(debugging,)k(all)d(pr)o(ocedur)o(es)e(that)681 3847 +y(take)24 b(pr)o(ocess)g(objects)h(will)g(also)g(accept)e(integer)h +(Unix)h(pids)f(as)g(ar)o(guments,)h(coer)o(cing)681 3947 +y(them)k(to)h(the)f(corr)o(esponding)h(pr)o(ocess)e(objects.)52 +b(Since)28 b(integer)i(pr)o(ocess)e(ids)i(ar)o(e)d(not)681 +4046 y(r)o(eliable)c(ways)h(to)h(keep)f(a)g(child's)h(exit)f(status)g +(fr)o(om)g(being)h(r)o(eaped)d(and)i(garbage)f(col-)681 +4146 y(lected,)18 b(pr)o(ogrammers)g(ar)o(e)e(encouraged)i(to)h(use)f (pr)o(ocess)g(objects)h(in)g(pr)o(oduction)g(code.)681 -1479 y FA(\(autoreap-policy)37 b FC([policy])p FA(\))85 +4294 y FA(\(autoreap-policy)37 b FC([policy])p FA(\))85 b Fw(\000)-15 b(!)88 b FC(old-policy)810 b FD(pr)o(ocedur)o(e)888 -1614 y(The)20 b(scsh)g(pr)o(ogrammer)f(can)h(choose)g(dif)o(fer)o(ent)e -(policies)i(for)g(automatic)f(pr)o(ocess)888 1714 y(r)o(eaping.)39 +4434 y(The)20 b(scsh)g(pr)o(ogrammer)f(can)h(choose)g(dif)o(fer)o(ent)e +(policies)i(for)g(automatic)f(pr)o(ocess)888 4534 y(r)o(eaping.)39 b(The)25 b(policy)h(is)g(determined)e(by)i(applying)f(this)h(pr)o -(ocedur)o(e)e(to)h(one)h(of)888 1813 y(the)21 b(values)g +(ocedur)o(e)e(to)h(one)h(of)888 4634 y(the)21 b(values)g FA('early)p FD(,)d FA('late)p FD(,)g(or)j FA(#f)f FD(\()p -FC(i.e.)o FD(,)h(no)g(autor)o(eap\).)888 1973 y FB(early)41 -b FD(The)25 b(child)g(is)h(r)o(eaped)d(fr)o(om)i(the)g(Unix)g(kernel's) -g(pr)o(ocess)g(table)f(into)i(scsh)1071 2072 y(as)h(soon)i(as)f(it)g -(dies.)46 b(This)29 b(is)f(done)g(by)f(having)h(a)g(signal)g(handler)f -(for)h(the)1071 2172 y FA(SIGCHLD)34 b FD(signal)j(r)o(eap)e(the)i(pr)o -(ocess.)147 b FC(If)37 b(a)f(scsh)h(pr)o(ogram)e(sets)i(its)g(own)1071 -2271 y(handler)29 b(for)h(the)f FA(SIGCHLD)d FC(signal,)32 -b(the)d(handler)g(must)g(r)o(eap)g(dead)f(childr)o(en)h(by)1071 -2371 y(calling)h FA(wait)p FC(,)g FA(wait-any)p FC(,)f(or)h -FA(reap-zombies)p FC(.)48 b FD(W)-8 b(e)30 b(depr)o(ecate)e(interr)o -(upt-)1071 2471 y(driven)17 b(code,)h(and)g(hope)g(to)g(pr)o(ovide)f -(alternative)f(tools)j(in)f(a)g(futur)o(e,)f(multi-)1071 -2570 y(thr)o(eaded)i(r)o(elease)g(of)i(scsh.)888 2688 -y FB(late)40 b FD(The)21 b(child)h(is)f(not)h(autor)o(eaped)d(until)j -(it)f(dies)g FC(and)g FD(the)g(scsh)h(pr)o(ogram)f(dr)o(ops)1071 -2780 y(all)g(pointers)h(to)f(its)g(pr)o(ocess)g(object.)27 -b(That)21 b(is,)g(the)g(pr)o(ocess)g(table)f(is)i(cleaned)1071 -2871 y(out)f(during)g(garbage)f(collection.)1226 2989 -y Fl(Oops:)50 b Fk(The)18 b Fh(late)g Fk(policy)f(is)g(not)h(supported) -e(under)h(the)h(curr)o(ent)f(r)o(elease)1226 3080 y(of)24 -b(scsh.)39 b(It)24 b(r)o(equir)o(es)d(mor)o(e)i(sophisticated)h(gc)f -(hooks)g(than)j(we)e(can)h(get)1226 3171 y(fr)o(om)18 -b(the)h(r)o(elease)e(of)h(Scheme)i(48)f(that)h(we)f(use.)888 -3298 y FA(#f)41 b FD(If)20 b(autor)o(eaping)e(is)j(turned)e(of)o(f,)g -(pr)o(ocess)h(r)o(eaping)f(is)h(completely)g(under)g(con-)1071 -3397 y(tr)o(ol)30 b(of)f(the)h(pr)o(ogrammer)-6 b(,)31 -b(who)g(can)e(for)o(ce)g(outstanding)h(zombies)g(to)g(be)1071 -3497 y(r)o(eaped)h(by)i(manually)h(calling)f(the)h FA(reap-zombies)28 -b FD(pr)o(ocedur)o(e)j(\(see)i(be-)1071 3597 y(low\).)888 -3756 y(Note)27 b(that)f(under)f(any)i(of)f(the)g(autor)o(eap)e -(policies,)k(a)e(particular)f(pr)o(ocess)g Fo(p)h FD(can)888 -3856 y(be)i(manually)g(r)o(eaped)e(into)j(scsh)g(by)f(simply)g(calling) -h FA(\(wait)41 b Fo(p)p FA(\))p FD(.)47 b FC(All)28 b -FD(zombies)888 3955 y(can)21 b(be)f(manually)h(r)o(eaped)e(with)i -FA(reap-zombies)p FD(.)888 4085 y(The)40 b FA(autoreap-policy)34 -b FD(pr)o(ocedur)o(e)k(r)o(eturns)h(the)h(policy's)g(pr)o(evious)g -(value.)888 4184 y(Calling)27 b FA(autoreap-policy)19 -b FD(with)27 b(no)g(ar)o(guments)f(r)o(eturns)f(the)h(curr)o(ent)f -(policy)888 4284 y(without)d(no)g(change.)681 4565 y -FA(\(reap-zombies\))81 b Fw(\000)-14 b(!)87 b FC(boolean)1321 -b FD(pr)o(ocedur)o(e)888 4699 y(This)25 b(pr)o(ocedur)o(e)e(r)o(eaps)g -(all)i(outstanding)g(exited)f(child)h(pr)o(ocesses)f(into)h(scsh.)38 -b(It)888 4799 y(r)o(eturns)26 b(tr)o(ue)g(if)g(ther)o(e)f(ar)o(e)g(no)i -(mor)o(e)f(child)g(pr)o(ocesses)g(to)g(wait)g(on,)i(and)e(false)f(if) -888 4898 y(ther)o(e)20 b(ar)o(e)g(outstanding)h(pr)o(ocesses)g(still)g -(r)o(unning)h(or)f(suspended.)2071 5147 y(56)p eop -%%Page: 57 63 -57 62 bop 365 906 a FB(Issues)20 b(with)g(process)g(reaping)365 -1110 y FD(Reaping)26 b(a)f(pr)o(ocess)h(does)f(not)i(r)o(eveal)d(its)i -(pr)o(ocess)f(gr)o(oup)h(at)f(the)h(time)g(of)g(death;)h(this)365 -1210 y(information)g(is)g(lost)f(when)h(the)f(pr)o(ocess)g(r)o(eaped.) -39 b(This)26 b(means)g(that)g(a)g(dead,)g(r)o(eaped)365 -1309 y(pr)o(ocess)h(is)h FC(not)f(eligible)h FD(as)f(a)g(r)o(eturn)g +FC(i.e.)o FD(,)h(no)g(autor)o(eap\).)888 4799 y FB(early)41 +b FD(The)30 b(child)h(is)f(r)o(eaped)e(fr)o(om)i(the)g(Unix)g(kernel's) +h(pr)o(ocess)f(table)f(into)i(sc-)1071 4898 y(sh)f(as)g(soon)h(as)e(it) +h(dies.)52 b(This)31 b(is)f(done)g(by)f(having)h(a)g(signal)g(handler)f +(for)2071 5147 y(56)p eop +%%Page: 57 65 +57 64 bop 756 614 a FD(the)27 b FA(SIGCHLD)e FD(signal)k(r)o(eap)d(the) +i(pr)o(ocess.)93 b FC(If)28 b(a)f(scsh)h(pr)o(ogram)e(sets)j(its)f(own) +756 714 y(handler)h(for)g(the)g FA(SIGCHLD)e FC(signal,)k(the)e +(handler)g(must)g(r)o(eap)g(dead)g(childr)o(en)g(by)756 +814 y(calling)g FA(wait)p FC(,)i FA(wait-any)p FC(,)d(or)i +FA(reap-zombies)p FC(.)49 b FD(W)-8 b(e)30 b(depr)o(ecate)e(interr)o +(upt-)756 913 y(driven)17 b(code,)h(and)f(hope)h(to)g(pr)o(ovide)f +(alternative)g(tools)i(in)f(a)f(futur)o(e,)g(multi-)756 +1013 y(thr)o(eaded)h(r)o(elease)i(of)g(scsh.)573 1138 +y FB(late)40 b FD(The)21 b(child)g(is)h(not)g(autor)o(eaped)d(until)j +(it)f(dies)g FC(and)g FD(the)g(scsh)h(pr)o(ogram)e(dr)o(ops)756 +1229 y(all)g(pointers)i(to)g(its)f(pr)o(ocess)g(object.)26 +b(That)21 b(is,)h(the)f(pr)o(ocess)g(table)f(is)h(cleaned)756 +1321 y(out)g(during)g(garbage)e(collection.)911 1446 +y Fl(Oops:)49 b Fk(The)18 b Fj(late)h Fk(policy)d(is)h(not)h(supported) +f(under)g(the)h(curr)o(ent)f(r)o(elease)911 1537 y(of)23 +b(scsh.)39 b(It)25 b(r)o(equir)o(es)c(mor)o(e)h(sophisticated)i(gc)g +(hooks)f(than)j(we)e(can)h(get)911 1629 y(fr)o(om)17 +b(the)j(r)o(elease)d(of)h(Scheme)h(48)g(that)i(we)d(use.)573 +1762 y FA(#f)41 b FD(If)19 b(autor)o(eaping)g(is)h(turned)g(of)o(f,)f +(pr)o(ocess)g(r)o(eaping)g(is)h(completely)h(under)e(con-)756 +1862 y(tr)o(ol)29 b(of)h(the)g(pr)o(ogrammer)-6 b(,)30 +b(who)h(can)f(for)o(ce)e(outstanding)j(zombies)f(to)g(be)756 +1962 y(r)o(eaped)h(by)i(manually)g(calling)h(the)f FA(reap-zombies)28 +b FD(pr)o(ocedur)o(e)k(\(see)g(be-)756 2061 y(low\).)573 +2229 y(Note)26 b(that)g(under)g(any)g(of)g(the)g(autor)o(eap)f +(policies,)j(a)d(particular)g(pr)o(ocess)h Fo(p)g FD(can)573 +2328 y(be)i(manually)g(r)o(eaped)e(into)i(scsh)h(by)f(simply)h(calling) +f FA(\(wait)42 b Fo(p)p FA(\))p FD(.)k FC(All)28 b FD(zombies)573 +2428 y(can)20 b(be)h(manually)g(r)o(eaped)d(with)k FA(reap-zombies)p +FD(.)573 2562 y(The)40 b FA(autoreap-policy)33 b FD(pr)o(ocedur)o(e)38 +b(r)o(eturns)h(the)h(policy's)h(pr)o(evious)e(value.)573 +2661 y(Calling)26 b FA(autoreap-policy)20 b FD(with)27 +b(no)f(ar)o(guments)g(r)o(eturns)g(the)g(curr)o(ent)f(policy)573 +2761 y(without)d(no)f(change.)365 3054 y FA(\(reap-zombies\))82 +b Fw(\000)-15 b(!)88 b FC(boolean)1321 b FD(pr)o(ocedur)o(e)573 +3195 y(This)25 b(pr)o(ocedur)o(e)e(r)o(eaps)g(all)h(outstanding)i +(exited)e(child)g(pr)o(ocesses)h(into)g(scsh.)38 b(It)573 +3295 y(r)o(eturns)25 b(tr)o(ue)i(if)f(ther)o(e)f(ar)o(e)g(no)h(mor)o(e) +g(child)h(pr)o(ocesses)e(to)i(wait)f(on,)i(and)d(false)h(if)573 +3395 y(ther)o(e)20 b(ar)o(e)f(outstanding)j(pr)o(ocesses)e(still)i(r)o +(unning)g(or)f(suspended.)365 3791 y FB(Issues)f(with)g(process)g +(reaping)365 3976 y FD(Reaping)26 b(a)f(pr)o(ocess)h(does)f(not)i(r)o +(eveal)d(its)i(pr)o(ocess)f(gr)o(oup)h(at)f(the)h(time)g(of)g(death;)h +(this)365 4075 y(information)g(is)g(lost)f(when)h(the)f(pr)o(ocess)g(r) +o(eaped.)39 b(This)26 b(means)g(that)g(a)g(dead,)g(r)o(eaped)365 +4175 y(pr)o(ocess)h(is)h FC(not)f(eligible)h FD(as)f(a)g(r)o(eturn)g (value)g(for)g(a)g(futur)o(e)f FA(wait-process-grou)o(p)21 -b FD(call.)365 1409 y(This)f(is)f(not)h(likely)f(to)g(be)g(a)f(pr)o +b FD(call.)365 4275 y(This)f(is)f(not)h(likely)f(to)g(be)g(a)f(pr)o (oblem)h(for)f(most)i(code,)f(as)f(pr)o(ograms)h(almost)g(never)g(wait) -365 1509 y(on)g(exited)d(pr)o(ocesses)i(by)f(pr)o(ocess)g(gr)o(oup.)25 +365 4374 y(on)g(exited)d(pr)o(ocesses)i(by)f(pr)o(ocess)g(gr)o(oup.)25 b(Pr)o(ocess)17 b(gr)o(oup)g(waiting)i(is)f(usually)f(applied)365 -1608 y(to)24 b FC(stopped)e FD(pr)o(ocesses,)i(which)g(ar)o(e)e(never)h +4474 y(to)24 b FC(stopped)e FD(pr)o(ocesses,)i(which)g(ar)o(e)e(never)h (r)o(eaped.)32 b(So)23 b(it)h(is)g(unlikely)g(that)f(this)i(will)f(be) -365 1708 y(a)d(pr)o(oblem)f(for)h(most)g(pr)o(ograms.)490 -1848 y(Automatic)30 b(pr)o(ocess)g(r)o(eaping)g(is)h(a)f(useful)g(pr)o -(ogramming)h(convenience.)55 b(How-)365 1948 y(ever)-6 -b(,)28 b(if)f(a)g(pr)o(ogram)f(is)i(car)o(eful)d(to)j(wait)f(for)g(all) -g(childr)o(en,)h(and)f(does)g(not)h(wish)g(auto-)365 -2047 y(matic)17 b(r)o(eaping)f(to)i(happen,)f(the)g(pr)o(ogrammer)g -(can)g(simply)h(turn)f(pr)o(ocess)f(autor)o(eaping)365 -2147 y(of)o(f.)490 2287 y(Pr)o(ograms)35 b(that)g(do)g(not)h(wish)h(to) -e(use)g(automatic)h(pr)o(ocess)e(r)o(eaping)h(should)h(be)365 -2387 y(awar)o(e)17 b(that)i(some)g(scsh)g(r)o(outines)g(cr)o(eate)e -(subpr)o(ocesses)i(but)f(do)h(not)g(r)o(eturn)f(the)h(child's)365 -2487 y(pid:)27 b FA(run/port*)p FD(,)17 b(and)k(its)h(r)o(elated)e(pr)o -(ocedur)o(es)g(and)h(special)g(forms)g(\()p FA(run/strings)p -FD(,)c FC(et)365 2586 y(al.)p FD(\).)32 b(Automatic)22 -b(pr)o(ocess)h(r)o(eaping)f(will)h(clean)g(the)g(child)g(pr)o(ocesses)g -(cr)o(eated)d(by)j(these)365 2686 y(pr)o(ocedur)o(es)f(out)i(of)g(the)g -(kernel's)g(pr)o(ocess)f(table.)34 b(If)24 b(a)f(pr)o(ogram)g(doesn't)h -(use)g(pr)o(ocess)365 2786 y(r)o(eaping,)32 b(it)f(should)h(either)e -(avoid)h(these)g(forms,)i(or)e(use)g FA(wait-any)c FD(to)k(wait)g(for)f -(the)365 2885 y(childr)o(en)21 b(to)g(exit.)365 3177 -y FB(3.4.2)81 b(Process)20 b(waiting)365 3401 y FA(\(wait)42 -b FC(pr)o(oc/pid)18 b([\003ags])p FA(\))86 b Fw(\000)-14 -b(!)87 b FC(status)1168 b FD(pr)o(ocedur)o(e)573 3530 -y(This)21 b(pr)o(ocedur)o(e)d(waits)j(until)g(a)f(child)g(pr)o(ocess)g -(exits,)g(and)g(r)o(eturns)g(its)h(exit)f(code.)573 3630 -y(The)28 b FC(pr)o(oc/pid)e FD(ar)o(gument)i(is)h(either)f(a)g(pr)o -(ocess)f(object)i(\(section)g(3.4.1\))d(or)i(an)g(in-)573 -3730 y(teger)23 b(pr)o(ocess)f(id.)33 b FA(Wait)22 b -FD(r)o(eturns)h(the)g(child's)h(exit)f(status)g(code)g(\(or)g -(suspension)573 3829 y(code,)29 b(if)e(the)h FA(wait/stopped-chil)o -(dre)o(n)22 b FD(option)29 b(is)f(used,)h(see)e(below\).)47 -b(Status)573 3929 y(values)20 b(can)h(be)f(queried)h(with)g(the)g(pr)o -(ocedur)o(es)e(in)i(section)h(3.4.3.)573 4072 y(The)f -FC(\003ags)g FD(ar)o(gument)g(is)g(an)g(integer)g(whose)h(bits)g -(specify)f(additional)g(options.)28 b(It)573 4172 y(is)21 -b(composed)g(by)g(or)6 b('ing)22 b(together)f(the)g(following)h -(\003ags:)p 573 4327 2662 4 v 573 4427 4 100 v 626 4397 -a(Flag)p 1591 4427 V 860 w(Meaning)p 3231 4427 V 573 -4430 2662 4 v 573 4447 V 573 4546 4 100 v 626 4516 a -FA(wait/poll)p 1591 4546 V 622 w FD(Return)f FA(#f)f -FD(immediately)h(if)g(child)g(still)g(active.)p 3231 -4546 V 573 4549 2662 4 v 573 4649 4 100 v 626 4619 a -FA(wait/stopped-chi)o(ldr)o(en)p 1591 4649 V 96 w FD(W)-8 -b(ait)21 b(for)g(suspend)g(as)f(well)h(as)g(exit.)p 3231 -4649 V 573 4652 2662 4 v 365 4845 a FA(\(wait-any)40 -b FC([\003ags])p FA(\))86 b Fw(\000)-14 b(!)87 b FC([pr)o(oc)19 -b(status])1069 b FD(pr)o(ocedur)o(e)1756 5147 y(57)p -eop -%%Page: 58 64 -58 63 bop 888 614 a FD(The)24 b(optional)g FC(\003ags)f -FD(ar)o(gument)g(is)g(as)g(for)g FA(wait)p FD(.)31 b(This)24 -b(pr)o(ocedur)o(e)e(waits)h(for)g(any)888 714 y(child)e(pr)o(ocess)f -(to)h(exit)f(\(or)h(stop,)f(if)h(the)f FA(wait/stopped-chil)o(dr)o(en) -14 b FD(\003ag)21 b(is)g(used\))888 814 y(It)g(r)o(eturns)g(the)g(pr)o -(ocess')g(pr)o(ocess)f(object)h(and)g(status)g(code.)26 -b(If)21 b(ther)o(e)f(ar)o(e)f(no)j(chil-)888 913 y(dr)o(en)k(left)f -(for)h(which)h(to)g(wait,)g(the)f(two)h(values)f FA([#f)42 -b(#t])25 b FD(ar)o(e)g(r)o(eturned.)40 b(If)26 b(the)888 -1013 y FA(wait/poll)18 b FD(\003ag)k(is)f(used,)g(and)g(none)i(of)e -(the)g(childr)o(en)g(ar)o(e)f(immediately)i(eligble)888 -1112 y(for)f(waiting,)g(then)g(the)g(values)f FA([#f)43 -b(#f])19 b FD(ar)o(e)h(r)o(eturned:)p 1688 1181 1057 -4 v 1688 1281 4 100 v 1741 1251 a([)p FA(#f)g(#f)p FD(])p -2042 1281 V 102 w(Poll,)h(none)h(r)o(eady)p 2742 1281 -V 1688 1284 1057 4 v 1688 1384 4 100 v 1741 1354 a([)p -FA(#f)e(#t)p FD(])p 2042 1384 V 102 w(No)h(childr)o(en)p -2742 1384 V 1688 1387 1057 4 v 888 1490 a FA(Wait-any)71 -b FD(will)k(not)f(r)o(eturn)g(a)f(pr)o(ocess)h(that)f(has)h(been)g(pr)o -(eviously)888 1589 y(waited)49 b(by)h(any)g(other)g(pr)o(ocess-wait)f -(pr)o(ocedur)o(e)e(\()p FA(wait)p FD(,)55 b FA(wait-any)p -FD(,)e(and)888 1689 y FA(wait-process-grou)o(p)p FD(\).)47 -b(It)30 b(will)h(r)o(eturn)e(r)o(eaped)f(pr)o(ocesses)i(that)g(haven't) -g(yet)888 1789 y(been)21 b(waited.)888 1922 y(The)g(use)g(of)g -FA(wait-any)c FD(is)k(depr)o(ecated.)681 2214 y FA(\(wait-process-gr)o -(ou)o(p)38 b FC(pr)o(oc/pid)18 b([\003ags])p FA(\))86 -b Fw(\000)-14 b(!)87 b FC([pr)o(oc)19 b(status])338 b -FD(pr)o(ocedur)o(e)888 2356 y(This)18 b(pr)o(ocedur)o(e)e(waits)i(for)f -(any)h(child)g(whose)g(pr)o(ocess)f(gr)o(oup)g(is)h FC(pr)o(oc/pid)e -FD(\(either)888 2455 y(a)21 b(pr)o(ocess)f(object)h(or)g(a)f(pid\).)25 -b(The)c FC(\003ags)f FD(ar)o(gument)h(is)g(as)f(for)h -FA(wait)p FD(.)888 2589 y(Note)j(that)g(if)g(the)g(pr)o(ogrammer)f -(wishes)i(to)f(wait)g(for)g(exited)f(pr)o(ocesses)h(by)g(pr)o(o-)888 -2688 y(cess)36 b(gr)o(oup,)k(the)c(pr)o(ogram)f(should)i(take)f(car)o -(e)e(not)j(to)f(use)g(pr)o(ocess)g(r)o(eaping)888 2788 -y(\(section)29 b(3.4.1\),)e(as)g(this)i(loses)f(pr)o(ocess)g(gr)o(oup)f -(information.)48 b(However)-6 b(,)29 b(most)888 2888 -y(pr)o(ocess-gr)o(oup)h(waiting)g(is)h(for)f(stopped)g(pr)o(ocesses)g -(\(to)g(implement)h(job)g(con-)888 2987 y(tr)o(ol\),)j(so)d(this)h(is)g -(rar)o(ely)e(an)h(issue,)j(as)d(stopped)g(pr)o(ocesses)g(ar)o(e)f(not)i -(subject)g(to)888 3087 y(r)o(eaping.)681 3482 y FB(3.4.3)81 -b(Analysing)19 b(process)h(status)f(codes)681 3666 y -FD(When)26 b(a)f(child)h(pr)o(ocess)f(dies)h(\(or)f(is)h(suspended\),)g -(its)h(par)o(ent)d(can)i(call)f(the)h FA(wait)e FD(pr)o(o-)681 -3766 y(cedur)o(e)d(to)h(r)o(ecover)f(the)h(exit)h(\(or)f(suspension\))h -(status)f(of)g(the)h(child.)30 b(The)22 b(exit)g(status)h(is)681 -3866 y(a)e(small)h(integer)g(that)f(encodes)h(information)h(describing) -e(how)i(the)f(child)g(terminated.)681 3965 y(The)27 b(bit-level)h -(format)f(of)h(the)f(exit)h(status)g(is)g(not)g(de\002ned)f(by)j(P)t -Fv(O)t(S)t(I)t(X)r FD(;)i(you)d(must)f(use)681 4065 y(the)i(following)h -(thr)o(ee)e(functions)h(to)g(decode)f(one.)53 b(However)-6 -b(,)31 b(if)f(a)f(child)h(terminates)681 4164 y(normally)20 -b(with)g(exit)g(code)f(0,)i(P)t Fv(O)t(S)t(I)t(X)i FD(does)c(r)o(equir) -o(e)f FA(wait)g FD(to)i(r)o(eturn)f(an)g(exit)h(status)f(that)681 -4264 y(is)i(exactly)g(zer)o(o.)k(So)c FA(\(zero?)42 b -FC(status)o FA(\))21 b FD(is)h(a)e(corr)o(ect)g(way)h(to)h(test)f(for)g -(non-err)o(or)-6 b(,)21 b(normal)681 4364 y(termination,)g -FC(e.g.)o FD(,)888 4556 y FA(\(if)43 b(\(zero?)e(\(run)h(\(rcp)g -(scsh.tar.gz)d(lambda.csd.hku.)o(hk:)o(\)\))o(\))1063 -4656 y(\(delete-file)f("scsh.tar.gz"\)\))681 4898 y(\(status:exit-val)f -FC(status)p FA(\))86 b Fw(\000)-14 b(!)87 b FC(integer)21 -b(or)g FA(#f)760 b FD(pr)o(ocedur)o(e)2071 5147 y(58)p -eop -%%Page: 59 65 -59 64 bop 365 614 a FA(\(status:stop-sig)37 b FC(status)p -FA(\))87 b Fw(\000)-14 b(!)87 b FC(integer)21 b(or)g -FA(#f)760 b FD(pr)o(ocedur)o(e)365 714 y FA(\(status:term-sig)37 -b FC(status)p FA(\))87 b Fw(\000)-14 b(!)87 b FC(integer)21 -b(or)g FA(#f)760 b FD(pr)o(ocedur)o(e)573 850 y(For)27 +365 4573 y(a)d(pr)o(oblem)f(for)h(most)g(pr)o(ograms.)490 +4699 y(Automatic)h(pr)o(ocess)f(r)o(eaping)g(is)h(a)g(useful)f(pr)o +(ogramming)h(convenience.)30 b(Howev-)365 4799 y(er)-6 +b(,)21 b(if)g(a)g(pr)o(ogram)g(is)h(car)o(eful)e(to)i(wait)f(for)g(all) +h(childr)o(en,)f(and)g(does)g(not)h(wish)h(automatic)365 +4898 y(r)o(eaping)d(to)h(happen,)g(the)f(pr)o(ogrammer)g(can)h(simply)g +(turn)g(pr)o(ocess)g(autor)o(eaping)f(of)o(f.)1756 5147 +y(57)p eop +%%Page: 58 66 +58 65 bop 805 614 a FD(Pr)o(ograms)35 b(that)h(do)f(not)h(wish)g(to)g +(use)f(automatic)g(pr)o(ocess)g(r)o(eaping)f(should)i(be)681 +714 y(awar)o(e)17 b(that)h(some)i(scsh)f(r)o(outines)g(cr)o(eate)e +(subpr)o(ocesses)h(but)h(do)f(not)i(r)o(eturn)e(the)h(child's)681 +814 y(pid:)26 b FA(run/port*)p FD(,)18 b(and)j(its)h(r)o(elated)d(pr)o +(ocedur)o(es)h(and)h(special)g(forms)h(\()p FA(run/strings)p +FD(,)16 b FC(et)681 913 y(al.)p FD(\).)31 b(Automatic)23 +b(pr)o(ocess)f(r)o(eaping)g(will)i(clean)e(the)i(child)f(pr)o(ocesses)f +(cr)o(eated)f(by)i(these)681 1013 y(pr)o(ocedur)o(es)f(out)i(of)g(the)g +(kernel's)g(pr)o(ocess)f(table.)34 b(If)23 b(a)g(pr)o(ogram)g(doesn't)i +(use)e(pr)o(ocess)681 1112 y(r)o(eaping,)32 b(it)f(should)g(either)g +(avoid)f(these)h(forms,)i(or)e(use)g FA(wait-any)d FD(to)j(wait)f(for)h +(the)681 1212 y(childr)o(en)20 b(to)h(exit.)681 1475 +y FB(3.4.2)81 b(Process)20 b(waiting)681 1687 y FA(\(wait)41 +b FC(pr)o(oc/pid)19 b([\003ags])p FA(\))86 b Fw(\000)-15 +b(!)88 b FC(status)1167 b FD(pr)o(ocedur)o(e)888 1813 +y(This)21 b(pr)o(ocedur)o(e)e(waits)h(until)h(a)f(child)h(pr)o(ocess)f +(exits,)g(and)g(r)o(eturns)g(its)g(exit)h(code.)888 1913 +y(The)29 b FC(pr)o(oc/pid)d FD(ar)o(gument)h(is)i(either)f(a)g(pr)o +(ocess)g(object)h(\(section)f(3.4.1\))e(or)j(an)f(in-)888 +2012 y(teger)23 b(pr)o(ocess)g(id.)33 b FA(Wait)21 b +FD(r)o(eturns)i(the)g(child's)h(exit)f(status)h(code)f(\(or)g +(suspension)888 2112 y(code,)29 b(if)f(the)g FA(wait/stopped-chi)o(ldr) +o(en)21 b FD(option)29 b(is)f(used,)h(see)f(below\).)47 +b(Status)888 2212 y(values)21 b(can)f(be)h(queried)f(with)i(the)f(pr)o +(ocedur)o(es)e(in)i(section)g(3.4.3.)888 2348 y(The)g +FC(\003ags)h FD(ar)o(gument)e(is)i(an)f(integer)g(whose)h(bits)f +(specify)g(additional)g(options.)28 b(It)888 2447 y(is)21 +b(composed)h(by)e(or)6 b('ing)22 b(together)f(the)g(following)h +(\003ags:)p 888 2595 2662 4 v 888 2694 4 100 v 941 2664 +a(Flag)p 1907 2694 V 861 w(Meaning)p 3547 2694 V 888 +2698 2662 4 v 888 2714 V 888 2814 4 100 v 941 2784 a +FA(wait/poll)p 1907 2814 V 623 w FD(Return)f FA(#f)f +FD(immediately)h(if)f(child)h(still)h(active.)p 3547 +2814 V 888 2817 2662 4 v 888 2917 4 100 v 941 2887 a +FA(wait/stopped-chil)o(dre)o(n)p 1907 2917 V 97 w FD(W)-8 +b(ait)21 b(for)f(suspend)h(as)g(well)g(as)f(exit.)p 3547 +2917 V 888 2920 2662 4 v 681 3090 a FA(\(wait-any)40 +b FC([\003ags])p FA(\))86 b Fw(\000)-15 b(!)88 b FC([pr)o(oc)19 +b(status])1068 b FD(pr)o(ocedur)o(e)888 3234 y(The)24 +b(optional)g FC(\003ags)f FD(ar)o(gument)g(is)g(as)g(for)g +FA(wait)p FD(.)31 b(This)24 b(pr)o(ocedur)o(e)e(waits)h(for)g(any)888 +3333 y(child)e(pr)o(ocess)f(to)h(exit)f(\(or)h(stop,)f(if)h(the)f +FA(wait/stopped-chil)o(dr)o(en)14 b FD(\003ag)21 b(is)g(used\))888 +3433 y(It)g(r)o(eturns)g(the)g(pr)o(ocess')g(pr)o(ocess)f(object)h(and) +g(status)g(code.)26 b(If)21 b(ther)o(e)f(ar)o(e)f(no)j(chil-)888 +3533 y(dr)o(en)k(left)f(for)h(which)h(to)g(wait,)g(the)f(two)h(values)f +FA([#f)42 b(#t])25 b FD(ar)o(e)g(r)o(eturned.)40 b(If)26 +b(the)888 3632 y FA(wait/poll)18 b FD(\003ag)k(is)f(used,)g(and)g(none) +i(of)e(the)g(childr)o(en)g(ar)o(e)f(immediately)i(eligble)888 +3732 y(for)f(waiting,)g(then)g(the)g(values)f FA([#f)43 +b(#f])19 b FD(ar)o(e)h(r)o(eturned:)p 1688 3803 1057 +4 v 1688 3903 4 100 v 1741 3873 a([)p FA(#f)g(#f)p FD(])p +2042 3903 V 102 w(Poll,)h(none)h(r)o(eady)p 2742 3903 +V 1688 3906 1057 4 v 1688 4006 4 100 v 1741 3976 a([)p +FA(#f)e(#t)p FD(])p 2042 4006 V 102 w(No)h(childr)o(en)p +2742 4006 V 1688 4009 1057 4 v 888 4114 a FA(Wait-any)45 +b FD(will)j(not)g(r)o(eturn)f(a)g(pr)o(ocess)g(that)h(has)g(been)f(pr)o +(eviously)g(wait-)888 4214 y(ed)69 b(by)f(any)h(other)g(pr)o +(ocess-wait)f(pr)o(ocedur)o(e)f(\()p FA(wait)p FD(,)78 +b FA(wait-any)p FD(,)f(and)888 4313 y FA(wait-process-grou)o(p)p +FD(\).)47 b(It)30 b(will)h(r)o(eturn)e(r)o(eaped)f(pr)o(ocesses)i(that) +g(haven't)g(yet)888 4413 y(been)21 b(waited.)888 4549 +y(The)g(use)g(of)g FA(wait-any)c FD(is)k(depr)o(ecated.)681 +4848 y FA(\(wait-process-gr)o(ou)o(p)38 b FC(pr)o(oc/pid)18 +b([\003ags])p FA(\))86 b Fw(\000)-14 b(!)87 b FC([pr)o(oc)19 +b(status])338 b FD(pr)o(ocedur)o(e)2071 5147 y(58)p eop +%%Page: 59 67 +59 66 bop 573 614 a FD(This)18 b(pr)o(ocedur)o(e)e(waits)h(for)h(any)f +(child)h(whose)g(pr)o(ocess)g(gr)o(oup)f(is)h FC(pr)o(oc/pid)d +FD(\(either)573 714 y(a)20 b(pr)o(ocess)g(object)i(or)e(a)h(pid\).)k +(The)20 b FC(\003ags)h FD(ar)o(gument)f(is)h(as)g(for)f +FA(wait)p FD(.)573 866 y(Note)k(that)g(if)g(the)g(pr)o(ogrammer)f +(wishes)i(to)f(wait)g(for)g(exited)f(pr)o(ocesses)g(by)h(pr)o(o-)573 +966 y(cess)36 b(gr)o(oup,)j(the)d(pr)o(ogram)g(should)h(take)e(car)o(e) +g(not)h(to)h(use)f(pr)o(ocess)f(r)o(eaping)573 1065 y(\(section)28 +b(3.4.1\),)f(as)h(this)g(loses)h(pr)o(ocess)e(gr)o(oup)h(information.) +48 b(However)-6 b(,)29 b(most)573 1165 y(pr)o(ocess-gr)o(oup)g(waiting) +i(is)f(for)g(stopped)h(pr)o(ocesses)e(\(to)i(implement)g(job)f(con-)573 +1265 y(tr)o(ol\),)j(so)f(this)g(is)g(rar)o(ely)e(an)h(issue,)j(as)d +(stopped)g(pr)o(ocesses)g(ar)o(e)f(not)i(subject)f(to)573 +1364 y(r)o(eaping.)365 1869 y FB(3.4.3)81 b(Analysing)19 +b(process)h(status)f(codes)365 2090 y FD(When)26 b(a)g(child)g(pr)o +(ocess)f(dies)g(\(or)h(is)g(suspended\),)g(its)g(par)o(ent)f(can)g +(call)g(the)h FA(wait)e FD(pr)o(o-)365 2190 y(cedur)o(e)d(to)i(r)o +(ecover)e(the)h(exit)g(\(or)g(suspension\))h(status)g(of)f(the)g +(child.)31 b(The)22 b(exit)g(status)g(is)365 2289 y(a)g(small)g +(integer)f(that)h(encodes)g(information)g(describing)g(how)h(the)e +(child)h(terminated.)365 2389 y(The)28 b(bit-level)f(format)g(of)h(the) +g(exit)f(status)h(is)g(not)h(de\002ned)e(by)j(P)t Fv(O)t(S)t(I)t(X)r +FD(;)i(you)c(must)h(use)365 2489 y(the)h(following)h(thr)o(ee)e +(functions)i(to)f(decode)f(one.)53 b(However)-6 b(,)31 +b(if)e(a)h(child)g(terminates)365 2588 y(normally)21 +b(with)f(exit)f(code)g(0,)i(P)t Fv(O)t(S)t(I)t(X)i FD(does)d(r)o(equir) +o(e)e FA(wait)g FD(to)i(r)o(eturn)e(an)i(exit)f(status)h(that)365 +2688 y(is)i(exactly)e(zer)o(o.)26 b(So)21 b FA(\(zero?)41 +b FC(status)p FA(\))21 b FD(is)g(a)g(corr)o(ect)f(way)h(to)h(test)f +(for)g(non-err)o(or)-6 b(,)20 b(normal)365 2788 y(termination,)i +FC(e.g.)o FD(,)573 3027 y FA(\(if)42 b(\(zero?)f(\(run)h(\(rcp)g +(scsh.tar.gz)d(lambda.csd.hku.hk)o(:\))o(\)\))747 3126 +y(\(delete-file)g("scsh.tar.gz"\)\))365 3435 y(\(status:exit-val)e +FC(status)p FA(\))87 b Fw(\000)-14 b(!)87 b FC(integer)21 +b(or)g FA(#f)760 b FD(pr)o(ocedur)o(e)365 3534 y FA(\(status:stop-sig) +37 b FC(status)p FA(\))87 b Fw(\000)-14 b(!)87 b FC(integer)21 +b(or)g FA(#f)760 b FD(pr)o(ocedur)o(e)365 3634 y FA(\(status:term-sig) +37 b FC(status)p FA(\))87 b Fw(\000)-14 b(!)87 b FC(integer)21 +b(or)g FA(#f)760 b FD(pr)o(ocedur)o(e)573 3794 y(For)27 b(a)g(given)g(status)g(value)f(pr)o(oduced)g(by)h(calling)g -FA(wait)p FD(,)g(exactly)f(one)i(of)e(these)573 950 y(r)o(outines)21 -b(will)g(r)o(eturn)f(a)h(tr)o(ue)f(value.)573 1081 y(If)31 -b(the)h(child)g(pr)o(ocess)g(exited)f(normally)-9 b(,)35 -b FA(status:exit-val)25 b FD(r)o(eturns)32 b(the)g(exit)573 -1180 y(code)26 b(for)g(the)g(child)g(pr)o(ocess)g(\()p +FA(wait)p FD(,)g(exactly)f(one)i(of)e(these)573 3894 +y(r)o(outines)21 b(will)g(r)o(eturn)f(a)h(tr)o(ue)f(value.)573 +4046 y(If)31 b(the)h(child)g(pr)o(ocess)g(exited)f(normally)-9 +b(,)35 b FA(status:exit-val)25 b FD(r)o(eturns)32 b(the)g(exit)573 +4146 y(code)26 b(for)g(the)g(child)g(pr)o(ocess)g(\()p FC(i.e.)o FD(,)i(the)e(value)f(the)i(child)f(passed)g(to)g -FA(exit)f FD(or)h(r)o(e-)573 1280 y(turned)20 b(fr)o(om)h +FA(exit)f FD(or)h(r)o(e-)573 4245 y(turned)20 b(fr)o(om)h FA(main)p FD(\).)i(Otherwise,)e(this)h(function)f(r)o(eturns)g(false.) -573 1410 y(If)d(the)i(child)f(pr)o(ocess)f(was)h(suspended)g(by)g(a)g -(signal,)g FA(status:stop-sig)13 b FD(r)o(eturns)573 -1510 y(the)35 b(signal)g(that)g(suspended)f(the)h(child.)68 -b(Otherwise,)38 b(this)e(function)f(r)o(eturns)573 1610 -y(false.)573 1740 y(If)19 b(the)g(child)h(pr)o(ocess)f(terminated)g +573 4398 y(If)e(the)h(child)g(pr)o(ocess)g(was)f(suspended)h(by)g(a)f +(signal,)h FA(status:stop-sig)14 b FD(r)o(eturn-)573 +4497 y(s)29 b(the)g(signal)h(that)f(suspended)f(the)i(child.)50 +b(Otherwise,)32 b(this)d(function)h(r)o(eturns)573 4597 +y(false.)573 4749 y(If)19 b(the)g(child)h(pr)o(ocess)f(terminated)g (abnormally)-9 b(,)19 b FA(status:term-sig)13 b FD(r)o(eturns)19 -b(the)573 1840 y(signal)i(that)g(terminated)f(the)h(child.)26 -b(Otherwise,)21 b(this)g(function)h(r)o(eturns)e(false.)365 -2129 y Fy(3.5)99 b(Process)26 b(state)365 2364 y FA(\(umask\))85 -b Fw(\000)-15 b(!)88 b FC(\002xnum)1633 b FD(pr)o(ocedur)o(e)365 -2463 y FA(\(set-umask)40 b FC(perms)p FA(\))86 b Fw(\000)-14 -b(!)87 b FC(unde\002ned)1126 b FD(pr)o(ocedur)o(e)365 -2563 y FA(\(with-umask*)39 b FC(perms)21 b(thunk)p FA(\))86 -b Fw(\000)-14 b(!)87 b FC(value\(s\))20 b(of)h(thunk)581 -b FD(pr)o(ocedur)o(e)365 2662 y FA(\(with-umask)39 b -FC(perms)21 b(.)g(body)p FA(\))86 b Fw(\000)-15 b(!)88 -b FC(value\(s\))20 b(of)h(body)796 b FD(syntax)573 2785 -y(The)49 b(pr)o(ocess')g(curr)o(ent)f(umask)h(is)h(r)o(etrieved)d(with) -j FA(umask)p FD(,)k(and)49 b(set)g(with)573 2884 y FA(\(set-umask)39 -b FC(perms)p FA(\))p FD(.)52 b(Calling)30 b FA(with-umask*)25 -b FD(changes)30 b(the)g(umask)g(to)g FC(perms)573 2984 -y FD(for)25 b(the)g(duration)h(of)f(the)g(call)g(to)h -FC(thunk)o FD(.)39 b(If)25 b(the)h(pr)o(ogram)e(thr)o(ows)i(out)g(of)f -FC(thunk)573 3083 y FD(by)k(invoking)i(a)e(continuation,)k(the)d(umask) -g(is)g(r)o(eset)e(to)i(its)g(external)f(value.)51 b(If)573 -3183 y(the)22 b(pr)o(ogram)f(thr)o(ows)h(back)g(into)g -FC(thunk)f FD(by)h(calling)g(a)g(stor)o(ed)f(continuation,)i(the)573 -3283 y(umask)32 b(is)f(r)o(estor)o(ed)f(to)i(the)g FC(perms)f -FD(value.)57 b(The)31 b(special)g(form)h FA(with-umask)27 -b FD(is)573 3382 y(equivalent)f(in)g(ef)o(fect)e(to)i(the)g(pr)o -(ocedur)o(e)e FA(with-umask*)p FD(,)e(but)k(does)f(not)i(r)o(equir)o(e) -573 3482 y(the)21 b(pr)o(ogrammer)g(to)g(explicitly)h(wrap)f(a)g -FA(\()p Fo(\025)38 b FA(\(\))43 b(...\))20 b FD(ar)o(ound)g(the)i(body) -f(of)g(the)573 3582 y(code)f(to)h(be)g(executed.)365 -3766 y FA(\(chdir)41 b FC([fname])p FA(\))86 b Fw(\000)-14 -b(!)87 b FC(unde\002ned)1245 b FD(pr)o(ocedur)o(e)365 -3865 y FA(\(cwd\))85 b Fw(\000)-14 b(!)87 b FC(string)1761 -b FD(pr)o(ocedur)o(e)365 3965 y FA(\(with-cwd*)40 b FC(fname)20 -b(thunk)p FA(\))87 b Fw(\000)-14 b(!)87 b FC(value\(s\))20 -b(of)h(thunk)668 b FD(pr)o(ocedur)o(e)365 4064 y FA(\(with-cwd)40 -b FC(fname)21 b(.)f(body)p FA(\))86 b Fw(\000)-14 b(!)87 -b FC(value\(s\))21 b(of)f(body)884 b FD(syntax)573 4201 -y(These)25 b(forms)g(manipulate)f(the)h(curr)o(ent)f(working)i(dir)o -(ectory)-9 b(.)37 b(The)25 b(cwd)f(can)h(be)573 4301 -y(changed)c(with)h FA(chdir)d FD(\(although)j(in)g(most)g(cases,)f -FA(with-cwd)d FD(is)k(pr)o(eferrable\).)i(If)573 4400 -y FA(chdir)17 b FD(is)j(called)e(with)i(no)g(ar)o(guments,)f(it)g -(changes)h(the)f(cwd)g(to)h(the)f(user)6 b('s)20 b(home)573 -4500 y(dir)o(ectory)-9 b(.)31 b(The)23 b FA(with-cwd*)c -FD(pr)o(ocedur)o(e)i(calls)i FA(thunk)d FD(with)k(the)f(cwd)g(temporar) -o(-)573 4599 y(ily)30 b(set)f(to)h FC(fname)p FD(;)j(when)d -FC(thunk)e FD(r)o(eturns,)j(or)e(is)h(exited)f(in)g(a)g(non-local)h -(fashion)573 4699 y(\()p FC(e.g.)o FD(,)d(by)f(raising)h(an)f -(exception)g(or)h(by)f(invoking)i(a)d(continuation\),)k(the)d(cwd)g(is) -573 4799 y(r)o(eturned)d(to)i(its)g(original)g(value.)35 -b(The)25 b(special)f(form)g FA(with-cwd)d FD(is)k(simply)g(syn-)573 -4898 y(tactic)20 b(sugar)h(for)f FA(with-cwd*)p FD(.)1756 +b(the)573 4849 y(signal)i(that)g(terminated)f(the)h(child.)26 +b(Otherwise,)21 b(this)g(function)h(r)o(eturns)e(false.)1756 5147 y(59)p eop -%%Page: 60 66 -60 65 bop 681 614 a FA(\(pid\))85 b Fw(\000)-14 b(!)87 -b FC(\002xnum)1720 b FD(pr)o(ocedur)o(e)681 714 y FA(\(parent-pid\))82 +%%Page: 60 68 +60 67 bop 681 614 a Fy(3.5)99 b(Process)25 b(state)681 +856 y FA(\(umask\))84 b Fw(\000)-14 b(!)87 b FC(\002xnum)1633 +b FD(pr)o(ocedur)o(e)681 956 y FA(\(set-umask)39 b FC(perms)p +FA(\))87 b Fw(\000)-14 b(!)87 b FC(unde\002ned)1125 b +FD(pr)o(ocedur)o(e)681 1056 y FA(\(with-umask*)38 b FC(perms)21 +b(thunk)p FA(\))87 b Fw(\000)-15 b(!)88 b FC(value\(s\))20 +b(of)h(thunk)580 b FD(pr)o(ocedur)o(e)681 1155 y FA(\(with-umask)39 +b FC(perms)21 b(.)f(body)p FA(\))86 b Fw(\000)-14 b(!)87 +b FC(value\(s\))20 b(of)h(body)797 b FD(syntax)888 1281 +y(The)49 b(pr)o(ocess')g(curr)o(ent)f(umask)i(is)f(r)o(etrieved)f(with) +i FA(umask)p FD(,)j(and)c(set)g(with)888 1381 y FA(\(set-umask)40 +b FC(perms)p FA(\))p FD(.)52 b(Calling)29 b FA(with-umask*)d +FD(changes)j(the)h(umask)g(to)g FC(perms)888 1480 y FD(for)25 +b(the)h(duration)f(of)g(the)h(call)f(to)h FC(thunk)o +FD(.)39 b(If)25 b(the)g(pr)o(ogram)g(thr)o(ows)h(out)f(of)h +FC(thunk)888 1580 y FD(by)k(invoking)h(a)e(continuation,)k(the)d(umask) +f(is)h(r)o(eset)f(to)h(its)g(external)e(value.)51 b(If)888 +1679 y(the)22 b(pr)o(ogram)f(thr)o(ows)i(back)e(into)i +FC(thunk)e FD(by)h(calling)g(a)f(stor)o(ed)h(continuation,)h(the)888 +1779 y(umask)i(is)g(r)o(estor)o(ed)e(to)h(the)h FC(perms)f +FD(value.)36 b(The)24 b(special)g(form)h FA(with-umask)20 +b FD(is)25 b(e-)888 1879 y(quivalent)30 b(in)g(ef)o(fect)e(to)i(the)g +(pr)o(ocedur)o(e)e FA(with-umask*)p FD(,)f(but)i(does)h(not)g(r)o +(equir)o(e)888 1978 y(the)22 b(pr)o(ogrammer)e(to)i(explicitly)f(wrap)g +(a)g FA(\()p Fo(\025)39 b FA(\(\))k(...\))19 b FD(ar)o(ound)i(the)g +(body)h(of)f(the)888 2078 y(code)g(to)g(be)f(executed.)681 +2275 y FA(\(chdir)41 b FC([fname])p FA(\))86 b Fw(\000)-14 +b(!)87 b FC(unde\002ned)1244 b FD(pr)o(ocedur)o(e)681 +2375 y FA(\(cwd\))85 b Fw(\000)-14 b(!)87 b FC(string)1760 +b FD(pr)o(ocedur)o(e)681 2474 y FA(\(with-cwd*)39 b FC(fname)21 +b(thunk)p FA(\))86 b Fw(\000)-14 b(!)87 b FC(value\(s\))21 +b(of)f(thunk)668 b FD(pr)o(ocedur)o(e)681 2574 y FA(\(with-cwd)40 +b FC(fname)20 b(.)h(body)p FA(\))86 b Fw(\000)-14 b(!)87 +b FC(value\(s\))20 b(of)h(body)884 b FD(syntax)888 2717 +y(These)25 b(forms)g(manipulate)g(the)g(curr)o(ent)f(working)i(dir)o +(ectory)-9 b(.)36 b(The)25 b(cwd)g(can)f(be)888 2817 +y(changed)d(with)h FA(chdir)e FD(\(although)i(in)f(most)i(cases,)d +FA(with-cwd)f FD(is)i(pr)o(eferrable\).)j(If)888 2916 +y FA(chdir)18 b FD(is)h(called)g(with)h(no)f(ar)o(guments,)g(it)h +(changes)f(the)h(cwd)f(to)g(the)h(user)6 b('s)19 b(home)888 +3016 y(dir)o(ectory)-9 b(.)31 b(The)23 b FA(with-cwd*)c +FD(pr)o(ocedur)o(e)i(calls)i FA(thunk)e FD(with)j(the)f(cwd)f(temporar) +o(-)888 3116 y(ily)30 b(set)f(to)h FC(fname)p FD(;)j(when)d +FC(thunk)f FD(r)o(eturns,)i(or)e(is)h(exited)e(in)i(a)f(non-local)h +(fashion)888 3215 y(\()p FC(e.g.)o FD(,)e(by)e(raising)g(an)g +(exception)h(or)f(by)g(invoking)i(a)e(continuation\),)i(the)f(cwd)f(is) +888 3315 y(r)o(eturned)e(to)g(its)h(original)g(value.)36 +b(The)24 b(special)g(form)h FA(with-cwd)c FD(is)j(simply)i(syn-)888 +3415 y(tactic)21 b(sugar)f(for)h FA(with-cwd*)p FD(.)681 +3612 y FA(\(pid\))85 b Fw(\000)-14 b(!)87 b FC(\002xnum)1720 +b FD(pr)o(ocedur)o(e)681 3711 y FA(\(parent-pid\))82 b Fw(\000)-14 b(!)87 b FC(\002xnum)1415 b FD(pr)o(ocedur)o(e)681 -814 y FA(\(process-group\))81 b Fw(\000)-15 b(!)88 b -FC(\002xnum)1284 b FD(pr)o(ocedur)o(e)681 913 y FA(\(set-process-gro)o +3811 y FA(\(process-group\))81 b Fw(\000)-15 b(!)88 b +FC(\002xnum)1284 b FD(pr)o(ocedur)o(e)681 3911 y FA(\(set-process-gro)o (up)37 b FC([pr)o(oc/pid])18 b(pgrp)p FA(\))85 b Fw(\000)-14 b(!)87 b FC(unde\002ned)473 b FD(pr)o(ocedur)o(e)888 -1063 y FA(\(pid\))25 b FD(and)i FA(\(parent-pid\))22 +4054 y FA(\(pid\))25 b FD(and)i FA(\(parent-pid\))22 b FD(r)o(etrieve)j(the)i(pr)o(ocess)g(id)g(for)f(the)h(curr)o(ent)f(pr) -o(ocess)888 1162 y(and)18 b(its)g(par)o(ent.)24 b FA(\(process-group\)) +o(ocess)888 4154 y(and)18 b(its)g(par)o(ent.)24 b FA(\(process-group\)) 12 b FD(r)o(eturns)17 b(the)h(pr)o(ocess)g(gr)o(oup)g(of)g(the)g(curr)o -(ent)888 1262 y(pr)o(ocess.)44 b(A)26 b(pr)o(ocess')h(pr)o(ocess-gr)o +(ent)888 4253 y(pr)o(ocess.)44 b(A)26 b(pr)o(ocess')h(pr)o(ocess-gr)o (oup)f(can)g(be)h(set)g(with)g FA(set-process-group)o -FD(;)888 1361 y(the)19 b(value)f FC(pr)o(oc/pid)e FD(speci\002es)i(the) +FD(;)888 4353 y(the)19 b(value)f FC(pr)o(oc/pid)e FD(speci\002es)i(the) h(af)o(fected)c(pr)o(ocess.)25 b(It)18 b(may)g(be)g(either)h(a)e(pr)o -(ocess)888 1461 y(object)k(or)g(an)g(integer)g(pr)o(ocess)f(id,)g(and)h -(defaults)f(to)h(the)g(curr)o(ent)f(pr)o(ocess.)681 1676 +(ocess)888 4452 y(object)k(or)g(an)g(integer)g(pr)o(ocess)f(id,)g(and)h +(defaults)f(to)h(the)g(curr)o(ent)f(pr)o(ocess.)681 4650 y FA(\(set-priority)38 b FC(which)20 b(who)g(priority)p FA(\))86 b Fw(\000)-15 b(!)88 b FC(unde\002ned)559 b -FD(pr)o(ocedur)o(e)681 1776 y FA(\(priority)40 b FC(which)19 +FD(pr)o(ocedur)o(e)681 4749 y FA(\(priority)40 b FC(which)19 b(who)p FA(\))86 b Fw(\000)-14 b(!)87 b FC(\002xnum)1100 -b FD(pr)o(ocedur)o(e)681 1876 y FA(\(nice)41 b FC([pr)o(oc/pid)18 +b FD(pr)o(ocedur)o(e)681 4849 y FA(\(nice)41 b FC([pr)o(oc/pid)18 b(delta])p FA(\))86 b Fw(\000)-14 b(!)87 b FC(unde\002ned)1035 -b FD(pr)o(ocedur)o(e)888 2025 y(These)21 b(pr)o(ocedur)o(es)e(set)i -(and)g(access)f(the)h(priority)g(of)g(pr)o(ocesses.)k(I)c(can't)g(r)o -(emem-)888 2125 y(ber)28 b(how)h FA(set-priority)23 b -FD(and)k FA(priority)e FD(work,)30 b(so)e(no)h(documentation,)h(and)888 -2224 y(besides,)21 b(they)g(ar)o(en't)e(implemented)i(yet,)g(anyway)-9 -b(.)681 2382 y FA(\(user-login-name)o(\))81 b Fw(\000)-14 -b(!)87 b FC(string)1237 b FD(pr)o(ocedur)o(e)681 2481 -y FA(\(user-uid\))83 b Fw(\000)-14 b(!)87 b FC(\002xnum)1502 -b FD(pr)o(ocedur)o(e)681 2581 y FA(\(user-effective-)o(ui)o(d\))81 -b Fw(\000)-15 b(!)88 b FC(\002xnum)1066 b FD(pr)o(ocedur)o(e)681 -2680 y FA(\(user-gid\))83 b Fw(\000)-14 b(!)87 b FC(\002xnum)1502 -b FD(pr)o(ocedur)o(e)681 2780 y FA(\(user-effective-)o(gi)o(d\))81 -b Fw(\000)-15 b(!)88 b FC(\002xnum)1066 b FD(pr)o(ocedur)o(e)681 -2880 y FA(\(user-supplement)o(ar)o(y-g)o(id)o(s\))81 -b Fw(\000)-15 b(!)88 b FC(\002xnum)20 b(list)722 b FD(pr)o(ocedur)o(e) -681 2979 y FA(\(set-uid)40 b FC(uid)p FA(\))87 b Fw(\000)-15 -b(!)87 b FC(unde\002ned)1305 b FD(pr)o(ocedur)o(e)681 -3079 y FA(\(set-gid)40 b FC(gid)p FA(\))86 b Fw(\000)-14 -b(!)87 b FC(unde\002ned)1309 b FD(pr)o(ocedur)o(e)888 -3228 y(These)22 b(r)o(outines)h(get)f(and)f(set)h(the)h(ef)o(fective)d -(and)h(r)o(eal)g(user)h(and)g(gr)o(oup)g(ids.)29 b(The)888 -3328 y FA(set-uid)g FD(and)j FA(set-gid)d FD(r)o(outines)j(corr)o -(espond)g(to)g(the)i(P)t Fv(O)t(S)t(I)t(X)i FA(setuid\(\))28 -b FD(and)888 3428 y FA(setgid\(\))18 b FD(pr)o(ocedur)o(es.)681 -3643 y FA(\(process-times\))81 b Fw(\000)-15 b(!)88 b -FC([\002xnum)19 b(\002xnum)h(\002xnum)g(\002xnum])440 -b FD(pr)o(ocedur)o(e)888 3792 y(Returns)22 b(four)e(values:)1071 -3892 y(user)h(CPU)f(time)h(in)g(clock-ticks)1071 3991 -y(system)g(CPU)g(time)g(in)g(clock-ticks)1071 4091 y(user)g(CPU)f(time) -h(of)g(all)f(descendant)g(pr)o(ocesses)1071 4191 y(system)h(CPU)g(time) -g(of)g(all)f(descendant)g(pr)o(ocesses)888 4290 y(Note)f(that)f(CPU)g -(time)h(clock)g(r)o(esolution)g(is)f(not)h(the)g(same)f(as)g(the)h(r)o -(eal-time)e(clock)888 4390 y(r)o(esolution)22 b(pr)o(ovided)d(by)i -FA(time+ticks)p FD(.)h(That's)e(Unix.)681 4605 y FA(\(cpu-ticks/sec\)) -81 b Fw(\000)-15 b(!)88 b FC(integer)1292 b FD(pr)o(ocedur)o(e)888 -4755 y(Returns)27 b(the)g(r)o(esolution)g(of)g(the)f(CPU)g(timer)h(in)g -(clock)g(ticks)g(per)f(second.)42 b(This)888 4854 y(can)21 -b(be)f(used)h(to)g(convert)g(the)g(times)g(r)o(eported)e(by)i -FA(process-times)15 b FD(to)22 b(seconds.)2071 5147 y(60)p -eop -%%Page: 61 67 -61 66 bop 365 614 a Fy(3.6)99 b(User)25 b(and)f(group)h(database)g -(access)365 829 y FD(These)32 b(pr)o(ocedur)o(es)d(ar)o(e)h(used)i(to)g -(access)e(the)i(user)f(and)g(gr)o(oup)h(databases)e(\()p -FC(e.g.)n FD(,)k(the)365 928 y(ones)22 b(traditionally)f(stor)o(ed)f -(in)h FA(/etc/passwd)16 b FD(and)k FA(/etc/group)p FD(.\))365 -1078 y FA(\(user-info)40 b FC(uid/name)p FA(\))86 b Fw(\000)-15 -b(!)88 b FC(r)o(ecord)1135 b FD(pr)o(ocedur)o(e)573 1219 +b FD(pr)o(ocedur)o(e)2071 5147 y(60)p eop +%%Page: 61 69 +61 68 bop 573 614 a FD(These)21 b(pr)o(ocedur)o(es)e(set)i(and)f +(access)g(the)h(priority)h(of)f(pr)o(ocesses.)k(I)c(can't)f(r)o(emem-) +573 714 y(ber)27 b(how)i FA(set-priority)23 b FD(and)28 +b FA(priority)c FD(work,)30 b(so)f(no)g(documentation,)h(and)573 +814 y(besides,)20 b(they)h(ar)o(en't)f(implemented)h(yet,)f(anyway)-9 +b(.)365 965 y FA(\(user-login-name\))80 b Fw(\000)-14 +b(!)87 b FC(string)1238 b FD(pr)o(ocedur)o(e)365 1064 +y FA(\(user-uid\))83 b Fw(\000)-14 b(!)87 b FC(\002xnum)1503 +b FD(pr)o(ocedur)o(e)365 1164 y FA(\(user-effective-u)o(id)o(\))81 +b Fw(\000)-14 b(!)87 b FC(\002xnum)1067 b FD(pr)o(ocedur)o(e)365 +1263 y FA(\(user-gid\))83 b Fw(\000)-14 b(!)87 b FC(\002xnum)1503 +b FD(pr)o(ocedur)o(e)365 1363 y FA(\(user-effective-g)o(id)o(\))81 +b Fw(\000)-14 b(!)87 b FC(\002xnum)1067 b FD(pr)o(ocedur)o(e)365 +1463 y FA(\(user-supplementa)o(ry)o(-gi)o(ds)o(\))81 +b Fw(\000)-14 b(!)87 b FC(\002xnum)20 b(list)723 b FD(pr)o(ocedur)o(e) +365 1562 y FA(\(set-uid)41 b FC(uid)p FA(\))86 b Fw(\000)-14 +b(!)87 b FC(unde\002ned)1305 b FD(pr)o(ocedur)o(e)365 +1662 y FA(\(set-gid)41 b FC(gid)p FA(\))85 b Fw(\000)-14 +b(!)87 b FC(unde\002ned)1310 b FD(pr)o(ocedur)o(e)573 +1808 y(These)22 b(r)o(outines)g(get)g(and)g(set)g(the)g(ef)o(fective)e +(and)i(r)o(eal)f(user)h(and)f(gr)o(oup)h(ids.)30 b(The)573 +1908 y FA(set-uid)f FD(and)i FA(set-gid)f FD(r)o(outines)i(corr)o +(espond)f(to)i(the)h(P)t Fv(O)t(S)t(I)t(X)h FA(setuid\(\))29 +b FD(and)573 2007 y FA(setgid\(\))17 b FD(pr)o(ocedur)o(es.)365 +2213 y FA(\(process-times\))81 b Fw(\000)-14 b(!)87 b +FC([\002xnum)20 b(\002xnum)g(\002xnum)g(\002xnum])440 +b FD(pr)o(ocedur)o(e)573 2359 y(Returns)21 b(four)g(values:)756 +2459 y(user)f(CPU)g(time)h(in)h(clock-ticks)756 2558 +y(system)f(CPU)f(time)h(in)h(clock-ticks)756 2658 y(user)e(CPU)g(time)h +(of)g(all)g(descendant)f(pr)o(ocesses)756 2758 y(system)h(CPU)f(time)h +(of)g(all)g(descendant)f(pr)o(ocesses)573 2857 y(Note)e(that)h(CPU)f +(time)g(clock)h(r)o(esolution)g(is)g(not)g(the)f(same)h(as)f(the)g(r)o +(eal-time)f(clock)573 2957 y(r)o(esolution)k(pr)o(ovided)f(by)h +FA(time+ticks)p FD(.)g(That's)g(Unix.)365 3162 y FA(\(cpu-ticks/sec\)) +81 b Fw(\000)-14 b(!)87 b FC(integer)1293 b FD(pr)o(ocedur)o(e)573 +3309 y(Returns)27 b(the)g(r)o(esolution)g(of)f(the)h(CPU)f(timer)g(in)h +(clock)g(ticks)g(per)f(second.)43 b(This)573 3408 y(can)20 +b(be)h(used)f(to)h(convert)g(the)g(times)g(r)o(eported)f(by)h +FA(process-times)15 b FD(to)21 b(seconds.)365 3724 y +Fy(3.6)99 b(User)25 b(and)f(group)h(database)g(access)365 +3947 y FD(These)32 b(pr)o(ocedur)o(es)d(ar)o(e)h(used)i(to)g(access)e +(the)i(user)f(and)g(gr)o(oup)h(databases)e(\()p FC(e.g.)n +FD(,)k(the)365 4047 y(ones)22 b(traditionally)f(stor)o(ed)f(in)h +FA(/etc/passwd)16 b FD(and)k FA(/etc/group)p FD(.\))365 +4201 y FA(\(user-info)40 b FC(uid/name)p FA(\))86 b Fw(\000)-15 +b(!)88 b FC(r)o(ecord)1135 b FD(pr)o(ocedur)o(e)573 4347 y(Return)24 b(a)e FA(user-info)e FD(r)o(ecor)o(d)h(giving)j(the)g(r)o -(ecor)o(ded)d(information)j(for)f(a)g(partic-)573 1319 -y(ular)d(user:)756 1485 y FA(\(define-record)37 b(user-info)843 -1585 y(name)42 b(uid)g(gid)g(home-dir)f(shell\))573 1751 +(ecor)o(ded)d(information)j(for)f(a)g(partic-)573 4447 +y(ular)d(user:)756 4623 y FA(\(define-record)37 b(user-info)843 +4722 y(name)42 b(uid)g(gid)g(home-dir)f(shell\))573 4898 y FD(The)21 b FC(uid/name)f FD(ar)o(gument)g(is)h(either)g(an)f -(integer)h(uid)g(or)g(a)f(string)h(user)o(-name.)365 -1942 y FA(\(->uid)41 b FC(uid/name)p FA(\))86 b Fw(\000)-14 -b(!)87 b FC(\002xnum)1275 b FD(pr)o(ocedur)o(e)365 2042 -y FA(\(->username)39 b FC(uid/name)p FA(\))86 b Fw(\000)-14 -b(!)87 b FC(string)1097 b FD(pr)o(ocedur)o(e)573 2183 -y(These)19 b(two)g(pr)o(ocedur)o(es)f(coer)o(ce)f(integer)i(uid's)h -(and)e(user)h(names)g(to)g(a)g(particular)573 2283 y(form.)365 -2474 y FA(\(group-info)39 b FC(gid/name)p FA(\))86 b -Fw(\000)-15 b(!)88 b FC(r)o(ecord)1096 b FD(pr)o(ocedur)o(e)573 -2615 y(Return)19 b(a)g FA(group-info)14 b FD(r)o(ecor)o(d)j(giving)j -(the)f(r)o(ecor)o(ded)e(information)j(for)e(a)h(partic-)573 -2715 y(ular)h(gr)o(oup:)756 2881 y FA(\(define-record)37 -b(group-info)843 2981 y(name)42 b(gid)g(members\))573 -3147 y FD(The)21 b FC(gid/name)e FD(ar)o(gument)h(is)h(either)g(an)f -(integer)h(gid)g(or)g(a)f(string)i(gr)o(oup-name.)365 -3442 y Fy(3.7)99 b(Accessing)26 b(command-line)e(arguments)365 -3681 y FA(command-line-argu)o(me)o(nts)1564 b FC(string)21 -b FD(list)365 3781 y FA(\(command-line\))82 b Fw(\000)-15 -b(!)88 b FC(string)20 b(list)1242 b FD(pr)o(ocedur)o(e)573 -3905 y(The)44 b(list)h(of)g(strings)g FA(command-line-argu)o(men)o(ts) -38 b FD(contains)45 b(the)g(ar)o(guments)573 4005 y(passed)16 -b(to)h(the)g(scsh)g(pr)o(ocess)f(on)i(the)f(command)g(line.)24 -b(Calling)17 b FA(\(command-line\))573 4104 y FD(r)o(eturns)h(the)h -(complete)g FA(argv)e FD(string)j(list,)f(including)h(the)f(pr)o -(ogram.)24 b(So)19 b(if)f(we)h(r)o(un)573 4204 y(a)h(scsh)h(pr)o(ogram) -756 4343 y FA(/usr/shivers/bi)o(n/)o(myl)o(s)37 b(-CF)43 -b(src)573 4482 y FD(then)21 b FA(command-line-arg)o(ume)o(nt)o(s)15 -b FD(is)756 4621 y FA(\("-CF")41 b("src"\))573 4759 y -FD(and)20 b FA(\(command-line\))15 b FD(r)o(eturns)756 -4898 y FA(\("/usr/shivers/)o(bi)o(n/m)o(yl)o(s")37 b("-CF")42 -b("src"\))1756 5147 y FD(61)p eop -%%Page: 62 68 -62 67 bop 888 614 a FA(command-line)32 b FD(r)o(eturns)k(a)g(fr)o(esh)g -(list)h(each)f(time)h(it)g(is)g(called.)72 b(In)37 b(this)h(way)-9 -b(,)888 714 y(the)37 b(pr)o(ogrammer)f(can)g(get)h(a)f(fr)o(esh)g(copy) -g(of)h(the)g(original)g(ar)o(gument)f(list)h(if)888 814 -y FA(command-line-argu)o(me)o(nts)14 b FD(has)21 b(been)f(modi\002ed)h -(or)g(is)g(lexically)g(shadowed.)681 1003 y FA(\(arg)42 -b FC(ar)o(glist)20 b(n)h([default])p FA(\))85 b Fw(\000)-14 -b(!)87 b FC(string)1128 b FD(pr)o(ocedur)o(e)681 1102 -y FA(\(arg*)41 b FC(ar)o(glist)20 b(n)h([default-thunk])p +(integer)h(uid)g(or)g(a)f(string)h(user)o(-name.)1756 +5147 y(61)p eop +%%Page: 62 70 +62 69 bop 681 614 a FA(\(->uid)41 b FC(uid/name)p FA(\))86 +b Fw(\000)-14 b(!)87 b FC(\002xnum)1274 b FD(pr)o(ocedur)o(e)681 +714 y FA(\(->username)39 b FC(uid/name)p FA(\))86 b Fw(\000)-14 +b(!)87 b FC(string)1096 b FD(pr)o(ocedur)o(e)888 856 +y(These)19 b(two)h(pr)o(ocedur)o(es)d(coer)o(ce)h(integer)h(uid's)g +(and)g(user)f(names)h(to)h(a)e(particular)888 956 y(form.)681 +1149 y FA(\(group-info)39 b FC(gid/name)p FA(\))85 b +Fw(\000)-14 b(!)87 b FC(r)o(ecord)1096 b FD(pr)o(ocedur)o(e)888 +1291 y(Return)20 b(a)e FA(group-info)d FD(r)o(ecor)o(d)i(giving)j(the)f +(r)o(ecor)o(ded)d(information)k(for)f(a)f(partic-)888 +1391 y(ular)j(gr)o(oup:)1071 1559 y FA(\(define-record)38 +b(group-info)1158 1658 y(name)k(gid)g(members\))888 1826 +y FD(The)21 b FC(gid/name)e FD(ar)o(gument)i(is)g(either)f(an)h +(integer)g(gid)g(or)f(a)h(string)g(gr)o(oup-name.)681 +2124 y Fy(3.7)99 b(Accessing)26 b(command-line)e(arguments)681 +2364 y FA(command-line-arg)o(um)o(ent)o(s)1565 b FC(string)20 +b FD(list)681 2464 y FA(\(command-line\))81 b Fw(\000)-14 +b(!)87 b FC(string)21 b(list)1241 b FD(pr)o(ocedur)o(e)888 +2589 y(The)45 b(list)g(of)f(strings)i FA(command-line-arg)o(um)o(ent)o +(s)38 b FD(contains)46 b(the)e(ar)o(guments)888 2689 +y(passed)16 b(to)h(the)g(scsh)h(pr)o(ocess)e(on)h(the)g(command)g +(line.)25 b(Calling)17 b FA(\(command-line\))888 2788 +y FD(r)o(eturns)i(the)g(complete)g FA(argv)e FD(string)i(list,)h +(including)f(the)g(pr)o(ogram.)24 b(So)19 b(if)g(we)g(r)o(un)888 +2888 y(a)i(scsh)g(pr)o(ogram)1071 3028 y FA(/usr/shivers/bin)o(/my)o +(ls)37 b(-CF)42 b(src)888 3169 y FD(then)22 b FA(command-line-ar)o(gum) +o(en)o(ts)14 b FD(is)1071 3310 y FA(\("-CF")41 b("src"\))888 +3450 y FD(and)21 b FA(\(command-line\))15 b FD(r)o(eturns)1071 +3591 y FA(\("/usr/shivers/b)o(in/)o(my)o(ls)o(")38 b("-CF")j("src"\)) +888 3732 y(command-line)32 b FD(r)o(eturns)k(a)g(fr)o(esh)g(list)h +(each)f(time)h(it)g(is)g(called.)72 b(In)37 b(this)h(way)-9 +b(,)888 3831 y(the)37 b(pr)o(ogrammer)f(can)g(get)h(a)f(fr)o(esh)g +(copy)g(of)h(the)g(original)g(ar)o(gument)f(list)h(if)888 +3931 y FA(command-line-argu)o(me)o(nts)14 b FD(has)21 +b(been)f(modi\002ed)h(or)g(is)g(lexically)g(shadowed.)681 +4124 y FA(\(arg)42 b FC(ar)o(glist)20 b(n)h([default])p +FA(\))85 b Fw(\000)-14 b(!)87 b FC(string)1128 b FD(pr)o(ocedur)o(e)681 +4224 y FA(\(arg*)41 b FC(ar)o(glist)20 b(n)h([default-thunk])p FA(\))85 b Fw(\000)-14 b(!)87 b FC(string)858 b FD(pr)o(ocedur)o(e)681 -1202 y FA(\(argv)41 b FC(n)21 b([default])p FA(\))86 +4324 y FA(\(argv)41 b FC(n)21 b([default])p FA(\))86 b Fw(\000)-14 b(!)87 b FC(string)1320 b FD(pr)o(ocedur)o(e)888 -1342 y(These)17 b(pr)o(ocedur)o(es)e(ar)o(e)g(useful)h(for)g(accessing) -h(ar)o(guments)f(fr)o(om)g(ar)o(gument)h(lists.)888 1442 -y FA(arg)28 b FD(r)o(eturns)g(the)h Fo(n)1535 1412 y -Fx(th)1630 1442 y FD(element)g(of)f FC(ar)o(glist)p FD(.)49 +4466 y(These)17 b(pr)o(ocedur)o(es)e(ar)o(e)g(useful)h(for)g(accessing) +h(ar)o(guments)f(fr)o(om)g(ar)o(gument)h(lists.)888 4565 +y FA(arg)28 b FD(r)o(eturns)g(the)h Fo(n)1535 4535 y +Fx(th)1630 4565 y FD(element)g(of)f FC(ar)o(glist)p FD(.)49 b(The)28 b(index)h(is)g(1-based.)47 b(If)29 b FC(n)f -FD(is)h(too)888 1541 y(lar)o(ge,)20 b FC(default)g FD(is)h(r)o +FD(is)h(too)888 4665 y(lar)o(ge,)20 b FC(default)g FD(is)h(r)o (eturned;)f(if)g(no)i FC(default)o FD(,)f(then)g(an)f(err)o(or)g(is)h -(signaled.)888 1674 y FA(arg*)j FD(is)h(similar)-6 b(,)27 +(signaled.)888 4799 y FA(arg*)j FD(is)h(similar)-6 b(,)27 b(except)d(that)h(the)h FC(default-thunk)e FD(is)h(called)g(to)g -(generate)g(the)g(de-)888 1773 y(fault)c(value.)888 1905 -y FA(\(argv)42 b FC(n)p FA(\))26 b FD(is)h(simply)g FA(\(arg)42 -b(\(command-line\))c(\(+)43 b FC(n)h FA(1\)\))p FD(.)d(The)26 -b(+1)h(of)o(fset)e(en-)888 2005 y(sur)o(es)c(that)f(the)h(two)h(forms) -1071 2170 y FA(\(arg)42 b(command-line-arg)o(um)o(ent)o(s)37 -b FC(n)q FA(\))1071 2270 y(\(argv)42 b FC(n)p FA(\))888 -2435 y FD(r)o(eturn)23 b(the)g(same)g(ar)o(gument)f(\(assuming)i(the)f -(user)g(has)g(not)h(r)o(ebound)f(or)g(modi-)888 2534 -y(\002ed)e FA(command-line-arg)o(um)o(ent)o(s)p FD(\))o(.)888 -2666 y(Example:)1071 2831 y FA(\(if)42 b(\(null?)f(command-line-argu)o -(men)o(ts)o(\))1245 2931 y(\(&)i(\(xterm)e(-n)i(,host)e(-title)h(,host) -1681 3031 y(-name)g(,\(string-append)37 b("xterm_")j(host\)\)\))1245 -3130 y(\(let*)i(\(\(progname)d(\(file-name-nondir)o(ec)o(tor)o(y)e -(\(argv)42 b(1\)\)\))1550 3230 y(\(title)g(\(string-append)37 -b(host)42 b(":")h(progname\)\)\))1333 3329 y(\(&)f(\(xterm)f(-n)217 -b(,title)1768 3429 y(-title)41 b(,title)1768 3529 y(-e)217 -b(,@command-line-ar)o(gum)o(en)o(ts\))o(\)\))o(\))888 -3694 y FD(A)23 b(subtlety:)31 b(when)24 b(the)f(scsh)h(interpr)o(eter)d -(is)j(used)f(to)g(execute)g(a)f(scsh)i(pr)o(ogram,)888 -3793 y(the)d(pr)o(ogram)g(name)f(r)o(eported)g(in)h(the)g(head)f(of)h -(the)g FA(\(command-line\))15 b FD(list)22 b(is)f(the)888 -3893 y(scsh)26 b(pr)o(ogram,)f FC(not)f FD(the)h(interpr)o(eter)-6 -b(.)37 b(For)25 b(example,)g(if)g(we)g(have)f(a)h(shell)g(script)888 -3992 y(in)d(\002le)e FA(fullecho)p FD(:)1071 4157 y FA -(#!/usr/local/bin)o(/sc)o(sh)37 b(-s)1071 4257 y(!#)1071 -4357 y(\(for-each)j(\()p Fo(\025)f FA(\(arg\))i(\(display)f(arg\))i -(\(display)f(")i("\)\))1507 4456 y(\(command-line\)\))888 -4621 y FD(and)21 b(we)f(r)o(un)i(the)f(pr)o(ogram)1071 -4760 y FA(fullecho)40 b(hello)i(world)888 4898 y FD(the)21 -b(pr)o(ogram)f(will)i(print)f(out)2071 5147 y(62)p eop -%%Page: 63 69 -63 68 bop 756 614 a FA(fullecho)40 b(hello)h(world)573 -767 y FD(not)756 919 y FA(/usr/local/bin/)o(sc)o(sh)c(-s)43 -b(fullecho)d(hello)i(world)573 1110 y FD(This)37 b(ar)o(gument)f(line)h -(pr)o(ocessing)f(ensur)o(es)g(that)h(if)f(a)g(scsh)h(pr)o(ogram)f(is)h -(sub-)573 1210 y(sequently)29 b(compiled)g(into)g(a)g(standalone)f -(executable)f(or)i(byte-compiled)f(to)h(a)573 1309 y(heap-image)c -(executable)g(by)h(the)h(Scheme)f(48)f(virtual)h(machine,)h(its)g -(semantics)573 1409 y(will)21 b(be)g(unchanged\227the)g(ar)o(glist)f -(pr)o(ocessing)h(is)g(invariant.)k(In)c(ef)o(fect,)e(the)756 -1561 y FA(/usr/local/bin/)o(sc)o(sh)37 b(-s)573 1713 -y FD(is)24 b(not)g(part)e(of)h(the)h(pr)o(ogram;)f(it's)h(a)f -(speci\002cation)h(for)f(the)g(machine)h(to)f(execute)573 -1813 y(the)e(pr)o(ogram)f(on,)h(so)g(it)g(is)g(not)g(pr)o(operly)f -(part)g(of)h(the)g(pr)o(ogram's)f(ar)o(gument)g(list.)365 -2132 y Fy(3.8)99 b(System)25 b(parameters)365 2380 y -FA(\(system-name\))82 b Fw(\000)-14 b(!)87 b FC(string)1412 -b FD(pr)o(ocedur)o(e)573 2507 y(Returns)24 b(the)g(name)f(of)h(the)g -(host)g(on)h(which)f(we)g(ar)o(e)e(executing.)34 b(This)24 -b(may)g(be)f(a)573 2607 y(local)d(name,)f(such)h(as)g(\223solar)-6 -b(,\224)18 b(as)i(opposed)g(to)g(a)f(fully-quali\002ed)h(domain)g(name) -573 2706 y(such)h(as)g(\223solar)-6 b(.csie.ntu.edu.tw)e(.\224)365 -3026 y Fy(3.9)99 b(Signal)26 b(system)365 3251 y FD(Signal)g(numbers)h -(ar)o(e)e(bound)i(to)f(the)h(variables)e FA(signal/hup)p -FD(,)e FA(signal/int)p FD(,)h(.)12 b(.)g(.)g(.)42 b(See)365 -3351 y(tables)21 b(3.9)e(and)i(3.3)e(for)i(the)f(full)h(list.)365 -3506 y FA(\(signal-process)38 b FC(pr)o(oc)19 b(sig)p -FA(\))87 b Fw(\000)-14 b(!)87 b FC(unde\002ned)850 b -FD(pr)o(ocedur)o(e)365 3606 y FA(\(signal-process-g)o(ro)o(up)37 -b FC(pr)o(grp)20 b(sig)p FA(\))86 b Fw(\000)-14 b(!)87 -b FC(unde\002ned)544 b FD(pr)o(ocedur)o(e)573 3753 y(These)23 -b(two)h(pr)o(ocedur)o(es)e(send)h(signals)h(to)g(a)f(speci\002c)g(pr)o -(ocess,)h(and)f(all)g(the)g(pr)o(o-)573 3852 y(cesses)g(in)i(a)e -(speci\002c)g(pr)o(ocess)h(gr)o(oup,)f(r)o(espectively)-9 -b(.)33 b(The)24 b FC(pr)o(oc)e FD(and)i FC(pr)o(grp)e -FD(ar)o(gu-)573 3952 y(ments)f(ar)o(e)f(either)g(pr)o(ocesses)h(or)f -(integer)h(pr)o(ocess)f(ids.)365 4160 y FA(\(itimer)41 -b FC(???)p FA(\))85 b Fw(\000)-14 b(!)87 b FC(unde\002ned)1335 -b FD(pr)o(ocedur)o(e)365 4260 y FA(\(pause-until-inte)o(rr)o(upt)o(\)) -81 b Fw(\000)-14 b(!)87 b FC(unde\002ned)849 b FD(pr)o(ocedur)o(e)365 -4415 y FA(\(sleep)41 b FC(secs)p FA(\))88 b Fw(\000)-14 -b(!)87 b FC(unde\002ned)1372 b FD(pr)o(ocedur)o(e)365 -4515 y FA(\(sleep-until)39 b FC(time)p FA(\))86 b Fw(\000)-14 -b(!)87 b FC(unde\002ned)1094 b FD(pr)o(ocedur)o(e)573 -4662 y(The)29 b FA(sleep)f FD(pr)o(ocedur)o(e)g(causes)h(the)h(pr)o -(ocess)f(to)h(sleep)f(for)h FC(secs)g FD(seconds.)53 -b(The)573 4761 y FA(sleep-until)26 b FD(pr)o(ocedur)o(e)j(causes)i(the) -g(pr)o(ocess)g(to)g(sleep)g(until)h FC(time)f FD(\(see)f(sec-)573 -4861 y(tion)21 b(3.10\).)1756 5147 y(63)p eop -%%Page: 64 70 -64 69 bop 910 535 2407 4 v 960 604 a FD(Interr)o(upt)854 -b(Unix)21 b(signal)246 b(OS)21 b(V)-8 b(ariant)p 910 -638 V 910 654 V 960 724 a FA(interrupt/alrm)1576 694 -y Ff(a)2149 724 y FA(signal/alrm)184 b FD(P)t Fv(O)t(S)t(I)t(X)960 -827 y FA(interrupt/int)1532 796 y Ff(b)2149 827 y FA(signal/int)228 -b FD(P)t Fv(O)t(S)t(I)t(X)960 926 y FA(interrupt/memor)o(y-s)o(ho)o -(rta)o(ge)93 b FD(N/A)960 1026 y FA(interrupt/chld)573 -b(signal/chld)184 b FD(P)t Fv(O)t(S)t(I)t(X)960 1125 -y FA(interrupt/cont)573 b(signal/cont)184 b FD(P)t Fv(O)t(S)t(I)t(X)960 -1225 y FA(interrupt/hup)617 b(signal/hup)228 b FD(P)t -Fv(O)t(S)t(I)t(X)960 1325 y FA(interrupt/quit)573 b(signal/quit)184 -b FD(P)t Fv(O)t(S)t(I)t(X)960 1424 y FA(interrupt/term)573 -b(signal/term)184 b FD(P)t Fv(O)t(S)t(I)t(X)960 1524 -y FA(interrupt/tstp)573 b(signal/tstp)184 b FD(P)t Fv(O)t(S)t(I)t(X)960 -1624 y FA(interrupt/usr1)573 b(signal/usr1)184 b FD(P)t -Fv(O)t(S)t(I)t(X)960 1723 y FA(interrupt/usr2)573 b(signal/usr2)184 -b FD(P)t Fv(O)t(S)t(I)t(X)960 1922 y FA(interrupt/info)573 -b(signal/info)182 b FD(BSD)21 b(only)960 2022 y FA(interrupt/io)661 -b(signal/io)270 b FD(BSD)21 b(+)g(SVR4)960 2122 y FA(interrupt/poll)573 -b(signal/poll)182 b FD(SVR4)20 b(only)960 2221 y FA(interrupt/prof)573 -b(signal/prof)182 b FD(BSD)21 b(+)g(SVR4)960 2321 y FA(interrupt/pwr) -617 b(signal/pwr)226 b FD(SVR4)20 b(only)960 2421 y FA(interrupt/urg) -617 b(signal/urg)226 b FD(BSD)21 b(+)g(SVR4)960 2520 -y FA(interrupt/vtalr)o(m)486 b(signal/vtalrm)94 b FD(BSD)21 -b(+)g(SVR4)960 2620 y FA(interrupt/winch)529 b(signal/winch)138 -b FD(BSD)21 b(+)g(SVR4)960 2719 y FA(interrupt/xcpu)573 -b(signal/xcpu)182 b FD(BSD)21 b(+)g(SVR4)960 2819 y FA(interrupt/xfsz) -573 b(signal/xfsz)182 b FD(BSD)21 b(+)g(SVR4)681 3084 -y(T)-8 b(able)17 b(3.2:)23 b(Scheme)18 b(48)f(virtual-machine)h(interr) -o(upts)g(and)g(r)o(elated)e(Unix)i(signals.)25 b(Only)681 -3183 y(the)20 b(P)t Fv(O)t(S)t(I)t(X)i FD(signals)d(ar)o(e)e -(guaranteed)g(to)h(be)g(de\002ned;)h(however)-6 b(,)18 -b(your)h(implementation)681 3283 y(and)h(OS)h(may)f(de\002ne)h(other)g -(signals)g(and)g(interr)o(upts)g(not)g(listed)g(her)o(e.)p -681 3360 1146 4 v 774 3413 a Fe(a)800 3436 y Fv(Also)c(bound)f(to)h -(Scheme)f(48)h(interr)o(upt)f Fj(interrupt/alarm)p Fv(.)773 -3497 y Fe(b)800 3520 y Fv(Also)h(bound)f(to)h(Scheme)f(48)h(interr)o -(upt)f Fj(interrupt/keyboard)p Fv(.)681 3822 y FB(Interrupt)j(handlers) -681 4045 y FD(Scsh)27 b(interr)o(upt)g(handlers)g(ar)o(e)e(complicated) -i(by)g(the)g(fact)f(that)h(scsh)g(is)h(implemented)681 -4145 y(on)c(top)g(of)f(the)h(Scheme)f(48)f(virtual)i(machine,)g(which)g -(has)g(its)f(own)i(interr)o(upt)f(system,)681 4245 y(independent)i(of)f +(generate)g(the)g(de-)888 4898 y(fault)c(value.)2071 +5147 y(62)p eop +%%Page: 63 71 +63 70 bop 573 614 a FA(\(argv)41 b FC(n)q FA(\))26 b +FD(is)g(simply)i FA(\(arg)42 b(\(command-line\))c(\(+)k +FC(n)i FA(1\)\))p FD(.)d(The)27 b(+1)f(of)o(fset)g(en-)573 +714 y(sur)o(es)20 b(that)h(the)g(two)g(forms)756 877 +y FA(\(arg)41 b(command-line-argu)o(men)o(ts)c FC(n)p +FA(\))756 977 y(\(argv)k FC(n)p FA(\))573 1141 y FD(r)o(eturn)22 +b(the)h(same)g(ar)o(gument)g(\(assuming)h(the)f(user)g(has)g(not)h(r)o +(ebound)e(or)h(modi-)573 1240 y(\002ed)d FA(command-line-argu)o(me)o +(nts)o FD(\).)573 1372 y(Example:)756 1535 y FA(\(if)42 +b(\(null?)f(command-line-arg)o(um)o(ent)o(s\))930 1635 +y(\(&)i(\(xterm)e(-n)h(,host)g(-title)f(,host)1366 1734 +y(-name)g(,\(string-append)d("xterm_")i(host\)\)\))930 +1834 y(\(let*)h(\(\(progname)f(\(file-name-nondi)o(re)o(cto)o(ry)d +(\(argv)k(1\)\)\))1235 1934 y(\(title)g(\(string-append)d(host)k(":")g +(progname\)\)\))1017 2033 y(\(&)h(\(xterm)e(-n)217 b(,title)1453 +2133 y(-title)41 b(,title)1453 2233 y(-e)217 b(,@command-line-a)o(rgu)o +(me)o(nt)o(s\)\))o(\)\))573 2396 y FD(A)23 b(subtlety:)30 +b(when)24 b(the)f(scsh)h(interpr)o(eter)e(is)h(used)g(to)h(execute)e(a) +h(scsh)h(pr)o(ogram,)573 2496 y(the)d(pr)o(ogram)f(name)h(r)o(eported)e +(in)j(the)f(head)f(of)h(the)g FA(\(command-line\))15 +b FD(list)21 b(is)g(the)573 2595 y(scsh)k(pr)o(ogram,)g +FC(not)g FD(the)g(interpr)o(eter)-6 b(.)36 b(For)26 b(example,)f(if)f +(we)h(have)g(a)f(shell)i(script)573 2695 y(in)21 b(\002le)g +FA(fullecho)p FD(:)756 2858 y FA(#!/usr/local/bi)o(n/)o(scs)o(h)37 +b(-s)756 2958 y(!#)756 3058 y(\(for-each)i(\()p Fo(\025)g +FA(\(arg\))j(\(display)e(arg\))i(\(display)e(")j("\)\))1191 +3157 y(\(command-line\)\))573 3321 y FD(and)20 b(we)h(r)o(un)g(the)g +(pr)o(ogram)756 3459 y FA(fullecho)40 b(hello)h(world)573 +3598 y FD(the)21 b(pr)o(ogram)f(will)h(print)g(out)756 +3736 y FA(fullecho)40 b(hello)h(world)573 3875 y FD(not)756 +4013 y FA(/usr/local/bin/)o(sc)o(sh)c(-s)43 b(fullecho)d(hello)i(world) +573 4184 y FD(This)37 b(ar)o(gument)f(line)h(pr)o(ocessing)f(ensur)o +(es)g(that)h(if)f(a)g(scsh)h(pr)o(ogram)f(is)h(sub-)573 +4284 y(sequently)29 b(compiled)g(into)g(a)g(standalone)f(executable)f +(or)i(byte-compiled)f(to)h(a)573 4383 y(heap-image)c(executable)g(by)h +(the)h(Scheme)f(48)f(virtual)h(machine,)h(its)g(semantics)573 +4483 y(will)21 b(be)g(unchanged\227the)g(ar)o(glist)f(pr)o(ocessing)h +(is)g(invariant.)k(In)c(ef)o(fect,)e(the)756 4621 y FA(/usr/local/bin/) +o(sc)o(sh)37 b(-s)573 4760 y FD(is)24 b(not)g(part)e(of)h(the)h(pr)o +(ogram;)f(it's)h(a)f(speci\002cation)h(for)f(the)g(machine)h(to)f +(execute)573 4860 y(the)e(pr)o(ogram)f(on,)h(so)g(it)g(is)g(not)g(pr)o +(operly)f(part)g(of)h(the)g(pr)o(ogram's)f(ar)o(gument)g(list.)1756 +5147 y(63)p eop +%%Page: 64 72 +64 71 bop 681 614 a Fy(3.8)99 b(System)25 b(parameters)681 +858 y FA(\(system-name\))82 b Fw(\000)-15 b(!)88 b FC(string)1411 +b FD(pr)o(ocedur)o(e)888 984 y(Returns)25 b(the)e(name)h(of)f(the)h +(host)h(on)f(which)h(we)e(ar)o(e)f(executing.)34 b(This)25 +b(may)e(be)h(a)888 1084 y(local)c(name,)g(such)g(as)f(\223solar)-6 +b(,\224)19 b(as)g(opposed)h(to)g(a)f(fully-quali\002ed)h(domain)g(name) +888 1183 y(such)i(as)e(\223solar)-6 b(.csie.ntu.edu.tw)e(.\224)681 +1491 y Fy(3.9)99 b(Signal)25 b(system)681 1711 y FD(Signal)h(numbers)h +(ar)o(e)e(bound)h(to)h(the)f(variables)g FA(signal/hup)p +FD(,)d FA(signal/int)p FD(,)g(.)12 b(.)g(.)g(.)43 b(See)681 +1811 y(tables)20 b(3.9)g(and)g(3.3)g(for)g(the)h(full)g(list.)681 +1963 y FA(\(signal-process)37 b FC(pr)o(oc)20 b(sig)p +FA(\))87 b Fw(\000)-15 b(!)87 b FC(unde\002ned)850 b +FD(pr)o(ocedur)o(e)681 2063 y FA(\(signal-process-)o(gr)o(oup)37 +b FC(pr)o(grp)19 b(sig)p FA(\))87 b Fw(\000)-15 b(!)88 +b FC(unde\002ned)543 b FD(pr)o(ocedur)o(e)888 2207 y(These)24 +b(two)g(pr)o(ocedur)o(es)d(send)j(signals)g(to)g(a)e(speci\002c)i(pr)o +(ocess,)f(and)g(all)g(the)h(pr)o(o-)888 2307 y(cesses)g(in)g(a)f +(speci\002c)h(pr)o(ocess)f(gr)o(oup,)h(r)o(espectively)-9 +b(.)33 b(The)23 b FC(pr)o(oc)g FD(and)g FC(pr)o(grp)f +FD(ar)o(gu-)888 2407 y(ments)g(ar)o(e)d(either)i(pr)o(ocesses)f(or)h +(integer)g(pr)o(ocess)f(ids.)681 2607 y FA(\(itimer)40 +b FC(???)p FA(\))86 b Fw(\000)-15 b(!)88 b FC(unde\002ned)1334 +b FD(pr)o(ocedur)o(e)681 2707 y FA(\(pause-until-int)o(er)o(rup)o(t\)) +80 b Fw(\000)-14 b(!)87 b FC(unde\002ned)849 b FD(pr)o(ocedur)o(e)681 +2859 y FA(\(sleep)41 b FC(secs)p FA(\))87 b Fw(\000)-14 +b(!)87 b FC(unde\002ned)1372 b FD(pr)o(ocedur)o(e)681 +2959 y FA(\(sleep-until)38 b FC(time)p FA(\))87 b Fw(\000)-14 +b(!)87 b FC(unde\002ned)1093 b FD(pr)o(ocedur)o(e)888 +3103 y(The)30 b FA(sleep)e FD(pr)o(ocedur)o(e)f(causes)i(the)h(pr)o +(ocess)f(to)h(sleep)g(for)f FC(secs)i FD(seconds.)52 +b(The)888 3203 y FA(sleep-until)27 b FD(pr)o(ocedur)o(e)i(causes)i(the) +g(pr)o(ocess)f(to)i(sleep)f(until)g FC(time)g FD(\(see)g(sec-)888 +3302 y(tion)22 b(3.10\).)681 3584 y FB(Interrupt)d(handlers)681 +3773 y FD(Scsh)27 b(interr)o(upt)g(handlers)g(ar)o(e)e(complicated)i +(by)g(the)g(fact)f(that)h(scsh)g(is)h(implemented)681 +3872 y(on)c(top)g(of)f(the)h(Scheme)f(48)f(virtual)i(machine,)g(which)g +(has)g(its)f(own)i(interr)o(upt)f(system,)681 3972 y(independent)i(of)f (the)i(Unix)e(signal)i(system.)42 b(This)26 b(means)g(that)g(Unix)g -(signals)g(ar)o(e)f(de-)681 4344 y(liver)o(ed)h(in)j(two)f(stages:)39 +(signals)g(ar)o(e)f(de-)681 4072 y(liver)o(ed)h(in)j(two)f(stages:)39 b(\002rst,)30 b(Unix)e(delivers)f(the)h(signal)g(to)g(the)g(Scheme)g -(48)e(virtual)681 4444 y(machine,)21 b(then)g(the)g(Scheme)f(48)g +(48)e(virtual)681 4171 y(machine,)21 b(then)g(the)g(Scheme)f(48)g (virtual)g(machine)h(delivers)g(the)g(signal)g(to)g(the)g(execut-)681 -4544 y(ing)c(Scheme)e(pr)o(ogram)h(as)g(a)g(Scheme)g(48)f(interr)o +4271 y(ing)c(Scheme)e(pr)o(ogram)h(as)g(a)g(Scheme)g(48)f(interr)o (upt.)24 b(This)17 b(ensur)o(es)f(that)g(signal)h(delivery)681 -4643 y(happens)g(between)h(two)h(vm)f(instr)o(uctions,)i(keeping)e -(individual)f(instr)o(uctions)j(atomic.)805 4799 y(The)28 +4371 y(happens)g(between)h(two)h(vm)f(instr)o(uctions,)i(keeping)e +(individual)f(instr)o(uctions)j(atomic.)805 4500 y(The)28 b(Scheme)g(48)e(machine)j(has)e(its)i(own)f(set)g(of)g(interr)o(upts,)i -(which)f(includes)f(the)681 4898 y(asynchr)o(onous)23 +(which)f(includes)f(the)681 4599 y(asynchr)o(onous)23 b(Unix)g(signals)g(\(table)e(3.9\).)61 b(Note)22 b(that)h(scsh)g(does)g -FC(not)f FD(support)h(signal)2071 5147 y(64)p eop -%%Page: 65 71 -65 70 bop 943 1542 1709 4 v 993 1612 a FD(Unix)21 b(signal)159 -b(T)-7 b(ype)399 b(OS)20 b(V)-8 b(ariant)p 943 1645 V -943 1662 V 993 1731 a FA(signal/stop)95 b FD(Uncatchable)125 -b(P)t Fv(O)t(S)t(I)t(X)993 1831 y FA(signal/kill)95 b -FD(Uncatchable)125 b(P)t Fv(O)t(S)t(I)t(X)993 2030 y -FA(signal/abrt)95 b FD(Synchr)o(onous)103 b(P)t Fv(O)t(S)t(I)t(X)993 -2130 y FA(signal/fpe)139 b FD(Synchr)o(onous)103 b(P)t -Fv(O)t(S)t(I)t(X)993 2230 y FA(signal/ill)139 b FD(Synchr)o(onous)103 -b(P)t Fv(O)t(S)t(I)t(X)993 2329 y FA(signal/pipe)95 b -FD(Synchr)o(onous)103 b(P)t Fv(O)t(S)t(I)t(X)993 2429 -y FA(signal/segv)95 b FD(Synchr)o(onous)103 b(P)t Fv(O)t(S)t(I)t(X)993 -2528 y FA(signal/ttin)95 b FD(Synchr)o(onous)103 b(P)t -Fv(O)t(S)t(I)t(X)993 2628 y FA(signal/ttou)95 b FD(Synchr)o(onous)103 -b(P)t Fv(O)t(S)t(I)t(X)993 2827 y FA(signal/bus)139 b -FD(Synchr)o(onous)101 b(BSD)20 b(+)h(SVR4)993 2927 y -FA(signal/emt)139 b FD(Synchr)o(onous)101 b(BSD)20 b(+)h(SVR4)993 -3027 y FA(signal/iot)139 b FD(Synchr)o(onous)101 b(BSD)20 -b(+)h(SVR4)993 3126 y FA(signal/sys)139 b FD(Synchr)o(onous)101 -b(BSD)20 b(+)h(SVR4)993 3226 y FA(signal/trap)95 b FD(Synchr)o(onous) -101 b(BSD)20 b(+)h(SVR4)365 3491 y(T)-8 b(able)19 b(3.3:)k(Uncatchable) -17 b(and)h(synchr)o(onous)i(Unix)f(signals.)25 b(While)20 -b(these)e(signals)i(may)365 3590 y(be)30 b(sent)g(with)h -FA(signal-process)24 b FD(or)31 b FA(signal-process-)o(gro)o(up)o -FD(,)26 b(ther)o(e)k(ar)o(e)e(no)j(corr)o(e-)365 3690 -y(sponding)21 b(scsh)f(interr)o(upt)g(handlers.)25 b(Only)20 -b(the)i(P)t Fv(O)t(S)t(I)t(X)h FD(signals)d(ar)o(e)f(guaranteed)f(to)i -(be)365 3789 y(de\002ned;)28 b(however)-6 b(,)26 b(your)g -(implementation)g(and)g(OS)f(may)g(de\002ne)h(other)g(signals)g(not)365 -3889 y(listed)21 b(her)o(e.)1756 5147 y(65)p eop -%%Page: 66 72 -66 71 bop 681 614 a FD(handlers)20 b(for)h(\223synchr)o(onous\224)h -(Unix)e(signals,)i(such)f(as)g FA(signal/ill)c FD(or)k -FA(signal/pipe)681 714 y FD(\(see)g(table)f(3.3\).)26 +FC(not)f FD(support)h(signal)681 4699 y(handlers)d(for)h(\223synchr)o +(onous\224)h(Unix)e(signals,)i(such)f(as)g FA(signal/ill)c +FD(or)k FA(signal/pipe)681 4799 y FD(\(see)g(table)f(3.3\).)26 b(Synchr)o(onous)c(occurr)o(ences)f(of)g(these)g(signals)h(ar)o(e)e -(better)h(handled)g(by)681 814 y(raising)k(a)g(Scheme)g(exception.)39 +(better)h(handled)g(by)681 4898 y(raising)k(a)g(Scheme)g(exception.)39 b(W)-8 b(e)25 b(r)o(ecommend)g(you)h(avoid)e(using)j(signal)e(handlers) -681 913 y(unless)19 b(you)h(absolutely)f(have)f(to;)h(we)g(intend)g(to) -g(pr)o(ovide)f(a)g(better)-6 b(,)19 b(higher)o(-level)f(inter)o(-)681 -1013 y(face)h(to)i(Unix)g(signals)h(after)d(scsh)i(has)g(been)g(ported) -f(to)h(a)g(multi-thr)o(eaded)e(platform.)681 1167 y FA -(\(signal->interru)o(pt)37 b FC(integer)p FA(\))87 b -Fw(\000)-14 b(!)87 b FC(integer)839 b FD(pr)o(ocedur)o(e)888 -1314 y(The)27 b(pr)o(ogrammer)f(maps)h(fr)o(om)f(Unix)g(signals)i(to)f -(Scheme)f(48)g(interr)o(upts)h(with)888 1413 y(the)22 -b FA(signal->interrupt)15 b FD(pr)o(ocedur)o(e.)27 b(If)21 -b(the)h(signal)g(does)g(not)h(have)e(a)h(de\002ned)888 -1513 y(Scheme)f(48)e(interr)o(upt,)i(an)g(errr)o(or)e(is)i(signaled.) -681 1819 y FA(\(interrupt-set)38 b FC(integer)1570 1831 -y Fx(1)1628 1819 y FC(.)12 b(.)g(.)g(integer)1962 1831 -y Fp(n)2008 1819 y FA(\))87 b Fw(\000)-15 b(!)88 b FC(integer)575 -b FD(pr)o(ocedur)o(e)888 1966 y(This)25 b(pr)o(ocedur)o(e)d(builds)i -(interr)o(upt)g(sets)g(fr)o(om)f(its)h(interr)o(upt)g(ar)o(guments.)35 -b(A)23 b(set)888 2065 y(is)h(r)o(epr)o(esented)d(as)h(an)h(integer)g -(using)h(a)f(two's-complement)h(r)o(epr)o(esentation)e(of)888 -2165 y(the)f(bit)g(set.)681 2471 y FA(\(enabled-interru)o(pt)o(s\))81 -b Fw(\000)-15 b(!)88 b FC(interrupt-set)880 b FD(pr)o(ocedur)o(e)681 -2571 y FA(\(set-enabled-int)o(er)o(rup)o(ts)37 b FC(interrupt-set)p -FA(\))87 b Fw(\000)-15 b(!)88 b FC(interrupt-set)233 -b FD(pr)o(ocedur)o(e)888 2717 y(Get)21 b(and)f(set)g(the)g(value)g(of)g -(the)h(enabled-interr)o(upt)e(set.)26 b(Only)21 b(interr)o(upts)g(in)f -(this)888 2816 y(set)f(have)f(their)g(handlers)g(called)g(when)h -(deliver)o(ed.)k(When)18 b(a)g(disabled)g(interr)o(upt)888 -2916 y(is)h(deliver)o(ed)e(to)i(the)g(Scheme)f(48)g(machine,)h(it)g(is) -g(held)g(pending)g(until)g(it)g(becomes)888 3016 y(enabled,)h(at)g -(which)i(time)f(its)g(handler)g(is)g(invoked.)888 3154 -y(Interr)o(upt)33 b(sets)g(ar)o(e)f(r)o(epr)o(esented)f(as)h(integer)h -(bit)g(sets)g(\(constr)o(ucted)g(with)h(the)888 3253 -y FA(interrupt-set)23 b FD(function\).)49 b(The)29 b -FA(set-enabled-int)o(err)o(up)o(ts)22 b FD(pr)o(ocedur)o(e)k(r)o(e-)888 -3353 y(turns)c(the)e(pr)o(evious)h(value)f(of)h(the)g(enabled-interr)o -(upt)e(set.)681 3560 y FA(\(with-enabled-in)o(te)o(rru)o(pt)o(s)37 -b FC(interrupt-set)17 b(.)g(body)p FA(\))53 b Fw(\000)-15 -b(!)54 b FC(value\(s\))17 b(of)f(body)87 b FD(syntax)681 -3659 y FA(\(with-enabled-in)o(te)o(rru)o(pt)o(s*)37 b -FC(interrupt-set)16 b(thunk)p FA(\))43 b Fw(\000)-15 -b(!)44 b FC(value\(s\))15 b(of)h(thunk)87 b FD(pr)o(ocedur)o(e)888 -3805 y(Run)30 b(code)e(with)i(a)e(given)h(set)f(of)h(interr)o(upts)g -(enabled.)48 b(Note)29 b(that)g(\223enabling\224)888 -3905 y(an)21 b(interr)o(upt)h(means)f(enabling)h(delivery)e(fr)o(om)h -(the)g(Scheme)g(48)f(vm)i(to)f(the)g(scsh)888 4005 y(pr)o(ogram.)62 -b(Using)34 b(the)f(Scheme)g(48)f(interr)o(upt)i(system)g(is)f(fairly)g -(lightweight,)888 4104 y(and)25 b(does)g(not)h(involve)f(actually)g -(making)g(a)g(system)h(call.)38 b(Note)25 b(that)g(enabling)888 -4204 y(an)d(interr)o(upt)h(means)f(that)g(the)g(assigned)g(interr)o -(upt)h(handler)f(is)g(allowed)g(to)h(r)o(un)888 4304 -y(when)f(the)f(interr)o(upt)g(is)g(deliver)o(ed.)j(Interr)o(upts)d(not) -h(enabled)e(ar)o(e)f(held)i(pending)888 4403 y(when)h(deliver)o(ed.)888 -4541 y(Interr)o(upt)33 b(sets)g(ar)o(e)f(r)o(epr)o(esented)f(as)h -(integer)h(bit)g(sets)g(\(constr)o(ucted)g(with)h(the)888 -4641 y FA(interrupt-set)16 b FD(function\).)681 4847 -y FA(\(set-interrupt-h)o(an)o(dle)o(r)37 b FC(interrupt)21 -b(handler)p FA(\))87 b Fw(\000)-15 b(!)88 b FC(old-handler)167 -b FD(pr)o(ocedur)o(e)2071 5147 y(66)p eop -%%Page: 67 73 -67 72 bop 573 614 a FD(Assigns)28 b(a)g(handler)f(for)g(a)g(given)h -(interr)o(upt,)i(and)d(r)o(eturns)g(the)h(interr)o(upt's)g(old)573 -714 y(handler)-6 b(.)25 b(The)20 b FC(handler)g FD(ar)o(gument)g(is)h -FA(#f)e FD(\(ignor)o(e\),)h FA(#t)g FD(\(default\),)e(or)j(a)f(pr)o -(ocedur)o(e)573 814 y(taking)28 b(an)g(integer)f(ar)o(gument;)k(the)d -(r)o(eturn)f(value)g(follows)i(the)f(same)f(conven-)573 -913 y(tions.)h(Note)22 b(that)f(the)h FC(interrupt)g -FD(ar)o(gument)e(is)i(an)g(interr)o(upt)f(value,)g(not)h(a)f(signal)573 -1013 y(value.)35 b(An)25 b(interr)o(upt)f(is)h(deliver)o(ed)d(to)j(the) -f(Scheme)g(48)g(machine)g(by)g(\(1\))f(block-)573 1112 -y(ing)30 b(all)f(interr)o(upts,)j(and)d(\(2\))f(applying)i(the)f -(handler)g(pr)o(ocedur)o(e)f(to)i(the)f(set)h(of)573 -1212 y(interr)o(upts)f(that)f(wer)o(e)f(enabled)h(prior)g(to)h(the)f -(interr)o(upt)h(delivery)-9 b(.)47 b(If)28 b(the)g(pr)o(o-)573 -1312 y(cedur)o(e)23 b(r)o(eturns)h(normally)i(\()p FC(i.e.)o -FD(,)g(it)f(doesn't)g(thr)o(ow)g(to)h(a)e(continuation\),)j(the)e(set) -573 1411 y(of)h(enabled)g(interr)o(upts)h(will)h(be)e(r)o(eturned)f(to) -i(its)g(pr)o(evious)g(value.)42 b(\(T)-8 b(o)27 b(r)o(estor)o(e)573 -1511 y(the)19 b(enabled-interr)o(upt)f(set)h(befor)o(e)e(thr)o(owing)j -(out)g(of)e(an)h(interr)o(upt)g(handler)-6 b(,)19 b(see)573 -1611 y FA(set-enabled-inte)o(rr)o(upt)o(s)p FD(\))573 -1740 y Fw(f)p FD(Note)29 b(If)f(you)i(set)f(a)g(handler)f(for)h(the)g -FA(interrupt/chld)24 b FD(interr)o(upt,)31 b(you)f(may)573 -1840 y(br)o(eak)f(scsh's)j(autor)o(eaping)e(pr)o(ocess)g(machinery)-9 -b(.)55 b(See)30 b(the)h(discussion)h(of)e(au-)573 1940 -y(tor)o(eaping)20 b(in)h(section)h(3.4.1.)p Fw(g)365 -2221 y FA(\(interrupt-handle)o(r)37 b FC(interrupt)p -FA(\))87 b Fw(\000)-14 b(!)87 b FC(handler)747 b FD(pr)o(ocedur)o(e)573 -2356 y(Return)28 b(the)g(handler)f(for)h(a)f(given)h(interr)o(upt.)46 -b(Note)28 b(that)g(the)g(ar)o(gument)f(is)h(an)573 2455 -y(interr)o(upt)i(value,)i(not)f(a)f(signal)g(value.)53 -b(A)30 b(handler)g(is)g(either)g FA(#f)g FD(\(ignor)o(e\),)h -FA(#t)573 2555 y FD(\(default\),)19 b(or)h(a)h(pr)o(ocedur)o(e)d -(taking)k(an)e(integer)h(ar)o(gument.)365 2967 y Fy(3.10)99 -b(T)-5 b(ime)365 3181 y FD(Scsh's)18 b(time)f(system)h(is)f(fairly)g -(sophisticated,)h(particularly)e(with)i(r)o(espect)e(to)i(its)f(car)o -(eful)365 3281 y(tr)o(eatment)h(of)g(time)g(zones.)25 -b(However)-6 b(,)18 b(casual)g(users)g(shouldn't)i(be)e(intimidated;)h -(all)f(of)365 3381 y(the)25 b(complexity)g(is)g(optional,)h(and)e -(defaulting)g(all)h(the)f(optional)i(ar)o(guments)e(r)o(educes)365 -3480 y(the)d(system)h(to)f(a)f(simple)h(interface.)573 -3637 y Fl(Remark:)66 b Fk(This)22 b(time)g(package)g(does)g(not)h(curr) -o(ently)e(work)h(with)h(NeXTSTEP)-10 b(,)22 b(as)573 -3728 y(NeXTSTEP)17 b(does)f(not)i(pr)o(ovide)e(a)k(P)t -Fg(O)t(S)t(I)t(X)r Fk(-compliant)d(time)g(library)g(that)i(will)e(even) -573 3820 y(link.)365 4068 y FB(3.10.1)81 b(T)-9 b(erminology)365 -4251 y FD(\223UTC\224)17 b(and)g(\223UCT\224)g(stand)g(for)h -(\223universal)g(coor)o(dinated)f(time,\224)h(which)h(is)f(the)g(of)o -(\002cial)365 4350 y(name)j(for)f(what)h(is)g(colloquially)i(r)o(eferr) -o(ed)18 b(to)j(as)f(\223Gr)o(eenwich)h(Mean)e(T)-5 b(ime.\224)492 -4475 y(P)t Fv(O)t(S)t(I)t(X)28 b FD(allows)d(a)g(single)g(time)g(zone)g -(to)g(specify)f FC(two)g FD(dif)o(fer)o(ent)f(of)o(fsets)h(fr)o(om)g -(UTC:)365 4575 y(one)33 b(standar)o(d)d(one,)35 b(and)c(one)h(for)g -(\223summer)g(time.\224)59 b(Summer)31 b(time)i(is)f(fr)o(equently)365 -4674 y(some)22 b(sort)f(of)g(daylight)g(savings)g(time.)490 -4799 y(The)32 b(scsh)g(time)g(package)f(consistently)i(uses)f(this)h -(terminology:)49 b(we)31 b(never)h(say)365 4898 y(\223gmt\224)21 -b(or)f(\223dst;\224)g(we)h(always)f(say)h(\223utc\224)f(and)g -(\223summer)h(time.\224)1756 5147 y(67)p eop -%%Page: 68 74 -68 73 bop 681 614 a FB(3.10.2)80 b(Basic)20 b(data)g(types)681 -810 y FD(W)-8 b(e)21 b(have)f(two)h(types:)26 b FC(time)20 -b FD(and)h FC(date)p FD(.)805 944 y(A)j FC(time)g FD(speci\002es)h(an)f -(instant)h(in)g(the)g(history)g(of)g(the)f(universe.)37 -b(It)24 b(is)h(location)g(and)681 1044 y(time-zone)g(independent.)1561 -1014 y Fs(3)1632 1044 y FD(A)f(time)h(is)h(a)e(r)o(eal)g(value)g -(giving)i(the)f(number)g(of)g(elapsed)681 1144 y(seconds)c(since)h(the) -f(Unix)h(\223epoch\224)e(\(Midnight,)h(January)g(1,)f(1970)g(UTC\).)g -(T)-5 b(ime)21 b(values)681 1243 y(pr)o(ovide)28 b(arbitrary)g(time)i -(r)o(esolution,)i(limited)e(only)h(by)e(the)h(number)f(system)h(of)g -(the)681 1343 y(underlying)21 b(Scheme)g(system.)805 -1477 y(A)32 b FC(date)f FD(is)h(a)g(name)f(for)h(an)g(instant)g(in)h -(time)f(that)g(is)g(speci\002ed)g(r)o(elative)e(to)i(some)681 -1577 y(location/time-zone)21 b(in)h(the)f(world,)f FC(e.g.)p -FD(:)888 1676 y(Friday)h(October)f(31,)g(1994)f(3:47:21)e(pm)k(EST)-6 -b(.)681 1776 y(Dates)33 b(pr)o(ovide)f(one-second)i(r)o(esolution,)j -(and)c(ar)o(e)f(expr)o(essed)g(with)i(the)g(following)681 -1876 y(r)o(ecor)o(d)19 b(type:)888 2083 y FA(\(define-record)38 -b(date)216 b(;)44 b(A)f(Posix)e(tm)i(struct)976 2183 -y(seconds)302 b(;)43 b(Seconds)e(after)g(the)h(minute)g([0-59])976 -2282 y(minute)346 b(;)43 b(Minutes)e(after)g(the)h(hour)g([0-59])976 -2382 y(hour)434 b(;)43 b(Hours)e(since)h(midnight)e([0-23])976 -2481 y(month-day)214 b(;)43 b(Day)f(of)h(the)f(month)g([1-31])976 -2581 y(month)390 b(;)43 b(Months)e(since)h(January)e([0-11])976 -2681 y(year)434 b(;)43 b(Years)e(since)h(1900)976 2780 -y(tz-name)302 b(;)43 b(Time-zone)d(name:)h(#f)i(or)g(a)g(string.)976 -2880 y(tz-secs)302 b(;)43 b(Time-zone)d(offset:)g(#f)j(or)g(an)g -(integer.)976 2980 y(summer?)302 b(;)43 b(Summer)e(\(Daylight)f -(Savings\))g(time)i(in)h(effect?)976 3079 y(week-day)258 -b(;)43 b(Days)f(since)f(Sunday)g([0-6])976 3179 y(year-day\))214 -b(;)43 b(Days)f(since)f(Jan.)h(1)h([0-365])681 3386 y -FD(If)31 b(the)g FA(tz-secs)e FD(\002eld)i(is)h(given,)i(it)d -(speci\002es)h(the)f(time-zone's)g(of)o(fset)g(fr)o(om)g(UTC)g(in)681 -3486 y(seconds.)50 b(If)28 b(it)h(is)g(speci\002ed,)i(the)d -FA(tz-name)e FD(and)j FA(summer?)d FD(\002elds)i(ar)o(e)g(ignor)o(ed)g -(when)681 3585 y(using)21 b(the)g(date)f(str)o(uctur)o(e)g(to)i -(determine)e(a)g(speci\002c)h(instant)g(in)h(time.)805 -3720 y(If)38 b(the)g FA(tz-name)d FD(\002eld)j(is)h(given,)j(it)d(is)f -(a)g(time-zone)g(string)h(such)f(as)g FA("EST")e FD(or)681 -3819 y FA("HKT")25 b FD(understood)i(by)g(the)h(OS.)e(Since)j(P)t -Fv(O)t(S)t(I)t(X)i FD(time-zone)c(strings)h(can)f(specify)g(dual)681 -3919 y(standar)o(d/summer)33 b(time-zones)i(\(e.g.,)i(\224EST5EDT\224) -32 b(speci\002es)j(U.S.)e(Eastern)h(Stan-)681 4018 y(dar)o(d/Eastern)20 -b(Daylight)j(T)-5 b(ime\),)22 b(the)g(value)g(of)g(the)g -FA(summer?)d FD(\002eld)j(is)g(used)g(to)h(r)o(esolve)681 -4118 y(the)k(amiguous)g(boundary)g(cases.)43 b(For)27 -b(example,)g(on)h(the)e(morning)j(of)d(the)h(Fall)g(day-)681 -4218 y(light)22 b(savings)h(change-over)-6 b(,)21 b(1:00am\2262:00am)c -(happens)22 b(twice.)28 b(Hence)22 b(the)g(date)f(1:30)681 -4317 y(am)27 b(on)h(this)g(morning)h(can)e(specify)g(two)h(dif)o(fer)o -(ent)d(seconds;)31 b(the)c FA(summer?)d FD(\003ag)k(says)681 -4417 y(which)21 b(one.)805 4551 y(A)i(date)e(with)j FA(tz-name)f -Fn(=)j FA(tz-secs)e Fn(=)i FA(#f)c FD(is)h(a)f(date)f(that)i(is)g -(speci\002ed)f(in)h(terms)g(of)681 4651 y(the)e(system's)g(curr)o(ent)f -(time)h(zone.)p 681 4740 1146 4 v 771 4796 a Fr(3)800 -4819 y Fv(Physics)26 b(pedants)f(please)g(note:)37 b(The)24 -b(scsh)i(authors)f(live)g(in)g(a)h(Newtonian)f(universe.)46 -b(W)-6 b(e)25 b(disclaim)681 4898 y(r)o(esponsibility)17 -b(for)g(calculations)i(performed)d(in)h(non-ANSI)f(standar)o(d)g -(light-cones.)2071 5147 y FD(68)p eop -%%Page: 69 75 -69 74 bop 490 614 a FD(Ther)o(e)20 b(is)h(r)o(edundancy)e(in)j(the)e -FA(date)g FD(data)f(str)o(uctur)o(e.)25 b(For)c(example,)f(the)h -FA(year-day)365 714 y FD(\002eld)f(is)g(r)o(edundant)e(with)i(the)g -FA(month-day)c FD(and)j FA(month)e FD(\002elds.)25 b(Either)20 -b(of)f(these)h(implies)365 814 y(the)27 b(values)g(of)f(the)h -FA(week-day)d FD(\002eld.)43 b(The)27 b FA(summer?)d -FD(and)j FA(tz-name)c FD(\002elds)k(ar)o(e)f(r)o(edun-)365 -913 y(dant)33 b(with)g(the)g FA(tz-secs)d FD(\002eld)i(in)h(terms)g(of) -g(specifying)g(an)f(instant)h(in)h(time.)61 b(This)365 -1013 y(r)o(edundancy)26 b(is)g(pr)o(ovided)g(because)f(consumers)j(of)e -(dates)g(may)g(want)h(it)g(br)o(oken)f(out)365 1112 y(in)d(dif)o(fer)o -(ent)d(ways.)29 b(The)22 b(scsh)h(pr)o(ocedur)o(es)d(that)i(pr)o(oduce) -f(date)g(r)o(ecor)o(ds)g(\002ll)i(them)f(out)365 1212 -y(completely)-9 b(.)58 b(However)-6 b(,)34 b(when)e(date)f(r)o(ecor)o -(ds)f(pr)o(oduced)g(by)i(the)f(pr)o(ogrammer)g(ar)o(e)365 -1312 y(passed)19 b(to)h(scsh)g(pr)o(ocedur)o(es,)d(the)j(r)o(edundancy) -e(is)h(r)o(esolved)g(by)g(ignoring)i(some)f(of)f(the)365 -1411 y(secondary)i(\002elds.)k(This)d(is)f(described)e(for)i(each)f(pr) -o(ocedur)o(e)f(below)-8 b(.)365 1563 y FA(\(make-date)40 -b FC(s)16 b(min)f(h)h(mday)e(mon)h(y)h([tzn)f(tzs)g(summ?)g(wday)g -(yday])p FA(\))41 b Fw(\000)-14 b(!)43 b FC(date)87 b -FD(pr)o(ocedur)o(e)573 1707 y(When)25 b(making)g(a)f -FA(date)f FD(r)o(ecor)o(d,)g(the)i(last)f(\002ve)h(elements)g(of)f(the) -h(r)o(ecor)o(d)e(ar)o(e)g(op-)573 1807 y(tional,)d(and)f(default)f(to)i -FA(#f)p FD(,)f FA(#f)p FD(,)g FA(#f)p FD(,)f(0,)i(and)f(0)g(r)o -(espectively)-9 b(.)24 b(This)c(is)f(useful)h(when)573 -1906 y(cr)o(eating)g(a)g FA(date)f FD(r)o(ecor)o(d)g(to)i(pass)g(as)f -(an)h(ar)o(gument)f(to)h FA(time)p FD(.)365 2185 y FB(3.10.3)81 -b(T)-5 b(ime)20 b(zones)365 2373 y FD(Several)30 b(time)i(pr)o(ocedur)o -(es)d(take)i(time)g(zones)h(as)f(ar)o(guments.)56 b(When)32 -b(optional,)i(the)365 2473 y(time)21 b(zone)g(defaults)f(to)h(local)g -(time)g(zone.)k(Otherwise)d(the)f(time)g(zone)f(can)h(be)f(one)h(of:) -623 2597 y FA(#f)273 b FD(Local)20 b(time)623 2697 y(Integer)99 -b(Seconds)19 b(of)g(of)o(fset)f(fr)o(om)h(UTC.)f(For)h(example,)g(New) -984 2797 y(Y)-8 b(ork)25 b(City)g(is)f(-18000)e(\(-5)h(hours\),)i(San)f -(Francisco)g(is)984 2896 y(-28800)18 b(\(-8)i(hours\).)623 -2996 y(String)139 b(A)18 b(P)t Fv(O)t(S)t(I)t(X)i FD(time)d(zone)f -(string)h(understood)g(by)f(the)h(OS)984 3096 y(\()p -FC(i.e.)p FD(.,)27 b(the)g(sort)g(of)g(time)g(zone)f(assigned)h(to)g -(the)g FA($TZ)984 3195 y FD(envir)o(onment)21 b(variable\).)365 -3339 y(An)f(integer)f(time)h(zone)f(gives)g(the)h(number)f(of)h -(seconds)f(you)h(must)g(add)e(to)i(UTC)f(to)h(get)365 -3438 y(time)h(in)h(that)e(zone.)26 b(It)21 b(is)g FC(not)f -FD(\223seconds)h(west\224)f(of)h(UTC\227that)f(\003ips)i(the)e(sign.) -490 3567 y(T)-8 b(o)21 b(get)g(UTC)f(time,)h(use)g(a)f(time)h(zone)g -(of)f(either)h(0)f(or)h FA("UCT0")p FD(.)365 3828 y FB(3.10.4)81 -b(Procedures)365 4039 y FA(\(time+ticks\))i Fw(\000)-15 -b(!)87 b FC([secs)22 b(ticks])1297 b FD(pr)o(ocedur)o(e)365 -4139 y FA(\(ticks/sec\))83 b Fw(\000)-14 b(!)87 b FC(r)o(eal)1579 -b FD(pr)o(ocedur)o(e)573 4265 y(The)27 b(curr)o(ent)g(time,)h(with)h -(sub-second)e(r)o(esolution.)46 b(Sub-second)26 b(r)o(esolution)i(is) -573 4364 y(not)h(pr)o(ovided)f(by)j(P)t Fv(O)t(S)t(I)t(X)r -FD(,)h(but)d(is)g(available)f(on)h(many)g(systems.)51 -b(The)29 b(time)g(is)573 4464 y(r)o(eturned)19 b(as)h(elapsed)g -(seconds)g(since)h(the)g(Unix)f(epoch,)g(plus)h(a)f(number)g(of)h(sub-) -573 4564 y(second)29 b(\223ticks.\224)50 b(The)29 b(length)h(of)f(a)g -(tick)g(may)g(vary)f(fr)o(om)h(implementation)h(to)573 -4663 y(implementation;)21 b(it)g(can)g(be)f(determined)g(fr)o(om)h -FA(\(ticks/sec\))p FD(.)573 4799 y(The)c(system)i(clock)f(is)g(not)g(r) -o(equir)o(ed)e(to)i(r)o(eport)f(time)h(at)f(the)h(full)g(r)o(esolution) -g(given)573 4898 y(by)g FA(\(ticks/sec\))p FD(.)i(For)f(example,)f(on)h -(BSD,)e(time)i(is)f(r)o(eported)f(at)h Fn(1)p Fo(\026)p -FD(s)g(r)o(esolution,)1756 5147 y(69)p eop -%%Page: 70 76 -70 75 bop 888 614 a FD(so)34 b FA(\(ticks/sec\))28 b -FD(is)33 b(1,000,000.)58 b(That)33 b(doesn't)g(mean)g(the)g(system)h -(clock)f(has)888 714 y(micr)o(o-second)21 b(r)o(esolution.)888 -851 y(If)c(the)f(OS)h(does)f(not)i(support)f(sub-second)f(r)o -(esolution,)i(the)f FC(ticks)f FD(value)g(is)h(always)888 -951 y(0,)j(and)h FA(\(ticks/sec\))16 b FD(r)o(eturns)k(1.)1071 -1136 y Fl(Remark:)93 b Fk(I)29 b(chose)g(to)g(r)o(epr)o(esent)e(system) -i(clock)f(r)o(esolution)g(as)h(ticks/sec)1071 1227 y(instead)20 -b(of)g(sec/tick)g(to)g(incr)o(ease)g(the)h(odds)e(that)j(the)e(value)h -(could)e(be)i(r)o(epr)o(e-)1071 1318 y(sented)j(as)g(an)h(exact)f -(integer)-6 b(,)25 b(incr)o(easing)e(ef)o(\002ciency)h(and)h(making)e -(it)i(easier)1071 1410 y(for)k(Scheme)h(implementations)g(that)i(don't) -d(have)i(sophisticated)f(numeric)1071 1501 y(support)18 -b(to)h(deal)f(with)i(the)f(quantity)-8 b(.)1071 1611 -y(Y)h(ou)18 b(can)i(convert)f(seconds)f(and)h(ticks)g(to)f(seconds)g -(with)i(the)f(expr)o(ession)1226 1747 y Fh(\(+)40 b Fi(secs)g -Fh(\(/)f Fi(ticks)h Fh(\(ticks/sec\)\)\))1071 1882 y -Fk(Given)23 b(that,)i(why)f(not)f(have)h(the)g(\002ne-grain)f(time)g -(pr)o(ocedur)o(e)d(just)k(r)o(eturn)e(a)1071 1973 y(non-integer)g(r)o -(eal)g(for)g(time?)35 b(Following)21 b(Common)i(Lisp,)f(I)h(chose)g(to) -f(allow)1071 2065 y(the)i(system)f(clock)g(to)h(r)o(eport)f(sub-second) -g(time)g(in)h(its)g(own)g(units)g(to)g(lower)1071 2156 -y(the)d(over)o(head)f(of)g(determining)f(the)j(time.)28 -b(This)20 b(would)g(be)g(important)h(for)f(a)1071 2247 -y(system)15 b(that)i(wanted)f(to)g(pr)o(ecisely)d(time)i(the)h -(duration)g(of)f(some)g(event.)22 b(T)l(ime)1071 2339 -y(stamps)16 b(could)g(be)h(collected)f(with)h(little)g(over)o(head,)e -(deferring)g(the)i(over)o(head)1071 2430 y(of)h(pr)o(ecisely)f -(calculating)i(with)h(them)f(until)g(after)g(collection.)1071 -2540 y(This)e(is)f(all)h(a)g(bit)g(academic)g(for)f(the)i(Scheme)f(48)g -(implementation,)h(wher)o(e)e(we)1071 2631 y(determine)23 -b(time)h(with)h(a)g(heavyweight)f(system)g(call,)h(but)g(it's)e(nice)i -(to)f(plan)1071 2723 y(for)18 b(the)h(futur)o(e.)681 -3001 y FA(\(date\))84 b Fw(\000)-14 b(!)87 b FC(date-r)o(ecord)1545 -b FD(pr)o(ocedur)o(e)681 3101 y FA(\(date)41 b FC([time)20 -b(tz])p FA(\))86 b Fw(\000)-14 b(!)87 b FC(date-r)o(ecord)1213 -b FD(pr)o(ocedur)o(e)888 3246 y(Simple)21 b FA(\(date\))d -FD(r)o(eturns)i(the)h(curr)o(ent)f(date,)g(in)h(the)g(local)g(time)g -(zone.)888 3383 y(W)-5 b(ith)23 b(the)g(optional)g(ar)o(guments,)e -FA(date)g FD(converts)h(the)h(time)f(to)g(the)h(date)e(as)h(spec-)888 -3483 y(i\002ed)h(by)f(the)h(time)g(zone)g FC(tz)o FD(.)31 -b FC(T)-5 b(ime)23 b FD(defaults)f(to)h(the)f(curr)o(ent)g(time;)i -FC(tz)e FD(defaults)g(to)888 3583 y(local)f(time,)g(and)f(is)h(as)g -(described)e(in)j(the)f(time-zone)f(section.)888 3720 -y(If)25 b(the)g FC(tz)f FD(ar)o(gument)h(is)g(an)g(integer)-6 -b(,)25 b(the)h(date's)e FA(tz-name)e FD(\002eld)j(is)g(a)h(P)t -Fv(O)t(S)t(I)t(X)j FD(time)888 3819 y(zone)17 b(of)f(the)h(form)f(\223) -p FA(UTC+)p Fu(hh)c FA(:)p Fu(mm)h FA(:)p Fu(ss)g FD(\224;)k(the)g -(trailing)g FA(:)p Fu(mm)c FA(:)p Fu(ss)30 b FD(portion)17 -b(is)g(deleted)888 3919 y(if)k(it)g(is)g(zer)o(oes.)1071 -4104 y Fl(Oops:)54 b Fk(The)20 b(Posix)f(facility)g(for)g(converting)g -(dates)h(to)f(times,)h Fh(mktime\(\))p Fk(,)h(has)1071 -4195 y(a)h(br)o(oken)g(design:)28 b(it)22 b(indicates)g(an)h(err)o(or)d -(by)i(r)o(eturning)f(-1,)i(which)g(is)e(also)h(a)1071 -4287 y(legal)e(r)o(eturn)h(value)h(\(for)e(date)h(23:59:59)i(UCT)-6 -b(,)22 b(12/31/1969\).)34 b(Scsh)22 b(r)o(esolves)1071 -4378 y(the)h(ambiguity)f(in)g(a)g(paranoid)g(fashion:)30 -b(it)23 b(always)f(r)o(eports)e(an)j(err)o(or)d(if)i(the)1071 -4469 y(underlying)17 b(Unix)i(facility)f(r)o(eturns)g(-1.)23 -b(W)-7 b(e)18 b(feel)g(your)g(pain.)681 4748 y FA(\(time\))84 -b Fw(\000)-14 b(!)87 b FC(integer)1685 b FD(pr)o(ocedur)o(e)681 -4848 y FA(\(time)41 b FC([date])p FA(\))86 b Fw(\000)-15 -b(!)88 b FC(integer)1447 b FD(pr)o(ocedur)o(e)2071 5147 -y(70)p eop -%%Page: 71 77 -71 76 bop 573 614 a FD(Simple)20 b FA(\(time\))f FD(r)o(eturns)h(the)h -(curr)o(ent)f(time.)573 744 y(W)-5 b(ith)30 b(the)f(optional)h(date)e -(ar)o(gument,)j FA(time)c FD(converts)i(a)g(date)f(to)i(a)e(time.)51 -b FC(Date)573 843 y FD(defaults)20 b(to)h(the)g(curr)o(ent)f(date.)573 -973 y(Note)30 b(that)h(the)f(input)h FC(date)f FD(r)o(ecor)o(d)f(is)i -(over)o(constrained.)54 b FA(time)28 b FD(ignor)o(es)j -FC(date)o FD('s)573 1073 y FA(week-day)i FD(and)j FA(year-day)d -FD(\002elds.)73 b(If)37 b(the)f(date's)g FA(tz-secs)e -FD(\002eld)i(is)h(set,)j(the)573 1172 y FA(tz-name)18 -b FD(and)i FA(summer?)e FD(\002elds)j(ar)o(e)e(ignor)o(ed.)573 -1302 y(If)26 b(the)g FA(tz-secs)e FD(\002eld)i(is)g FA(#f)p -FD(,)h(then)g(the)f(time-zone)g(is)h(taken)f(fr)o(om)g(the)g -FA(tz-name)573 1401 y FD(\002eld.)35 b(A)24 b(false)g -FA(tz-name)d FD(means)j(the)g(system's)h(curr)o(ent)f(time)g(zone.)36 -b(When)24 b(cal-)573 1501 y(culating)f(with)h(time-zones,)f(the)g -(date's)f FA(summer?)e FD(\002eld)j(is)g(used)g(to)g(r)o(esolve)f(am-) -573 1601 y(biguities:)805 1702 y FA(#f)161 b FD(Resolve)21 -b(an)g(ambiguous)g(time)g(in)h(favor)e(of)g(non-summer)i(time.)805 -1802 y(tr)o(ue)100 b(Resolve)21 b(an)g(ambiguous)g(time)g(in)h(favor)e -(of)g(summer)h(time.)573 1900 y(This)f(is)h(useful)f(in)g(boundary)g -(cases)g(during)g(the)g(change-over)-6 b(.)25 b(For)20 -b(example,)f(in)573 2000 y(the)g(Fall,)g(when)h(US)f(daylight)g -(savings)h(time)f(changes)h(over)f(at)g(2:00)e(am,)i(1:30)f(am)573 -2100 y(happens)j(twice\227it)g(names)f(two)i(instants)f(in)h(time,)e -(an)h(hour)g(apart.)573 2229 y(Outside)31 b(of)h(these)f(boundary)g -(cases,)i(the)f FA(summer?)c FD(\003ag)j(is)h(ignor)o(ed.)57 -b(For)31 b(ex-)573 2329 y(ample,)21 b(if)g(the)g(standar)o(d/summer)g -(change-overs)g(happen)g(in)h(the)f(Fall)h(and)e(the)573 -2428 y(Spring,)f(then)h(the)g(value)f(of)h FA(summer?)d -FD(is)j(ignor)o(ed)f(for)h(a)f(January)f(or)i(July)g(date.)k(A)573 -2528 y(January)18 b(date)h(would)h(be)f(r)o(esolved)f(with)i(standar)o -(d)e(time,)i(and)f(a)g(July)g(date)g(with)573 2628 y(summer)i(time,)g -(r)o(egar)o(dless)e(of)h(the)h FA(summer?)d FD(value.)573 -2757 y(The)k FA(summer?)d FD(\003ag)j(is)g(also)g(ignor)o(ed)g(if)g -(the)g(time)g(zone)g(doesn't)g(have)g(a)f(summer)573 -2857 y(time\227for)g(example,)e(simple)j(UTC.)365 3037 -y FA(\(date->string)39 b FC(date)p FA(\))86 b Fw(\000)-15 -b(!)88 b FC(string)1186 b FD(pr)o(ocedur)o(e)365 3137 -y FA(\(format-date)39 b FC(fmt)20 b(date)p FA(\))86 b -Fw(\000)-14 b(!)87 b FC(string)1094 b FD(pr)o(ocedur)o(e)573 -3272 y FA(Date->string)16 b FD(formats)k(the)h(date)f(as)g(a)h -(24-character)d(string)j(of)g(the)g(form:)756 3371 y(Sun)f(Sep)g(16)g -(01:03:52)d(1973)573 3501 y FA(Format-date)26 b FD(formats)31 -b(the)g(date)f(accor)o(ding)g(to)i(the)f(format)f(string)i -FC(fmt)o FD(.)57 b(The)573 3600 y(format)16 b(string)i(is)f(copied)f -(verbatim,)h(except)f(that)g(tilde)h(characters)e(indicate)h(con-)573 -3700 y(version)21 b(speci\002ers)g(that)f(ar)o(e)f(r)o(eplaced)g(by)i -(\002elds)f(fr)o(om)h(the)f(date)g(r)o(ecor)o(d.)k(Figur)o(e)573 -3799 y(3.1)19 b(gives)i(the)g(full)g(set)g(of)g(conversion)g -(speci\002ers)g(supported)f(by)h FA(format-date)p FD(.)365 -3980 y FA(\(fill-in-date!)38 b FC(date)p FA(\))86 b Fw(\000)-14 -b(!)87 b FC(date)1207 b FD(pr)o(ocedur)o(e)573 4115 y(This)27 -b(pr)o(ocedur)o(e)d(\002lls)j(in)f(missing,)j(r)o(edundant)c(slots)i -(in)g(a)f(date)f(r)o(ecor)o(d.)40 b(In)26 b(de-)573 4214 -y(cr)o(easing)20 b(or)o(der)g(of)g(priority:)672 4374 -y Fw(\017)42 b FB(year)-5 b(,)20 b(month,)f(month-day)g -Fw(\))i FB(year)o(-day)756 4473 y FD(If)g(the)g FA(year)p -FD(,)f FA(month)p FD(,)f(and)i FA(month-day)d FD(\002elds)j(ar)o(e)f -(all)i(de\002ned)f(\(ar)o(e)e(all)j(inte-)756 4573 y(gers\),)e(the)g -FA(year-day)e FD(\002eld)j(is)g(set)f(to)i(the)f(corr)o(esponding)f -(value.)672 4699 y Fw(\017)42 b FB(year)-5 b(,)20 b(year)o(-day)f -Fw(\))h FB(month,)g(month-day)756 4799 y FD(If)41 b(the)h -FA(month)e FD(and)h FA(month-day)d FD(\002elds)k(ar)o(en't)f(set,)47 -b(but)42 b(the)g FA(year)e FD(and)756 4898 y FA(year-day)17 -b FD(\002elds)k(ar)o(e)e(set,)i(then)g FA(month)e FD(and)h -FA(month-day)d FD(ar)o(e)i(calculated.)1756 5147 y(71)p +2071 5147 y(64)p eop +%%Page: 65 73 +65 72 bop 594 1208 2407 4 v 644 1278 a FD(Interr)o(upt)854 +b(Unix)21 b(signal)247 b(OS)20 b(V)-8 b(ariant)p 594 +1311 V 594 1327 V 644 1397 a FA(interrupt/alrm)1260 1367 +y Ff(a)1833 1397 y FA(signal/alrm)185 b FD(P)t Fv(O)t(S)t(I)t(X)644 +1500 y FA(interrupt/int)1216 1470 y Ff(b)1833 1500 y +FA(signal/int)229 b FD(P)t Fv(O)t(S)t(I)t(X)644 1599 +y FA(interrupt/memory-)o(sh)o(ort)o(ag)o(e)93 b FD(N/A)644 +1699 y FA(interrupt/chld)573 b(signal/chld)185 b FD(P)t +Fv(O)t(S)t(I)t(X)644 1799 y FA(interrupt/cont)573 b(signal/cont)185 +b FD(P)t Fv(O)t(S)t(I)t(X)644 1898 y FA(interrupt/hup)617 +b(signal/hup)229 b FD(P)t Fv(O)t(S)t(I)t(X)644 1998 y +FA(interrupt/quit)573 b(signal/quit)185 b FD(P)t Fv(O)t(S)t(I)t(X)644 +2097 y FA(interrupt/term)573 b(signal/term)185 b FD(P)t +Fv(O)t(S)t(I)t(X)644 2197 y FA(interrupt/tstp)573 b(signal/tstp)185 +b FD(P)t Fv(O)t(S)t(I)t(X)644 2297 y FA(interrupt/usr1)573 +b(signal/usr1)185 b FD(P)t Fv(O)t(S)t(I)t(X)644 2396 +y FA(interrupt/usr2)573 b(signal/usr2)185 b FD(P)t Fv(O)t(S)t(I)t(X)644 +2596 y FA(interrupt/info)573 b(signal/info)183 b FD(BSD)20 +b(only)644 2695 y FA(interrupt/io)661 b(signal/io)271 +b FD(BSD)20 b(+)h(SVR4)644 2795 y FA(interrupt/poll)573 +b(signal/poll)183 b FD(SVR4)20 b(only)644 2894 y FA(interrupt/prof)573 +b(signal/prof)183 b FD(BSD)20 b(+)h(SVR4)644 2994 y FA(interrupt/pwr) +617 b(signal/pwr)227 b FD(SVR4)20 b(only)644 3094 y FA(interrupt/urg) +617 b(signal/urg)227 b FD(BSD)20 b(+)h(SVR4)644 3193 +y FA(interrupt/vtalrm)485 b(signal/vtalrm)95 b FD(BSD)20 +b(+)h(SVR4)644 3293 y FA(interrupt/winch)529 b(signal/winch)139 +b FD(BSD)20 b(+)h(SVR4)644 3393 y FA(interrupt/xcpu)573 +b(signal/xcpu)183 b FD(BSD)20 b(+)h(SVR4)644 3492 y FA(interrupt/xfsz) +573 b(signal/xfsz)183 b FD(BSD)20 b(+)h(SVR4)365 3757 +y(T)-8 b(able)18 b(3.2:)23 b(Scheme)17 b(48)h(virtual-machine)f(interr) +o(upts)i(and)e(r)o(elated)f(Unix)i(signals.)26 b(Only)365 +3857 y(the)21 b(P)t Fv(O)t(S)t(I)t(X)g FD(signals)e(ar)o(e)e +(guaranteed)g(to)i(be)f(de\002ned;)g(however)-6 b(,)19 +b(your)f(implementation)365 3956 y(and)j(OS)f(may)h(de\002ne)g(other)g +(signals)g(and)f(interr)o(upts)i(not)f(listed)g(her)o(e.)p +365 4033 1146 4 v 459 4086 a Fe(a)485 4110 y Fv(Also)c(bound)f(to)g +(Scheme)g(48)h(interr)o(upt)g Fi(interrupt/alarm)p Fv(.)458 +4170 y Fe(b)485 4193 y Fv(Also)g(bound)f(to)g(Scheme)g(48)h(interr)o +(upt)g Fi(interrupt/keyboard)p Fv(.)1756 5147 y FD(65)p eop -%%Page: 72 78 -72 77 bop 681 1129 2865 4 v 681 4301 4 3173 v 759 1274 -a FA(~~)99 b FD(Converted)20 b(to)h(the)g FA(~)f FD(character)-6 -b(.)759 1399 y FA(~a)99 b FD(abbr)o(eviated)18 b(weekday)i(name)759 -1523 y FA(~A)99 b FD(full)20 b(weekday)g(name)759 1648 -y FA(~b)99 b FD(abbr)o(eviated)18 b(month)k(name)759 -1772 y FA(~B)99 b FD(full)20 b(month)i(name)759 1897 -y FA(~c)99 b FD(time)21 b(and)f(date)g(using)h(the)g(time)g(and)g(date) -f(r)o(epr)o(esentation)f(for)i(the)g(locale)946 1996 -y(\()p FA(~X)42 b(~x)p FD(\))759 2121 y FA(~d)99 b FD(day)20 -b(of)h(the)f(month)j(as)d(a)g(decimal)g(number)h(\(01-31\))759 -2245 y FA(~H)99 b FD(hour)21 b(based)f(on)h(a)f(24-hour)g(clock)h(as)g -(a)f(decimal)g(number)h(\(00-23\))759 2370 y FA(~I)99 -b FD(hour)21 b(based)f(on)h(a)f(12-hour)g(clock)h(as)g(a)f(decimal)g -(number)h(\(01-12\))759 2495 y FA(~j)99 b FD(day)20 b(of)h(the)f(year)g -(as)h(a)f(decimal)g(number)h(\(001-366\))759 2619 y FA(~m)99 -b FD(month)22 b(as)e(a)g(decimal)h(number)g(\(01-12\))759 -2744 y FA(~M)99 b FD(minute)21 b(as)g(a)f(decimal)g(number)h(\(00-59\)) -759 2868 y FA(~p)99 b FD(AM/PM)19 b(designation)j(associated)e(with)i -(a)e(12-hour)g(clock)759 2993 y FA(~S)99 b FD(second)21 -b(as)f(a)g(decimal)h(number)f(\(00-61\))759 3117 y FA(~U)99 -b FD(week)20 b(number)h(of)g(the)g(year;)f(Sunday)g(is)h(\002rst)g(day) -f(of)h(week)f(\(00-53\))759 3242 y FA(~w)99 b FD(weekday)20 -b(as)g(a)g(decimal)h(number)g(\(0-6\),)d(wher)o(e)i(Sunday)g(is)h(0)759 -3366 y FA(~W)99 b FD(week)20 b(number)h(of)g(the)g(year;)f(Monday)g(is) -h(\002rst)g(day)f(of)h(week)g(\(00-53\))759 3491 y FA(~x)99 -b FD(date)19 b(using)j(the)f(date)f(r)o(epr)o(esentation)f(for)i(the)g -(locale)759 3615 y FA(~X)99 b FD(time)21 b(using)g(the)g(time)g(r)o -(epr)o(esentation)f(for)g(the)h(locale)759 3740 y FA(~y)99 -b FD(year)20 b(without)i(century)e(\(00-99\))759 3864 -y FA(~Y)99 b FD(year)20 b(with)h(century)g(\()p FC(e.g.)o -FD(1990\))759 3989 y FA(~Z)99 b FD(time)21 b(zone)f(name)h(or)g(abbr)o -(eviation,)e(or)i(no)h(characters)d(if)i(no)g(time)g(zone)g(is)946 -4089 y(determinable)1275 4278 y(Figur)o(e)f(3.1:)k FA(format-date)17 -b FD(conversion)k(speci\002ers)p 3542 4301 V 681 4304 -2865 4 v 2071 5147 a(72)p eop -%%Page: 73 79 -73 78 bop 672 614 a Fw(\017)42 b FB(year)-5 b(,)20 b(month,)f -(month-day)-8 b(,)19 b(year)o(-day)g Fw(\))i FB(week-day)756 -714 y FD(If)27 b(either)g(of)h(the)f(above)g(r)o(ules)h(is)g(able)f(to) -h(determine)f(what)h(day)f(it)h(is,)h(the)756 814 y FA(week-day)17 -b FD(\002eld)k(is)g(then)g(set.)672 933 y Fw(\017)42 -b FB(tz-secs)18 b Fw(\))j FB(tz-name)756 1033 y FD(If)i -FA(tz-secs)d FD(is)k(de\002ned,)g(but)g FA(tz-name)c -FD(is)k(not,)h(it)f(is)g(assigned)g(a)f(time-zone)756 -1132 y(name)h(of)i(the)f(form)g(\223)p FA(UTC+)p Fu(hh)11 -b FA(:)p Fu(mm)j FA(:)p Fu(ss)f FD(\224;)26 b(the)f(trailing)h -FA(:)p Fu(mm)13 b FA(:)p Fu(ss)38 b FD(portion)26 b(is)756 -1232 y(deleted)19 b(if)i(it)g(is)g(zer)o(oes.)672 1351 -y Fw(\017)42 b FB(tz-name,)17 b(date,)i(summer?)25 b -Fw(\))c FB(tz-secs,)d(summer?)756 1451 y FD(If)f(the)i(date)e -(information)i(is)g(pr)o(ovided)e(up)h(to)h(second)f(r)o(esolution,)h -FA(tz-name)756 1551 y FD(is)j(also)h(pr)o(ovided,)e(and)h -FA(tz-secs)d FD(is)k(not)g(set,)f(then)h FA(tz-secs)d -FD(and)h FA(summer?)756 1650 y FD(ar)o(e)34 b(set)i(to)h(their)f(corr)o -(ect)f(values.)71 b(Summer)o(-time)36 b(ambiguities)g(ar)o(e)f(r)o(e-) -756 1750 y(solved)21 b(using)i(the)f(original)g(value)f(of)h -FA(summer?)p FD(.)j(If)d(the)f(time)h(zone)g(doesn't)756 -1849 y(have)e(a)g(summer)h(time)g(variant,)f(then)h FA(summer?)d -FD(is)j(set)g(to)g FA(#f)p FD(.)672 1969 y Fw(\017)42 -b FB(local)19 b(time,)g(date,)g(summer?)25 b Fw(\))20 -b FB(tz-name,)e(tz-secs,)h(summer?)756 2068 y FD(If)24 -b(the)g(date)g(information)i(is)f(pr)o(ovided)e(up)i(to)g(second)f(r)o -(esolution,)i(but)f(no)756 2168 y(time)16 b(zone)f(information)i(is)f -(pr)o(ovided)f(\(both)h FA(tz-name)d FD(and)j FA(tz-secs)d -FD(ar)o(en't)756 2268 y(set\),)24 b(then)g(we)g(pr)o(oceed)e(as)i(in)g -(the)g(above)f(case,)h(except)f(the)h(system's)h(cur)o(-)756 -2367 y(r)o(ent)20 b(time)h(zone)f(is)i(used.)573 2520 -y(These)31 b(r)o(ules)g(allow)g(one)h(particular)d(ambiguity)j(to)f -(escape:)45 b(if)31 b(both)g FA(tz-name)573 2620 y FD(and)c -FA(tz-secs)d FD(ar)o(e)i(set,)i(they)g(ar)o(e)e(not)i(br)o(ought)f -(into)h(agr)o(eement.)44 b(It)27 b(isn't)h(clear)573 -2719 y(how)21 b(to)h(do)e(this,)i(nor)f(is)g(it)g(clear)f(which)h(one)h -(should)f(take)f(pr)o(ecedence.)756 2873 y Fl(Oops:)50 -b Fh(fill-in-date!)22 b Fk(isn't)d(implemented)f(yet.)365 -3207 y Fy(3.1)l(1)100 b(Environment)24 b(variables)365 -3433 y FA(\(setenv)41 b FC(var)20 b(val)p FA(\))87 b -Fw(\000)-15 b(!)88 b FC(unde\002ned)1226 b FD(pr)o(ocedur)o(e)365 -3532 y FA(\(getenv)41 b FC(var)p FA(\))86 b Fw(\000)-14 -b(!)87 b FC(string)1476 b FD(pr)o(ocedur)o(e)573 3650 -y(These)21 b(functions)i(get)e(and)g(set)h(the)g(pr)o(ocess)f(envir)o -(onment,)h(stor)o(ed)f(in)h(the)f(exter)o(-)573 3750 -y(nal)h(C)g(variable)f FA(char)41 b(**environ)p FD(.)26 -b(An)c(envir)o(onment)h(variable)d FC(var)i FD(is)h(a)e(string.)573 -3849 y(If)k(an)g(envir)o(onment)g(variable)f(is)i(set)f(to)h(a)e -(string)i FC(val)p FD(,)g(then)f(the)h(pr)o(ocess')e(global)573 -3949 y(envir)o(onment)i(str)o(uctur)o(e)g(is)g(alter)o(ed)f(with)h(an)g -(entry)g(of)g(the)h(form)f FA(")p FC(var)o FA(=)p FC(val)o -FA(")p FD(.)41 b(If)573 4049 y FC(val)20 b FD(is)h FA(#f)p -FD(,)f(then)h(any)g(entry)g(for)f FC(var)h FD(is)g(deleted.)365 -4220 y FA(\(env->alist\))83 b Fw(\000)-15 b(!)87 b FC(string)p -Fw(!)p FC(string)21 b(alist)1006 b FD(pr)o(ocedur)o(e)573 -4347 y(The)21 b FA(env->alist)c FD(pr)o(ocedur)o(e)i(converts)i(the)g -(entir)o(e)f(envir)o(onment)i(into)g(an)f(alist,)573 -4447 y FC(e.g.)o FD(,)756 4599 y FA(\(\("TERM")40 b(.)j("vt100"\))799 -4699 y(\("SHELL")d(.)k("/bin/csh"\))799 4799 y(\("EDITOR")c(.)j -("emacs"\))799 4898 y(...\))1756 5147 y FD(73)p eop -%%Page: 74 80 -74 79 bop 681 614 a FA(\(alist->env)39 b FC(alist)p FA(\))87 -b Fw(\000)-15 b(!)87 b FC(unde\002ned)1142 b FD(pr)o(ocedur)o(e)888 -761 y FC(Alist)29 b FD(must)g(be)f(an)g(alist)h(whose)g(keys)g(ar)o(e)e -(all)h(strings,)j(and)d(whose)h(values)f(ar)o(e)888 860 -y(all)i(either)g(strings)h(or)f(string)g(lists.)54 b(String)30 -b(lists)g(ar)o(e)f(converted)g(to)h(colon)h(lists)888 -960 y(\(see)c(below\).)46 b(The)27 b(alist)h(is)g(installed)f(as)g(the) -h(curr)o(ent)e(Unix)i(envir)o(onment)g(\()p FC(i.e.)o -FD(,)888 1059 y(converted)23 b(to)g(a)g(null-terminated)g(C)g(vector)f -(of)h FA(")p FC(var)p FA(=)p FC(val)o FA(")f FD(strings)i(which)g(is)g -(as-)888 1159 y(signed)d(to)h(the)e(global)h FA(char)42 -b(**environ)p FD(\).)805 1343 y(The)21 b(following)i(thr)o(ee)d -(functions)i(help)f(the)g(pr)o(ogrammer)f(manipulate)g(alist)h(tables) -681 1442 y(in)f(some)g(generally)g(useful)f(ways.)26 -b(They)20 b(ar)o(e)e(all)h(de\002ned)h(using)g FA(equal?)e -FD(for)h(key)h(com-)681 1542 y(parison.)681 1696 y FA(\(alist-delete)38 -b FC(key)20 b(alist)p FA(\))87 b Fw(\000)-14 b(!)87 b -FC(alist)1110 b FD(pr)o(ocedur)o(e)888 1842 y(Delete)21 -b(any)g(entry)f(labelled)g(by)h(value)f FC(key)p FD(.)681 -2148 y FA(\(alist-update)38 b FC(key)20 b(val)h(alist)p -FA(\))86 b Fw(\000)-14 b(!)87 b FC(alist)988 b FD(pr)o(ocedur)o(e)888 -2294 y(Delete)21 b FC(key)f FD(fr)o(om)h FC(alist)p FD(,)f(then)h(cons) -h(on)f(a)f FA(\()p FC(key)43 b FA(.)g FC(val)p FA(\))20 -b FD(entry)-9 b(.)681 2600 y FA(\(alist-compress)37 b -FC(alist)p FA(\))87 b Fw(\000)-14 b(!)87 b FC(alist)1154 -b FD(pr)o(ocedur)o(e)888 2746 y(Compr)o(esses)21 b FC(alist)g -FD(by)f(r)o(emoving)h(shadowed)g(entries.)26 b(Example:)1071 -2922 y FA(;;;)42 b(Shadowed)f(\(1)h(.)i(c\))e(entry)g(removed.)1071 -3022 y(\(alist-compress)37 b('\()43 b(\(1)g(.)g(a\))g(\(2)g(.)g(b\))g -(\(1)f(.)h(c\))g(\(3)g(.)g(d\))g(\)\))1245 3121 y Fn(=)-14 -b Fw(\))87 b FA(\(\(1)43 b(.)g(a\))g(\(2)f(.)h(b\))g(\(3)g(.)g(d\)\)) -681 3423 y(\(with-env*)c FC(env-alist-delta)20 b(thunk)p -FA(\))86 b Fw(\000)-14 b(!)87 b FC(value\(s\))20 b(of)h(thunk)391 -b FD(pr)o(ocedur)o(e)681 3522 y FA(\(with-total-env*)37 -b FC(env-alist)20 b(thunk)p FA(\))87 b Fw(\000)-15 b(!)88 -b FC(value\(s\))20 b(of)g(thunk)319 b FD(pr)o(ocedur)o(e)888 -3668 y(These)35 b(pr)o(ocedur)o(es)d(call)i FC(thunk)f -FD(in)i(the)f(context)h(of)f(an)g(alter)o(ed)f(envir)o(onment.)888 -3768 y(They)20 b(r)o(eturn)f(whatever)h(values)f FC(thunk)g -FD(r)o(eturns.)25 b(Non-local)20 b(r)o(eturns)f(r)o(estor)o(e)g(the)888 -3868 y(envir)o(onment)g(to)f(its)g(outer)f(value;)h(thr)o(owing)h(back) -e(into)h(the)g(thunk)h(by)f(invoking)888 3967 y(a)j(stor)o(ed)f -(continuation)i(r)o(estor)o(es)e(the)h(envir)o(onment)g(back)f(to)h -(its)g(inner)h(value.)888 4105 y(The)17 b FC(env-alist-delta)e -FD(ar)o(gument)h(speci\002es)g(a)g FC(modi\002cation)f -FD(to)i(the)g(curr)o(ent)e(envir)o(on-)888 4205 y(ment\227)p -FC(thunk)p FD('s)21 b(envir)o(onment)g(is)f(the)h(original)g(envir)o -(onment)g(overridden)e(with)888 4304 y(the)i(bindings)h(speci\002ed)e -(by)h(the)g(alist)g(delta.)888 4442 y(The)g FC(env-alist)g -FD(ar)o(gument)g(speci\002es)g(a)g(complete)g(envir)o(onment)g(that)h -(is)f(installed)888 4542 y(for)g FC(thunk)o FD(.)681 -4748 y FA(\(with-env)40 b FC(env-alist-delta)19 b(.)i(body)p -FA(\))86 b Fw(\000)-15 b(!)88 b FC(value\(s\))20 b(of)g(body)608 -b FD(syntax)681 4847 y FA(\(with-total-env)37 b FC(env-alist)20 -b(.)h(body)p FA(\))86 b Fw(\000)-14 b(!)87 b FC(value\(s\))20 -b(of)h(body)535 b FD(syntax)2071 5147 y(74)p eop -%%Page: 75 81 -75 80 bop 573 614 a FD(These)34 b(special)f(forms)h(pr)o(ovide)f -(syntactic)g(sugar)h(for)f FA(with-env*)d FD(and)k FA(with-)573 -714 y(total-env*)p FD(.)21 b(The)e(env)g(alists)h(ar)o(e)e(not)i -(evaluated)d(positions,)k(but)f(ar)o(e)d(implicitly)573 -814 y(backquoted.)32 b(In)24 b(this)f(way)-9 b(,)24 b(they)f(tend)g(to) -g(r)o(esemble)g(binding)g(lists)h(for)f FA(let)f FD(and)573 -913 y FA(let*)d FD(forms.)490 1071 y(Example:)39 b(These)28 -b(four)f(pieces)h(of)f(code)h(all)g(r)o(un)g(the)g(mailer)g(with)g -(special)g FA($TERM)365 1162 y FD(and)21 b FA($EDITOR)c -FD(values.)573 1311 y Fh(\(with-env)41 b(\(\("TERM")g(.)f("xterm"\))h -(\("EDITOR")g(.)e(,my-editor\)\))651 1403 y(\(run)h(\(mail)h -(shivers@lcs.mit.edu\)\)\))573 1585 y(\(with-env*)g(`\(\("TERM")h(.)d -("xterm"\))i(\("EDITOR")g(.)f(,my-editor\)\))651 1677 -y(\()n Fd(\025)c Fh(\(\))k(\(run)g(\(mail)g(shivers@csd.hku.hk\)\)\)\)) -573 1859 y(\(run)g(\(begin)h(\(setenv)f("TERM")h("xterm"\))237 -b(;)40 b(Env)g(mutation)h(happens)1044 1951 y(\(setenv)f("EDITOR")h -(my-editor\))h(;)d(in)h(the)g(subshell.)1044 2042 y(\(exec-epf)h -(\(mail)f(shivers@research.att.com\)\)\)\))573 2225 y(;;)g(In)f(this)h -(example,)h(we)f(compute)h(an)f(alternate)h(environment)h(ENV2)573 -2316 y(;;)e(as)f(an)h(alist,)g(and)g(install)h(it)f(with)g(an)g -(explicit)h(call)f(to)g(the)573 2407 y(;;)g(EXEC-PATH/ENV)i(procedure.) -573 2499 y(\(let*)e(\(\(env)h(\(env->alist\)\))434 b(;)39 -b(Get)h(the)g(current)h(environment,)847 2590 y(\(env1)g -(\(alist-update)h(env)79 b("TERM")41 b("xterm"\)\))237 -b(;)40 b(and)f(compute)847 2681 y(\(env2)i(\(alist-update)h(env1)e -("EDITOR")h(my-editor\)\)\))h(;)e(the)f(new)h(env.)651 +%%Page: 66 74 +66 73 bop 1259 1542 1709 4 v 1309 1612 a FD(Unix)20 b(signal)160 +b(T)-7 b(ype)398 b(OS)21 b(V)-8 b(ariant)p 1259 1645 +V 1259 1662 V 1309 1732 a FA(signal/stop)95 b FD(Uncatchable)124 +b(P)t Fv(O)t(S)t(I)t(X)1309 1831 y FA(signal/kill)95 +b FD(Uncatchable)124 b(P)t Fv(O)t(S)t(I)t(X)1309 2031 +y FA(signal/abrt)95 b FD(Synchr)o(onous)102 b(P)t Fv(O)t(S)t(I)t(X)1309 +2130 y FA(signal/fpe)139 b FD(Synchr)o(onous)102 b(P)t +Fv(O)t(S)t(I)t(X)1309 2230 y FA(signal/ill)139 b FD(Synchr)o(onous)102 +b(P)t Fv(O)t(S)t(I)t(X)1309 2329 y FA(signal/pipe)95 +b FD(Synchr)o(onous)102 b(P)t Fv(O)t(S)t(I)t(X)1309 2429 +y FA(signal/segv)95 b FD(Synchr)o(onous)102 b(P)t Fv(O)t(S)t(I)t(X)1309 +2529 y FA(signal/ttin)95 b FD(Synchr)o(onous)102 b(P)t +Fv(O)t(S)t(I)t(X)1309 2628 y FA(signal/ttou)95 b FD(Synchr)o(onous)102 +b(P)t Fv(O)t(S)t(I)t(X)1309 2828 y FA(signal/bus)139 +b FD(Synchr)o(onous)100 b(BSD)21 b(+)g(SVR4)1309 2927 +y FA(signal/emt)139 b FD(Synchr)o(onous)100 b(BSD)21 +b(+)g(SVR4)1309 3027 y FA(signal/iot)139 b FD(Synchr)o(onous)100 +b(BSD)21 b(+)g(SVR4)1309 3126 y FA(signal/sys)139 b FD(Synchr)o(onous) +100 b(BSD)21 b(+)g(SVR4)1309 3226 y FA(signal/trap)95 +b FD(Synchr)o(onous)100 b(BSD)21 b(+)g(SVR4)681 3491 +y(T)-8 b(able)18 b(3.3:)23 b(Uncatchable)18 b(and)g(synchr)o(onous)i +(Unix)e(signals.)26 b(While)19 b(these)g(signals)g(may)681 +3590 y(be)29 b(sent)i(with)g FA(signal-process)24 b FD(or)30 +b FA(signal-process-g)o(rou)o(p)p FD(,)c(ther)o(e)j(ar)o(e)g(no)h(corr) +o(e-)681 3690 y(sponding)20 b(scsh)h(interr)o(upt)e(handlers.)25 +b(Only)c(the)h(P)t Fv(O)t(S)t(I)t(X)h FD(signals)d(ar)o(e)e(guaranteed) +g(to)i(be)681 3790 y(de\002ned;)27 b(however)-6 b(,)26 +b(your)g(implementation)h(and)e(OS)g(may)h(de\002ne)f(other)h(signals)g +(not)681 3889 y(listed)21 b(her)o(e.)2071 5147 y(66)p +eop +%%Page: 67 75 +67 74 bop 365 614 a FD(unless)20 b(you)f(absolutely)g(have)f(to;)i(we)f +(intend)g(to)g(pr)o(ovide)f(a)g(better)-6 b(,)18 b(higher)o(-level)g +(inter)o(-)365 714 y(face)i(to)h(Unix)g(signals)g(after)f(scsh)h(has)g +(been)f(ported)h(to)g(a)f(multi-thr)o(eaded)f(platform.)365 +864 y FA(\(signal->interrup)o(t)37 b FC(integer)p FA(\))87 +b Fw(\000)-14 b(!)87 b FC(integer)840 b FD(pr)o(ocedur)o(e)573 +1005 y(The)27 b(pr)o(ogrammer)e(maps)i(fr)o(om)f(Unix)h(signals)g(to)h +(Scheme)e(48)g(interr)o(upts)h(with)573 1105 y(the)22 +b FA(signal->interrup)o(t)16 b FD(pr)o(ocedur)o(e.)26 +b(If)c(the)g(signal)g(does)g(not)g(have)g(a)f(de\002ned)573 +1205 y(Scheme)f(48)g(interr)o(upt,)h(an)f(errr)o(or)g(is)h(signaled.) +365 1496 y FA(\(interrupt-set)38 b FC(integer)1254 1508 +y Fx(1)1312 1496 y FC(.)12 b(.)g(.)g(integer)1646 1508 +y Fp(n)1692 1496 y FA(\))87 b Fw(\000)-14 b(!)87 b FC(integer)576 +b FD(pr)o(ocedur)o(e)573 1638 y(This)24 b(pr)o(ocedur)o(e)e(builds)i +(interr)o(upt)g(sets)g(fr)o(om)g(its)g(interr)o(upt)g(ar)o(guments.)34 +b(A)24 b(set)573 1738 y(is)f(r)o(epr)o(esented)e(as)i(an)g(integer)g +(using)h(a)e(two's-complement)j(r)o(epr)o(esentation)d(of)573 +1837 y(the)f(bit)g(set.)365 2129 y FA(\(enabled-interrup)o(ts)o(\))81 +b Fw(\000)-14 b(!)87 b FC(interrupt-set)881 b FD(pr)o(ocedur)o(e)365 +2229 y FA(\(set-enabled-inte)o(rr)o(upt)o(s)37 b FC(interrupt-set)p +FA(\))87 b Fw(\000)-14 b(!)87 b FC(interrupt-set)234 +b FD(pr)o(ocedur)o(e)573 2370 y(Get)20 b(and)g(set)h(the)f(value)g(of)g +(the)g(enabled-interr)o(upt)g(set.)25 b(Only)c(interr)o(upts)g(in)g +(this)573 2470 y(set)d(have)g(their)h(handlers)f(called)f(when)i +(deliver)o(ed.)k(When)c(a)f(disabled)f(interr)o(upt)573 +2570 y(is)i(deliver)o(ed)e(to)i(the)g(Scheme)f(48)g(machine,)h(it)g(is) +g(held)f(pending)h(until)h(it)e(becomes)573 2669 y(enabled,)i(at)g +(which)i(time)f(its)g(handler)f(is)h(invoked.)573 2802 +y(Interr)o(upt)33 b(sets)g(ar)o(e)e(r)o(epr)o(esented)g(as)i(integer)g +(bit)g(sets)g(\(constr)o(ucted)g(with)g(the)573 2902 +y FA(interrupt-set)23 b FD(function\).)49 b(The)28 b +FA(set-enabled-inter)o(ru)o(pt)o(s)22 b FD(pr)o(ocedur)o(e)27 +b(r)o(e-)573 3002 y(turns)21 b(the)g(pr)o(evious)f(value)g(of)h(the)g +(enabled-interr)o(upt)f(set.)365 3194 y FA(\(with-enabled-int)o(er)o +(rup)o(ts)37 b FC(interrupt-set)17 b(.)g(body)p FA(\))52 +b Fw(\000)-14 b(!)54 b FC(value\(s\))16 b(of)h(body)86 +b FD(syntax)365 3293 y FA(\(with-enabled-int)o(er)o(rup)o(ts)o(*)38 +b FC(interrupt-set)15 b(thunk)p FA(\))43 b Fw(\000)-14 +b(!)44 b FC(value\(s\))15 b(of)h(thunk)86 b FD(pr)o(ocedur)o(e)573 +3435 y(Run)29 b(code)g(with)g(a)f(given)h(set)g(of)f(interr)o(upts)i +(enabled.)48 b(Note)29 b(that)f(\223enabling\224)573 +3535 y(an)21 b(interr)o(upt)g(means)h(enabling)f(delivery)g(fr)o(om)f +(the)i(Scheme)f(48)f(vm)h(to)h(the)f(scsh)573 3634 y(pr)o(ogram.)62 +b(Using)33 b(the)h(Scheme)f(48)f(interr)o(upt)h(system)h(is)g(fairly)e +(lightweight,)573 3734 y(and)24 b(does)h(not)h(involve)g(actually)e +(making)i(a)e(system)i(call.)38 b(Note)25 b(that)g(enabling)573 +3834 y(an)d(interr)o(upt)g(means)g(that)g(the)h(assigned)f(interr)o +(upt)g(handler)g(is)h(allowed)f(to)g(r)o(un)573 3933 +y(when)f(the)g(interr)o(upt)g(is)h(deliver)o(ed.)h(Interr)o(upts)f(not) +f(enabled)f(ar)o(e)f(held)i(pending)573 4033 y(when)g(deliver)o(ed.)573 +4166 y(Interr)o(upt)33 b(sets)g(ar)o(e)e(r)o(epr)o(esented)g(as)i +(integer)g(bit)g(sets)g(\(constr)o(ucted)g(with)g(the)573 +4266 y FA(interrupt-set)15 b FD(function\).)365 4458 +y FA(\(set-interrupt-ha)o(nd)o(ler)37 b FC(interrupt)21 +b(handler)p FA(\))86 b Fw(\000)-14 b(!)87 b FC(old-handler)168 +b FD(pr)o(ocedur)o(e)573 4599 y(Assigns)28 b(a)g(handler)f(for)g(a)g +(given)h(interr)o(upt,)i(and)d(r)o(eturns)g(the)h(interr)o(upt's)g(old) +573 4699 y(handler)-6 b(.)25 b(The)20 b FC(handler)g +FD(ar)o(gument)g(is)h FA(#f)e FD(\(ignor)o(e\),)h FA(#t)g +FD(\(default\),)e(or)j(a)f(pr)o(ocedur)o(e)573 4799 y(taking)28 +b(an)g(integer)f(ar)o(gument;)k(the)d(r)o(eturn)f(value)g(follows)i +(the)f(same)f(conven-)573 4898 y(tions.)h(Note)22 b(that)f(the)h +FC(interrupt)g FD(ar)o(gument)e(is)i(an)g(interr)o(upt)f(value,)g(not)h +(a)f(signal)1756 5147 y(67)p eop +%%Page: 68 76 +68 75 bop 888 614 a FD(value.)36 b(An)24 b(interr)o(upt)h(is)f(deliver) +o(ed)f(to)h(the)h(Scheme)f(48)f(machine)i(by)f(\(1\))f(block-)888 +714 y(ing)30 b(all)g(interr)o(upts,)h(and)e(\(2\))g(applying)g(the)h +(handler)f(pr)o(ocedur)o(e)e(to)j(the)g(set)f(of)888 +814 y(interr)o(upts)g(that)f(wer)o(e)g(enabled)f(prior)h(to)h(the)g +(interr)o(upt)f(delivery)-9 b(.)47 b(If)28 b(the)h(pr)o(o-)888 +913 y(cedur)o(e)24 b(r)o(eturns)g(normally)h(\()p FC(i.e.)p +FD(,)h(it)f(doesn't)g(thr)o(ow)g(to)g(a)f(continuation\),)j(the)e(set) +888 1013 y(of)i(enabled)f(interr)o(upts)h(will)g(be)f(r)o(eturned)g(to) +h(its)g(pr)o(evious)f(value.)42 b(\(T)-8 b(o)27 b(r)o(estor)o(e)888 +1112 y(the)19 b(enabled-interr)o(upt)f(set)h(befor)o(e)f(thr)o(owing)i +(out)f(of)g(an)g(interr)o(upt)g(handler)-6 b(,)18 b(see)888 +1212 y FA(set-enabled-inter)o(ru)o(pts)o FD(\))888 1360 +y Fw(f)p FD(Note)29 b(If)g(you)g(set)h(a)e(handler)h(for)g(the)g +FA(interrupt/chld)23 b FD(interr)o(upt,)31 b(you)f(may)888 +1459 y(br)o(eak)g(scsh's)h(autor)o(eaping)f(pr)o(ocess)g(machinery)-9 +b(.)56 b(See)29 b(the)i(discussion)h(of)f(au-)888 1559 +y(tor)o(eaping)21 b(in)g(section)g(3.4.1.)p Fw(g)681 +1893 y FA(\(interrupt-handl)o(er)37 b FC(interrupt)p +FA(\))87 b Fw(\000)-15 b(!)88 b FC(handler)746 b FD(pr)o(ocedur)o(e)888 +2049 y(Return)28 b(the)g(handler)g(for)f(a)g(given)h(interr)o(upt.)47 +b(Note)28 b(that)f(the)h(ar)o(gument)f(is)h(an)888 2149 +y(interr)o(upt)j(value,)g(not)g(a)f(signal)h(value.)53 +b(A)30 b(handler)f(is)i(either)f FA(#f)f FD(\(ignor)o(e\),)j +FA(#t)888 2249 y FD(\(default\),)19 b(or)i(a)f(pr)o(ocedur)o(e)f +(taking)i(an)g(integer)f(ar)o(gument.)681 2753 y Fy(3.10)99 +b(T)-5 b(ime)681 2996 y FD(Scsh's)17 b(time)h(system)f(is)h(fairly)f +(sophisticated,)g(particularly)g(with)h(r)o(espect)e(to)h(its)h(car)o +(eful)681 3095 y(tr)o(eatment)f(of)h(time)h(zones.)25 +b(However)-6 b(,)18 b(casual)g(users)g(shouldn't)h(be)f(intimidated;)h +(all)f(of)681 3195 y(the)24 b(complexity)i(is)e(optional,)i(and)f +(defaulting)f(all)g(the)h(optional)g(ar)o(guments)f(r)o(educes)681 +3295 y(the)d(system)g(to)g(a)g(simple)g(interface.)888 +3505 y Fl(Remark:)66 b Fk(This)22 b(time)h(package)f(does)f(not)i(curr) +o(ently)f(work)f(with)j(NeXTSTEP)-10 b(,)21 b(as)888 +3596 y(NeXTSTEP)c(does)g(not)h(pr)o(ovide)e(a)j(P)t Fg(O)t(S)t(I)t(X)r +Fk(-compliant)e(time)h(library)e(that)j(will)e(even)888 +3687 y(link.)681 3995 y FB(3.10.1)80 b(T)-9 b(erminology)681 +4207 y FD(\223UTC\224)16 b(and)i(\223UCT\224)e(stand)i(for)g +(\223universal)f(coor)o(dinated)g(time,\224)h(which)h(is)f(the)h(of)o +(\002cial)681 4306 y(name)h(for)h(what)g(is)g(colloquially)h(r)o(eferr) +o(ed)c(to)j(as)g(\223Gr)o(eenwich)f(Mean)g(T)-5 b(ime.\224)807 +4453 y(P)t Fv(O)t(S)t(I)t(X)29 b FD(allows)c(a)f(single)i(time)f(zone)f +(to)h(specify)g FC(two)f FD(dif)o(fer)o(ent)f(of)o(fsets)h(fr)o(om)g +(UTC:)681 4553 y(one)32 b(standar)o(d)e(one,)35 b(and)d(one)g(for)g +(\223summer)f(time.\224)59 b(Summer)32 b(time)g(is)g(fr)o(equently)681 +4652 y(some)21 b(sort)g(of)g(daylight)g(savings)g(time.)805 +4799 y(The)32 b(scsh)g(time)g(package)f(consistently)i(uses)f(this)h +(terminology:)49 b(we)32 b(never)f(say)681 4898 y(\223gmt\224)20 +b(or)h(\223dst;\224)e(we)i(always)g(say)f(\223utc\224)g(and)g +(\223summer)h(time.\224)2071 5147 y(68)p eop +%%Page: 69 77 +69 76 bop 365 614 a FB(3.10.2)81 b(Basic)20 b(data)f(types)365 +813 y FD(W)-8 b(e)21 b(have)f(two)i(types:)j FC(time)c +FD(and)f FC(date)p FD(.)490 950 y(A)k FC(time)g FD(speci\002es)g(an)h +(instant)g(in)g(the)f(history)i(of)e(the)h(universe.)36 +b(It)25 b(is)g(location)g(and)365 1049 y(time-zone)g(independent.)1245 +1019 y Fs(3)1316 1049 y FD(A)g(time)g(is)g(a)g(r)o(eal)e(value)i +(giving)g(the)h(number)f(of)g(elapsed)365 1149 y(seconds)d(since)g(the) +f(Unix)g(\223epoch\224)g(\(Midnight,)g(January)f(1,)h(1970)e(UTC\).)h +(T)-5 b(ime)22 b(values)365 1249 y(pr)o(ovide)29 b(arbitrary)f(time)i +(r)o(esolution,)i(limited)e(only)g(by)g(the)f(number)h(system)g(of)f +(the)365 1348 y(underlying)22 b(Scheme)e(system.)490 +1485 y(A)31 b FC(date)h FD(is)g(a)f(name)h(for)g(an)f(instant)i(in)f +(time)h(that)e(is)i(speci\002ed)e(r)o(elative)g(to)h(some)365 +1585 y(location/time-zone)22 b(in)f(the)g(world,)g FC(e.g.)o +FD(:)573 1684 y(Friday)f(October)h(31,)e(1994)g(3:47:21)f(pm)j(EST)-6 +b(.)365 1784 y(Dates)33 b(pr)o(ovide)g(one-second)h(r)o(esolution,)j +(and)c(ar)o(e)f(expr)o(essed)f(with)k(the)e(following)365 +1883 y(r)o(ecor)o(d)19 b(type:)573 2095 y FA(\(define-record)38 +b(date)216 b(;)43 b(A)g(Posix)f(tm)h(struct)660 2194 +y(seconds)302 b(;)43 b(Seconds)e(after)h(the)g(minute)f([0-59])660 +2294 y(minute)346 b(;)43 b(Minutes)e(after)h(the)g(hour)g([0-59])660 +2393 y(hour)434 b(;)43 b(Hours)f(since)f(midnight)g([0-23])660 +2493 y(month-day)214 b(;)43 b(Day)g(of)g(the)f(month)f([1-31])660 +2593 y(month)390 b(;)43 b(Months)f(since)f(January)g([0-11])660 +2692 y(year)434 b(;)43 b(Years)f(since)f(1900)660 2792 +y(tz-name)302 b(;)43 b(Time-zone)d(name:)i(#f)h(or)f(a)h(string.)660 +2892 y(tz-secs)302 b(;)43 b(Time-zone)d(offset:)h(#f)i(or)f(an)h +(integer.)660 2991 y(summer?)302 b(;)43 b(Summer)f(\(Daylight)d +(Savings\))i(time)h(in)g(effect?)660 3091 y(week-day)258 +b(;)43 b(Days)f(since)g(Sunday)f([0-6])660 3190 y(year-day\))214 +b(;)43 b(Days)f(since)g(Jan.)g(1)h([0-365])365 3402 y +FD(If)31 b(the)h FA(tz-secs)c FD(\002eld)j(is)h(given,)i(it)e +(speci\002es)f(the)h(time-zone's)f(of)o(fset)g(fr)o(om)f(UTC)h(in)365 +3501 y(seconds.)50 b(If)29 b(it)g(is)g(speci\002ed,)h(the)f +FA(tz-name)d FD(and)i FA(summer?)e FD(\002elds)j(ar)o(e)e(ignor)o(ed)i +(when)365 3601 y(using)22 b(the)f(date)f(str)o(uctur)o(e)g(to)h +(determine)g(a)f(speci\002c)h(instant)g(in)g(time.)490 +3737 y(If)38 b(the)g FA(tz-name)d FD(\002eld)j(is)g(given,)43 +b(it)38 b(is)h(a)e(time-zone)h(string)h(such)g(as)e FA("EST")f +FD(or)365 3837 y FA("HKT")29 b FD(understood)i(by)f(the)h(OS.)f(Since)j +(P)t Fv(O)t(S)t(I)t(X)h FD(time-zone)c(strings)i(can)e(specify)g(du-) +365 3937 y(al)22 b(standar)o(d/summer)g(time-zones)g(\(e.g.,)g +(\224EST5EDT\224)e(speci\002es)j(U.S.)e(Eastern)g(Stan-)365 +4036 y(dar)o(d/Eastern)f(Daylight)j(T)-5 b(ime\),)22 +b(the)h(value)e(of)h(the)g FA(summer?)e FD(\002eld)h(is)i(used)f(to)g +(r)o(esolve)365 4136 y(the)27 b(amiguous)h(boundary)e(cases.)43 +b(For)27 b(example,)h(on)f(the)g(morning)h(of)f(the)g(Fall)g(day-)365 +4236 y(light)c(savings)f(change-over)-6 b(,)21 b(1:00am\2262:00am)d +(happens)j(twice.)29 b(Hence)22 b(the)f(date)g(1:30)365 +4335 y(am)27 b(on)h(this)g(morning)h(can)e(specify)g(two)h(dif)o(fer)o +(ent)d(seconds;)31 b(the)d FA(summer?)c FD(\003ag)j(says)365 +4435 y(which)22 b(one.)490 4571 y(A)g(date)g(with)h FA(tz-name)h +Fn(=)i FA(tz-secs)d Fn(=)j FA(#f)c FD(is)h(a)f(date)g(that)h(is)g +(speci\002ed)f(in)h(terms)g(of)365 4671 y(the)e(system's)h(curr)o(ent)e +(time)h(zone.)p 365 4740 1146 4 v 456 4796 a Fr(3)485 +4819 y Fv(Physics)26 b(pedants)e(please)h(note:)37 b(The)25 +b(scsh)g(authors)h(live)f(in)g(a)g(Newtonian)h(universe.)45 +b(W)-6 b(e)25 b(disclaim)365 4898 y(r)o(esponsibility)18 +b(for)f(calculations)i(performed)d(in)g(non-ANSI)h(standar)o(d)e +(light-cones.)1756 5147 y FD(69)p eop +%%Page: 70 78 +70 77 bop 805 614 a FD(Ther)o(e)20 b(is)h(r)o(edundancy)f(in)h(the)g +FA(date)e FD(data)h(str)o(uctur)o(e.)25 b(For)c(example,)e(the)i +FA(year-day)681 714 y FD(\002eld)e(is)h(r)o(edundant)e(with)j(the)e +FA(month-day)d FD(and)j FA(month)f FD(\002elds.)25 b(Either)19 +b(of)h(these)f(implies)681 814 y(the)27 b(values)f(of)h(the)g +FA(week-day)c FD(\002eld.)44 b(The)27 b FA(summer?)d +FD(and)i FA(tz-name)e FD(\002elds)j(ar)o(e)e(r)o(edun-)681 +913 y(dant)32 b(with)h(the)g FA(tz-secs)d FD(\002eld)j(in)g(terms)f(of) +h(specifying)g(an)g(instant)g(in)g(time.)61 b(This)681 +1013 y(r)o(edundancy)25 b(is)i(pr)o(ovided)e(because)h(consumers)h(of)g +(dates)e(may)i(want)g(it)f(br)o(oken)h(out)681 1112 y(in)22 +b(dif)o(fer)o(ent)e(ways.)30 b(The)22 b(scsh)g(pr)o(ocedur)o(es)f(that) +h(pr)o(oduce)f(date)g(r)o(ecor)o(ds)f(\002ll)j(them)g(out)681 +1212 y(completely)-9 b(.)58 b(However)-6 b(,)34 b(when)e(date)e(r)o +(ecor)o(ds)g(pr)o(oduced)h(by)g(the)h(pr)o(ogrammer)e(ar)o(e)681 +1312 y(passed)18 b(to)i(scsh)g(pr)o(ocedur)o(es,)e(the)h(r)o(edundancy) +f(is)i(r)o(esolved)e(by)i(ignoring)h(some)f(of)f(the)681 +1411 y(secondary)h(\002elds.)26 b(This)21 b(is)g(described)f(for)g +(each)h(pr)o(ocedur)o(e)d(below)-8 b(.)681 1563 y FA(\(make-date)39 +b FC(s)16 b(min)g(h)f(mday)f(mon)i(y)f([tzn)g(tzs)h(summ?)f(wday)f +(yday])p FA(\))42 b Fw(\000)-15 b(!)44 b FC(date)86 b +FD(pr)o(ocedur)o(e)888 1707 y(When)25 b(making)g(a)f +FA(date)f FD(r)o(ecor)o(d,)h(the)g(last)h(\002ve)f(elements)h(of)g(the) +f(r)o(ecor)o(d)f(ar)o(e)g(op-)888 1807 y(tional,)d(and)f(default)g(to)h +FA(#f)p FD(,)f FA(#f)p FD(,)f FA(#f)p FD(,)h(0,)g(and)g(0)g(r)o +(espectively)-9 b(.)24 b(This)c(is)g(useful)f(when)888 +1906 y(cr)o(eating)h(a)g FA(date)g FD(r)o(ecor)o(d)f(to)i(pass)f(as)h +(an)f(ar)o(gument)h(to)g FA(time)p FD(.)681 2185 y FB(3.10.3)80 +b(T)-5 b(ime)21 b(zones)681 2373 y FD(Several)30 b(time)h(pr)o(ocedur)o +(es)f(take)g(time)i(zones)f(as)g(ar)o(guments.)57 b(When)31 +b(optional,)k(the)681 2473 y(time)21 b(zone)g(defaults)e(to)j(local)e +(time)h(zone.)26 b(Otherwise)21 b(the)g(time)g(zone)g(can)f(be)h(one)g +(of:)938 2597 y FA(#f)274 b FD(Local)20 b(time)938 2697 +y(Integer)100 b(Seconds)18 b(of)h(of)o(fset)g(fr)o(om)f(UTC.)g(For)i +(example,)e(New)1300 2796 y(Y)-8 b(ork)25 b(City)f(is)h(-18000)c(\(-5)i +(hours\),)j(San)d(Francisco)i(is)1300 2896 y(-28800)18 +b(\(-8)h(hours\).)938 2996 y(String)140 b(A)18 b(P)t +Fv(O)t(S)t(I)t(X)h FD(time)e(zone)f(string)i(understood)e(by)h(the)f +(OS)1300 3095 y(\()p FC(i.e.)o FD(.,)28 b(the)f(sort)g(of)f(time)h +(zone)g(assigned)f(to)h(the)g FA($TZ)1300 3195 y FD(envir)o(onment)21 +b(variable\).)681 3339 y(An)e(integer)g(time)h(zone)f(gives)h(the)f +(number)h(of)f(seconds)h(you)g(must)g(add)e(to)i(UTC)e(to)i(get)681 +3438 y(time)h(in)g(that)g(zone.)k(It)c(is)g FC(not)g +FD(\223seconds)f(west\224)h(of)f(UTC\227that)h(\003ips)g(the)g(sign.) +805 3567 y(T)-8 b(o)22 b(get)e(UTC)g(time,)h(use)g(a)f(time)h(zone)g +(of)g(either)f(0)h(or)g FA("UCT0")p FD(.)681 3828 y FB(3.10.4)80 +b(Procedures)681 4039 y FA(\(time+ticks\))i Fw(\000)-14 +b(!)87 b FC([secs)21 b(ticks])1297 b FD(pr)o(ocedur)o(e)681 +4139 y FA(\(ticks/sec\))82 b Fw(\000)-14 b(!)87 b FC(r)o(eal)1579 +b FD(pr)o(ocedur)o(e)888 4265 y(The)28 b(curr)o(ent)e(time,)j(with)f +(sub-second)f(r)o(esolution.)46 b(Sub-second)27 b(r)o(esolution)h(is) +888 4364 y(not)i(pr)o(ovided)e(by)j(P)t Fv(O)t(S)t(I)t(X)r +FD(,)h(but)d(is)g(available)e(on)j(many)f(systems.)51 +b(The)29 b(time)g(is)888 4464 y(r)o(eturned)20 b(as)g(elapsed)f +(seconds)i(since)g(the)f(Unix)g(epoch,)h(plus)f(a)g(number)h(of)f(sub-) +888 4564 y(second)30 b(\223ticks.\224)49 b(The)30 b(length)f(of)g(a)g +(tick)g(may)g(vary)g(fr)o(om)f(implementation)j(to)888 +4663 y(implementation;)22 b(it)f(can)f(be)h(determined)f(fr)o(om)g +FA(\(ticks/sec\))p FD(.)888 4799 y(The)e(system)g(clock)g(is)g(not)h(r) +o(equir)o(ed)d(to)i(r)o(eport)f(time)h(at)f(the)h(full)f(r)o(esolution) +i(given)888 4898 y(by)g FA(\(ticks/sec\))p FD(.)h(For)e(example,)g(on)h +(BSD,)f(time)g(is)h(r)o(eported)e(at)h Fn(1)p Fo(\026)p +FD(s)g(r)o(esolution,)2071 5147 y(70)p eop +%%Page: 71 79 +71 78 bop 573 614 a FD(so)33 b FA(\(ticks/sec\))c FD(is)k(1,000,000.)58 +b(That)32 b(doesn't)i(mean)f(the)g(system)g(clock)h(has)573 +714 y(micr)o(o-second)20 b(r)o(esolution.)573 851 y(If)c(the)h(OS)f +(does)h(not)g(support)g(sub-second)g(r)o(esolution,)h(the)e +FC(ticks)h FD(value)f(is)h(always)573 951 y(0,)j(and)g +FA(\(ticks/sec\))c FD(r)o(eturns)21 b(1.)756 1136 y Fl(Remark:)92 +b Fk(I)29 b(chose)g(to)h(r)o(epr)o(esent)d(system)h(clock)h(r)o +(esolution)e(as)i(ticks/sec)756 1227 y(instead)20 b(of)g(sec/tick)g(to) +g(incr)o(ease)f(the)i(odds)e(that)j(the)f(value)f(could)g(be)g(r)o(epr) +o(e-)756 1318 y(sented)j(as)i(an)f(exact)h(integer)-6 +b(,)25 b(incr)o(easing)e(ef)o(\002ciency)g(and)i(making)f(it)g(easier) +756 1410 y(for)k(Scheme)j(implementations)f(that)h(don't)f(have)h +(sophisticated)e(numeric)756 1501 y(support)17 b(to)i(deal)f(with)i +(the)f(quantity)-8 b(.)756 1611 y(Y)h(ou)18 b(can)i(convert)f(seconds)f +(and)h(ticks)f(to)h(seconds)f(with)h(the)h(expr)o(ession)911 +1747 y Fj(\(+)39 b Fh(secs)h Fj(\(/)g Fh(ticks)f Fj(\(ticks/sec\)\)\)) +756 1882 y Fk(Given)23 b(that,)i(why)e(not)h(have)g(the)f(\002ne-grain) +g(time)g(pr)o(ocedur)o(e)e(just)i(r)o(eturn)g(a)756 1973 +y(non-integer)f(r)o(eal)g(for)g(time?)35 b(Following)21 +b(Common)i(Lisp,)f(I)h(chose)f(to)h(allow)756 2065 y(the)h(system)f +(clock)g(to)h(r)o(eport)e(sub-second)h(time)h(in)g(its)f(own)i(units)f +(to)g(lower)756 2156 y(the)d(over)o(head)e(of)h(determining)g(the)h +(time.)28 b(This)20 b(would)g(be)h(important)g(for)f(a)756 +2247 y(system)14 b(that)j(wanted)g(to)e(pr)o(ecisely)e(time)j(the)g +(duration)f(of)h(some)e(event.)23 b(T)l(ime)756 2339 +y(stamps)16 b(could)g(be)h(collected)e(with)j(little)e(over)o(head,)g +(deferring)e(the)k(over)o(head)756 2430 y(of)g(pr)o(ecisely)e +(calculating)k(with)f(them)g(until)g(after)g(collection.)756 +2540 y(This)d(is)g(all)h(a)g(bit)h(academic)f(for)f(the)h(Scheme)g(48)h +(implementation,)f(wher)o(e)g(we)756 2631 y(determine)23 +b(time)h(with)h(a)f(heavyweight)h(system)e(call,)i(but)g(it's)f(nice)g +(to)g(plan)756 2723 y(for)17 b(the)j(futur)o(e.)365 3001 +y FA(\(date\))85 b Fw(\000)-14 b(!)87 b FC(date-r)o(ecord)1545 +b FD(pr)o(ocedur)o(e)365 3101 y FA(\(date)42 b FC([time)20 +b(tz])p FA(\))86 b Fw(\000)-15 b(!)88 b FC(date-r)o(ecord)1213 +b FD(pr)o(ocedur)o(e)573 3246 y(Simple)20 b FA(\(date\))f +FD(r)o(eturns)h(the)h(curr)o(ent)f(date,)f(in)j(the)f(local)f(time)h +(zone.)573 3383 y(W)-5 b(ith)23 b(the)f(optional)h(ar)o(guments,)f +FA(date)e FD(converts)j(the)f(time)g(to)h(the)f(date)f(as)h(spec-)573 +3483 y(i\002ed)g(by)h(the)g(time)g(zone)f FC(tz)p FD(.)31 +b FC(T)-5 b(ime)22 b FD(defaults)g(to)h(the)g(curr)o(ent)f(time;)h +FC(tz)f FD(defaults)g(to)573 3583 y(local)f(time,)f(and)h(is)g(as)f +(described)g(in)h(the)g(time-zone)g(section.)573 3720 +y(If)j(the)h FC(tz)g FD(ar)o(gument)f(is)i(an)e(integer)-6 +b(,)26 b(the)f(date's)f FA(tz-name)e FD(\002eld)j(is)g(a)i(P)t +Fv(O)t(S)t(I)t(X)h FD(time)573 3819 y(zone)16 b(of)h(the)f(form)h(\223) +p FA(UTC+)p Fu(hh)11 b FA(:)p Fu(mm)j FA(:)p Fu(ss)f +FD(\224;)k(the)g(trailing)f FA(:)p Fu(mm)e FA(:)p Fu(ss)29 +b FD(portion)18 b(is)f(deleted)573 3919 y(if)j(it)h(is)h(zer)o(oes.)756 +4104 y Fl(Oops:)54 b Fk(The)20 b(Posix)e(facility)h(for)g(converting)h +(dates)f(to)h(times,)f Fj(mktime\(\))p Fk(,)i(has)756 +4195 y(a)h(br)o(oken)f(design:)28 b(it)23 b(indicates)f(an)h(err)o(or)c +(by)j(r)o(eturning)f(-1,)i(which)g(is)f(also)g(a)756 +4287 y(legal)e(r)o(eturn)h(value)g(\(for)f(date)i(23:59:59)h(UCT)-6 +b(,)21 b(12/31/1969\).)34 b(Scsh)22 b(r)o(esolves)756 +4378 y(the)g(ambiguity)g(in)g(a)h(paranoid)f(fashion:)30 +b(it)22 b(always)g(r)o(eports)f(an)i(err)o(or)d(if)h(the)756 +4469 y(underlying)c(Unix)h(facility)h(r)o(eturns)e(-1.)23 +b(W)-7 b(e)19 b(feel)f(your)f(pain.)365 4748 y FA(\(time\))85 +b Fw(\000)-14 b(!)87 b FC(integer)1685 b FD(pr)o(ocedur)o(e)365 +4848 y FA(\(time)42 b FC([date])p FA(\))85 b Fw(\000)-14 +b(!)87 b FC(integer)1448 b FD(pr)o(ocedur)o(e)1756 5147 +y(71)p eop +%%Page: 72 80 +72 79 bop 888 614 a FD(Simple)21 b FA(\(time\))d FD(r)o(eturns)i(the)h +(curr)o(ent)f(time.)888 744 y(W)-5 b(ith)30 b(the)g(optional)g(date)e +(ar)o(gument,)i FA(time)e FD(converts)h(a)g(date)f(to)h(a)g(time.)51 +b FC(Date)888 843 y FD(defaults)20 b(to)h(the)g(curr)o(ent)f(date.)888 +973 y(Note)31 b(that)f(the)h(input)g FC(date)f FD(r)o(ecor)o(d)e(is)j +(over)o(constrained.)54 b FA(time)29 b FD(ignor)o(es)h +FC(date)p FD('s)888 1073 y FA(week-day)k FD(and)i FA(year-day)d +FD(\002elds.)73 b(If)36 b(the)h(date's)f FA(tz-secs)d +FD(\002eld)k(is)g(set,)j(the)888 1172 y FA(tz-name)18 +b FD(and)j FA(summer?)c FD(\002elds)k(ar)o(e)f(ignor)o(ed.)888 +1302 y(If)26 b(the)h FA(tz-secs)c FD(\002eld)j(is)h FA(#f)p +FD(,)g(then)f(the)h(time-zone)f(is)h(taken)f(fr)o(om)f(the)i +FA(tz-name)888 1401 y FD(\002eld.)36 b(A)24 b(false)f +FA(tz-name)e FD(means)k(the)f(system's)h(curr)o(ent)e(time)i(zone.)35 +b(When)25 b(cal-)888 1501 y(culating)e(with)h(time-zones,)f(the)g +(date's)g FA(summer?)c FD(\002eld)k(is)g(used)g(to)g(r)o(esolve)g(am-) +888 1601 y(biguities:)1121 1702 y FA(#f)160 b FD(Resolve)22 +b(an)e(ambiguous)i(time)f(in)g(favor)f(of)h(non-summer)h(time.)1121 +1802 y(tr)o(ue)99 b(Resolve)22 b(an)e(ambiguous)i(time)f(in)g(favor)f +(of)h(summer)g(time.)888 1900 y(This)g(is)f(useful)g(in)h(boundary)f +(cases)f(during)h(the)h(change-over)-6 b(.)24 b(For)c(example,)g(in)888 +2000 y(the)g(Fall,)f(when)h(US)e(daylight)i(savings)f(time)h(changes)f +(over)g(at)g(2:00)f(am,)h(1:30)e(am)888 2100 y(happens)k(twice\227it)g +(names)g(two)g(instants)h(in)f(time,)g(an)g(hour)g(apart.)888 +2229 y(Outside)32 b(of)f(these)g(boundary)h(cases,)h(the)e +FA(summer?)d FD(\003ag)k(is)f(ignor)o(ed.)57 b(For)32 +b(ex-)888 2329 y(ample,)21 b(if)g(the)h(standar)o(d/summer)e +(change-overs)h(happen)g(in)h(the)g(Fall)f(and)g(the)888 +2428 y(Spring,)f(then)g(the)g(value)f(of)g FA(summer?)e +FD(is)j(ignor)o(ed)g(for)f(a)g(January)g(or)h(July)f(date.)24 +b(A)888 2528 y(January)19 b(date)f(would)i(be)f(r)o(esolved)g(with)h +(standar)o(d)e(time,)h(and)g(a)g(July)h(date)e(with)888 +2628 y(summer)k(time,)e(r)o(egar)o(dless)f(of)i(the)g +FA(summer?)d FD(value.)888 2757 y(The)k FA(summer?)d +FD(\003ag)j(is)h(also)f(ignor)o(ed)f(if)h(the)g(time)g(zone)g(doesn't)h +(have)e(a)h(summer)888 2857 y(time\227for)f(example,)f(simple)h(UTC.) +681 3037 y FA(\(date->string)38 b FC(date)p FA(\))86 +b Fw(\000)-14 b(!)87 b FC(string)1186 b FD(pr)o(ocedur)o(e)681 +3137 y FA(\(format-date)38 b FC(fmt)20 b(date)p FA(\))87 +b Fw(\000)-15 b(!)87 b FC(string)1094 b FD(pr)o(ocedur)o(e)888 +3272 y FA(Date->string)16 b FD(formats)21 b(the)g(date)e(as)i(a)f +(24-character)e(string)k(of)e(the)h(form:)1071 3371 y(Sun)g(Sep)f(16)f +(01:03:52)f(1973)888 3501 y FA(Format-date)27 b FD(formats)k(the)g +(date)f(accor)o(ding)g(to)h(the)g(format)g(string)h FC(fmt)o +FD(.)56 b(The)888 3600 y(format)17 b(string)g(is)g(copied)g(verbatim,)f +(except)g(that)h(tilde)f(characters)g(indicate)g(con-)888 +3700 y(version)21 b(speci\002ers)g(that)g(ar)o(e)e(r)o(eplaced)f(by)j +(\002elds)g(fr)o(om)f(the)h(date)f(r)o(ecor)o(d.)j(Figur)o(e)888 +3799 y(3.1)d(gives)h(the)g(full)g(set)f(of)h(conversion)h(speci\002ers) +e(supported)h(by)g FA(format-date)p FD(.)681 3980 y FA(\(fill-in-date!) +38 b FC(date)p FA(\))86 b Fw(\000)-15 b(!)88 b FC(date)1206 +b FD(pr)o(ocedur)o(e)888 4115 y(This)27 b(pr)o(ocedur)o(e)d(\002lls)j +(in)g(missing,)i(r)o(edundant)c(slots)i(in)f(a)g(date)f(r)o(ecor)o(d.) +40 b(In)27 b(de-)888 4214 y(cr)o(easing)20 b(or)o(der)g(of)h(priority:) +988 4374 y Fw(\017)41 b FB(year)-5 b(,)20 b(month,)g(month-day)f +Fw(\))i FB(year)o(-day)1071 4473 y FD(If)g(the)h FA(year)p +FD(,)d FA(month)p FD(,)h(and)h FA(month-day)c FD(\002elds)22 +b(ar)o(e)e(all)h(de\002ned)g(\(ar)o(e)f(all)h(inte-)1071 +4573 y(gers\),)f(the)h FA(year-day)c FD(\002eld)k(is)g(set)g(to)g(the)g +(corr)o(esponding)g(value.)988 4699 y Fw(\017)41 b FB(year)-5 +b(,)20 b(year)o(-day)f Fw(\))i FB(month,)f(month-day)1071 +4799 y FD(If)41 b(the)h FA(month)e FD(and)i FA(month-day)c +FD(\002elds)k(ar)o(en't)f(set,)46 b(but)c(the)g FA(year)e +FD(and)1071 4898 y FA(year-day)17 b FD(\002elds)k(ar)o(e)f(set,)g(then) +h FA(month)e FD(and)h FA(month-day)d FD(ar)o(e)j(calculated.)2071 +5147 y(72)p eop +%%Page: 73 81 +73 80 bop 365 1129 2865 4 v 365 4301 4 3173 v 443 1274 +a FA(~~)99 b FD(Converted)20 b(to)i(the)e FA(~)h FD(character)-6 +b(.)443 1399 y FA(~a)99 b FD(abbr)o(eviated)18 b(weekday)j(name)443 +1523 y FA(~A)99 b FD(full)21 b(weekday)f(name)443 1648 +y FA(~b)99 b FD(abbr)o(eviated)18 b(month)23 b(name)443 +1772 y FA(~B)99 b FD(full)21 b(month)h(name)443 1897 +y FA(~c)99 b FD(time)21 b(and)g(date)e(using)j(the)f(time)g(and)f(date) +g(r)o(epr)o(esentation)g(for)g(the)h(locale)630 1996 +y(\()p FA(~X)43 b(~x)p FD(\))443 2121 y FA(~d)99 b FD(day)20 +b(of)h(the)g(month)h(as)e(a)h(decimal)f(number)h(\(01-31\))443 +2245 y FA(~H)99 b FD(hour)21 b(based)f(on)i(a)e(24-hour)g(clock)h(as)f +(a)h(decimal)f(number)h(\(00-23\))443 2370 y FA(~I)99 +b FD(hour)21 b(based)f(on)i(a)e(12-hour)g(clock)h(as)f(a)h(decimal)f +(number)h(\(01-12\))443 2495 y FA(~j)99 b FD(day)20 b(of)h(the)g(year)f +(as)g(a)h(decimal)f(number)h(\(001-366\))443 2619 y FA(~m)99 +b FD(month)22 b(as)f(a)f(decimal)g(number)h(\(01-12\))443 +2744 y FA(~M)99 b FD(minute)22 b(as)e(a)g(decimal)h(number)f(\(00-59\)) +443 2868 y FA(~p)99 b FD(AM/PM)20 b(designation)h(associated)g(with)g +(a)f(12-hour)g(clock)443 2993 y FA(~S)99 b FD(second)21 +b(as)g(a)f(decimal)g(number)h(\(00-61\))443 3117 y FA(~U)99 +b FD(week)21 b(number)g(of)f(the)h(year;)f(Sunday)g(is)h(\002rst)g(day) +g(of)f(week)h(\(00-53\))443 3242 y FA(~w)99 b FD(weekday)20 +b(as)h(a)f(decimal)g(number)h(\(0-6\),)e(wher)o(e)h(Sunday)g(is)h(0)443 +3366 y FA(~W)99 b FD(week)21 b(number)g(of)f(the)h(year;)f(Monday)g(is) +i(\002rst)f(day)f(of)g(week)h(\(00-53\))443 3491 y FA(~x)99 +b FD(date)20 b(using)i(the)f(date)e(r)o(epr)o(esentation)h(for)g(the)h +(locale)443 3615 y FA(~X)99 b FD(time)21 b(using)h(the)f(time)g(r)o +(epr)o(esentation)e(for)i(the)g(locale)443 3740 y FA(~y)99 +b FD(year)20 b(without)i(century)f(\(00-99\))443 3864 +y FA(~Y)99 b FD(year)20 b(with)i(century)e(\()p FC(e.g.)o +FD(1990\))443 3989 y FA(~Z)99 b FD(time)21 b(zone)g(name)g(or)f(abbr)o +(eviation,)g(or)h(no)g(characters)e(if)i(no)g(time)g(zone)g(is)630 +4089 y(determinable)959 4278 y(Figur)o(e)g(3.1:)j FA(format-date)16 +b FD(conversion)22 b(speci\002ers)p 3226 4301 V 365 4304 +2865 4 v 1756 5147 a(73)p eop +%%Page: 74 82 +74 81 bop 988 614 a Fw(\017)41 b FB(year)-5 b(,)20 b(month,)g +(month-day)-8 b(,)19 b(year)o(-day)g Fw(\))i FB(week-day)1071 +714 y FD(If)27 b(either)h(of)f(the)h(above)f(r)o(ules)h(is)g(able)f(to) +h(determine)f(what)h(day)f(it)g(is,)j(the)1071 814 y +FA(week-day)17 b FD(\002eld)k(is)g(then)g(set.)988 933 +y Fw(\017)41 b FB(tz-secs)19 b Fw(\))h FB(tz-name)1071 +1033 y FD(If)j FA(tz-secs)e FD(is)j(de\002ned,)f(but)h +FA(tz-name)d FD(is)j(not,)h(it)e(is)h(assigned)g(a)f(time-zone)1071 +1132 y(name)i(of)g(the)g(form)g(\223)p FA(UTC+)p Fu(hh)12 +b FA(:)p Fu(mm)h FA(:)p Fu(ss)g FD(\224;)27 b(the)e(trailing)g +FA(:)p Fu(mm)13 b FA(:)p Fu(ss)39 b FD(portion)26 b(is)1071 +1232 y(deleted)20 b(if)g(it)h(is)g(zer)o(oes.)988 1351 +y Fw(\017)41 b FB(tz-name,)18 b(date,)h(summer?)24 b +Fw(\))d FB(tz-secs,)e(summer?)1071 1451 y FD(If)f(the)g(date)g +(information)h(is)f(pr)o(ovided)f(up)i(to)f(second)h(r)o(esolution,)g +FA(tz-name)1071 1551 y FD(is)k(also)f(pr)o(ovided,)f(and)h +FA(tz-secs)e FD(is)i(not)h(set,)g(then)g FA(tz-secs)c +FD(and)j FA(summer?)1071 1650 y FD(ar)o(e)35 b(set)h(to)g(their)g(corr) +o(ect)g(values.)71 b(Summer)o(-time)35 b(ambiguities)i(ar)o(e)d(r)o(e-) +1071 1750 y(solved)22 b(using)g(the)g(original)h(value)e(of)g +FA(summer?)p FD(.)26 b(If)21 b(the)h(time)g(zone)g(doesn't)1071 +1849 y(have)e(a)h(summer)g(time)g(variant,)f(then)h FA(summer?)d +FD(is)j(set)g(to)g FA(#f)p FD(.)988 1969 y Fw(\017)41 +b FB(local)20 b(time,)f(date,)g(summer?)24 b Fw(\))d +FB(tz-name,)d(tz-secs,)g(summer?)1071 2068 y FD(If)24 +b(the)h(date)f(information)h(is)g(pr)o(ovided)e(up)i(to)g(second)g(r)o +(esolution,)h(but)e(no)1071 2168 y(time)16 b(zone)g(information)h(is)f +(pr)o(ovided)f(\(both)h FA(tz-name)d FD(and)i FA(tz-secs)e +FD(ar)o(en't)1071 2268 y(set\),)24 b(then)g(we)g(pr)o(oceed)f(as)g(in)h +(the)g(above)g(case,)f(except)g(the)h(system's)h(cur)o(-)1071 +2367 y(r)o(ent)20 b(time)h(zone)g(is)g(used.)888 2520 +y(These)31 b(r)o(ules)g(allow)h(one)f(particular)f(ambiguity)h(to)h +(escape:)45 b(if)30 b(both)i FA(tz-name)888 2620 y FD(and)27 +b FA(tz-secs)d FD(ar)o(e)i(set,)j(they)e(ar)o(e)f(not)i(br)o(ought)g +(into)g(agr)o(eement.)44 b(It)27 b(isn't)h(clear)888 +2719 y(how)22 b(to)f(do)g(this,)g(nor)g(is)h(it)e(clear)g(which)i(one)f +(should)h(take)e(pr)o(ecedence.)1071 2873 y Fl(Oops:)51 +b Fj(fill-in-date!)21 b Fk(isn't)e(implemented)f(yet.)681 +3207 y Fy(3.1)l(1)99 b(Environment)25 b(variables)681 +3433 y FA(\(setenv)40 b FC(var)21 b(val)p FA(\))86 b +Fw(\000)-14 b(!)87 b FC(unde\002ned)1226 b FD(pr)o(ocedur)o(e)681 +3532 y FA(\(getenv)40 b FC(var)p FA(\))87 b Fw(\000)-14 +b(!)87 b FC(string)1475 b FD(pr)o(ocedur)o(e)888 3650 +y(These)22 b(functions)g(get)g(and)f(set)g(the)h(pr)o(ocess)f(envir)o +(onment,)h(stor)o(ed)f(in)h(the)g(exter)o(-)888 3750 +y(nal)g(C)g(variable)f FA(char)42 b(**environ)p FD(.)26 +b(An)c(envir)o(onment)g(variable)f FC(var)h FD(is)g(a)g(string.)888 +3849 y(If)j(an)g(envir)o(onment)h(variable)e(is)h(set)g(to)h(a)f +(string)h FC(val)o FD(,)g(then)g(the)f(pr)o(ocess')g(global)888 +3949 y(envir)o(onment)i(str)o(uctur)o(e)e(is)i(alter)o(ed)d(with)j(an)f +(entry)g(of)g(the)g(form)g FA(")p FC(var)o FA(=)p FC(val)p +FA(")p FD(.)40 b(If)888 4049 y FC(val)21 b FD(is)g FA(#f)p +FD(,)e(then)j(any)e(entry)h(for)g FC(var)f FD(is)h(deleted.)681 +4220 y FA(\(env->alist\))82 b Fw(\000)-14 b(!)87 b FC(string)p +Fw(!)p FC(string)21 b(alist)1005 b FD(pr)o(ocedur)o(e)888 +4347 y(The)21 b FA(env->alist)c FD(pr)o(ocedur)o(e)i(converts)i(the)h +(entir)o(e)e(envir)o(onment)h(into)h(an)f(alist,)888 +4447 y FC(e.g.)p FD(,)1071 4599 y FA(\(\("TERM")40 b(.)j("vt100"\))1115 +4699 y(\("SHELL")d(.)j("/bin/csh"\))1115 4799 y(\("EDITOR")c(.)44 +b("emacs"\))1115 4898 y(...\))2071 5147 y FD(74)p eop +%%Page: 75 83 +75 82 bop 365 614 a FA(\(alist->env)39 b FC(alist)p FA(\))87 +b Fw(\000)-14 b(!)87 b FC(unde\002ned)1142 b FD(pr)o(ocedur)o(e)573 +761 y FC(Alist)28 b FD(must)h(be)g(an)f(alist)g(whose)i(keys)e(ar)o(e)f +(all)i(strings,)i(and)d(whose)h(values)f(ar)o(e)573 860 +y(all)i(either)f(strings)i(or)f(string)h(lists.)53 b(String)30 +b(lists)h(ar)o(e)d(converted)i(to)g(colon)h(lists)573 +960 y(\(see)c(below\).)45 b(The)28 b(alist)f(is)h(installed)g(as)f(the) +g(curr)o(ent)g(Unix)g(envir)o(onment)h(\()p FC(i.e.)p +FD(,)573 1059 y(converted)22 b(to)i(a)e(null-terminated)h(C)g(vector)g +(of)g FA(")p FC(var)o FA(=)p FC(val)o FA(")g FD(strings)h(which)g(is)f +(as-)573 1159 y(signed)e(to)g(the)g(global)g FA(char)42 +b(**environ)p FD(\).)490 1343 y(The)21 b(following)h(thr)o(ee)e +(functions)i(help)f(the)g(pr)o(ogrammer)f(manipulate)h(alist)g(tables) +365 1442 y(in)g(some)f(generally)f(useful)h(ways.)25 +b(They)20 b(ar)o(e)e(all)i(de\002ned)f(using)i FA(equal?)c +FD(for)j(key)f(com-)365 1542 y(parison.)365 1696 y FA(\(alist-delete)39 +b FC(key)20 b(alist)p FA(\))87 b Fw(\000)-15 b(!)88 b +FC(alist)1110 b FD(pr)o(ocedur)o(e)573 1842 y(Delete)20 +b(any)h(entry)g(labelled)f(by)h(value)f FC(key)p FD(.)365 +2148 y FA(\(alist-update)39 b FC(key)20 b(val)g(alist)p +FA(\))87 b Fw(\000)-14 b(!)87 b FC(alist)988 b FD(pr)o(ocedur)o(e)573 +2294 y(Delete)20 b FC(key)h FD(fr)o(om)f FC(alist)p FD(,)h(then)g(cons) +g(on)h(a)e FA(\()p FC(key)43 b FA(.)g FC(val)o FA(\))21 +b FD(entry)-9 b(.)365 2600 y FA(\(alist-compress)38 b +FC(alist)p FA(\))86 b Fw(\000)-14 b(!)87 b FC(alist)1155 +b FD(pr)o(ocedur)o(e)573 2746 y(Compr)o(esses)20 b FC(alist)h +FD(by)g(r)o(emoving)g(shadowed)g(entries.)k(Example:)756 +2922 y FA(;;;)42 b(Shadowed)e(\(1)j(.)g(c\))g(entry)e(removed.)756 +3022 y(\(alist-compress)c('\()43 b(\(1)f(.)i(a\))e(\(2)h(.)g(b\))g(\(1) +g(.)g(c\))g(\(3)f(.)i(d\))e(\)\))930 3121 y Fn(=)-14 +b Fw(\))87 b FA(\(\(1)42 b(.)h(a\))g(\(2)g(.)g(b\))g(\(3)f(.)i(d\)\)) +365 3423 y(\(with-env*)c FC(env-alist-delta)19 b(thunk)p +FA(\))87 b Fw(\000)-15 b(!)88 b FC(value\(s\))20 b(of)g(thunk)392 +b FD(pr)o(ocedur)o(e)365 3522 y FA(\(with-total-env*)37 +b FC(env-alist)21 b(thunk)p FA(\))86 b Fw(\000)-14 b(!)87 +b FC(value\(s\))20 b(of)h(thunk)319 b FD(pr)o(ocedur)o(e)573 +3668 y(These)34 b(pr)o(ocedur)o(es)e(call)i FC(thunk)g +FD(in)h(the)f(context)g(of)h(an)f(alter)o(ed)e(envir)o(onment.)573 +3768 y(They)20 b(r)o(eturn)f(whatever)g(values)h FC(thunk)f +FD(r)o(eturns.)24 b(Non-local)d(r)o(eturns)e(r)o(estor)o(e)f(the)573 +3868 y(envir)o(onment)g(to)g(its)g(outer)g(value;)g(thr)o(owing)g(back) +f(into)i(the)f(thunk)g(by)g(invoking)573 3967 y(a)i(stor)o(ed)g +(continuation)j(r)o(estor)o(es)c(the)i(envir)o(onment)g(back)g(to)g +(its)g(inner)g(value.)573 4105 y(The)16 b FC(env-alist-delta)f +FD(ar)o(gument)h(speci\002es)h(a)f FC(modi\002cation)f +FD(to)i(the)f(curr)o(ent)g(envir)o(on-)573 4205 y(ment\227)p +FC(thunk)p FD('s)k(envir)o(onment)h(is)g(the)f(original)h(envir)o +(onment)g(overridden)f(with)573 4304 y(the)h(bindings)g(speci\002ed)g +(by)g(the)g(alist)f(delta.)573 4442 y(The)h FC(env-alist)g +FD(ar)o(gument)f(speci\002es)h(a)g(complete)g(envir)o(onment)h(that)f +(is)g(installed)573 4542 y(for)f FC(thunk)p FD(.)365 +4748 y FA(\(with-env)40 b FC(env-alist-delta)20 b(.)g(body)p +FA(\))86 b Fw(\000)-14 b(!)87 b FC(value\(s\))20 b(of)h(body)607 +b FD(syntax)365 4847 y FA(\(with-total-env)38 b FC(env-alist)20 +b(.)h(body)p FA(\))86 b Fw(\000)-15 b(!)88 b FC(value\(s\))20 +b(of)g(body)535 b FD(syntax)1756 5147 y(75)p eop +%%Page: 76 84 +76 83 bop 888 614 a FD(These)34 b(special)f(forms)h(pr)o(ovide)f +(syntactic)h(sugar)f(for)h FA(with-env*)c FD(and)j FA(with-)888 +714 y(total-env*)p FD(.)21 b(The)e(env)h(alists)f(ar)o(e)f(not)i +(evaluated)e(positions,)j(but)e(ar)o(e)f(implicitly)888 +814 y(backquoted.)33 b(In)23 b(this)h(way)-9 b(,)23 b(they)g(tend)g(to) +h(r)o(esemble)e(binding)i(lists)g(for)f FA(let)e FD(and)888 +913 y FA(let*)e FD(forms.)805 1071 y(Example:)39 b(These)28 +b(four)g(pieces)f(of)h(code)g(all)f(r)o(un)i(the)f(mailer)f(with)i +(special)e FA($TERM)681 1162 y FD(and)20 b FA($EDITOR)e +FD(values.)888 1311 y Fj(\(with-env)42 b(\(\("TERM")f(.)e("xterm"\))i +(\("EDITOR")g(.)f(,my-editor\)\))967 1403 y(\(run)g(\(mail)g +(shivers@lcs.mit.edu\)\)\))888 1585 y(\(with-env*)i(`\(\("TERM")f(.)f +("xterm"\))h(\("EDITOR")g(.)e(,my-editor\)\))967 1677 +y(\()n Fd(\025)c Fj(\(\))40 b(\(run)g(\(mail)h +(shivers@csd.hku.hk\)\)\)\))888 1859 y(\(run)f(\(begin)h(\(setenv)g +("TERM")f("xterm"\))238 b(;)39 b(Env)h(mutation)h(happens)1359 +1951 y(\(setenv)g("EDITOR")g(my-editor\))g(;)f(in)g(the)f(subshell.) +1359 2042 y(\(exec-epf)i(\(mail)g(shivers@research.att.com\)\)\)\))888 +2225 y(;;)f(In)g(this)g(example,)h(we)f(compute)g(an)g(alternate)h +(environment)h(ENV2)888 2316 y(;;)e(as)g(an)f(alist,)i(and)f(install)h +(it)e(with)i(an)e(explicit)i(call)f(to)g(the)888 2407 +y(;;)g(EXEC-PATH/ENV)i(procedure.)888 2499 y(\(let*)f(\(\(env)f +(\(env->alist\)\))435 b(;)39 b(Get)h(the)g(current)h(environment,)1163 +2590 y(\(env1)f(\(alist-update)i(env)80 b("TERM")40 b("xterm"\)\))238 +b(;)39 b(and)h(compute)1163 2681 y(\(env2)g(\(alist-update)i(env1)f +("EDITOR")g(my-editor\)\)\))h(;)d(the)h(new)g(env.)967 2772 y(\(run)g(\(begin)h(\(exec-path/env)h("mail")f(env2)f -("shivers@cs.cmu.edu"\)\)\)\))365 3181 y FB(3.1)m(1.1)81 -b(Path)19 b(lists)h(and)f(colon)i(lists)365 3355 y FD(Envir)o(onment)h -(variables)e(such)i(as)f FA($PATH)e FD(encode)i(a)g(list)h(of)f -(strings)h(by)g(separating)e(the)365 3447 y(list)g(elements)f(with)h -(colon)f(delimiters.)25 b(Once)19 b(parsed)f(into)i(actual)e(lists,)i -(these)f(or)o(der)o(ed)365 3538 y(lists)h(can)f(be)g(manipulated)f -(with)i(the)g(following)g(two)g(functions.)26 b(T)-8 -b(o)20 b(convert)f(between)365 3629 y(the)26 b(colon-separated)e -(string)h(encoding)h(and)f(the)g(list-of-strings)h(r)o(epr)o -(esentation,)f(see)365 3721 y(the)c FA(field-reader)16 -b FD(and)k FA(join-strings)c FD(functions)22 b(in)f(section)g(7.1.)573 -3870 y Fl(Remark:)71 b Fk(An)24 b(earlier)f(r)o(elease)f(of)h(scsh)h -(pr)o(ovided)e(the)i Fh(split-colon-list)k Fk(and)573 -3961 y Fh(string-list->colon-list)41 b Fk(functions.)77 -b(These)36 b(have)h(been)f(r)o(emoved)f(fr)o(om)573 4053 -y(scsh,)27 b(and)g(ar)o(e)e(r)o(eplaced)f(by)i(the)h(mor)o(e)d(general) -h(parsers)g(and)h(unparsers)f(of)g(the)573 4144 y(\002eld-r)o(eader)16 -b(module.)365 4326 y FA(\(add-before)39 b FC(elt)21 b(befor)o(e)h(list) -p FA(\))86 b Fw(\000)-14 b(!)87 b FC(list)1085 b FD(pr)o(ocedur)o(e)365 -4426 y FA(\(add-after)40 b FC(elt)21 b(after)f(list)p -FA(\))87 b Fw(\000)-14 b(!)87 b FC(list)1170 b FD(pr)o(ocedur)o(e)573 +("shivers@cs.cmu.edu"\)\)\)\))681 3181 y FB(3.1)m(1.1)80 +b(Path)20 b(lists)f(and)h(colon)g(lists)681 3355 y FD(Envir)o(onment)i +(variables)e(such)i(as)f FA($PATH)e FD(encode)i(a)g(list)g(of)h +(strings)g(by)f(separating)g(the)681 3447 y(list)e(elements)g(with)h +(colon)g(delimiters.)25 b(Once)19 b(parsed)f(into)h(actual)f(lists,)i +(these)f(or)o(der)o(ed)681 3538 y(lists)h(can)e(be)h(manipulated)g +(with)h(the)f(following)i(two)e(functions.)26 b(T)-8 +b(o)20 b(convert)f(between)681 3629 y(the)25 b(colon-separated)f +(string)i(encoding)g(and)e(the)i(list-of-strings)g(r)o(epr)o +(esentation,)e(see)681 3721 y(the)d FA(field-reader)15 +b FD(and)21 b FA(join-strings)16 b FD(functions)21 b(in)h(section)f +(8.1.)888 3870 y Fl(Remark:)71 b Fk(An)25 b(earlier)d(r)o(elease)g(of)i +(scsh)f(pr)o(ovided)f(the)j Fj(split-colon-list)i Fk(and)888 +3961 y Fj(string-list->colon-list)h Fk(functions.)34 +b(These)22 b(have)h(been)g(r)o(emoved)e(fr)o(om)g(sc-)888 +4053 y(sh,)16 b(and)h(ar)o(e)e(r)o(eplaced)f(by)h(the)i(mor)o(e)d +(general)h(parsers)f(and)i(unparsers)f(of)g(the)h(\002eld-)888 +4144 y(r)o(eader)h(module.)681 4326 y FA(\(add-before)39 +b FC(elt)21 b(befor)o(e)g(list)p FA(\))87 b Fw(\000)-14 +b(!)87 b FC(list)1084 b FD(pr)o(ocedur)o(e)681 4426 y +FA(\(add-after)39 b FC(elt)21 b(after)g(list)p FA(\))87 +b Fw(\000)-14 b(!)87 b FC(list)1169 b FD(pr)o(ocedur)o(e)888 4566 y(These)20 b(functions)h(ar)o(e)e(for)h(modifying)h(sear)o -(ch-path)d(lists,)j(wher)o(e)e(element)i(or)o(der)573 -4666 y(is)g(signi\002cant.)573 4799 y FA(add-before)c -FD(adds)k FC(elt)g FD(to)h(the)g(list)g(immediately)g(befor)o(e)e(the)h -(\002rst)h(occurr)o(ence)f(of)573 4898 y FC(befor)o(e)f -FD(in)g(the)f(list.)26 b(If)19 b FC(befor)o(e)h FD(is)g(not)g(in)g(the) -f(list,)h FC(elt)f FD(is)h(added)e(to)i(the)f(end)g(of)h(the)f(list.) -1756 5147 y(75)p eop -%%Page: 76 82 -76 81 bop 888 614 a FA(add-after)18 b FD(is)k(similar:)27 -b FC(elt)21 b FD(is)h(added)e(after)g(the)h(last)h(occurr)o(ence)e(of)h -FC(after)q FD(.)27 b(If)21 b FC(after)888 714 y FD(is)g(not)h(found,)f -FC(elt)f FD(is)h(added)f(to)h(the)g(beginning)h(of)e(the)h(list.)888 -872 y(Neither)16 b(function)h(destr)o(uctively)f(alters)g(the)g -(original)g(path-list.)24 b(The)16 b(r)o(esult)g(may)888 -971 y(shar)o(e)21 b(str)o(uctur)o(e)f(with)i(the)g(original)g(list.)27 -b(Both)22 b(functions)g(use)f FA(equal?)e FD(for)i(com-)888 -1071 y(paring)g(elements.)681 1447 y FB(3.1)m(1.2)80 -b FA($USER)p FB(,)19 b FA($HOME)p FB(,)f(and)i FA($PATH)681 -1679 y FD(Like)25 b(sh)i(and)e(unlike)h(csh,)h(scsh)g(has)e -FC(no)h FD(interactive)f(dependencies)g(on)h(envir)o(onment)681 -1779 y(variables.)56 b(It)31 b(does,)j(however)-6 b(,)34 -b(initialise)e(certain)f(internal)g(values)g(at)g(startup)g(time)681 -1879 y(fr)o(om)39 b(the)g(initial)h(pr)o(ocess)e(envir)o(onment,)45 -b(in)39 b(particular)f FA($HOME)f FD(and)i FA($PATH)p -FD(.)e(Scsh)681 1978 y(never)23 b(uses)h FA($USER)d FD(at)i(all.)34 -b(It)24 b(computes)g FA(\(user-login-nam)o(e\))17 b FD(fr)o(om)23 -b(the)h(system)g(call)681 2078 y FA(\(user-uid\))p FD(.)681 -2252 y FA(home-directory)2045 b FC(string)681 2352 y -FA(exec-path-list)1914 b FC(string)20 b FD(list)888 2518 -y(Scsh)29 b(accesses)e FA($HOME)g FD(at)h(start-up)f(time,)k(and)d -(stor)o(es)g(the)h(value)e(in)i(the)g(global)888 2618 -y(variable)19 b FA(home-directory)p FD(.)h(It)g(uses)h(this)g(value)e -(for)h FA(~)g FD(lookups)h(and)f(for)g(r)o(eturn-)888 -2717 y(ing)i(to)f(home)g(on)h FA(\(chdir\))p FD(.)888 -2875 y(Scsh)g(accesses)f FA($PATH)f FD(at)h(start-up)g(time,)h -(colon-splits)h(the)e(path)h(list,)g(and)f(stor)o(es)888 -2975 y(the)33 b(value)f(in)h(the)g(global)f(variable)g -FA(exec-path-list)p FD(.)55 b(This)33 b(list)g(is)g(used)f(for)888 -3074 y FA(exec-path)17 b FD(and)k FA(exec-path/env)15 -b FD(sear)o(ches.)681 3477 y Fy(3.12)99 b(T)-11 b(erminal)24 -b(device)h(control)681 3740 y FD(Scsh)g(pr)o(ovides)f(a)h(complete)g -(set)g(of)g(r)o(outines)h(for)f(manipulating)g(terminal)h(devices\227) -681 3840 y(putting)f(them)f(in)h(\223raw\224)e(mode,)i(changing)g(and)e -(querying)j(their)e(special)g(characters,)681 3939 y(modifying)i(their) -f(i/o)i(speeds,)e(and)g(so)h(forth.)39 b(The)26 b(scsh)f(interface)g -(is)g(designed)g(both)681 4039 y(for)34 b(generality)g(and)g -(portability)g(acr)o(oss)g(dif)o(fer)o(ent)e(Unix)i(platforms,)j(so)e -(you)g(don't)681 4139 y(have)29 b(to)h(r)o(ewrite)e(your)i(pr)o(ogram)f -(each)g(time)g(you)h(move)g(to)g(a)f(new)h(system.)52 -b(W)-8 b(e've)681 4238 y(also)30 b(made)f(an)h(ef)o(fort)f(to)h(use)g -(r)o(easonable,)h(Scheme-like)f(names)g(for)f(the)i(multitudi-)681 -4338 y(nous)g(named)e(constants)i(involved,)i(so)d(when)h(you)f(ar)o(e) -f(r)o(eading)g(code,)j(you'll)f(have)681 4437 y(less)26 -b(likelihood)i(of)e(getting)h(lost)f(in)h(a)f(bewildering)g(maze)f(of)h -(obfuscatory)g(constants)681 4537 y(named)20 b FA(ICRNL)p -FD(,)f FA(INPCK)p FD(,)f FA(IUCLC)p FD(,)g(and)j FA(ONOCR)p -FD(.)805 4699 y(This)k(section)g(can)f(only)i(lay)e(out)h(the)f(basic)g -(functionality)i(of)e(the)g(terminal)h(device)681 4799 -y(interface.)36 b(For)25 b(further)f(details,)h(see)g(the)f -(termios\(3\))h(man)f(page)g(on)i(your)f(system,)h(or)681 -4898 y(consult)c(one)f(of)f(the)h(standar)o(d)e(Unix)i(texts.)2071 -5147 y(76)p eop -%%Page: 77 83 -77 82 bop 365 614 a FB(3.12.1)81 b(Portability)18 b(across)j(OS)f -(variants)365 800 y FD(T)-8 b(erminal-contr)o(ol)29 b(softwar)o(e)e(is) -h(inescapably)g(complex,)i(ugly)-9 b(,)29 b(and)f(low-level.)48 -b(Unix)365 900 y(variants)26 b(each)f(pr)o(ovide)g(their)h(own)h(way)f -(of)g(contr)o(olling)h(terminal)f(devices,)h(making)365 -1000 y(it)20 b(dif)o(\002cult)f(to)h(pr)o(ovide)e(interfaces)h(that)g -(ar)o(e)f(portable)h(acr)o(oss)g(dif)o(fer)o(ent)f(Unix)h(systems.)365 -1099 y(Scsh's)28 b(terminal)f(support)g(is)g(based)f(primarily)h(upon)h -(the)h(P)t Fv(O)t(S)t(I)t(X)h FD(termios)e(interface.)365 -1199 y(Pr)o(ograms)i(that)f(can)g(be)g(written)h(using)h(only)f(the)i -(P)t Fv(O)t(S)t(I)t(X)h FD(interface)28 b(ar)o(e)g(likely)i(to)g(be)365 -1299 y(widely)21 b(portable.)490 1426 y(The)f(bulk)g(of)f(the)h -(documentation)h(that)f(follows)h(consists)g(of)f(several)e(pages)i -(worth)365 1525 y(of)26 b(tables)f(de\002ning)h(dif)o(fer)o(ent)e -(named)h(constants)i(that)e(enable)g(and)h(disable)f(dif)o(fer)o(ent) -365 1625 y(featur)o(es)20 b(of)i(the)g(terminal)g(driver)-6 -b(.)28 b(Some)21 b(of)h(these)g(\003ags)g(ar)o(e)h(P)t -Fv(O)t(S)t(I)t(X)r FD(;)g(others)f(ar)o(e)f(taken)365 -1724 y(fr)o(om)c(the)h(two)g(common)h(branches)f(of)f(Unix)h -(development,)g(SVR4)f(and)g(4.3+)g(Berkeley)-9 b(.)365 -1824 y(Scsh)21 b(guarantees)f(that)h(the)g(non-)r(P)t -Fv(O)t(S)t(I)t(X)j FD(constants)e(will)f(be)g(bound)g(identi\002ers.) -490 2019 y Fw(\017)41 b FD(If)22 b(your)g(OS)h(supports)f(a)g -(particular)f(non-)r(P)t Fv(O)t(S)t(I)t(X)27 b FD(\003ag,)22 -b(its)h(named)f(constant)h(will)573 2119 y(be)d(bound)h(to)h(the)e -(\003ag's)i(value.)490 2288 y Fw(\017)41 b FD(If)26 b(your)g(OS)g -(doesn't)h(support)f(the)g(\003ag,)i(its)e(named)g(constant)h(will)g -(be)e(pr)o(esent,)573 2387 y(but)c(bound)g(to)g FA(#f)p -FD(.)365 2582 y(This)30 b(means)e(that)h(if)f(you)i(want)e(to)i(use)e -(SVR4)g(or)h(Berkeley)f(featur)o(es)f(in)i(a)g(pr)o(ogram,)365 -2682 y(your)23 b(pr)o(ogram)e(can)h(portably)g(test)h(the)f(values)g -(of)g(the)g(\003ags)h(befor)o(e)e(using)i(them\227the)365 -2782 y(\003ags)30 b(can)e(r)o(eliably)g(be)h(r)o(efer)o(enced)d -(without)k(pr)o(oducing)f(OS-dependent)e(\223unbound)365 -2881 y(variable\224)19 b(err)o(ors.)490 3008 y(Finally)-9 -b(,)18 b(note)h(that)f(although)j(P)t Fv(O)t(S)t(I)t(X)r -FD(,)e(SVR4,)f(and)f(Berkeley)h(cover)f(the)h(lion's)h(shar)o(e)365 -3108 y(of)i(the)g(terminal-driver)f(functionality)-9 -b(,)21 b(each)f(operating)h(system)g(inevitably)g(has)g(non-)365 -3207 y(standar)o(d)34 b(extensions.)71 b(While)36 b(a)f(particular)f -(scsh)i(implementation)h(may)e(pr)o(ovide)365 3307 y(these)21 -b(extensions,)h(they)f(ar)o(e)e(not)j(portable,)d(and)i(so)g(ar)o(e)e -(not)j(documented)f(her)o(e.)365 3564 y FB(3.12.2)81 -b(Miscellaneous)17 b(procedures)365 3775 y FA(\(tty?)42 -b FC(fd/port)p FA(\))85 b Fw(\000)-14 b(!)87 b FC(boolean)1399 -b FD(pr)o(ocedur)o(e)573 3900 y(Return)21 b(tr)o(ue)g(if)f(the)h(ar)o -(gument)g(is)g(a)f(tty)-9 b(.)365 4096 y FA(\(tty-file-name)38 -b FC(fd/port)p FA(\))85 b Fw(\000)-14 b(!)87 b FC(string)1054 -b FD(pr)o(ocedur)o(e)573 4238 y(The)24 b(ar)o(gument)f -FC(fd/port)f FD(must)j(be)e(a)h(\002le)g(descriptor)f(or)h(port)g(open) -g(on)h(a)e(tty)-9 b(.)35 b(Re-)573 4338 y(turn)21 b(the)g(\002le-name)f -(of)h(the)g(tty)-9 b(.)365 4613 y FB(3.12.3)81 b(The)20 -b(tty-info)g(record)h(type)365 4799 y FD(The)36 b(primary)e(data-str)o -(uctur)o(e)g(that)h(describes)g(a)f(terminal's)i(mode)f(is)h(a)f -FA(tty-info)365 4898 y FD(r)o(ecor)o(d,)19 b(de\002ned)h(as)h(follows:) -1756 5147 y(77)p eop -%%Page: 78 84 -78 83 bop 888 614 a FA(\(define-record)38 b(tty-info)976 -714 y(control-chars)81 b(;)43 b(String:)e(Magic)h(input)f(chars)976 -814 y(input-flags)169 b(;)43 b(Int:)f(Input)g(processing)976 -913 y(output-flags)125 b(;)43 b(Int:)f(Output)g(processing)976 -1013 y(control-flags)81 b(;)43 b(Int:)f(Serial-line)d(control)976 -1112 y(local-flags)169 b(;)43 b(Int:)f(Line-editting)d(UI)976 -1212 y(input-speed)169 b(;)43 b(Int:)f(Code)g(for)h(input)e(speed)976 -1312 y(output-speed)125 b(;)43 b(Int:)f(Code)g(for)h(output)e(speed)976 -1411 y(min)521 b(;)43 b(Int:)f(Raw-mode)f(input)g(policy)976 -1511 y(time\))433 b(;)43 b(Int:)f(Raw-mode)f(input)g(policy)681 -1966 y FB(The)20 b(control-characters)e(string)681 2204 -y FD(The)h FA(control-chars)13 b FD(\002eld)19 b(is)g(a)f(character)g -(string;)i(its)f(characters)e(may)i(be)g(indexed)f(by)681 -2304 y(integer)j(values)f(taken)h(fr)o(om)f(table)g(3.4.)805 -2471 y(As)28 b(discussed)f(above,)i(only)g(the)g(P)t -Fv(O)t(S)t(I)t(X)j FD(entries)27 b(in)h(table)g(3.4)e(ar)o(e)g -(guaranteed)h(to)681 2571 y(be)d(legal,)h(integer)f(indices.)37 -b(A)23 b(pr)o(ogram)h(can)g(r)o(eliably)g(test)g(the)h(OS)f(to)h(see)f -(if)g(the)g(non-)683 2670 y(P)t Fv(O)t(S)t(I)t(X)e FD(characters)17 -b(ar)o(e)h(supported)g(by)h(checking)g(the)g(index)f(constants.)26 -b(If)18 b(the)h(contr)o(ol-)681 2770 y(character)g(function)i(is)g -(supported)g(by)f(the)h(terminal)g(driver)-6 b(,)19 b(then)i(the)g -(corr)o(esponding)681 2870 y(index)c(will)h(be)e(bound)i(to)g(an)e -(integer;)j(if)e(it)g(is)g(not)h(supported,)g(the)f(index)g(will)h(be)f -(bound)681 2969 y(to)k FA(#f)p FD(.)805 3136 y(T)-8 b(o)58 -b(disable)f(a)g(given)h(contr)o(ol-character)e(function,)67 -b(set)57 b(its)h(corr)o(esponding)681 3236 y(entry)67 -b(in)g(the)g FA(tty-info:contro)o(l-)o(cha)o(rs)60 b -FD(string)67 b(to)h(the)e(special)h(character)681 3336 -y FA(disable-tty-char)21 b FD(\(and)27 b(then)h(use)g(the)f -FA(\(set-tty-info)39 b FC(fd/port)j(info)p FA(\))27 b -FD(pr)o(ocedur)o(e)681 3435 y(to)21 b(update)f(the)h(terminal's)g -(state\).)681 3795 y FB(The)f(\003ag)g(\002elds)681 4034 -y FD(The)48 b FA(tty-info)d FD(r)o(ecor)o(d's)i FA(input-flags)p -FD(,)k FA(output-flags)p FD(,)f FA(control-flags)p FD(,)f(and)681 -4134 y FA(local-flags)22 b FD(\002elds)k(ar)o(e)g(all)g(bit)h(sets)f(r) -o(epr)o(esented)f(as)h(two's-complement)i(integers.)681 -4233 y(Their)i(values)f(ar)o(e)g(composed)i(by)f(or)6 -b('ing)31 b(together)f(values)g(taken)g(fr)o(om)f(the)h(named)681 -4333 y(constants)21 b(listed)g(in)g(tables)g(3.5)e(thr)o(ough)j(3.9.) -805 4500 y(As)j(discussed)h(above,)f(only)h(the)i(P)t -Fv(O)t(S)t(I)t(X)h FD(entries)c(listed)g(in)h(these)g(tables)e(ar)o(e)g -(guar)o(-)681 4599 y(anteed)17 b(to)i(be)e(legal,)i(integer)f(\003ag)g -(values.)24 b(A)18 b(pr)o(ogram)f(can)h(r)o(eliably)f(test)i(the)f(OS)g -(to)g(see)681 4699 y(if)25 b(the)g(non-)r(P)t Fv(O)t(S)t(I)t(X)k -FD(\003ags)c(ar)o(e)e(supported)i(by)g(checking)h(the)f(named)f -(constants.)39 b(If)25 b(the)681 4799 y(featur)o(e)17 -b(is)i(supported)g(by)g(the)g(terminal)g(driver)-6 b(,)19 -b(then)g(the)g(corr)o(esponding)g(\003ag)h(will)f(be)681 -4898 y(bound)i(to)g(an)g(integer;)f(if)h(it)g(is)g(not)g(supported,)g -(the)f(\003ag)h(will)h(be)e(bound)h(to)g FA(#f)p FD(.)2071 -5147 y(78)p eop -%%Page: 79 85 -79 84 bop 365 614 a FB(The)21 b(speed)e(\002elds)365 -797 y FD(The)27 b FA(input-speed)22 b FD(and)k FA(output-speed)c -FD(\002elds)k(determine)h(the)g(I/O)g(rate)e(of)i(the)g(ter)o(-)365 -897 y(minal's)20 b(line.)26 b(The)19 b(value)g(of)h(these)f(\002elds)h -(is)g(an)f(integer)g(giving)i(the)e(speed)g(in)h(bits-per)o(-)365 -997 y(second.)26 b(The)21 b(following)h(speeds)e(ar)o(e)g(supported)g -(by)j(P)t Fv(O)t(S)t(I)t(X)r FD(:)1417 1169 y(0)100 b(134)139 -b(600)h(4800)1376 1269 y(50)99 b(150)f(1200)139 b(9600)1376 -1368 y(75)99 b(200)f(1800)f(19200)1339 1468 y(1)-5 b(10)99 -b(300)f(2400)f(38400)365 1638 y(Y)-8 b(our)27 b(OS)g(may)f(accept)f -(others;)k(it)e(may)f(also)g(allow)h(the)f(special)g(symbols)i -FA('exta)c FD(and)365 1738 y FA('extb)p FD(.)365 1984 -y FB(The)d(min)f(and)f(time)h(\002elds)365 2167 y FD(The)31 -b(integer)f FA(min)f FD(and)h FA(time)e FD(\002elds)i(determine)g -(input)h(blocking)g(behaviour)f(during)365 2266 y(non-canonical)19 -b(\(raw\))e(input;)i(otherwise,)h(they)e(ar)o(e)f(ignor)o(ed.)24 -b(See)17 b(the)i(termios\(3\))e(man)365 2366 y(page)j(for)h(further)f -(details.)490 2491 y(Be)29 b(warned)f(that)k(P)t Fv(O)t(S)t(I)t(X)g -FD(allows)e(the)g(base)f(system)h(call's)f(r)o(epr)o(esentation)f(of)h -(the)365 2590 y FA(tty-info)14 b FD(r)o(ecor)o(d)h(to)i(shar)o(e)e -(storage)i(for)f(the)h FA(min)f FD(\002eld)g(and)g(the)h -FA(ttychar/eof)12 b FD(element)365 2690 y(of)32 b(the)f(contr)o -(ol-characters)f(string,)k(and)d(for)g(the)h FA(time)e -FD(\002eld)h(and)g(the)g FA(ttychar/eol)365 2789 y FD(element)20 -b(of)f(the)g(contr)o(ol-characters)f(string.)26 b(Many)18 -b(implementations)j(in)f(fact)e(do)h(this.)490 2914 y(T)-8 -b(o)19 b(stay)g(out)g(of)g(tr)o(ouble,)f(set)h(the)g -FA(min)f FD(and)g FA(time)f FD(\002elds)i(only)h(if)e(you)i(ar)o(e)d -(putting)i(the)365 3014 y(terminal)25 b(into)h(raw)f(mode;)i(set)e(the) -g(eof)f(and)h(eol)g(contr)o(ol-characters)f(only)i(if)e(you)i(ar)o(e) -365 3113 y(putting)c(the)f(terminal)g(into)g(canonical)g(mode.)26 -b(It's)21 b(ugly)-9 b(,)20 b(but)h(it's)h(Unix.)365 3360 -y FB(3.12.4)81 b(Using)20 b(tty-info)f(records)365 3557 -y FA(\(make-tty-info)38 b FC(if)16 b(of)g(cf)f(lf)h(ispeed)g(ospeed)g -(min)f(time)p FA(\))43 b Fw(\000)-14 b(!)43 b FC(tty-info-r)o(ecord)85 -b FD(pr)o(ocedur)o(e)365 3657 y FA(\(copy-tty-info)38 -b FC(tty-info-r)o(ecord)p FA(\))85 b Fw(\000)-15 b(!)88 -b FC(tty-info-r)o(ecord)504 b FD(pr)o(ocedur)o(e)573 -3777 y(These)24 b(pr)o(ocedur)o(es)f(make)h(it)h(possible)g(to)f(cr)o -(eate)f(new)i FA(tty-info)c FD(r)o(ecor)o(ds.)35 b(The)573 -3876 y(typical)18 b(method)g(for)g(cr)o(eating)f(a)g(new)i(r)o(ecor)o -(d)d(is)i(to)h(copy)f(one)g(r)o(etrieved)e(by)i(a)g(call)573 -3976 y(to)27 b(the)f FA(tty-info)d FD(pr)o(ocedur)o(e,)i(then)i(modify) -g(the)f(copy)h(as)f(desir)o(ed.)40 b(Note)27 b(that)573 -4075 y(the)32 b FA(make-tty-info)26 b FD(pr)o(ocedur)o(e)k(does)i(not)g -(take)f(a)h(parameter)e(to)i(de\002ne)f(the)573 4175 -y(new)d(r)o(ecor)o(d's)e(contr)o(ol)i(characters.)1760 -4145 y Fs(4)1839 4175 y FD(Instead,)h(it)f(simply)g(r)o(eturns)g(a)f -FA(tty-info)573 4275 y FD(r)o(ecor)o(d)16 b(whose)i(contr)o -(ol-character)e(string)i(has)f(all)g(elements)h(initialised)g(to)i(A)t -Fv(S)t(C)t(I)t(I)573 4374 y FD(nul.)77 b(Y)-8 b(ou)38 -b(may)g(then)g(install)g(the)g(special)f(characters)g(by)h(assigning)g -(to)g(the)573 4474 y(string.)43 b(Similarly)-9 b(,)27 -b(the)g(contr)o(ol-character)d(string)k(in)e(the)h(r)o(ecor)o(d)d(pr)o -(oduced)h(by)573 4574 y FA(copy-tty-info)16 b FD(does)22 -b(not)g(shar)o(e)f(str)o(uctur)o(e)g(with)i(the)f(string)g(in)g(the)g -(r)o(ecor)o(d)e(be-)573 4673 y(ing)h(copied,)f(so)i(you)f(may)g(mutate) -f(it)h(fr)o(eely)-9 b(.)p 365 4740 1146 4 v 456 4796 -a Fr(4)485 4819 y Fv(Why?)23 b(Because)17 b(the)f(length)h(of)g(the)g -(string)g(varies)g(fr)o(om)h(Unix)f(to)g(Unix.)22 b(For)c(example,)f -(the)f(wor)o(d-erase)365 4898 y(contr)o(ol)i(character)f(\(typically)h -(contr)o(ol-w\))g(is)f(pr)o(ovided)f(by)g(most)g(Unixes,)g(but)g(not)h -(part)f(of)h(the)h(P)t Fq(O)t(S)t(I)t(X)d Fv(spec.)1756 -5147 y FD(79)p eop -%%Page: 80 86 -80 85 bop 681 614 a FA(\(tty-info)40 b FC(fd/port)p FA(\))85 -b Fw(\000)-14 b(!)87 b FC(tty-info-r)o(ecord)983 b FD(pr)o(ocedur)o(e) -888 755 y(The)33 b FC(fd/port)e FD(parameter)g(is)i(an)f(integer)g -(\002le)h(descriptor)f(or)h(Scheme)f(I/O)h(port)888 855 -y(opened)24 b(on)h(a)f(terminal)g(device.)35 b(This)25 -b(pr)o(ocedur)o(e)d(r)o(eturns)i(a)g FA(tty-info)d FD(r)o(ecor)o(d)888 -954 y(describing)g(the)g(terminal's)g(curr)o(ent)f(mode.)681 -1144 y FA(\(set-tty-info/no)o(w)37 b FC(fd/port)20 b(info)p -FA(\))87 b Fw(\000)-15 b(!)87 b FC(no-value)685 b FD(pr)o(ocedur)o(e) -681 1244 y FA(\(set-tty-info/dr)o(ai)o(n)38 b FC(fd/port)19 -b(info)p FA(\))87 b Fw(\000)-15 b(!)88 b FC(no-value)597 -b FD(pr)o(ocedur)o(e)681 1344 y FA(\(set-tty-info/fl)o(us)o(h)38 -b FC(fd/port)19 b(info)p FA(\))87 b Fw(\000)-15 b(!)88 -b FC(no-value)597 b FD(pr)o(ocedur)o(e)888 1484 y(The)33 -b FC(fd/port)e FD(parameter)g(is)i(an)f(integer)g(\002le)h(descriptor)f -(or)h(Scheme)f(I/O)h(port)888 1584 y(opened)d(on)h(a)e(terminal)h -(device.)53 b(The)30 b(pr)o(ocedur)o(e)e(chosen)j(determines)e(when)888 -1683 y(and)21 b(how)g(the)g(terminal's)g(mode)g(is)g(alter)o(ed:)p -1004 1730 2425 4 v 1004 1829 4 100 v 1057 1800 a(Pr)o(ocedur)o(e)508 -b(Meaning)p 3426 1829 V 1004 1833 2425 4 v 1004 1849 -V 1004 1949 4 100 v 1057 1919 a FA(set-tty-info/now)181 -b FD(Make)19 b(change)i(immediately)-9 b(.)p 3426 1949 -V 1004 2049 V 1057 2019 a FA(set-tty-info/drai)o(n)94 -b FD(Drain)20 b(output,)h(then)h(change.)p 3426 2049 -V 1004 2148 V 1057 2118 a FA(set-tty-info/flus)o(h)94 -b FD(Drain)20 b(output,)h(\003ush)h(input,)f(then)g(change.)p -3426 2148 V 1004 2152 2425 4 v 681 2387 a FB(3.12.5)80 -b(Other)20 b(terminal-device)d(procedures)681 2594 y -FA(\(send-tty-break)37 b FC(fd/port)19 b([duration])p -FA(\))86 b Fw(\000)-14 b(!)87 b FC(no-value)555 b FD(pr)o(ocedur)o(e) -888 2719 y(Send)34 b(a)g(br)o(eak)e(signal)j(on)g(the)f(terminal)g -(associated)g(with)h(\002le)f(descriptor)g(or)888 2818 -y(Scheme)18 b(I/O)h(port)f FC(fd/port)o FD(.)24 b(A)18 -b(br)o(eak)f(signal)i(is)g(a)e(sequence)i(of)f(continuous)i(zer)o(os) -888 2918 y(on)i(the)f(terminal's)g(transmission)h(line.)888 -3050 y(The)h FC(duration)f FD(ar)o(gument)f(determines)i(the)f(length)h -(of)g(the)f(br)o(eak)f(signal.)31 b(A)22 b(zer)o(o)888 -3150 y(value)i(\(the)g(default\))f(causes)h(a)g(br)o(eak)f(of)h -(between)g(0.25)f(and)h(0.5)f(seconds)i(to)f(be)888 3250 -y(sent;)d(other)f(values)f(determine)h(a)f(period)h(in)g(a)f(manner)h -(that)g(will)g(depend)f(upon)888 3349 y(local)i(community)h(standar)o -(ds.)681 3539 y FA(\(drain-tty)39 b FC(fd/port)p FA(\))85 -b Fw(\000)-14 b(!)87 b FC(no-value)1140 b FD(pr)o(ocedur)o(e)888 -3680 y(This)27 b(pr)o(ocedur)o(e)e(waits)i(until)g(all)g(the)f(output)h -(written)g(to)g(the)g(terminal)g(device)888 3780 y(has)37 -b(been)g(transmitted)g(to)g(the)g(device.)73 b(If)36 -b FC(fd/port)f FD(is)i(an)g(output)g(port)g(with)888 -3879 y(buf)o(fer)o(ed)19 b(I/O)j(enabled,)f(then)g(the)h(port's)g(buf)o -(fer)o(ed)d(characters)h(ar)o(e)g(\003ushed)i(be-)888 -3979 y(for)o(e)e(waiting)h(for)g(the)g(device)f(to)h(drain.)681 -4169 y FA(\(flush-tty/input)37 b FC(fd/port)p FA(\))85 -b Fw(\000)-14 b(!)87 b FC(no-value)878 b FD(pr)o(ocedur)o(e)681 -4269 y FA(\(flush-tty/outpu)o(t)37 b FC(fd/port)p FA(\))86 -b Fw(\000)-15 b(!)87 b FC(no-value)835 b FD(pr)o(ocedur)o(e)681 -4368 y FA(\(flush-tty/both)37 b FC(fd/port)p FA(\))85 -b Fw(\000)-14 b(!)87 b FC(no-value)922 b FD(pr)o(ocedur)o(e)888 -4509 y(These)33 b(pr)o(ocedur)o(es)e(discar)o(d)h(the)h(unr)o(ead)f -(input)h(chars)g(or)g(unwritten)h(output)888 4609 y(chars)21 -b(in)g(the)g(tty's)g(kernel)g(buf)o(fers.)681 4799 y -FA(\(start-tty-outpu)o(t)37 b FC(fd/port)p FA(\))86 b -Fw(\000)-15 b(!)87 b FC(no-value)835 b FD(pr)o(ocedur)o(e)681 -4898 y FA(\(stop-tty-output)37 b FC(fd/port)p FA(\))85 -b Fw(\000)-14 b(!)87 b FC(no-value)878 b FD(pr)o(ocedur)o(e)2071 -5147 y(80)p eop -%%Page: 81 87 -81 86 bop 365 614 a FA(\(start-tty-input)37 b FC(fd/port)p -FA(\))85 b Fw(\000)-14 b(!)87 b FC(no-value)879 b FD(pr)o(ocedur)o(e) -365 714 y FA(\(stop-tty-input)38 b FC(fd/port)p FA(\))85 -b Fw(\000)-14 b(!)87 b FC(no-value)922 b FD(pr)o(ocedur)o(e)573 -861 y(These)37 b(pr)o(ocedur)o(es)f(can)h(be)g(used)h(to)g(contr)o(ol)f -(a)h(terminal's)f(input)h(and)f(out-)573 961 y(put)22 -b(\003ow)-8 b(.)31 b(The)22 b FA(stop-tty-output)16 b -FD(and)22 b FA(start-tty-outpu)o(t)16 b FD(pr)o(ocedur)o(es)k(sus-)573 -1060 y(pend)27 b(and)h(r)o(esume)f(output)i(fr)o(om)e(a)g(terminal)h -(device.)46 b(The)28 b FA(stop-tty-input)573 1160 y FD(and)21 -b FA(start-tty-input)15 b FD(pr)o(ocedur)o(es)k(transmit)j(the)g -(special)f(ST)o(OP)f(and)h(ST)-6 b(AR)m(T)573 1259 y(characters)19 -b(to)h(the)g(terminal)h(with)g(the)f(intention)h(of)g(stopping)g(and)e -(starting)i(ter)o(-)573 1359 y(minal)g(input)g(\003ow)-8 -b(.)365 1652 y FB(3.12.6)81 b(Control)20 b(terminals,)e(sessions,)h -(and)h(terminal)f(process)h(groups)365 1868 y FA(\(open-control-tty)37 -b FC(tty-name)19 b([\003ags])p FA(\))86 b Fw(\000)-14 -b(!)87 b FC(port)678 b FD(pr)o(ocedur)o(e)573 1996 y(This)18 -b(pr)o(ocedur)o(e)e(opens)i(terminal)g(device)f FC(tty-name)g -FD(as)g(the)h(pr)o(ocess')g(contr)o(ol)g(ter)o(-)573 -2095 y(minal)j(\(see)g(the)g FA(termios)d FD(man)k(page)e(for)h(mor)o -(e)g(information)h(on)f(contr)o(ol)h(termi-)573 2195 -y(nals\).)29 b(The)22 b FC(tty-name)e FD(ar)o(gument)i(is)g(a)g -(\002le-name)g(such)g(as)g FA(/dev/ttya)p FD(.)k(The)c -FC(\003ags)573 2295 y FD(ar)o(gument)29 b(is)g(a)g(value)g(suitable)g -(as)g(the)h(second)f(ar)o(gument)g(to)h(the)f FA(open-file)573 -2394 y FD(call;)g(it)f(defaults)e(to)h FA(open/read+write)p -FD(,)22 b(causing)27 b(the)h(terminal)f(to)g(be)g(opened)573 -2494 y(for)20 b(both)i(input)f(and)f(output.)573 2633 -y(The)h(port)g(r)o(eturned)f(is)i(an)e(input)i(port)f(if)g(the)g -FC(\003ags)g FD(permit)h(it,)f(otherwise)h(an)e(out-)573 -2732 y(put)j(port.)33 b(R4RS/Scheme)23 b(48/scsh)h(do)f(not)h(have)f -(input/output)h(ports,)g(so)g(it's)573 2832 y(one)i(or)f(the)h(other)-6 -b(.)40 b(However)-6 b(,)26 b(you)g(can)f(get)g(both)h(r)o(ead)e(and)h -(write)h(ports)f(open)573 2931 y(on)e(a)e(terminal)h(by)h(opening)g(it) -f(r)o(ead/write,)f(taking)h(the)g(r)o(esult)g(input)h(port,)f(and)573 -3031 y(duping)f(it)g(to)g(an)g(output)g(port)g(with)g -FA(dup->outport)p FD(.)573 3170 y(This)d(pr)o(ocedur)o(e)e(guarantees)h -(to)h(make)g(the)g(opened)f(terminal)h(the)g(pr)o(ocess')f(con-)573 -3269 y(tr)o(ol)29 b(terminal)g(only)h(if)f(the)h(pr)o(ocess)e(does)h -(not)h(have)f(an)g(assigned)g(contr)o(ol)h(ter)o(-)573 -3369 y(minal)h(at)g(the)g(time)h(of)f(the)g(call.)57 -b(If)30 b(the)i(scsh)f(pr)o(ocess)g(alr)o(eady)e(has)j(a)e(contr)o(ol) -573 3469 y(terminal,)20 b(the)h(r)o(esults)g(ar)o(e)e(unde\002ned.)573 -3607 y(T)-8 b(o)19 b(arrange)e(for)i(the)f(pr)o(ocess)h(to)g(have)f(no) -h(contr)o(ol)g(terminal)f(prior)h(to)g(calling)g(this)573 -3707 y(pr)o(ocedur)o(e,)f(use)j(the)g FA(become-session-l)o(ead)o(er)14 -b FD(pr)o(ocedur)o(e.)365 3915 y FA(\(become-session-l)o(ea)o(der)o(\)) -81 b Fw(\000)-14 b(!)87 b FC(integer)944 b FD(pr)o(ocedur)o(e)573 -4062 y(This)20 b(is)g(the)g(C)g FA(setsid\(\))c FD(call.)27 -b(P)t Fv(O)t(S)t(I)t(X)c FD(job-contr)o(ol)d(has)g(a)f(thr)o(ee-level)g -(hierar)o(chy:)573 4162 y(session/pr)o(ocess-gr)o(oup/pr)o(ocess.)31 -b(Every)22 b(session)i(has)f(an)f(associated)g(contr)o(ol)573 -4262 y(terminal.)59 b(This)32 b(pr)o(ocedur)o(e)e(places)h(the)h(curr)o -(ent)g(pr)o(ocess)f(into)i(a)e(brand)g(new)573 4361 y(session,)f(and)e -(disassociates)g(the)g(pr)o(ocess)f(fr)o(om)g(any)h(pr)o(evious)g -(contr)o(ol)g(termi-)573 4461 y(nal.)d(Y)-8 b(ou)20 b(may)e -(subsequently)i(use)f FA(open-control-tty)12 b FD(to)20 -b(open)f(a)f(new)h(contr)o(ol)573 4560 y(terminal.)573 -4699 y(It)34 b(is)h(an)f(err)o(or)f(to)i(call)e(this)i(pr)o(ocedur)o(e) -e(if)h(the)g(curr)o(ent)f(pr)o(ocess)h(is)h(alr)o(eady)d(a)573 -4799 y(pr)o(ocess-gr)o(oup)18 b(leader)-6 b(.)24 b(One)c(way)g(to)g -(guarantee)e(this)j(is)f(not)g(the)g(case)f(is)h(only)g(to)573 -4898 y(call)g(this)i(pr)o(ocedur)o(e)d(after)g(forking.)1756 +(ch-path)e(lists,)h(wher)o(e)g(element)g(or)o(der)888 +4666 y(is)h(signi\002cant.)888 4799 y FA(add-before)d +FD(adds)i FC(elt)i FD(to)g(the)f(list)h(immediately)g(befor)o(e)e(the)i +(\002rst)g(occurr)o(ence)e(of)888 4898 y FC(befor)o(e)g +FD(in)g(the)g(list.)25 b(If)19 b FC(befor)o(e)h FD(is)g(not)g(in)g(the) +g(list,)g FC(elt)f FD(is)h(added)d(to)j(the)g(end)f(of)g(the)h(list.) +2071 5147 y(76)p eop +%%Page: 77 85 +77 84 bop 573 614 a FA(add-after)18 b FD(is)j(similar:)27 +b FC(elt)22 b FD(is)f(added)f(after)g(the)i(last)f(occurr)o(ence)g(of)g +FC(after)p FD(.)27 b(If)21 b FC(after)573 714 y FD(is)g(not)g(found,)g +FC(elt)g FD(is)g(added)e(to)i(the)g(beginning)h(of)f(the)g(list.)573 +872 y(Neither)16 b(function)h(destr)o(uctively)f(alters)f(the)h +(original)h(path-list.)24 b(The)16 b(r)o(esult)g(may)573 +971 y(shar)o(e)k(str)o(uctur)o(e)h(with)h(the)f(original)h(list.)28 +b(Both)21 b(functions)h(use)g FA(equal?)c FD(for)j(com-)573 +1071 y(paring)f(elements.)365 1447 y FB(3.1)m(1.2)81 +b FA($USER)p FB(,)18 b FA($HOME)p FB(,)h(and)g FA($PATH)365 +1679 y FD(Like)26 b(sh)g(and)f(unlike)h(csh,)i(scsh)e(has)f +FC(no)h FD(interactive)f(dependencies)g(on)h(envir)o(onmen-)365 +1779 y(t)h(variables.)44 b(It)27 b(does,)h(however)-6 +b(,)28 b(initialise)g(certain)e(internal)h(values)g(at)g(startup)f +(time)365 1879 y(fr)o(om)j(the)g(initial)g(pr)o(ocess)g(envir)o +(onment,)i(in)f(particular)e FA($HOME)e FD(and)j FA($PATH)p +FD(.)e(Scsh)i(n-)365 1978 y(ever)e(uses)g FA($USER)f +FD(at)g(all.)45 b(It)28 b(computes)f FA(\(user-login-name\))21 +b FD(fr)o(om)26 b(the)i(system)g(call)365 2078 y FA(\(user-uid\))p +FD(.)365 2252 y FA(home-directory)2046 b FC(string)365 +2352 y FA(exec-path-list)1914 b FC(string)21 b FD(list)573 +2518 y(Scsh)28 b(accesses)g FA($HOME)e FD(at)i(start-up)g(time,)i(and)e +(stor)o(es)h(the)f(value)g(in)h(the)f(global)573 2618 +y(variable)19 b FA(home-directory)p FD(.)g(It)i(uses)f(this)h(value)f +(for)g FA(~)f FD(lookups)j(and)e(for)g(r)o(eturn-)573 +2717 y(ing)h(to)g(home)h(on)f FA(\(chdir\))p FD(.)573 +2875 y(Scsh)g(accesses)g FA($PATH)f FD(at)h(start-up)g(time,)h +(colon-splits)h(the)f(path)f(list,)h(and)g(stor)o(es)573 +2975 y(the)33 b(value)f(in)h(the)f(global)h(variable)e +FA(exec-path-list)p FD(.)55 b(This)33 b(list)h(is)e(used)h(for)573 +3074 y FA(exec-path)17 b FD(and)j FA(exec-path/env)c +FD(sear)o(ches.)365 3477 y Fy(3.12)99 b(T)-11 b(erminal)25 +b(device)g(control)365 3740 y FD(Scsh)g(pr)o(ovides)g(a)f(complete)i +(set)f(of)g(r)o(outines)g(for)g(manipulating)h(terminal)f(devices\227) +365 3840 y(putting)g(them)g(in)g(\223raw\224)d(mode,)j(changing)g(and)f +(querying)h(their)f(special)g(characters,)365 3939 y(modifying)j(their) +e(i/o)h(speeds,)g(and)f(so)h(forth.)39 b(The)25 b(scsh)h(interface)e +(is)i(designed)f(both)365 4039 y(for)34 b(generality)g(and)g +(portability)g(acr)o(oss)g(dif)o(fer)o(ent)e(Unix)i(platforms,)k(so)c +(you)h(don't)365 4139 y(have)29 b(to)h(r)o(ewrite)f(your)g(pr)o(ogram)g +(each)g(time)h(you)g(move)g(to)g(a)f(new)g(system.)53 +b(W)-8 b(e've)365 4238 y(also)30 b(made)g(an)g(ef)o(fort)e(to)j(use)f +(r)o(easonable,)h(Scheme-like)e(names)h(for)g(the)g(multitudi-)365 +4338 y(nous)h(named)f(constants)h(involved,)h(so)f(when)f(you)h(ar)o(e) +d(r)o(eading)h(code,)j(you'll)f(have)365 4437 y(less)c(likelihood)g(of) +f(getting)h(lost)g(in)f(a)g(bewildering)g(maze)g(of)g(obfuscatory)g +(constants)365 4537 y(named)21 b FA(ICRNL)p FD(,)d FA(INPCK)p +FD(,)h FA(IUCLC)p FD(,)f(and)i FA(ONOCR)p FD(.)490 4699 +y(This)25 b(section)g(can)f(only)h(lay)f(out)h(the)g(basic)f +(functionality)h(of)f(the)h(terminal)f(device)365 4799 +y(interface.)36 b(For)25 b(further)g(details,)g(see)f(the)h +(termios\(3\))f(man)h(page)f(on)h(your)g(system,)h(or)365 +4898 y(consult)c(one)f(of)g(the)g(standar)o(d)e(Unix)i(texts.)1756 +5147 y(77)p eop +%%Page: 78 86 +78 85 bop 681 614 a FB(3.12.1)80 b(Portability)19 b(across)h(OS)h +(variants)681 800 y FD(T)-8 b(erminal-contr)o(ol)28 b(softwar)o(e)f(is) +i(inescapably)e(complex,)j(ugly)-9 b(,)30 b(and)e(low-level.)47 +b(Unix)681 900 y(variants)25 b(each)h(pr)o(ovide)f(their)h(own)h(way)f +(of)g(contr)o(olling)h(terminal)f(devices,)g(making)681 +1000 y(it)19 b(dif)o(\002cult)g(to)h(pr)o(ovide)f(interfaces)f(that)i +(ar)o(e)e(portable)h(acr)o(oss)g(dif)o(fer)o(ent)e(Unix)i(systems.)681 +1099 y(Scsh's)27 b(terminal)g(support)g(is)h(based)e(primarily)h(upon)g +(the)i(P)t Fv(O)t(S)t(I)t(X)i FD(termios)c(interface.)681 +1199 y(Pr)o(ograms)i(that)g(can)h(be)f(written)h(using)g(only)g(the)i +(P)t Fv(O)t(S)t(I)t(X)h FD(interface)28 b(ar)o(e)g(likely)i(to)g(be)681 +1299 y(widely)21 b(portable.)805 1426 y(The)f(bulk)g(of)g(the)g +(documentation)h(that)e(follows)i(consists)g(of)f(several)f(pages)g +(worth)681 1525 y(of)25 b(tables)h(de\002ning)g(dif)o(fer)o(ent)d +(named)j(constants)g(that)g(enable)f(and)g(disable)g(dif)o(fer)o(ent) +681 1625 y(featur)o(es)20 b(of)i(the)g(terminal)f(driver)-6 +b(.)28 b(Some)22 b(of)g(these)g(\003ags)g(ar)o(e)g(P)t +Fv(O)t(S)t(I)t(X)r FD(;)i(others)e(ar)o(e)e(taken)681 +1724 y(fr)o(om)d(the)h(two)g(common)h(branches)e(of)h(Unix)f +(development,)h(SVR4)f(and)h(4.3+)e(Berkeley)-9 b(.)681 +1824 y(Scsh)21 b(guarantees)e(that)i(the)g(non-)r(P)t +Fv(O)t(S)t(I)t(X)k FD(constants)d(will)f(be)f(bound)i(identi\002ers.) +805 2019 y Fw(\017)41 b FD(If)22 b(your)h(OS)f(supports)h(a)f +(particular)f(non-)r(P)t Fv(O)t(S)t(I)t(X)26 b FD(\003ag,)d(its)f +(named)g(constant)h(will)888 2119 y(be)e(bound)g(to)g(the)g(\003ag's)g +(value.)805 2288 y Fw(\017)41 b FD(If)26 b(your)h(OS)f(doesn't)g +(support)h(the)f(\003ag,)h(its)g(named)f(constant)g(will)h(be)f(pr)o +(esent,)888 2387 y(but)21 b(bound)g(to)g FA(#f)p FD(.)681 +2582 y(This)29 b(means)g(that)f(if)h(you)g(want)g(to)g(use)g(SVR4)f(or) +h(Berkeley)f(featur)o(es)f(in)i(a)f(pr)o(ogram,)681 2682 +y(your)22 b(pr)o(ogram)g(can)g(portably)g(test)g(the)g(values)g(of)g +(the)h(\003ags)f(befor)o(e)f(using)i(them\227the)681 +2782 y(\003ags)29 b(can)g(r)o(eliably)f(be)g(r)o(efer)o(enced)e +(without)k(pr)o(oducing)f(OS-dependent)f(\223unbound)681 +2881 y(variable\224)19 b(err)o(ors.)805 3008 y(Finally)-9 +b(,)19 b(note)f(that)g(although)j(P)t Fv(O)t(S)t(I)t(X)r +FD(,)f(SVR4,)d(and)h(Berkeley)f(cover)h(the)g(lion's)h(shar)o(e)681 +3108 y(of)i(the)f(terminal-driver)g(functionality)-9 +b(,)21 b(each)f(operating)h(system)h(inevitably)f(has)f(non-)681 +3207 y(standar)o(d)34 b(extensions.)70 b(While)36 b(a)f(particular)g +(scsh)h(implementation)g(may)g(pr)o(ovide)681 3307 y(these)21 +b(extensions,)g(they)g(ar)o(e)f(not)h(portable,)f(and)g(so)i(ar)o(e)d +(not)i(documented)g(her)o(e.)681 3564 y FB(3.12.2)80 +b(Miscellaneous)18 b(procedures)681 3775 y FA(\(tty?)41 +b FC(fd/port)p FA(\))86 b Fw(\000)-15 b(!)87 b FC(boolean)1399 +b FD(pr)o(ocedur)o(e)888 3900 y(Return)22 b(tr)o(ue)e(if)h(the)g(ar)o +(gument)f(is)h(a)f(tty)-9 b(.)681 4096 y FA(\(tty-file-name)38 +b FC(fd/port)p FA(\))85 b Fw(\000)-14 b(!)87 b FC(string)1053 +b FD(pr)o(ocedur)o(e)888 4238 y(The)24 b(ar)o(gument)f +FC(fd/port)g FD(must)h(be)g(a)f(\002le)h(descriptor)g(or)f(port)h(open) +h(on)f(a)f(tty)-9 b(.)35 b(Re-)888 4338 y(turn)21 b(the)g(\002le-name)g +(of)f(the)h(tty)-9 b(.)681 4613 y FB(3.12.3)80 b(The)21 +b(tty-info)e(record)i(type)681 4799 y FD(The)35 b(primary)g(data-str)o +(uctur)o(e)e(that)i(describes)g(a)g(terminal's)h(mode)f(is)h(a)e +FA(tty-info)681 4898 y FD(r)o(ecor)o(d,)19 b(de\002ned)h(as)g(follows:) +2071 5147 y(78)p eop +%%Page: 79 87 +79 86 bop 573 614 a FA(\(define-record)38 b(tty-info)660 +714 y(control-chars)82 b(;)43 b(String:)e(Magic)g(input)h(chars)660 +814 y(input-flags)170 b(;)43 b(Int:)f(Input)f(processing)660 +913 y(output-flags)126 b(;)43 b(Int:)f(Output)f(processing)660 +1013 y(control-flags)82 b(;)43 b(Int:)f(Serial-line)d(control)660 +1112 y(local-flags)170 b(;)43 b(Int:)f(Line-editting)c(UI)660 +1212 y(input-speed)170 b(;)43 b(Int:)f(Code)g(for)g(input)g(speed)660 +1312 y(output-speed)126 b(;)43 b(Int:)f(Code)g(for)g(output)f(speed)660 +1411 y(min)522 b(;)43 b(Int:)f(Raw-mode)e(input)i(policy)660 +1511 y(time\))434 b(;)43 b(Int:)f(Raw-mode)e(input)i(policy)365 +1966 y FB(The)21 b(control-characters)d(string)365 2204 +y FD(The)h FA(control-chars)14 b FD(\002eld)k(is)i(a)e(character)f +(string;)j(its)f(characters)f(may)h(be)f(indexed)g(by)365 +2304 y(integer)j(values)f(taken)h(fr)o(om)f(table)h(3.4.)490 +2471 y(As)27 b(discussed)h(above,)g(only)h(the)h(P)t +Fv(O)t(S)t(I)t(X)h FD(entries)d(in)g(table)f(3.4)g(ar)o(e)f(guaranteed) +g(to)365 2571 y(be)e(legal,)h(integer)g(indices.)36 b(A)24 +b(pr)o(ogram)g(can)g(r)o(eliably)f(test)i(the)f(OS)g(to)h(see)f(if)g +(the)h(non-)367 2670 y(P)t Fv(O)t(S)t(I)t(X)d FD(characters)c(ar)o(e)f +(supported)h(by)h(checking)g(the)g(index)g(constants.)25 +b(If)19 b(the)g(contr)o(ol-)365 2770 y(character)g(function)j(is)f +(supported)f(by)h(the)f(terminal)h(driver)-6 b(,)20 b(then)h(the)f +(corr)o(esponding)365 2870 y(index)d(will)h(be)f(bound)g(to)h(an)f +(integer;)h(if)f(it)g(is)h(not)g(supported,)f(the)h(index)f(will)g(be)g +(bound)365 2969 y(to)k FA(#f)p FD(.)490 3136 y(T)-8 b(o)58 +b(disable)f(a)g(given)g(contr)o(ol-character)f(function,)67 +b(set)58 b(its)f(corr)o(esponding)365 3236 y(entry)67 +b(in)g(the)g FA(tty-info:control)o(-ch)o(ar)o(s)61 b +FD(string)67 b(to)g(the)g(special)f(character)365 3336 +y FA(disable-tty-char)21 b FD(\(and)27 b(then)h(use)g(the)g +FA(\(set-tty-info)38 b FC(fd/port)k(info)p FA(\))28 b +FD(pr)o(ocedur)o(e)365 3435 y(to)21 b(update)f(the)h(terminal's)g +(state\).)365 3795 y FB(The)g(\003ag)f(\002elds)365 4034 +y FD(The)49 b FA(tty-info)c FD(r)o(ecor)o(d's)i FA(input-flags)p +FD(,)j FA(output-flags)p FD(,)g FA(control-flags)p FD(,)g(and)365 +4134 y FA(local-flags)22 b FD(\002elds)27 b(ar)o(e)e(all)h(bit)h(sets)g +(r)o(epr)o(esented)d(as)j(two's-complement)h(integers.)365 +4233 y(Their)i(values)g(ar)o(e)f(composed)h(by)g(or)6 +b('ing)31 b(together)g(values)e(taken)h(fr)o(om)g(the)g(named)365 +4333 y(constants)22 b(listed)f(in)g(tables)f(3.5)g(thr)o(ough)h(3.9.) +490 4500 y(As)k(discussed)g(above,)h(only)g(the)h(P)t +Fv(O)t(S)t(I)t(X)i FD(entries)d(listed)f(in)h(these)f(tables)g(ar)o(e)f +(guar)o(-)365 4599 y(anteed)18 b(to)g(be)g(legal,)g(integer)g(\003ag)g +(values.)25 b(A)17 b(pr)o(ogram)h(can)g(r)o(eliably)f(test)h(the)g(OS)g +(to)h(see)365 4699 y(if)25 b(the)g(non-)r(P)t Fv(O)t(S)t(I)t(X)k +FD(\003ags)c(ar)o(e)f(supported)h(by)g(checking)g(the)g(named)g +(constants.)39 b(If)24 b(the)365 4799 y(featur)o(e)17 +b(is)j(supported)f(by)g(the)g(terminal)g(driver)-6 b(,)18 +b(then)i(the)f(corr)o(esponding)g(\003ag)g(will)h(be)365 +4898 y(bound)h(to)h(an)e(integer;)h(if)f(it)h(is)g(not)h(supported,)e +(the)h(\003ag)g(will)g(be)g(bound)g(to)g FA(#f)p FD(.)1756 +5147 y(79)p eop +%%Page: 80 88 +80 87 bop 681 614 a FB(The)20 b(speed)f(\002elds)681 +797 y FD(The)26 b FA(input-speed)c FD(and)27 b FA(output-speed)21 +b FD(\002elds)27 b(determine)f(the)h(I/O)g(rate)f(of)g(the)h(ter)o(-) +681 897 y(minal's)20 b(line.)25 b(The)20 b(value)f(of)g(these)h +(\002elds)f(is)h(an)f(integer)h(giving)g(the)g(speed)f(in)g(bits-per)o +(-)681 997 y(second.)25 b(The)c(following)h(speeds)f(ar)o(e)e +(supported)i(by)h(P)t Fv(O)t(S)t(I)t(X)r FD(:)1733 1175 +y(0)99 b(134)140 b(600)f(4800)1691 1275 y(50)99 b(150)f(1200)139 +b(9600)1691 1375 y(75)99 b(200)f(1800)g(19200)1654 1474 +y(1)-5 b(10)99 b(300)f(2400)g(38400)681 1650 y(Y)-8 b(our)27 +b(OS)f(may)g(accept)g(others;)j(it)d(may)g(also)h(allow)g(the)f +(special)g(symbols)h FA('exta)d FD(and)681 1750 y FA('extb)p +FD(.)681 1998 y FB(The)c(min)g(and)g(time)f(\002elds)681 +2181 y FD(The)30 b(integer)g FA(min)f FD(and)h FA(time)f +FD(\002elds)h(determine)g(input)h(blocking)g(behaviour)f(during)681 +2281 y(non-canonical)19 b(\(raw\))e(input;)i(otherwise,)g(they)g(ar)o +(e)d(ignor)o(ed.)25 b(See)17 b(the)h(termios\(3\))g(man)681 +2380 y(page)i(for)g(further)h(details.)805 2505 y(Be)29 +b(warned)g(that)i(P)t Fv(O)t(S)t(I)t(X)i FD(allows)d(the)f(base)g +(system)h(call's)f(r)o(epr)o(esentation)g(of)g(the)681 +2604 y FA(tty-info)13 b FD(r)o(ecor)o(d)i(to)i(shar)o(e)f(storage)g +(for)h(the)g FA(min)e FD(\002eld)i(and)f(the)h FA(ttychar/eof)12 +b FD(element)681 2704 y(of)31 b(the)h(contr)o(ol-characters)e(string,)k +(and)d(for)g(the)g FA(time)f FD(\002eld)h(and)g(the)h +FA(ttychar/eol)681 2804 y FD(element)19 b(of)g(the)h(contr)o +(ol-characters)d(string.)26 b(Many)19 b(implementations)h(in)g(fact)e +(do)i(this.)805 2928 y(T)-8 b(o)20 b(stay)e(out)i(of)e(tr)o(ouble,)h +(set)g(the)g FA(min)e FD(and)h FA(time)g FD(\002elds)g(only)i(if)f(you) +g(ar)o(e)e(putting)j(the)681 3028 y(terminal)25 b(into)h(raw)e(mode;)j +(set)e(the)g(eof)g(and)f(eol)i(contr)o(ol-characters)d(only)j(if)f(you) +g(ar)o(e)681 3127 y(putting)c(the)g(terminal)g(into)h(canonical)e +(mode.)26 b(It's)21 b(ugly)-9 b(,)21 b(but)g(it's)g(Unix.)681 +3375 y FB(3.12.4)80 b(Using)20 b(tty-info)g(records)681 +3576 y FA(\(make-tty-info)38 b FC(if)16 b(of)f(cf)h(lf)g(ispeed)g +(ospeed)f(min)h(time)p FA(\))42 b Fw(\000)-14 b(!)44 +b FC(tty-info-r)o(ecord)85 b FD(pr)o(ocedur)o(e)681 3676 +y FA(\(copy-tty-info)38 b FC(tty-info-r)o(ecord)p FA(\))84 +b Fw(\000)-14 b(!)87 b FC(tty-info-r)o(ecord)504 b FD(pr)o(ocedur)o(e) +888 3797 y(These)25 b(pr)o(ocedur)o(es)d(make)i(it)h(possible)g(to)g +(cr)o(eate)d(new)j FA(tty-info)c FD(r)o(ecor)o(ds.)35 +b(The)888 3896 y(typical)18 b(method)h(for)e(cr)o(eating)g(a)h(new)g(r) +o(ecor)o(d)e(is)j(to)f(copy)g(one)h(r)o(etrieved)d(by)i(a)f(call)888 +3996 y(to)27 b(the)f FA(tty-info)d FD(pr)o(ocedur)o(e,)j(then)h(modify) +f(the)h(copy)f(as)g(desir)o(ed.)41 b(Note)26 b(that)888 +4096 y(the)32 b FA(make-tty-info)27 b FD(pr)o(ocedur)o(e)i(does)j(not)h +(take)e(a)g(parameter)f(to)i(de\002ne)g(the)888 4195 +y(new)c(r)o(ecor)o(d's)f(contr)o(ol)h(characters.)2076 +4165 y Fs(4)2154 4195 y FD(Instead,)h(it)f(simply)h(r)o(eturns)e(a)g +FA(tty-info)888 4295 y FD(r)o(ecor)o(d)15 b(whose)j(contr)o +(ol-character)d(string)j(has)f(all)f(elements)h(initialised)h(to)h(A)t +Fv(S)t(C)t(I)t FD(-)890 4395 y Fv(I)36 b FD(nul.)63 b(Y)-8 +b(ou)34 b(may)f(then)h(install)f(the)h(special)e(characters)g(by)h +(assigning)h(to)g(the)888 4494 y(string.)43 b(Similarly)-9 +b(,)28 b(the)e(contr)o(ol-character)f(string)i(in)g(the)f(r)o(ecor)o(d) +f(pr)o(oduced)g(by)888 4594 y FA(copy-tty-info)17 b FD(does)k(not)i +(shar)o(e)e(str)o(uctur)o(e)g(with)h(the)g(string)h(in)f(the)g(r)o +(ecor)o(d)e(be-)888 4693 y(ing)i(copied,)e(so)h(you)h(may)e(mutate)h +(it)g(fr)o(eely)-9 b(.)p 681 4740 1146 4 v 771 4796 a +Fr(4)800 4819 y Fv(Why?)23 b(Because)18 b(the)e(length)g(of)i(the)e +(string)h(varies)h(fr)o(om)f(Unix)g(to)g(Unix.)22 b(For)c(example,)f +(the)f(wor)o(d-erase)681 4898 y(contr)o(ol)h(character)h(\(typically)f +(contr)o(ol-w\))h(is)f(pr)o(ovided)f(by)g(most)h(Unixes,)f(but)g(not)g +(part)h(of)g(the)g(P)t Fq(O)t(S)t(I)t(X)f Fv(spec.)2071 +5147 y FD(80)p eop +%%Page: 81 89 +81 88 bop 365 614 a FA(\(tty-info)40 b FC([fd/port/fname])p +FA(\))84 b Fw(\000)-14 b(!)87 b FC(tty-info-r)o(ecord)701 +b FD(pr)o(ocedur)o(e)573 743 y(The)28 b FC(fd/port/fname)f +FD(parameter)g(is)i(an)f(integer)h(\002le)f(descriptor)g(or)h(Scheme)f +(I/O)573 843 y(port)g(opened)g(on)h(a)f(terminal)g(device,)h(or)g(a)f +(\002le-name)f(for)i(a)e(terminal)i(device;)573 943 y(it)c(defaults)g +(to)g(the)h(curr)o(ent)e(input)i(port.)39 b(This)26 b(pr)o(ocedur)o(e)d +(r)o(eturns)i(a)g FA(tty-info)573 1042 y FD(r)o(ecor)o(d)19 +b(describing)i(the)g(terminal's)g(curr)o(ent)f(mode.)365 +1215 y FA(\(set-tty-info/now)37 b FC(fd/port/fname)19 +b(info)p FA(\))87 b Fw(\000)-15 b(!)88 b FC(no-value)457 +b FD(pr)o(ocedur)o(e)365 1315 y FA(\(set-tty-info/dra)o(in)37 +b FC(fd/port/fname)19 b(info)p FA(\))87 b Fw(\000)-15 +b(!)88 b FC(no-value)370 b FD(pr)o(ocedur)o(e)365 1414 +y FA(\(set-tty-info/flu)o(sh)37 b FC(fd/port/fname)19 +b(info)p FA(\))87 b Fw(\000)-15 b(!)88 b FC(no-value)370 +b FD(pr)o(ocedur)o(e)573 1543 y(The)28 b FC(fd/port/fname)f +FD(parameter)g(is)i(an)f(integer)h(\002le)f(descriptor)g(or)h(Scheme)f +(I/O)573 1643 y(port)g(opened)g(on)h(a)f(terminal)g(device,)h(or)g(a)f +(\002le-name)f(for)i(a)e(terminal)i(device.)573 1743 +y(The)21 b(pr)o(ocedur)o(e)f(chosen)i(determines)g(when)g(and)f(how)i +(the)f(terminal's)f(mode)h(is)573 1842 y(alter)o(ed:)p +689 1882 2425 4 v 689 1982 4 100 v 742 1952 a(Pr)o(ocedur)o(e)507 +b(Meaning)p 3110 1982 V 689 1985 2425 4 v 689 2002 V +689 2101 4 100 v 742 2072 a FA(set-tty-info/now)180 b +FD(Make)20 b(change)g(immediately)-9 b(.)p 3110 2101 +V 689 2201 V 742 2171 a FA(set-tty-info/dra)o(in)93 b +FD(Drain)21 b(output,)g(then)g(change.)p 3110 2201 V +689 2301 V 742 2271 a FA(set-tty-info/flu)o(sh)93 b FD(Drain)21 +b(output,)g(\003ush)h(input,)f(then)g(change.)p 3110 +2301 V 689 2304 2425 4 v 756 2432 a Fl(Oops:)49 b Fk(If)18 +b(I)f(had)h(de\002ned)g(these)f(with)i(the)f(parameters)e(in)i(the)g(r) +o(everse)e(or)o(der)-6 b(,)756 2523 y(I)18 b(could)g(have)i(made)e +Fh(fd/port/fname)i Fk(optional.)j(T)-7 b(oo)18 b(late)h(now)-7 +b(.)365 2833 y FB(3.12.5)81 b(Other)20 b(terminal-device)d(procedures) +365 3029 y FA(\(send-tty-break)38 b FC([fd/port/fname)18 +b(duration])p FA(\))86 b Fw(\000)-14 b(!)87 b FC(no-value)328 +b FD(pr)o(ocedur)o(e)573 3147 y(The)28 b FC(fd/port/fname)f +FD(parameter)g(is)i(an)f(integer)h(\002le)f(descriptor)g(or)h(Scheme)f +(I/O)573 3247 y(port)g(opened)g(on)h(a)f(terminal)g(device,)h(or)g(a)f +(\002le-name)f(for)i(a)e(terminal)i(device;)573 3347 +y(it)e(defaults)g(to)g(the)g(curr)o(ent)g(output)g(port.)45 +b(Send)27 b(a)g(br)o(eak)e(signal)j(to)g(the)f(desig-)573 +3446 y(nated)d(terminal.)36 b(A)24 b(br)o(eak)g(signal)h(is)f(a)g +(sequence)h(of)g(continuous)h(zer)o(os)d(on)i(the)573 +3546 y(terminal's)c(transmission)h(line.)573 3673 y(The)g +FC(duration)g FD(ar)o(gument)g(determines)g(the)h(length)g(of)f(the)h +(br)o(eak)e(signal.)31 b(A)22 b(zer)o(o)573 3772 y(value)i(\(the)g +(default\))f(causes)h(a)f(br)o(eak)g(of)i(between)f(0.25)e(and)i(0.5)f +(seconds)i(to)g(be)573 3872 y(sent;)20 b(other)g(values)g(determine)f +(a)h(period)f(in)h(a)g(manner)g(that)f(will)i(depend)e(upon)573 +3972 y(local)i(community)h(standar)o(ds.)365 4144 y FA(\(drain-tty)40 +b FC([fd/port/fname])p FA(\))84 b Fw(\000)-14 b(!)87 +b FC(no-value)857 b FD(pr)o(ocedur)o(e)573 4273 y(The)28 +b FC(fd/port/fname)f FD(parameter)g(is)i(an)f(integer)h(\002le)f +(descriptor)g(or)h(Scheme)f(I/O)573 4373 y(port)22 b(opened)g(on)h(a)f +(terminal)g(device,)g(or)g(a)g(\002le-name)f(for)h(a)g(terminal)g +(device;)g(it)573 4473 y(defaults)e(to)h(the)g(curr)o(ent)f(output)h +(port.)573 4599 y(This)27 b(pr)o(ocedur)o(e)e(waits)h(until)i(all)e +(the)h(output)g(written)g(to)g(the)g(terminal)f(device)573 +4699 y(has)20 b(been)h(transmitted)f(to)h(the)g(device.)j(If)c +FC(fd/port/fname)f FD(is)i(an)f(output)h(port)g(with)573 +4799 y(buf)o(fer)o(ed)e(I/O)j(enabled,)e(then)i(the)g(port's)f(buf)o +(fer)o(ed)e(characters)h(ar)o(e)g(\003ushed)i(be-)573 +4898 y(for)o(e)e(waiting)h(for)g(the)f(device)g(to)i(drain.)1756 5147 y(81)p eop -%%Page: 82 88 -82 87 bop 681 614 a FA(\(tty-process-gro)o(up)37 b FC(fd/port)p -FA(\))85 b Fw(\000)-14 b(!)87 b FC(integer)847 b FD(pr)o(ocedur)o(e)681 -714 y FA(\(set-tty-process)o(-g)o(rou)o(p)37 b FC(fd/port)19 -b(pgrp)p FA(\))86 b Fw(\000)-14 b(!)87 b FC(unde\002ned)400 -b FD(pr)o(ocedur)o(e)888 852 y(This)23 b(pair)e(of)h(pr)o(ocedur)o(es)e -(gets)i(and)g(sets)g(the)g(pr)o(ocess)f(gr)o(oup)h(of)g(a)f(given)h -(termi-)888 951 y(nal.)681 1137 y FA(\(control-tty-fil)o(e-)o(nam)o -(e\))80 b Fw(\000)-14 b(!)87 b FC(string)976 b FD(pr)o(ocedur)o(e)888 -1274 y(Return)21 b(the)f(\002le-name)f(of)h(the)g(pr)o(ocess')g(contr)o -(ol)g(tty)-9 b(.)25 b(On)c(every)e(version)h(of)g(Unix)888 -1374 y(of)j(which)h(we)f(ar)o(e)f(awar)o(e,)g(this)i(is)f(just)h(the)f -(string)h FA("/dev/tty")p FD(.)k(However)-6 b(,)23 b(this)888 -1474 y(pr)o(ocedur)o(e)16 b(uses)h(the)h(of)o(\002cial)f(Posix)h -(interface,)e(so)i(it)g(is)f(mor)o(e)g(portable)g(than)h(sim-)888 -1573 y(ply)j(using)h(a)e(constant)i(string.)681 1837 -y FB(3.12.7)80 b(Pseudo-terminals)681 2020 y FD(Scsh)21 -b(implements)g(an)g(interface)e(to)j(Berkeley-style)e -(pseudo-terminals.)681 2166 y FA(\(fork-pty-sessio)o(n)37 -b FC(thunk)p FA(\))65 b Fw(\000)-14 b(!)65 b FC([pr)o(ocess)18 -b(pty-in)f(pty-out)f(tty-name])85 b FD(pr)o(ocedur)o(e)888 -2304 y(This)54 b(pr)o(ocedur)o(e)d(gives)j(a)f(convenient)h(high-level) -g(interface)e(to)h(pseudo-)888 2403 y(terminals.)59 b(It)32 -b(\002rst)g(allocates)f(a)g(pty/tty)i(pair)e(of)h(devices,)h(and)e -(then)i(forks)f(a)888 2503 y(child)21 b(to)g(execute)f(pr)o(ocedur)o(e) -f FC(thunk)o FD(.)26 b(In)21 b(the)g(child)g(pr)o(ocess)988 -2665 y Fw(\017)41 b FD(Stdio)21 b(and)f(the)h(curr)o(ent)f(I/O)h(ports) -g(ar)o(e)e(bound)j(to)f(the)g(terminal)f(device.)988 -2795 y Fw(\017)41 b FD(The)29 b(child)g(is)g(placed)e(in)j(its)f(own,)i -(new)e(session)h(\(see)e FA(become-session-)1071 2894 -y(leader)p FD(\).)988 3024 y Fw(\017)41 b FD(The)20 b(terminal)h -(device)f(becomes)g(the)h(new)f(session's)i(contr)o(olling)g(terminal) -1071 3123 y(\(see)e FA(open-control-tty)o FD(\).)988 -3253 y Fw(\017)41 b FD(The)21 b FA(\(error-output-po)o(rt)o(\))15 -b FD(is)21 b(unbuf)o(fer)o(ed.)888 3415 y(The)16 b FA(fork-pty-session) -10 b FD(pr)o(ocedur)o(e)k(r)o(eturns)h(four)h(values:)23 -b(the)16 b(child's)g(pr)o(ocess)888 3515 y(object,)21 +%%Page: 82 90 +82 89 bop 681 614 a FA(\(flush-tty/input)37 b FC([fd/port/fname])p +FA(\))84 b Fw(\000)-14 b(!)87 b FC(no-value)595 b FD(pr)o(ocedur)o(e) +681 714 y FA(\(flush-tty/outpu)o(t)37 b FC([fd/port/fname])p +FA(\))84 b Fw(\000)-14 b(!)87 b FC(no-value)552 b FD(pr)o(ocedur)o(e) +681 814 y FA(\(flush-tty/both)37 b FC([fd/port/fname])p +FA(\))84 b Fw(\000)-14 b(!)87 b FC(no-value)639 b FD(pr)o(ocedur)o(e) +888 941 y(The)48 b FC(fd/port/fname)e FD(parameter)g(is)i(an)f(integer) +h(\002le)f(descriptor)h(or)f(Scheme)888 1041 y(I/O)f(port)e(opened)h +(on)g(a)g(terminal)f(device,)50 b(or)45 b(a)f(\002le-name)h(for)f(a)g +(termi-)888 1140 y(nal)30 b(device;)k(it)d(defaults)e(to)h(the)h(curr)o +(ent)e(input)i(port)f(\()p FA(flush-tty/input)23 b FD(and)888 +1240 y FA(flush-tty/both)p FD(\),)15 b(or)21 b(output)g(port)g(\()p +FA(flush-tty/outp)o(ut)p FD(\))o(.)888 1366 y(These)33 +b(pr)o(ocedur)o(es)e(discar)o(d)h(the)h(unr)o(ead)f(input)h(chars)g(or) +g(unwritten)h(output)888 1465 y(chars)21 b(in)g(the)g(tty's)g(kernel)g +(buf)o(fers.)681 1636 y FA(\(start-tty-outpu)o(t)37 b +FC([fd/port/fname])p FA(\))84 b Fw(\000)-14 b(!)87 b +FC(no-value)552 b FD(pr)o(ocedur)o(e)681 1735 y FA(\(stop-tty-output)37 +b FC([fd/port/fname])p FA(\))84 b Fw(\000)-14 b(!)87 +b FC(no-value)595 b FD(pr)o(ocedur)o(e)681 1835 y FA(\(start-tty-input) +37 b FC([fd/port/fname])p FA(\))84 b Fw(\000)-14 b(!)87 +b FC(no-value)595 b FD(pr)o(ocedur)o(e)681 1934 y FA(\(stop-tty-input) +37 b FC([fd/port/fname])p FA(\))84 b Fw(\000)-14 b(!)87 +b FC(no-value)639 b FD(pr)o(ocedur)o(e)888 2062 y(These)29 +b(pr)o(ocedur)o(es)d(can)j(be)f(used)g(to)h(contr)o(ol)g(a)f +(terminal's)h(input)g(and)f(output)888 2161 y(\003ow)-8 +b(.)37 b(The)24 b FC(fd/port/fname)e FD(parameter)g(is)i(an)g(integer)g +(\002le)g(descriptor)f(or)h(Scheme)888 2261 y(I/O)j(port)f(opened)g(on) +g(a)g(terminal)g(device,)g(or)g(a)f(\002le-name)h(for)f(a)h(terminal)g +(de-)888 2361 y(vice;)21 b(it)g(defaults)e(to)j(the)e(curr)o(ent)g +(input)i(or)f(output)g(port.)888 2487 y(The)28 b FA(stop-tty-output)21 +b FD(and)28 b FA(start-tty-outpu)o(t)22 b FD(pr)o(ocedur)o(es)k +(suspend)h(and)888 2586 y(r)o(esume)49 b(output)h(fr)o(om)f(a)h +(terminal)f(device.)111 b(The)50 b FA(stop-tty-input)43 +b FD(and)888 2686 y FA(start-tty-input)c FD(pr)o(ocedur)o(es)j +(transmit)j(the)g(special)f(ST)o(OP)g(and)g(ST)-6 b(AR)m(T)888 +2785 y(characters)19 b(to)i(the)f(terminal)g(with)h(the)f(intention)i +(of)e(stopping)h(and)f(starting)g(ter)o(-)888 2885 y(minal)i(input)f +(\003ow)-8 b(.)681 3139 y FB(3.12.6)80 b(Control)21 b(terminals,)d +(sessions,)h(and)h(terminal)e(process)i(groups)681 3333 +y FA(\(open-control-tt)o(y)37 b FC(tty-name)19 b([\003ags])p +FA(\))86 b Fw(\000)-14 b(!)87 b FC(port)678 b FD(pr)o(ocedur)o(e)888 +3451 y(This)19 b(pr)o(ocedur)o(e)d(opens)i(terminal)g(device)f +FC(tty-name)f FD(as)i(the)g(pr)o(ocess')f(contr)o(ol)h(ter)o(-)888 +3551 y(minal)k(\(see)e(the)i FA(termios)c FD(man)j(page)f(for)h(mor)o +(e)g(information)h(on)g(contr)o(ol)f(termi-)888 3650 +y(nals\).)30 b(The)22 b FC(tty-name)e FD(ar)o(gument)h(is)i(a)e +(\002le-name)h(such)h(as)e FA(/dev/ttya)p FD(.)26 b(The)c +FC(\003ags)888 3750 y FD(ar)o(gument)29 b(is)h(a)f(value)f(suitable)i +(as)f(the)g(second)h(ar)o(gument)f(to)g(the)h FA(open-file)888 +3849 y FD(call;)g(it)d(defaults)f(to)i FA(open/read+write)o +FD(,)23 b(causing)k(the)g(terminal)g(to)h(be)e(opened)888 +3949 y(for)21 b(both)g(input)g(and)g(output.)888 4075 +y(The)g(port)h(r)o(eturned)e(is)h(an)g(input)h(port)f(if)g(the)g +FC(\003ags)g FD(permit)g(it,)g(otherwise)h(an)f(out-)888 +4175 y(put)j(port.)33 b(R4RS/Scheme)23 b(48/scsh)g(do)g(not)h(have)f +(input/output)i(ports,)f(so)g(it's)888 4274 y(one)i(or)g(the)f(other)-6 +b(.)40 b(However)-6 b(,)26 b(you)g(can)f(get)h(both)g(r)o(ead)e(and)h +(write)g(ports)h(open)888 4374 y(on)d(a)f(terminal)g(by)g(opening)h(it) +f(r)o(ead/write,)f(taking)i(the)f(r)o(esult)g(input)g(port,)g(and)888 +4474 y(duping)f(it)g(to)h(an)e(output)h(port)g(with)h +FA(dup->outport)p FD(.)888 4599 y(This)d(pr)o(ocedur)o(e)c(guarantees)i +(to)i(make)e(the)h(opened)g(terminal)g(the)f(pr)o(ocess')h(con-)888 +4699 y(tr)o(ol)29 b(terminal)h(only)g(if)f(the)g(pr)o(ocess)g(does)g +(not)h(have)f(an)g(assigned)g(contr)o(ol)g(ter)o(-)888 +4799 y(minal)j(at)f(the)g(time)g(of)g(the)h(call.)56 +b(If)31 b(the)g(scsh)h(pr)o(ocess)f(alr)o(eady)e(has)i(a)g(contr)o(ol) +888 4898 y(terminal,)21 b(the)g(r)o(esults)f(ar)o(e)g(unde\002ned.)2071 +5147 y(82)p eop +%%Page: 83 91 +83 90 bop 573 614 a FD(T)-8 b(o)19 b(arrange)e(for)i(the)f(pr)o(ocess)h +(to)g(have)f(no)h(contr)o(ol)g(terminal)f(prior)h(to)g(calling)g(this) +573 714 y(pr)o(ocedur)o(e,)f(use)j(the)g FA(become-session-l)o(ead)o +(er)14 b FD(pr)o(ocedur)o(e.)365 923 y FA(\(become-session-l)o(ea)o +(der)o(\))81 b Fw(\000)-14 b(!)87 b FC(integer)944 b +FD(pr)o(ocedur)o(e)573 1070 y(This)20 b(is)g(the)g(C)g +FA(setsid\(\))c FD(call.)27 b(P)t Fv(O)t(S)t(I)t(X)c +FD(job-contr)o(ol)d(has)g(a)f(thr)o(ee-level)g(hierar)o(chy:)573 +1169 y(session/pr)o(ocess-gr)o(oup/pr)o(ocess.)31 b(Every)22 +b(session)i(has)f(an)f(associated)g(contr)o(ol)573 1269 +y(terminal.)59 b(This)32 b(pr)o(ocedur)o(e)e(places)h(the)h(curr)o(ent) +g(pr)o(ocess)f(into)i(a)e(brand)g(new)573 1369 y(session,)f(and)e +(disassociates)g(the)g(pr)o(ocess)f(fr)o(om)g(any)h(pr)o(evious)g +(contr)o(ol)g(termi-)573 1468 y(nal.)d(Y)-8 b(ou)20 b(may)e +(subsequently)i(use)f FA(open-control-tty)12 b FD(to)20 +b(open)f(a)f(new)h(contr)o(ol)573 1568 y(terminal.)573 +1707 y(It)34 b(is)h(an)f(err)o(or)f(to)i(call)e(this)i(pr)o(ocedur)o(e) +e(if)h(the)g(curr)o(ent)f(pr)o(ocess)h(is)h(alr)o(eady)d(a)573 +1806 y(pr)o(ocess-gr)o(oup)c(leader)-6 b(.)50 b(One)30 +b(way)g(to)f(guarantee)g(this)h(is)g(not)g(the)g(case)e(is)i(on-)573 +1906 y(ly)21 b(to)g(call)g(this)g(pr)o(ocedur)o(e)e(after)g(forking.) +365 2115 y FA(\(tty-process-grou)o(p)37 b FC(fd/port/fname)p +FA(\))85 b Fw(\000)-14 b(!)87 b FC(integer)620 b FD(pr)o(ocedur)o(e)365 +2214 y FA(\(set-tty-process-)o(gr)o(oup)37 b FC(fd/port/fname)19 +b(pgrp)p FA(\))85 b Fw(\000)-14 b(!)87 b FC(unde\002ned)173 +b FD(pr)o(ocedur)o(e)573 2361 y(This)22 b(pair)g(of)f(pr)o(ocedur)o(es) +g(gets)h(and)f(sets)h(the)g(pr)o(ocess)g(gr)o(oup)f(of)h(a)g(given)g +(termi-)573 2461 y(nal.)365 2669 y FA(\(control-tty-file)o(-n)o(ame)o +(\))81 b Fw(\000)-14 b(!)87 b FC(string)976 b FD(pr)o(ocedur)o(e)573 +2817 y(Return)27 b(the)f(\002le-name)g(of)g(the)h(pr)o(ocess')f(contr)o +(ol)g(tty)-9 b(.)43 b(On)27 b(every)e(version)i(of)f(U-)573 +2916 y(nix)f(of)f(which)h(we)g(ar)o(e)e(awar)o(e,)g(this)j(is)f(just)g +(the)f(string)i FA("/dev/tty")p FD(.)32 b(However)-6 +b(,)573 3016 y(this)20 b(pr)o(ocedur)o(e)e(uses)h(the)h(of)o(\002cial)f +(Posix)h(interface,)f(so)h(it)f(is)h(mor)o(e)f(portable)g(than)573 +3115 y(simply)i(using)h(a)e(constant)i(string.)365 3409 +y FB(3.12.7)81 b(Pseudo-terminals)365 3603 y FD(Scsh)21 +b(implements)h(an)e(interface)g(to)h(Berkeley-style)f +(pseudo-terminals.)365 3759 y FA(\(fork-pty-session)37 +b FC(thunk)p FA(\))65 b Fw(\000)-15 b(!)66 b FC([pr)o(ocess)17 +b(pty-in)g(pty-out)f(tty-name])86 b FD(pr)o(ocedur)o(e)573 +3906 y(This)54 b(pr)o(ocedur)o(e)d(gives)j(a)e(convenient)i(high-level) +g(interface)e(to)i(pseudo-)573 4005 y(terminals.)59 b(It)31 +b(\002rst)h(allocates)g(a)f(pty/tty)h(pair)f(of)h(devices,)i(and)d +(then)h(forks)g(a)573 4105 y(child)21 b(to)g(execute)f(pr)o(ocedur)o(e) +f FC(thunk)o FD(.)25 b(In)d(the)e(child)h(pr)o(ocess)672 +4283 y Fw(\017)42 b FD(Stdio)20 b(and)g(the)h(curr)o(ent)f(I/O)i(ports) +f(ar)o(e)e(bound)i(to)g(the)g(terminal)g(device.)672 +4422 y Fw(\017)42 b FD(The)28 b(child)h(is)g(placed)f(in)h(its)g(own,)j +(new)d(session)h(\(see)e FA(become-session-)756 4521 +y(leader)p FD(\).)672 4660 y Fw(\017)42 b FD(The)20 b(terminal)g +(device)g(becomes)h(the)f(new)h(session's)h(contr)o(olling)f(terminal) +756 4760 y(\(see)f FA(open-control-tt)o(y)p FD(\).)672 +4898 y Fw(\017)42 b FD(The)20 b FA(\(error-output-por)o(t\))14 +b FD(is)21 b(unbuf)o(fer)o(ed.)1756 5147 y(83)p eop +%%Page: 84 92 +84 91 bop 888 614 a FD(The)16 b FA(fork-pty-session)10 +b FD(pr)o(ocedur)o(e)k(r)o(eturns)h(four)h(values:)23 +b(the)16 b(child's)g(pr)o(ocess)888 714 y(object,)21 b(two)g(ports)g(open)g(on)g(the)g(contr)o(olling)h(pty)e(device,)g(and) -g(the)h(name)f(of)h(the)888 3614 y(child's)h(corr)o(esponding)f -(terminal)f(device.)681 3800 y FA(\(open-pty\))83 b Fw(\000)-14 +g(the)h(name)f(of)h(the)888 814 y(child's)h(corr)o(esponding)f +(terminal)f(device.)681 994 y FA(\(open-pty\))83 b Fw(\000)-14 b(!)87 b FC(pty-inport)18 b(tty-name)1073 b FD(pr)o(ocedur)o(e)888 -3937 y(This)27 b(pr)o(ocedur)o(e)e(\002nds)h(a)g(fr)o(ee)f(pty/tty)i +1127 y(This)27 b(pr)o(ocedur)o(e)e(\002nds)h(a)g(fr)o(ee)f(pty/tty)i (pair)-6 b(,)27 b(and)f(opens)h(the)f(pty)h(device)e(with)888 -4037 y(r)o(ead/write)19 b(access.)24 b(It)c(r)o(eturns)g(a)f(port)h(on) +1227 y(r)o(ead/write)19 b(access.)24 b(It)c(r)o(eturns)g(a)f(port)h(on) h(the)f(pty)-9 b(,)19 b(and)h(the)g(name)f(of)h(the)g(corr)o(e-)888 -4137 y(sponding)i(terminal)f(device.)888 4268 y(The)i(port)f(r)o +1327 y(sponding)i(terminal)f(device.)888 1456 y(The)i(port)f(r)o (eturned)f(is)i(an)f(input)h(port\227Scheme)f(doesn't)h(allow)g -(input/output)888 4367 y(ports.)51 b(However)-6 b(,)31 +(input/output)888 1555 y(ports.)51 b(However)-6 b(,)31 b(you)f(can)f(easily)g(use)g FA(\(dup->outport)39 b FC(pty-inport)m -FA(\))29 b FD(to)h(pr)o(o-)888 4467 y(duce)20 b(a)f(matching)i(output)g +FA(\))29 b FD(to)h(pr)o(o-)888 1655 y(duce)20 b(a)f(matching)i(output)g (port.)k(Y)-8 b(ou)21 b(may)f(wish)h(to)f(turn)h(of)o(f)e(I/O)h(buf)o -(fering)f(for)888 4567 y(this)j(output)f(port.)681 4752 +(fering)f(for)888 1755 y(this)j(output)f(port.)681 1935 y FA(\(pty-name->tty-n)o(am)o(e)38 b FC(pty-name)p FA(\))84 b Fw(\000)-14 b(!)87 b FC(tty-name)642 b FD(pr)o(ocedur)o(e)681 -4852 y FA(\(tty-name->pty-n)o(am)o(e)38 b FC(tty-name)p +2034 y FA(\(tty-name->pty-n)o(am)o(e)38 b FC(tty-name)p FA(\))85 b Fw(\000)-15 b(!)88 b FC(pty-name)641 b FD(pr)o(ocedur)o(e) -2071 5147 y(82)p eop -%%Page: 83 89 -83 88 bop 573 614 a FD(These)16 b(two)i(pr)o(ocedur)o(es)c(map)j -(between)f(corr)o(esponding)h(terminal)g(and)f(pty)g(con-)573 -714 y(tr)o(oller)k(names.)26 b(For)21 b(example,)756 -880 y FA(\(pty-name->tty-)o(na)o(me)37 b("/dev/ptyq3"\))h -Fn(=)-14 b Fw(\))87 b FA("/dev/ttyq3")756 980 y(\(tty-name->pty-)o(na)o -(me)37 b("/dev/ttyrc"\))h Fn(=)-14 b Fw(\))87 b FA("/dev/ptyrc")756 -1187 y Fl(Remark:)58 b Fk(This)21 b(is)f(rather)h(Berkeley-speci\002c.) -26 b(SVR4)21 b(ptys)f(ar)o(e)g(rar)o(e)g(enough)756 1279 -y(that)h(I've)f(no)h(r)o(eal)e(idea)g(if)h(it)g(generalises)e(acr)o -(oss)h(the)i(Unix)f(gap.)27 b(Experts)19 b(ar)o(e)756 -1370 y(invited)i(to)i(advise.)32 b(Users)20 b(feel)i(fr)o(ee)e(to)i -(not)h(worry\227the)e(pr)o(edominance)g(of)756 1461 y(curr)o(ent)d -(popular)g(Unix)g(systems)g(use)g(Berkeley)e(ptys.)365 -1669 y FA(\(make-pty-generat)o(or)o(\))81 b Fw(\000)-14 -b(!)87 b FC(pr)o(ocedur)o(e)983 b FD(pr)o(ocedur)o(e)573 -1810 y(This)17 b(pr)o(ocedur)o(e)e(r)o(eturns)h(a)g(generator)g(of)h -(candidate)e(pty)i(names.)24 b(Each)16 b(time)h(the)573 -1910 y(r)o(eturned)j(pr)o(ocedur)o(e)g(is)i(called,)f(it)h(pr)o(oduces) -f(a)g(new)h(candidate.)27 b(Softwar)o(e)21 b(that)573 -2009 y(wishes)f(to)g(sear)o(ch)f(thr)o(ough)h(the)g(set)g(of)f -(available)f(ptys)i(can)g(use)f(a)g(pty)h(generator)573 -2109 y(to)28 b(iterate)f(over)g(them.)47 b(After)26 b(pr)o(oducing)i -(all)f(the)h(possible)g(ptys,)i(a)d(generator)573 2208 -y(r)o(eturns)20 b FA(#f)g FD(every)g(time)h(it)g(is)g(called.)k -(Example:)756 2374 y FA(\(define)40 b(pg)j(\(make-pty-genera)o(to)o -(r\)\))756 2474 y(\(pg\))e Fn(=)-14 b Fw(\))87 b FA("/dev/ptyp0")756 -2574 y(\(pg\))41 b Fn(=)-14 b Fw(\))87 b FA("/dev/ptyp1")1104 -2661 y(.)1104 2694 y(.)1104 2727 y(.)756 2827 y(\(pg\))41 -b Fn(=)-14 b Fw(\))87 b FA("/dev/ptyqe")756 2926 y(\(pg\))41 -b Fn(=)-14 b Fw(\))87 b FA("/dev/ptyqf")170 b Fu(\(Last)41 -b(one\))756 3026 y FA(\(pg\))g Fn(=)-14 b Fw(\))87 b -FA(#f)756 3126 y(\(pg\))41 b Fn(=)-14 b Fw(\))87 b FA(#f)1104 -3212 y(.)1104 3246 y(.)1104 3279 y(.)1756 5147 y FD(83)p +888 2168 y(These)17 b(two)g(pr)o(ocedur)o(es)e(map)h(between)h(corr)o +(esponding)f(terminal)h(and)f(pty)h(con-)888 2268 y(tr)o(oller)k +(names.)k(For)c(example,)1071 2426 y FA(\(pty-name->tty-n)o(ame)37 +b("/dev/ptyq3"\))h Fn(=)-14 b Fw(\))87 b FA("/dev/ttyq3")1071 +2526 y(\(tty-name->pty-n)o(ame)37 b("/dev/ttyrc"\))h +Fn(=)-14 b Fw(\))87 b FA("/dev/ptyrc")1071 2719 y Fl(Remark:)59 +b Fk(This)20 b(is)h(rather)f(Berkeley-speci\002c.)26 +b(SVR4)21 b(ptys)g(ar)o(e)f(rar)o(e)f(enough)1071 2810 +y(that)j(I've)e(no)g(r)o(eal)f(idea)h(if)g(it)g(generalises)e(acr)o +(oss)h(the)i(Unix)f(gap.)27 b(Experts)18 b(ar)o(e)1071 +2901 y(invited)k(to)g(advise.)32 b(Users)21 b(feel)g(fr)o(ee)g(to)h +(not)g(worry\227the)f(pr)o(edominance)h(of)1071 2993 +y(curr)o(ent)c(popular)g(Unix)h(systems)e(use)h(Berkeley)e(ptys.)681 +3189 y FA(\(make-pty-genera)o(to)o(r\))81 b Fw(\000)-15 +b(!)88 b FC(pr)o(ocedur)o(e)982 b FD(pr)o(ocedur)o(e)888 +3323 y(This)18 b(pr)o(ocedur)o(e)c(r)o(eturns)i(a)h(generator)f(of)g +(candidate)g(pty)h(names.)24 b(Each)16 b(time)h(the)888 +3423 y(r)o(eturned)k(pr)o(ocedur)o(e)f(is)i(called,)f(it)h(pr)o(oduces) +e(a)i(new)g(candidate.)27 b(Softwar)o(e)20 b(that)888 +3522 y(wishes)h(to)f(sear)o(ch)e(thr)o(ough)j(the)e(set)h(of)g +(available)e(ptys)i(can)f(use)h(a)f(pty)h(generator)888 +3622 y(to)28 b(iterate)f(over)h(them.)46 b(After)27 b(pr)o(oducing)g +(all)h(the)g(possible)g(ptys,)h(a)f(generator)888 3722 +y(r)o(eturns)21 b FA(#f)f FD(every)g(time)h(it)g(is)g(called.)j +(Example:)1071 3880 y FA(\(define)41 b(pg)h(\(make-pty-generat)o(or\))o +(\))1071 3980 y(\(pg\))g Fn(=)-14 b Fw(\))87 b FA("/dev/ptyp0")1071 +4080 y(\(pg\))42 b Fn(=)-14 b Fw(\))87 b FA("/dev/ptyp1")1420 +4167 y(.)1420 4200 y(.)1420 4233 y(.)1071 4333 y(\(pg\))42 +b Fn(=)-14 b Fw(\))87 b FA("/dev/ptyqe")1071 4432 y(\(pg\))42 +b Fn(=)-14 b Fw(\))87 b FA("/dev/ptyqf")169 b Fu(\(Last)42 +b(one\))1071 4532 y FA(\(pg\))g Fn(=)-14 b Fw(\))87 b +FA(#f)1071 4631 y(\(pg\))42 b Fn(=)-14 b Fw(\))87 b FA(#f)1420 +4718 y(.)1420 4752 y(.)1420 4785 y(.)2071 5147 y FD(84)p eop -%%Page: 84 90 -84 89 bop 1083 1460 2060 4 v 1083 1559 4 100 v 1136 1529 -a FD(Scsh)938 b(C)346 b(T)-7 b(ypical)20 b(char)p 3139 -1559 V 1083 1563 2060 4 v 1083 1579 V 1083 1679 4 100 -v 1138 1649 a(P)t Fv(O)t(S)t(I)t(X)p 3139 1679 V 1083 -1779 V 1136 1749 a FA(ttychar/delete-ch)o(ar)267 b(ERASE)185 -b FD(del)p 3139 1779 V 1083 1878 V 1136 1848 a FA(ttychar/delete-li)o -(ne)267 b(KILL)229 b(^U)p 3139 1878 V 1083 1978 V 1136 -1948 a(ttychar/eof)618 b(EOF)273 b(^D)p 3139 1978 V 1083 -2077 V 1136 2048 a(ttychar/eol)618 b(EOL)p 3139 2077 -V 1083 2177 V 1136 2147 a(ttychar/interrupt)354 b(INTR)229 -b(^C)p 3139 2177 V 1083 2277 V 1136 2247 a(ttychar/quit)574 -b(QUIT)229 b(^\\)p 3139 2277 V 1083 2376 V 1136 2346 -a(ttychar/suspend)442 b(SUSP)229 b(^Z)p 3139 2376 V 1083 -2476 V 1136 2446 a(ttychar/start)530 b(START)185 b(^Q)p -3139 2476 V 1083 2576 V 1136 2546 a(ttychar/stop)574 -b(STOP)229 b(^S)p 3139 2576 V 1083 2579 2060 4 v 1083 -2595 V 1083 2695 4 100 v 1136 2665 a FD(SVR4)21 b(and)f(4.3+BSD)p -3139 2695 V 1083 2795 V 1136 2765 a FA(ttychar/delayed-s)o(us)o(pen)o -(d)93 b(DSUSP)185 b(^Y)p 3139 2795 V 1083 2894 V 1136 -2864 a(ttychar/delete-wo)o(rd)267 b(WERASE)141 b(^W)p -3139 2894 V 1083 2994 V 1136 2964 a(ttychar/discard)442 -b(DISCARD)97 b(^O)p 3139 2994 V 1083 3094 V 1136 3064 -a(ttychar/eol2)574 b(EOL2)p 3139 3094 V 1083 3193 V 1136 -3163 a(ttychar/literal-n)o(ex)o(t)224 b(LNEXT)185 b(^V)p -3139 3193 V 1083 3293 V 1136 3263 a(ttychar/reprint)442 -b(REPRINT)97 b(^R)p 3139 3293 V 1083 3296 2060 4 v 1083 -3313 V 1083 3412 4 100 v 1136 3383 a FD(4.3+BSD)p 3139 -3412 V 1083 3512 V 1136 3482 a FA(ttychar/status)486 -b(STATUS)141 b(^T)p 3139 3512 V 1083 3515 2060 4 v 681 -3751 a FD(T)-8 b(able)23 b(3.4:)29 b(Indices)23 b(into)i(the)e -FA(tty-info)d FD(r)o(ecor)o(d's)i FC(contr)o(ol-chars)g -FD(string,)i(and)f(the)g(char)o(-)681 3850 y(acter)f(traditionally)i -(found)g(at)f(each)g(index.)34 b(Only)25 b(the)f(indices)g(for)f(the)j -(P)t Fv(O)t(S)t(I)t(X)h FD(entries)681 3950 y(ar)o(e)19 -b(guaranteed)h(to)h(be)f(non-)p FA(#f)p FD(.)2071 5147 -y(84)p eop -%%Page: 85 91 -85 90 bop 383 558 2830 4 v 383 650 4 92 v 436 622 a Fk(Scsh)1090 -b(C)321 b(Meaning)p 3209 650 V 383 653 2830 4 v 383 670 -V 383 761 4 92 v 438 733 a(P)t Fg(O)t(S)t(I)t(X)p 3209 -761 V 383 852 V 436 825 a Fh(ttyin/check-parity)535 b(INPCK)179 -b Fk(Check)19 b(parity)-8 b(.)p 3209 852 V 383 944 V -436 916 a Fh(ttyin/ignore-bad-parity-chars)106 b(IGNPAR)140 -b Fk(Ignor)o(e)18 b(chars)h(with)g(parity)g(err)o(ors.)p -3209 944 V 383 1035 V 436 1007 a Fh(ttyin/mark-parity-errors)301 -b(PARMRK)140 b Fk(Insert)19 b(chars)g(to)g(mark)f(parity)g(err)o(ors.)p -3209 1035 V 383 1126 V 436 1099 a Fh(ttyin/ignore-break)535 -b(IGNBRK)140 b Fk(Ignor)o(e)18 b(br)o(eaks.)p 3209 1126 -V 383 1217 V 436 1190 a Fh(ttyin/interrupt-on-break)301 -b(BRKINT)140 b Fk(Signal)19 b(on)g(br)o(eaks.)p 3209 -1217 V 383 1309 V 436 1281 a Fh(ttyin/7bits)808 b(ISTRIP)140 -b Fk(Strip)19 b(char)g(to)g(seven)f(bits.)p 3209 1309 -V 383 1400 V 436 1373 a Fh(ttyin/cr->nl)769 b(ICRNL)179 -b Fk(Map)19 b(carriage-r)o(eturn)e(to)i(newline.)p 3209 -1400 V 383 1491 V 436 1464 a Fh(ttyin/ignore-cr)652 b(IGNCR)179 -b Fk(Ignor)o(e)18 b(carriage-r)o(eturns.)p 3209 1491 -V 383 1583 V 436 1555 a Fh(ttyin/nl->cr)769 b(INLCR)179 -b Fk(Map)19 b(newline)g(to)g(carriage-r)o(eturn.)p 3209 -1583 V 383 1674 V 436 1647 a Fh(ttyin/input-flow-ctl)457 -b(IXOFF)179 b Fk(Enable)19 b(input)h(\003ow)f(contr)o(ol.)p -3209 1674 V 383 1765 V 436 1738 a Fh(ttyin/output-flow-ctl)418 -b(IXON)218 b Fk(Enable)19 b(output)h(\003ow)f(contr)o(ol.)p -3209 1765 V 383 1769 2830 4 v 383 1785 V 383 1877 4 92 -v 436 1849 a(SVR4)g(and)g(4.3+BSD)p 3209 1877 V 383 1968 -V 436 1941 a Fh(ttyin/xon-any)730 b(IXANY)179 b Fk(Any)19 -b(char)g(r)o(estarts)f(after)h(stop.)p 3209 1968 V 383 -2059 V 436 2032 a Fh(ttyin/beep-on-overflow)379 b(IMAXBEL)101 -b Fk(Ring)19 b(bell)f(when)i(queue)e(full.)p 3209 2059 -V 383 2063 2830 4 v 383 2079 V 383 2171 4 92 v 436 2143 -a(SVR4)p 3209 2171 V 383 2262 V 436 2234 a Fh(ttyin/lowercase)652 -b(IUCLC)179 b Fk(Map)19 b(upper)f(case)g(to)h(lower)f(case.)p -3209 2262 V 383 2265 2830 4 v 365 2500 a FD(T)-8 b(able)31 -b(3.5:)46 b(Input-\003ags.)58 b(These)31 b(ar)o(e)f(the)i(named)f -(\003ags)h(for)f(the)h FA(tty-info)c FD(r)o(ecor)o(d's)365 -2600 y FC(input-\003ags)i FD(\002eld.)54 b(These)30 b(\003ags)g -(generally)h(contr)o(ol)f(the)h(pr)o(ocessing)f(of)g(input)h(chars.)365 -2699 y(Only)22 b(the)h(P)t Fv(O)t(S)t(I)t(X)h FD(entries)d(ar)o(e)e -(guaranteed)h(to)h(be)f(non-)p FA(#f)p FD(.)p 497 2840 -2601 4 v 497 2939 4 100 v 550 2909 a(Scsh)982 b(C)335 -b(Meaning)p 3094 2939 V 497 2943 2601 4 v 497 2959 V -497 3059 4 100 v 552 3029 a(P)t Fv(O)t(S)t(I)t(X)p 3094 -3059 V 497 3158 V 550 3129 a FA(ttyout/enable)574 b(OPOST)174 -b FD(Enable)20 b(output)i(pr)o(ocessing.)p 3094 3158 -V 497 3162 2601 4 v 497 3178 V 497 3278 4 100 v 550 3248 -a(SVR4)e(and)h(4.3+BSD)p 3094 3278 V 497 3378 V 550 3348 -a FA(ttyout/nl->crnl)486 b(ONLCR)174 b FD(Map)20 b(nl)h(to)g(cr)o(-nl.) -p 3094 3378 V 497 3381 2601 4 v 497 3398 V 497 3497 4 -100 v 550 3467 a(4.3+BSD)p 3094 3497 V 497 3597 V 550 -3567 a FA(ttyout/discard-eo)o(t)355 b(ONOEOT)130 b FD(Discar)o(d)20 -b(EOT)h(chars.)p 3094 3597 V 497 3697 V 550 3667 a FA -(ttyout/expand-tab)o(s)355 b(OXTABS)1960 3637 y Fs(5)2090 -3667 y FD(Expand)20 b(tabs.)p 3094 3697 V 497 3700 2601 -4 v 497 3716 V 497 3816 4 100 v 550 3786 a(SVR4)p 3094 -3816 V 497 3916 V 550 3886 a FA(ttyout/cr->nl)574 b(OCRNL)174 -b FD(Map)20 b(cr)g(to)i(nl.)p 3094 3916 V 497 4015 V -550 3985 a FA(ttyout/nl-does-cr)398 b(ONLRET)130 b FD(Nl)21 -b(performs)g(cr)f(as)h(well.)p 3094 4015 V 497 4115 V -550 4085 a FA(ttyout/no-col0-cr)398 b(ONOCR)174 b FD(No)21 -b(cr)g(output)g(in)g(column)h(0.)p 3094 4115 V 497 4215 -V 550 4185 a FA(ttyout/delay-w/fi)o(ll)o(-ch)o(ar)93 -b(OFILL)174 b FD(Send)20 b(\002ll)i(char)e(to)h(delay)-9 -b(.)p 3094 4215 V 497 4314 V 550 4284 a FA(ttyout/fill-w/del)398 -b(OFDEL)174 b FD(Fill)22 b(char)e(is)j(A)t Fv(S)t(C)t(I)t(I)h -FD(DEL.)p 3094 4314 V 497 4414 V 550 4384 a FA(ttyout/uppercase)442 -b(OLCUC)174 b FD(Map)20 b(lower)h(to)g(upper)f(case.)p -3094 4414 V 497 4417 2601 4 v 365 4652 a(T)-8 b(able)27 -b(3.6:)36 b(Output-\003ags.)44 b(These)26 b(ar)o(e)g(the)h(named)f -(\003ags)h(for)g(the)g FA(tty-info)c FD(r)o(ecor)o(d's)365 -4752 y FC(output-\003ags)f FD(\002eld.)31 b(These)22 -b(\003ags)h(generally)g(contr)o(ol)g(the)f(pr)o(ocessing)h(of)g(output) -g(chars.)365 4851 y(Only)f(the)h(P)t Fv(O)t(S)t(I)t(X)h -FD(entries)d(ar)o(e)e(guaranteed)h(to)h(be)f(non-)p FA(#f)p -FD(.)1756 5147 y(85)p eop -%%Page: 86 92 -86 91 bop 1581 1286 1696 4 v 1578 1382 4 100 v 1631 1352 -a FD(V)-8 b(alue)676 b(Comment)p 3274 1382 V 1581 1385 -1696 4 v 927 1452 a(Backspace)19 b(delay)p 1578 1482 -4 100 v 102 w FA(ttyout/bs-delay)224 b FD(Bit-\002eld)21 -b(mask)p 3274 1482 V 1578 1581 V 1631 1551 a FA(ttyout/bs-delay0)p -3274 1581 V 1578 1681 V 1631 1651 a(ttyout/bs-delay1)p -3274 1681 V 1581 1684 1696 4 v 731 1750 a FD(Carriage-r)o(eturn)d -(delay)p 1578 1780 4 100 v 102 w FA(ttyout/cr-delay)224 -b FD(Bit-\002eld)21 b(mask)p 3274 1780 V 1578 1880 V -1631 1850 a FA(ttyout/cr-delay0)p 3274 1880 V 1578 1980 -V 1631 1950 a(ttyout/cr-delay1)p 3274 1980 V 1578 2079 -V 1631 2049 a(ttyout/cr-delay2)p 3274 2079 V 1578 2179 -V 1631 2149 a(ttyout/cr-delay3)p 3274 2179 V 1581 2182 -1696 4 v 922 2249 a FD(Form-feed)f(delay)p 1578 2279 -4 100 v 102 w FA(ttyout/ff-delay)224 b FD(Bit-\002eld)21 -b(mask)p 3274 2279 V 1578 2378 V 1631 2348 a FA(ttyout/ff-delay0)p -3274 2378 V 1578 2478 V 1631 2448 a(ttyout/ff-delay1)p -3274 2478 V 1581 2481 1696 4 v 764 2548 a FD(Horizontal-tab)f(delay)p -1578 2577 4 100 v 102 w FA(ttyout/tab-delay)180 b FD(Bit-\002eld)21 -b(mask)p 3274 2577 V 1578 2677 V 1631 2647 a FA(ttyout/tab-delay0)p -3274 2677 V 1578 2777 V 1631 2747 a(ttyout/tab-delay1)p -3274 2777 V 1578 2876 V 1631 2846 a(ttyout/tab-delay2)p -3274 2876 V 1578 2976 V 1631 2946 a(ttyout/tab-delayx)136 -b FD(Expand)20 b(tabs)p 3274 2976 V 1581 2979 1696 4 -v 991 3046 a(Newline)h(delay)p 1578 3076 4 100 v 102 -w FA(ttyout/nl-delay)224 b FD(Bit-\002eld)21 b(mask)p -3274 3076 V 1578 3175 V 1631 3145 a FA(ttyout/nl-delay0)p -3274 3175 V 1578 3275 V 1631 3245 a(ttyout/nl-delay1)p -3274 3275 V 1581 3278 1696 4 v 893 3345 a FD(V)-9 b(ertical)20 -b(tab)g(delay)p 1578 3374 4 100 v 102 w FA(ttyout/vtab-delay)136 -b FD(Bit-\002eld)21 b(mask)p 3274 3374 V 1578 3474 V -1631 3444 a FA(ttyout/vtab-delay)o(0)p 3274 3474 V 1578 -3574 V 1631 3544 a(ttyout/vtab-delay)o(1)p 3274 3574 -V 1581 3577 1696 4 v 1415 3643 a FD(All)p 1578 3673 4 -100 v 103 w FA(ttyout/all-delay)180 b FD(T)-8 b(otal)21 -b(bit-\002eld)g(mask)p 3274 3673 V 1581 3677 1696 4 v -681 3825 a(T)-8 b(able)18 b(3.7:)23 b(Delay)18 b(constants.)25 -b(These)18 b(ar)o(e)f(the)i(named)f(\003ags)g(for)g(the)h -FA(tty-info)14 b FD(r)o(ecor)o(d's)681 3925 y FC(output-\003ags)h -FD(\002eld.)24 b(These)17 b(\003ags)g(contr)o(ol)g(the)f(output)i -(delays)e(associated)g(with)h(printing)681 4024 y(special)j -(characters.)25 b(They)d(ar)o(e)d(non-)r(P)t Fv(O)t(S)t(I)t(X)r -FD(,)k(and)e(have)f(non-)p FA(#f)h FD(values)g(only)h(on)g(SVR4)681 -4124 y(systems.)2071 5147 y(86)p eop -%%Page: 87 93 -87 92 bop 409 1570 2777 4 v 409 1669 4 100 v 462 1639 -a FD(Scsh)982 b(C)476 b(Meaning)p 3183 1669 V 409 1672 -2777 4 v 409 1689 V 409 1789 4 100 v 464 1759 a(P)t Fv(O)t(S)t(I)t(X)p -3183 1789 V 409 1888 V 462 1858 a FA(ttyc/char-size)530 -b(CSIZE)315 b FD(Character)19 b(size)i(mask)p 3183 1888 -V 409 1988 V 462 1958 a FA(ttyc/char-size5)486 b(CS5)403 -b FD(5)21 b(bits)p 3183 1988 V 409 2088 V 462 2058 a -FA(ttyc/char-size6)486 b(CS6)403 b FD(6)21 b(bits)p 3183 -2088 V 409 2187 V 462 2157 a FA(ttyc/char-size7)486 b(CS7)403 -b FD(7)21 b(bits)p 3183 2187 V 409 2287 V 462 2257 a -FA(ttyc/char-size8)486 b(CS8)403 b FD(8)21 b(bits)p 3183 -2287 V 409 2386 V 462 2357 a FA(ttyc/enable-pari)o(ty)355 -b(PARENB)271 b FD(Generate)20 b(and)h(detect)f(parity)-9 -b(.)p 3183 2386 V 409 2486 V 462 2456 a FA(ttyc/odd-parity)486 -b(PARODD)271 b FD(Odd)21 b(parity)-9 b(.)p 3183 2486 -V 409 2586 V 462 2556 a FA(ttyc/enable-read)442 b(CREAD)315 -b FD(Enable)20 b(r)o(eception)h(of)f(chars.)p 3183 2586 -V 409 2685 V 462 2655 a FA(ttyc/hup-on-clos)o(e)399 b(HUPCL)315 -b FD(Hang)21 b(up)g(on)g(last)g(close.)p 3183 2685 V -409 2785 V 462 2755 a FA(ttyc/no-modem-sy)o(nc)355 b(LOCAL)315 -b FD(Ignor)o(e)21 b(modem)g(lines.)p 3183 2785 V 409 -2885 V 462 2855 a FA(ttyc/2-stop-bits)442 b(CSTOPB)271 -b FD(Send)20 b(two)i(stop)f(bits.)p 3183 2885 V 409 2888 -2777 4 v 409 2905 V 409 3004 4 100 v 462 2974 a(4.3+BSD)p -3183 3004 V 409 3104 V 462 3074 a FA(ttyc/ignore-flag)o(s)399 -b(CIGNORE)227 b FD(Ignor)o(e)21 b(contr)o(ol)g(\003ags.)p -3183 3104 V 409 3203 V 462 3173 a FA(ttyc/CTS-output-)o(flo)o(w-)o(ctl) -93 b(CCTS_OFLOW)i FD(CTS)20 b(\003ow)i(contr)o(ol)f(of)g(output)p -3183 3203 V 409 3303 V 462 3273 a FA(ttyc/RTS-input-f)o(low)o(-c)o(tl) -137 b(CRTS_IFLOW)95 b FD(R)m(TS)21 b(\003ow)h(contr)o(ol)f(of)g(input)p -3183 3303 V 409 3403 V 462 3373 a FA(ttyc/carrier-flo)o(w-c)o(tl)224 -b(MDMBUF)p 3183 3403 V 409 3406 2777 4 v 365 3641 a FD(T)-8 -b(able)26 b(3.8:)35 b(Contr)o(ol-\003ags.)41 b(These)26 -b(ar)o(e)e(the)j(named)e(\003ags)h(for)g(the)g FA(tty-info)d -FD(r)o(ecor)o(d's)365 3740 y FC(contr)o(ol-\003ags)32 -b FD(\002eld.)61 b(These)33 b(\003ags)g(generally)f(contr)o(ol)h(the)g -(details)g(of)f(the)h(terminal's)365 3840 y(serial)21 -b(line.)26 b(Only)21 b(the)i(P)t Fv(O)t(S)t(I)t(X)h FD(entries)d(ar)o -(e)e(guaranteed)h(to)h(be)g(non-)p FA(#f)p FD(.)1756 -5147 y(87)p eop -%%Page: 88 94 -88 93 bop 725 1442 2776 4 v 725 1533 4 92 v 778 1506 -a Fk(Scsh)973 b(C)439 b(Meaning)p 3497 1533 V 725 1536 -2776 4 v 725 1553 V 725 1644 4 92 v 780 1617 a(P)t Fg(O)t(S)t(I)t(X)p -3497 1644 V 725 1736 V 778 1708 a Fh(ttyl/canonical)574 -b(ICANON)258 b Fk(Canonical)19 b(input)h(pr)o(ocessing.)p -3497 1736 V 725 1827 V 778 1799 a Fh(ttyl/echo)769 b(ECHO)336 -b Fk(Enable)19 b(echoing.)p 3497 1827 V 725 1918 V 778 -1891 a Fh(ttyl/echo-delete-line)301 b(ECHOK)c Fk(Echo)18 -b(newline)h(after)g(line)f(kill.)p 3497 1918 V 725 2010 -V 778 1982 a Fh(ttyl/echo-nl)652 b(ECHONL)258 b Fk(Echo)18 -b(newline)h(even)g(if)g(echo)g(is)f(of)o(f.)p 3497 2010 -V 725 2101 V 778 2073 a Fh(ttyl/visual-delete)418 b(ECHOE)297 -b Fk(V)l(isually)17 b(erase)h(chars.)p 3497 2101 V 725 -2192 V 778 2165 a Fh(ttyl/enable-signals)379 b(ISIG)336 -b Fk(Enable)19 b Fh(^)p Fk(C,)f Fh(^)p Fk(Z)h(signalling.)p -3497 2192 V 725 2284 V 778 2256 a Fh(ttyl/extended)613 -b(IEXTEN)258 b Fk(Enable)19 b(extensions.)p 3497 2284 -V 725 2375 V 778 2347 a Fh(ttyl/no-flush-on-interrupt)106 -b(NOFLSH)258 b Fk(Don't)19 b(\003ush)g(after)f(interr)o(upt.)p -3497 2375 V 725 2466 V 778 2439 a Fh(ttyl/ttou-signal)496 -b(ITOSTOP)219 b(SIGTTOU)20 b Fk(on)f(backgr)o(ound)f(output.)p -3497 2466 V 725 2469 2776 4 v 725 2486 V 725 2577 4 92 -v 778 2550 a(SVR4)h(and)g(4.3+BSD)p 3497 2577 V 725 2669 -V 778 2641 a Fh(ttyl/echo-ctl)613 b(ECHOCTL)219 b Fk(Echo)18 -b(contr)o(ol)h(chars)g(as)f(\223)p Fh(^X)p Fk(\224.)p -3497 2669 V 725 2760 V 778 2733 a Fh(ttyl/flush-output)457 -b(FLUSHO)258 b Fk(Output)19 b(is)f(being)g(\003ushed.)p -3497 2760 V 725 2851 V 778 2824 a Fh(ttyl/hardcopy-delete)340 -b(ECHOPRT)219 b Fk(V)l(isual)18 b(erase)g(for)f(har)o(dcopy)-8 -b(.)p 3497 2851 V 725 2943 V 778 2915 a Fh(ttyl/reprint-unread-chars) -145 b(PENDIN)258 b Fk(Retype)18 b(pending)g(input.)p -3497 2943 V 725 3034 V 778 3007 a Fh(ttyl/visual-delete-line)223 -b(ECHOKE)258 b Fk(V)l(isually)17 b(erase)h(a)h(line-kill.)p -3497 3034 V 725 3037 2776 4 v 725 3054 V 725 3145 4 92 -v 778 3118 a(4.3+BSD)p 3497 3145 V 725 3237 V 778 3209 -a Fh(ttyl/alt-delete-word)340 b(ALTWERASE)141 b Fk(Alternate)19 -b(wor)o(d)e(erase)h(algorithm)p 3497 3237 V 725 3328 -V 778 3301 a Fh(ttyl/no-kernel-status)301 b(NOKERNINFO)102 -b Fk(No)18 b(kernel)g(status)h(on)g Fh(^T)p Fk(.)p 3497 -3328 V 725 3331 2776 4 v 725 3348 V 725 3439 4 92 v 778 -3412 a(SVR4)p 3497 3439 V 725 3530 V 778 3503 a Fh(ttyl/case-map)613 -b(XCASE)297 b Fk(Canonical)19 b(case)g(pr)o(esentation)p -3497 3530 V 725 3534 2776 4 v 681 3769 a FD(T)-8 b(able)31 -b(3.9:)47 b(Local-\003ags.)58 b(These)32 b(ar)o(e)e(the)i(named)f -(\003ags)h(for)g(the)g FA(tty-info)c FD(r)o(ecor)o(d's)681 -3868 y FC(local-\003ags)k FD(\002eld.)61 b(These)32 b(\003ags)h -(generally)g(contr)o(ol)g(the)g(details)f(of)h(the)g(line-editting)681 -3968 y(user)20 b(interface.)25 b(Only)c(the)i(P)t Fv(O)t(S)t(I)t(X)i +%%Page: 85 93 +85 92 bop 768 1460 2060 4 v 768 1559 4 100 v 821 1529 +a FD(Scsh)938 b(C)346 b(T)-7 b(ypical)20 b(char)p 2824 +1559 V 768 1563 2060 4 v 768 1579 V 768 1679 4 100 v +823 1649 a(P)t Fv(O)t(S)t(I)t(X)p 2824 1679 V 768 1779 +V 821 1749 a FA(ttychar/delete-c)o(ha)o(r)268 b(ERASE)185 +b FD(del)p 2824 1779 V 768 1878 V 821 1848 a FA(ttychar/delete-l)o(in)o +(e)268 b(KILL)229 b(^U)p 2824 1878 V 768 1978 V 821 1948 +a(ttychar/eof)618 b(EOF)273 b(^D)p 2824 1978 V 768 2077 +V 821 2048 a(ttychar/eol)618 b(EOL)p 2824 2077 V 768 +2177 V 821 2147 a(ttychar/interrup)o(t)355 b(INTR)229 +b(^C)p 2824 2177 V 768 2277 V 821 2247 a(ttychar/quit)574 +b(QUIT)229 b(^\\)p 2824 2277 V 768 2376 V 821 2346 a(ttychar/suspend) +442 b(SUSP)229 b(^Z)p 2824 2376 V 768 2476 V 821 2446 +a(ttychar/start)530 b(START)185 b(^Q)p 2824 2476 V 768 +2576 V 821 2546 a(ttychar/stop)574 b(STOP)229 b(^S)p +2824 2576 V 768 2579 2060 4 v 768 2595 V 768 2695 4 100 +v 821 2665 a FD(SVR4)20 b(and)g(4.3+BSD)p 2824 2695 V +768 2795 V 821 2765 a FA(ttychar/delayed-)o(su)o(spe)o(nd)93 +b(DSUSP)185 b(^Y)p 2824 2795 V 768 2894 V 821 2864 a(ttychar/delete-w)o +(or)o(d)268 b(WERASE)141 b(^W)p 2824 2894 V 768 2994 +V 821 2964 a(ttychar/discard)442 b(DISCARD)97 b(^O)p +2824 2994 V 768 3094 V 821 3064 a(ttychar/eol2)574 b(EOL2)p +2824 3094 V 768 3193 V 821 3163 a(ttychar/literal-)o(ne)o(xt)224 +b(LNEXT)185 b(^V)p 2824 3193 V 768 3293 V 821 3263 a(ttychar/reprint) +442 b(REPRINT)97 b(^R)p 2824 3293 V 768 3296 2060 4 v +768 3313 V 768 3412 4 100 v 821 3383 a FD(4.3+BSD)p 2824 +3412 V 768 3512 V 821 3482 a FA(ttychar/status)486 b(STATUS)141 +b(^T)p 2824 3512 V 768 3515 2060 4 v 365 3751 a FD(T)-8 +b(able)23 b(3.4:)30 b(Indices)23 b(into)h(the)f FA(tty-info)d +FD(r)o(ecor)o(d's)i FC(contr)o(ol-chars)g FD(string,)j(and)d(the)i +(char)o(-)365 3850 y(acter)f(traditionally)h(found)f(at)h(each)f +(index.)34 b(Only)24 b(the)g(indices)g(for)g(the)h(P)t +Fv(O)t(S)t(I)t(X)i FD(entries)365 3950 y(ar)o(e)20 b(guaranteed)f(to)i +(be)g(non-)p FA(#f)p FD(.)1756 5147 y(85)p eop +%%Page: 86 94 +86 93 bop 698 558 2830 4 v 698 650 4 92 v 751 622 a Fk(Scsh)1091 +b(C)321 b(Meaning)p 3524 650 V 698 653 2830 4 v 698 670 +V 698 761 4 92 v 753 733 a(P)t Fg(O)t(S)t(I)t(X)p 3524 +761 V 698 852 V 751 825 a Fj(ttyin/check-parity)536 b(INPCK)179 +b Fk(Check)18 b(parity)-8 b(.)p 3524 852 V 698 944 V +751 916 a Fj(ttyin/ignore-bad-parity-char)q(s)106 b(IGNPAR)140 +b Fk(Ignor)o(e)17 b(chars)i(with)h(parity)e(err)o(ors.)p +3524 944 V 698 1035 V 751 1007 a Fj(ttyin/mark-parity-errors)302 +b(PARMRK)140 b Fk(Insert)18 b(chars)h(to)g(mark)f(parity)g(err)o(ors.)p +3524 1035 V 698 1126 V 751 1099 a Fj(ttyin/ignore-break)536 +b(IGNBRK)140 b Fk(Ignor)o(e)17 b(br)o(eaks.)p 3524 1126 +V 698 1217 V 751 1190 a Fj(ttyin/interrupt-on-break)302 +b(BRKINT)140 b Fk(Signal)19 b(on)g(br)o(eaks.)p 3524 +1217 V 698 1309 V 751 1281 a Fj(ttyin/7bits)809 b(ISTRIP)140 +b Fk(Strip)18 b(char)h(to)g(seven)g(bits.)p 3524 1309 +V 698 1400 V 751 1373 a Fj(ttyin/cr->nl)770 b(ICRNL)179 +b Fk(Map)18 b(carriage-r)o(eturn)f(to)i(newline.)p 3524 +1400 V 698 1491 V 751 1464 a Fj(ttyin/ignore-cr)653 b(IGNCR)179 +b Fk(Ignor)o(e)17 b(carriage-r)o(eturns.)p 3524 1491 +V 698 1583 V 751 1555 a Fj(ttyin/nl->cr)770 b(INLCR)179 +b Fk(Map)18 b(newline)h(to)g(carriage-r)o(eturn.)p 3524 +1583 V 698 1674 V 751 1647 a Fj(ttyin/input-flow-ctl)458 +b(IXOFF)179 b Fk(Enable)19 b(input)g(\003ow)g(contr)o(ol.)p +3524 1674 V 698 1765 V 751 1738 a Fj(ttyin/output-flow-ctl)419 +b(IXON)218 b Fk(Enable)19 b(output)g(\003ow)g(contr)o(ol.)p +3524 1765 V 698 1769 2830 4 v 698 1785 V 698 1877 4 92 +v 751 1849 a(SVR4)g(and)h(4.3+BSD)p 3524 1877 V 698 1968 +V 751 1941 a Fj(ttyin/xon-any)731 b(IXANY)179 b Fk(Any)19 +b(char)g(r)o(estarts)e(after)i(stop.)p 3524 1968 V 698 +2059 V 751 2032 a Fj(ttyin/beep-on-overflow)380 b(IMAXBEL)101 +b Fk(Ring)18 b(bell)g(when)i(queue)e(full.)p 3524 2059 +V 698 2063 2830 4 v 698 2079 V 698 2171 4 92 v 751 2143 +a(SVR4)p 3524 2171 V 698 2262 V 751 2234 a Fj(ttyin/lowercase)653 +b(IUCLC)179 b Fk(Map)18 b(upper)g(case)h(to)g(lower)f(case.)p +3524 2262 V 698 2265 2830 4 v 681 2500 a FD(T)-8 b(able)31 +b(3.5:)46 b(Input-\003ags.)57 b(These)32 b(ar)o(e)e(the)i(named)f +(\003ags)g(for)h(the)f FA(tty-info)d FD(r)o(ecor)o(d's)681 +2600 y FC(input-\003ags)h FD(\002eld.)54 b(These)30 b(\003ags)h +(generally)f(contr)o(ol)h(the)f(pr)o(ocessing)h(of)f(input)h(chars.)681 +2699 y(Only)21 b(the)i(P)t Fv(O)t(S)t(I)t(X)i FD(entries)20 +b(ar)o(e)g(guaranteed)f(to)i(be)g(non-)p FA(#f)p FD(.)p +813 2840 2601 4 v 813 2939 4 100 v 866 2909 a(Scsh)981 +b(C)336 b(Meaning)p 3410 2939 V 813 2943 2601 4 v 813 +2959 V 813 3059 4 100 v 868 3029 a(P)t Fv(O)t(S)t(I)t(X)p +3410 3059 V 813 3158 V 866 3129 a FA(ttyout/enable)573 +b(OPOST)175 b FD(Enable)20 b(output)h(pr)o(ocessing.)p +3410 3158 V 813 3162 2601 4 v 813 3178 V 813 3278 4 100 +v 866 3248 a(SVR4)f(and)g(4.3+BSD)p 3410 3278 V 813 3378 +V 866 3348 a FA(ttyout/nl->crnl)485 b(ONLCR)175 b FD(Map)19 +b(nl)j(to)f(cr)o(-nl.)p 3410 3378 V 813 3381 2601 4 v +813 3398 V 813 3497 4 100 v 866 3467 a(4.3+BSD)p 3410 +3497 V 813 3597 V 866 3567 a FA(ttyout/discard-e)o(ot)354 +b(ONOEOT)131 b FD(Discar)o(d)20 b(EOT)g(chars.)p 3410 +3597 V 813 3697 V 866 3667 a FA(ttyout/expand-ta)o(bs)354 +b(OXTABS)2275 3637 y Fs(5)2406 3667 y FD(Expand)20 b(tabs.)p +3410 3697 V 813 3700 2601 4 v 813 3716 V 813 3816 4 100 +v 866 3786 a(SVR4)p 3410 3816 V 813 3916 V 866 3886 a +FA(ttyout/cr->nl)573 b(OCRNL)175 b FD(Map)19 b(cr)i(to)g(nl.)p +3410 3916 V 813 4015 V 866 3985 a FA(ttyout/nl-does-c)o(r)398 +b(ONLRET)131 b FD(Nl)21 b(performs)f(cr)h(as)f(well.)p +3410 4015 V 813 4115 V 866 4085 a FA(ttyout/no-col0-c)o(r)398 +b(ONOCR)175 b FD(No)21 b(cr)f(output)h(in)h(column)g(0.)p +3410 4115 V 813 4215 V 866 4185 a FA(ttyout/delay-w/f)o(il)o(l-)o(cha)o +(r)93 b(OFILL)175 b FD(Send)20 b(\002ll)h(char)f(to)i(delay)-9 +b(.)p 3410 4215 V 813 4314 V 866 4284 a FA(ttyout/fill-w/de)o(l)398 +b(OFDEL)175 b FD(Fill)21 b(char)f(is)k(A)t Fv(S)t(C)t(I)t(I)f +FD(DEL.)p 3410 4314 V 813 4414 V 866 4384 a FA(ttyout/uppercase)441 +b(OLCUC)175 b FD(Map)19 b(lower)j(to)f(upper)f(case.)p +3410 4414 V 813 4417 2601 4 v 681 4652 a(T)-8 b(able)26 +b(3.6:)36 b(Output-\003ags.)44 b(These)27 b(ar)o(e)e(the)i(named)g +(\003ags)g(for)f(the)h FA(tty-info)c FD(r)o(ecor)o(d's)681 +4752 y FC(output-\003ags)e FD(\002eld.)31 b(These)23 +b(\003ags)g(generally)f(contr)o(ol)h(the)g(pr)o(ocessing)g(of)f(output) +i(chars.)681 4851 y(Only)d(the)i(P)t Fv(O)t(S)t(I)t(X)i FD(entries)20 b(ar)o(e)g(guaranteed)f(to)i(be)g(non-)p -FA(#f)p FD(.)2071 5147 y(88)p eop -%%Page: 89 95 -89 94 bop 365 1274 a Fz(Chapter)45 b(4)365 1727 y FE(Networking)365 -2220 y FD(The)28 b(Scheme)g(Shell)g(pr)o(ovides)f(a)h(BSD-style)f -(sockets)i(interface.)46 b(Ther)o(e)27 b(is)h(not)h(an)f(of-)365 -2320 y(\002cial)f(standar)o(d)e(for)i(a)f(network)h(interface)f(for)h -(scsh)g(to)g(adopt)f(\(this)h(is)h(the)f(subject)g(of)365 -2420 y(the)k(forthcoming)h(Posix.8)e(standar)o(d\).)52 -b(However)-6 b(,)33 b(Berkeley)c(sockets)i(ar)o(e)e(a)h -FC(de)g(facto)365 2519 y FD(standar)o(d,)19 b(being)i(found)g(on)g -(most)h(Unix)f(workstations)h(and)e(PC)h(operating)g(systems.)490 -2656 y(It)29 b(is)h(fairly)f(straightforwar)o(d)g(to)h(add)e(higher)o -(-level)h(network)i(pr)o(otocols)f(such)g(as)365 2756 -y(smtp,)22 b(telnet,)f(or)g(http)h(on)f(top)h(of)f(the)g(the)h(basic)e -(socket-level)h(support)h(scsh)g(pr)o(ovides.)365 2855 -y(The)29 b(Scheme)f(Under)o(gr)o(ound)f(has)i(also)g(r)o(eleased)e(a)h -(network)h(library)f(with)i(many)f(of)365 2955 y(these)22 -b(pr)o(otocols)g(as)g(a)f(companion)i(to)f(the)g(curr)o(ent)f(r)o -(elease)f(of)i(scsh.)29 b(See)21 b(this)h(code)g(for)365 -3055 y(examples)e(showing)j(the)e(use)g(of)f(the)h(sockets)h -(interface.)365 3364 y Fy(4.1)99 b(High-level)26 b(interface)365 -3595 y FD(For)18 b(convenience,)h(and)e(to)h(avoid)g(some)g(of)g(the)g -(messy)h(details)e(of)h(the)g(socket)g(interface,)365 -3694 y(we)f(pr)o(ovide)f(a)h(high)g(level)g(socket)g(interface.)23 -b(These)17 b(r)o(outines)g(attempt)g(to)g(make)g(it)g(easy)365 -3794 y(to)23 b(write)f(simple)h(clients)g(and)f(servers)g(without)h -(having)g(to)f(think)i(of)e(many)h(of)f(the)g(de-)365 -3894 y(tails)g(of)f(initiating)h(socket)g(connections.)28 -b(W)-8 b(e)22 b(welcome)f(suggested)h(impr)o(ovements)f(to)365 -3993 y(this)i(interface,)e(including)i(better)f(names,)g(which)h(right) -g(now)g(ar)o(e)d(solely)j(descriptions)365 4093 y(of)28 -b(the)h(pr)o(ocedur)o(e's)d(action.)48 b(This)28 b(might)i(be)d(\002ne) -i(for)f(people)g(who)h(alr)o(eady)d(under)o(-)365 4193 -y(stand)21 b(sockets,)g(but)g(does)g(not)g(help)g(the)g(new)g -(networking)h(pr)o(ogrammer)-6 b(.)365 4350 y FA(\(socket-connect)38 -b FC(pr)o(otocol-family)18 b(socket-type)h(.)h(ar)o(gs)p -FA(\))87 b Fw(\000)-15 b(!)87 b FC(socket)139 b FD(pr)o(ocedur)o(e)573 -4500 y FA(socket-connect)92 b FD(is)98 b(intended)g(for)g(cr)o(eating)f -(client)i(applications.)573 4599 y FC(pr)o(otocol-family)49 -b FD(is)k(speci\002ed)f(as)g(either)g(the)g FA(protocol-family/i)o(nte) -o(rn)o(et)573 4699 y FD(or)85 b FA(protocol-family)o(/un)o(ix)o -FD(.)212 b FC(socket-type)83 b FD(is)i(speci\002ed)f(as)h(either)573 -4799 y FA(socket-type/stre)o(am)44 b FD(or)51 b FA(socket-type/data)o -(gra)o(m)p FD(.)109 b(See)50 b FA(socket)f FD(for)h(a)573 -4898 y(mor)o(e)20 b(complete)h(description)g(of)g(these)g(terms.)1756 -5147 y(89)p eop -%%Page: 90 96 -90 95 bop 888 614 a FD(The)20 b(variable)e FC(ar)o(gs)g -FD(list)i(is)g(meant)f(to)g(specify)g(pr)o(otocol)h(family)f -(speci\002c)g(informa-)888 714 y(tion.)48 b(For)28 b(Internet)g -(sockets,)i(this)e(consists)i(of)d(two)i(ar)o(guments:)39 -b(a)27 b(host)i(name)888 814 y(and)21 b(a)f(port)h(number)-6 -b(.)25 b(For)c(Unix)g(sockets,)g(this)h(consists)g(of)e(a)h(pathname.) -888 947 y FA(socket-connect)e FD(r)o(eturns)24 b(a)g -FA(socket)e FD(which)j(can)f(be)g(used)g(for)g(input)h(and)f(out-)888 -1046 y(put)19 b(fr)o(om)f(a)h(r)o(emote)f(server)-6 b(.)24 -b(See)18 b FA(socket)e FD(for)i(a)h(description)g(of)f(the)h -FC(socket)g(r)o(ecord)p FD(.)681 1238 y FA(\(bind-listen-acc)o(ep)o -(t-l)o(oo)o(p)37 b FC(pr)o(otocol-family)13 b(pr)o(oc)i(ar)o(g)p -FA(\))43 b Fw(\000)-15 b(!)44 b FC(does-not-r)o(eturn)86 -b FD(pr)o(ocedur)o(e)888 1380 y FA(bind-listen-accep)o(t-)o(loo)o(p)22 -b FD(is)29 b(intended)f(for)g(cr)o(eating)f(server)g(applications.)888 -1480 y FC(pr)o(otocol-family)k FD(is)j(speci\002ed)g(as)f(either)g(the) -h FA(protocol-family/i)o(nt)o(ern)o(et)27 b FD(or)888 -1579 y FA(protocol-family/u)o(ni)o(x)p FD(.)d FC(pr)o(oc)d -FD(is)i(a)e(pr)o(ocedur)o(e)g(of)h(two)h(ar)o(guments:)28 -b(a)22 b FA(socket)888 1679 y FD(and)c(a)f(socket-addr)o(ess.)23 -b FC(ar)o(g)17 b FD(speci\002es)i(a)e(port)h(number)g(for)g(Internet)g -(sockets)g(or)h(a)888 1778 y(pathname)k(for)g(Unix)h(sockets.)33 -b(See)23 b FA(socket)d FD(for)k(a)e(mor)o(e)h(complete)h(description) -888 1878 y(of)d(these)g(terms.)888 2011 y FC(pr)o(oc)g -FD(is)h(called)f(with)h(a)f(socket)h(and)f(a)g(socket)h(addr)o(ess)e -(each)h(time)h(ther)o(e)f(is)h(a)f(con-)888 2111 y(nection)36 -b(fr)o(om)f(a)g(client)g(application.)69 b(The)35 b(socket)g(allows)h -(communications)888 2210 y(with)30 b(the)g(client.)51 -b(The)29 b(socket)g(addr)o(ess)f(speci\002es)h(the)g(addr)o(ess)f(of)h -(the)h(r)o(emote)888 2310 y(client.)888 2443 y(This)23 -b(pr)o(ocedur)o(e)e(does)h(not)h(r)o(eturn,)f(but)g(loops)i -(inde\002nitely)f(accepting)f(connec-)888 2543 y(tions)g(fr)o(om)f -(client)g(pr)o(ograms.)681 2838 y Fy(4.2)99 b(Sockets)681 -3078 y FA(\(create-socket)38 b FC(pr)o(otocol-family)18 -b(type)h([pr)o(otocol])p FA(\))85 b Fw(\000)-15 b(!)88 -b FC(socket)269 b FD(pr)o(ocedur)o(e)681 3178 y FA(\(create-socket-p)o -(ai)o(r)38 b FC(type)p FA(\))85 b Fw(\000)-14 b(!)87 -b FC([socket)2275 3190 y Fx(1)2333 3178 y FC(socket)2533 -3190 y Fx(2)2570 3178 y FC(])572 b FD(pr)o(ocedur)o(e)681 -3277 y FA(\(close-socket)38 b FC(socket)p FA(\))86 b -Fw(\000)-14 b(!)87 b FC(unde\002ned)998 b FD(pr)o(ocedur)o(e)888 -3402 y(A)28 b(socket)g(is)h(one)f(end)g(of)g(a)g(network)g(connection.) -49 b(Thr)o(ee)27 b(speci\002c)h(pr)o(operties)888 3501 -y(of)i(sockets)f(ar)o(e)f(speci\002ed)h(at)g(cr)o(eation)f(time:)43 -b(the)30 b(pr)o(otocol-family)-9 b(,)30 b(type,)h(and)888 -3601 y(pr)o(otocol.)888 3734 y(The)43 b FC(pr)o(otocol-family)c -FD(speci\002es)k(the)g(pr)o(otocol)f(family)h(to)f(be)g(used)h(with)g -(the)888 3834 y(socket.)75 b(This)37 b(also)g(determines)g(the)g(addr)o -(ess)f(family)h(of)g(socket)g(addr)o(esses,)888 3934 -y(which)30 b(ar)o(e)e(described)g(in)i(mor)o(e)f(detail)f(below)-8 -b(.)52 b(Scsh)29 b(curr)o(ently)f(supports)i(the)888 -4033 y(Unix)i(internal)h(pr)o(otocols)f(and)g(the)g(Internet)h(pr)o -(otocols)f(using)h(the)g(following)888 4133 y(constants:)1071 -4300 y FA(protocol-family/)o(uns)o(pe)o(ci)o(fie)o(d)1071 -4399 y(protocol-family/)o(uni)o(x)1071 4499 y(protocol-family/)o(int)o -(er)o(ne)o(t)888 4699 y FD(The)23 b FC(type)f FD(speci\002es)h(the)g -(style)g(of)g(communication.)34 b(Examples)22 b(that)h(your)g(oper)o(-) -888 4799 y(ating)c(system)f(pr)o(obably)f(pr)o(ovides)h(ar)o(e)e(str)o -(eam)h(and)h(datagram)e(sockets.)26 b(Others)888 4898 -y(maybe)21 b(available)e(depending)i(on)g(your)g(system.)26 -b(T)-7 b(ypical)20 b(values)h(ar)o(e:)2071 5147 y(90)p +FA(#f)p FD(.)2071 5147 y(86)p eop +%%Page: 87 95 +87 94 bop 1266 1286 1696 4 v 1263 1382 4 100 v 1316 1352 +a FD(V)-8 b(alue)676 b(Comment)p 2958 1382 V 1266 1385 +1696 4 v 611 1452 a(Backspace)19 b(delay)p 1263 1482 +4 100 v 103 w FA(ttyout/bs-delay)224 b FD(Bit-\002eld)20 +b(mask)p 2958 1482 V 1263 1581 V 1316 1551 a FA(ttyout/bs-delay)o(0)p +2958 1581 V 1263 1681 V 1316 1651 a(ttyout/bs-delay)o(1)p +2958 1681 V 1266 1684 1696 4 v 415 1750 a FD(Carriage-r)o(eturn)e +(delay)p 1263 1780 4 100 v 103 w FA(ttyout/cr-delay)224 +b FD(Bit-\002eld)20 b(mask)p 2958 1780 V 1263 1880 V +1316 1850 a FA(ttyout/cr-delay)o(0)p 2958 1880 V 1263 +1980 V 1316 1950 a(ttyout/cr-delay)o(1)p 2958 1980 V +1263 2079 V 1316 2049 a(ttyout/cr-delay)o(2)p 2958 2079 +V 1263 2179 V 1316 2149 a(ttyout/cr-delay)o(3)p 2958 +2179 V 1266 2182 1696 4 v 606 2249 a FD(Form-feed)g(delay)p +1263 2279 4 100 v 103 w FA(ttyout/ff-delay)224 b FD(Bit-\002eld)20 +b(mask)p 2958 2279 V 1263 2378 V 1316 2348 a FA(ttyout/ff-delay)o(0)p +2958 2378 V 1263 2478 V 1316 2448 a(ttyout/ff-delay)o(1)p +2958 2478 V 1266 2481 1696 4 v 448 2548 a FD(Horizontal-tab)g(delay)p +1263 2577 4 100 v 103 w FA(ttyout/tab-dela)o(y)181 b +FD(Bit-\002eld)20 b(mask)p 2958 2577 V 1263 2677 V 1316 +2647 a FA(ttyout/tab-dela)o(y0)p 2958 2677 V 1263 2777 +V 1316 2747 a(ttyout/tab-dela)o(y1)p 2958 2777 V 1263 +2876 V 1316 2846 a(ttyout/tab-dela)o(y2)p 2958 2876 V +1263 2976 V 1316 2946 a(ttyout/tab-dela)o(yx)137 b FD(Expand)20 +b(tabs)p 2958 2976 V 1266 2979 1696 4 v 675 3046 a(Newline)h(delay)p +1263 3076 4 100 v 103 w FA(ttyout/nl-delay)224 b FD(Bit-\002eld)20 +b(mask)p 2958 3076 V 1263 3175 V 1316 3145 a FA(ttyout/nl-delay)o(0)p +2958 3175 V 1263 3275 V 1316 3245 a(ttyout/nl-delay)o(1)p +2958 3275 V 1266 3278 1696 4 v 577 3345 a FD(V)-9 b(ertical)20 +b(tab)g(delay)p 1263 3374 4 100 v 103 w FA(ttyout/vtab-del)o(ay)137 +b FD(Bit-\002eld)20 b(mask)p 2958 3374 V 1263 3474 V +1316 3444 a FA(ttyout/vtab-del)o(ay0)p 2958 3474 V 1263 +3574 V 1316 3544 a(ttyout/vtab-del)o(ay1)p 2958 3574 +V 1266 3577 1696 4 v 1100 3643 a FD(All)p 1263 3673 4 +100 v 103 w FA(ttyout/all-dela)o(y)181 b FD(T)-8 b(otal)21 +b(bit-\002eld)f(mask)p 2958 3673 V 1266 3677 1696 4 v +365 3825 a(T)-8 b(able)18 b(3.7:)23 b(Delay)18 b(constants.)26 +b(These)18 b(ar)o(e)f(the)h(named)g(\003ags)h(for)f(the)g +FA(tty-info)d FD(r)o(ecor)o(d's)365 3925 y FC(output-\003ags)g +FD(\002eld.)25 b(These)16 b(\003ags)h(contr)o(ol)g(the)g(output)g +(delays)f(associated)g(with)i(printing)365 4024 y(special)j +(characters.)k(They)c(ar)o(e)f(non-)r(P)t Fv(O)t(S)t(I)t(X)r +FD(,)j(and)d(have)h(non-)p FA(#f)g FD(values)f(only)i(on)g(SVR4)365 +4124 y(systems.)1756 5147 y(87)p eop +%%Page: 88 96 +88 95 bop 724 1570 2777 4 v 724 1669 4 100 v 778 1639 +a FD(Scsh)981 b(C)477 b(Meaning)p 3498 1669 V 724 1672 +2777 4 v 724 1689 V 724 1789 4 100 v 780 1759 a(P)t Fv(O)t(S)t(I)t(X)p +3498 1789 V 724 1888 V 778 1858 a FA(ttyc/char-size)529 +b(CSIZE)316 b FD(Character)19 b(size)h(mask)p 3498 1888 +V 724 1988 V 778 1958 a FA(ttyc/char-size5)485 b(CS5)404 +b FD(5)20 b(bits)p 3498 1988 V 724 2088 V 778 2058 a +FA(ttyc/char-size6)485 b(CS6)404 b FD(6)20 b(bits)p 3498 +2088 V 724 2187 V 778 2157 a FA(ttyc/char-size7)485 b(CS7)404 +b FD(7)20 b(bits)p 3498 2187 V 724 2287 V 778 2257 a +FA(ttyc/char-size8)485 b(CS8)404 b FD(8)20 b(bits)p 3498 +2287 V 724 2386 V 778 2357 a FA(ttyc/enable-par)o(ity)354 +b(PARENB)272 b FD(Generate)20 b(and)g(detect)g(parity)-9 +b(.)p 3498 2386 V 724 2486 V 778 2456 a FA(ttyc/odd-parity)485 +b(PARODD)272 b FD(Odd)20 b(parity)-9 b(.)p 3498 2486 +V 724 2586 V 778 2556 a FA(ttyc/enable-rea)o(d)442 b(CREAD)316 +b FD(Enable)20 b(r)o(eception)g(of)h(chars.)p 3498 2586 +V 724 2685 V 778 2655 a FA(ttyc/hup-on-clo)o(se)398 b(HUPCL)316 +b FD(Hang)21 b(up)f(on)i(last)e(close.)p 3498 2685 V +724 2785 V 778 2755 a FA(ttyc/no-modem-s)o(ync)354 b(LOCAL)316 +b FD(Ignor)o(e)20 b(modem)i(lines.)p 3498 2785 V 724 +2885 V 778 2855 a FA(ttyc/2-stop-bit)o(s)442 b(CSTOPB)272 +b FD(Send)20 b(two)h(stop)h(bits.)p 3498 2885 V 724 2888 +2777 4 v 724 2905 V 724 3004 4 100 v 778 2974 a(4.3+BSD)p +3498 3004 V 724 3104 V 778 3074 a FA(ttyc/ignore-fla)o(gs)398 +b(CIGNORE)228 b FD(Ignor)o(e)20 b(contr)o(ol)h(\003ags.)p +3498 3104 V 724 3203 V 778 3173 a FA(ttyc/CTS-output)o(-fl)o(ow)o(-c)o +(tl)93 b(CCTS_OFLOW)j FD(CTS)20 b(\003ow)i(contr)o(ol)f(of)f(output)p +3498 3203 V 724 3303 V 778 3273 a FA(ttyc/RTS-input-)o(flo)o(w-)o(ct)o +(l)137 b(CRTS_IFLOW)96 b FD(R)m(TS)20 b(\003ow)i(contr)o(ol)f(of)g +(input)p 3498 3303 V 724 3403 V 778 3373 a FA(ttyc/carrier-fl)o(ow-)o +(ct)o(l)224 b(MDMBUF)p 3498 3403 V 724 3406 2777 4 v +681 3641 a FD(T)-8 b(able)25 b(3.8:)35 b(Contr)o(ol-\003ags.)42 +b(These)25 b(ar)o(e)g(the)h(named)g(\003ags)g(for)g(the)g +FA(tty-info)c FD(r)o(ecor)o(d's)681 3740 y FC(contr)o(ol-\003ags)31 +b FD(\002eld.)62 b(These)32 b(\003ags)h(generally)g(contr)o(ol)g(the)g +(details)f(of)h(the)g(terminal's)681 3840 y(serial)20 +b(line.)26 b(Only)c(the)h(P)t Fv(O)t(S)t(I)t(X)h FD(entries)d(ar)o(e)e +(guaranteed)g(to)j(be)e(non-)p FA(#f)p FD(.)2071 5147 +y(88)p eop +%%Page: 89 97 +89 96 bop 410 1442 2776 4 v 410 1533 4 92 v 463 1506 +a Fk(Scsh)972 b(C)439 b(Meaning)p 3182 1533 V 410 1536 +2776 4 v 410 1553 V 410 1644 4 92 v 465 1617 a(P)t Fg(O)t(S)t(I)t(X)p +3182 1644 V 410 1736 V 463 1708 a Fj(ttyl/canonical)573 +b(ICANON)258 b Fk(Canonical)20 b(input)f(pr)o(ocessing.)p +3182 1736 V 410 1827 V 463 1799 a Fj(ttyl/echo)768 b(ECHO)336 +b Fk(Enable)19 b(echoing.)p 3182 1827 V 410 1918 V 463 +1891 a Fj(ttyl/echo-delete-line)300 b(ECHOK)d Fk(Echo)19 +b(newline)g(after)g(line)f(kill.)p 3182 1918 V 410 2010 +V 463 1982 a Fj(ttyl/echo-nl)651 b(ECHONL)258 b Fk(Echo)19 +b(newline)g(even)g(if)f(echo)h(is)f(of)o(f.)p 3182 2010 +V 410 2101 V 463 2073 a Fj(ttyl/visual-delete)417 b(ECHOE)297 +b Fk(V)l(isually)18 b(erase)f(chars.)p 3182 2101 V 410 +2192 V 463 2165 a Fj(ttyl/enable-signals)378 b(ISIG)336 +b Fk(Enable)19 b Fj(^)p Fk(C,)g Fj(^)p Fk(Z)f(signalling.)p +3182 2192 V 410 2284 V 463 2256 a Fj(ttyl/extended)612 +b(IEXTEN)258 b Fk(Enable)19 b(extensions.)p 3182 2284 +V 410 2375 V 463 2347 a Fj(ttyl/no-flush-on-interrupt)105 +b(NOFLSH)258 b Fk(Don't)19 b(\003ush)g(after)g(interr)o(upt.)p +3182 2375 V 410 2466 V 463 2439 a Fj(ttyl/ttou-signal)495 +b(ITOSTOP)219 b(SIGTTOU)20 b Fk(on)f(backgr)o(ound)f(output.)p +3182 2466 V 410 2469 2776 4 v 410 2486 V 410 2577 4 92 +v 463 2550 a(SVR4)h(and)g(4.3+BSD)p 3182 2577 V 410 2669 +V 463 2641 a Fj(ttyl/echo-ctl)612 b(ECHOCTL)219 b Fk(Echo)19 +b(contr)o(ol)f(chars)h(as)g(\223)p Fj(^X)p Fk(\224.)p +3182 2669 V 410 2760 V 463 2733 a Fj(ttyl/flush-output)456 +b(FLUSHO)258 b Fk(Output)19 b(is)f(being)h(\003ushed.)p +3182 2760 V 410 2851 V 463 2824 a Fj(ttyl/hardcopy-delete)339 +b(ECHOPRT)219 b Fk(V)l(isual)18 b(erase)g(for)g(har)o(dcopy)-8 +b(.)p 3182 2851 V 410 2943 V 463 2915 a Fj(ttyl/reprint-unread-chars) +144 b(PENDIN)258 b Fk(Retype)18 b(pending)g(input.)p +3182 2943 V 410 3034 V 463 3007 a Fj(ttyl/visual-delete-line)222 +b(ECHOKE)258 b Fk(V)l(isually)18 b(erase)f(a)i(line-kill.)p +3182 3034 V 410 3037 2776 4 v 410 3054 V 410 3145 4 92 +v 463 3118 a(4.3+BSD)p 3182 3145 V 410 3237 V 463 3209 +a Fj(ttyl/alt-delete-word)339 b(ALTWERASE)141 b Fk(Alternate)19 +b(wor)o(d)f(erase)g(algorithm)p 3182 3237 V 410 3328 +V 463 3301 a Fj(ttyl/no-kernel-status)300 b(NOKERNINFO)102 +b Fk(No)19 b(kernel)e(status)i(on)g Fj(^T)p Fk(.)p 3182 +3328 V 410 3331 2776 4 v 410 3348 V 410 3439 4 92 v 463 +3412 a(SVR4)p 3182 3439 V 410 3530 V 463 3503 a Fj(ttyl/case-map)612 +b(XCASE)297 b Fk(Canonical)20 b(case)f(pr)o(esentation)p +3182 3530 V 410 3534 2776 4 v 365 3769 a FD(T)-8 b(able)32 +b(3.9:)46 b(Local-\003ags.)58 b(These)32 b(ar)o(e)e(the)i(named)g +(\003ags)g(for)g(the)f FA(tty-info)e FD(r)o(ecor)o(d's)365 +3868 y FC(local-\003ags)j FD(\002eld.)61 b(These)33 b(\003ags)g +(generally)f(contr)o(ol)i(the)e(details)h(of)f(the)h(line-editting)365 +3968 y(user)21 b(interface.)j(Only)e(the)h(P)t Fv(O)t(S)t(I)t(X)h +FD(entries)d(ar)o(e)e(guaranteed)h(to)h(be)f(non-)p FA(#f)p +FD(.)1756 5147 y(89)p eop +%%Page: 90 98 +90 97 bop 681 1274 a Fz(Chapter)44 b(4)681 1727 y FE(Networking)681 +2220 y FD(The)28 b(Scheme)f(Shell)h(pr)o(ovides)g(a)f(BSD-style)h +(sockets)g(interface.)46 b(Ther)o(e)28 b(is)g(not)h(an)e(of-)681 +2320 y(\002cial)f(standar)o(d)g(for)g(a)g(network)i(interface)d(for)i +(scsh)g(to)h(adopt)e(\(this)h(is)g(the)g(subject)g(of)681 +2420 y(the)j(forthcoming)i(Posix.8)e(standar)o(d\).)53 +b(However)-6 b(,)32 b(Berkeley)e(sockets)h(ar)o(e)e(a)h +FC(de)g(facto)681 2519 y FD(standar)o(d,)19 b(being)i(found)g(on)g +(most)h(Unix)e(workstations)i(and)f(PC)f(operating)h(systems.)805 +2656 y(It)30 b(is)g(fairly)f(straightforwar)o(d)f(to)i(add)f(higher)o +(-level)g(network)h(pr)o(otocols)g(such)g(as)681 2756 +y(smtp,)21 b(telnet,)g(or)h(http)f(on)h(top)f(of)h(the)f(the)g(basic)g +(socket-level)g(support)g(scsh)h(pr)o(ovides.)681 2855 +y(The)28 b(Scheme)h(Under)o(gr)o(ound)e(has)i(also)f(r)o(eleased)f(a)h +(network)i(library)e(with)h(many)g(of)681 2955 y(these)22 +b(pr)o(otocols)g(as)f(a)h(companion)g(to)h(the)e(curr)o(ent)g(r)o +(elease)g(of)g(scsh.)29 b(See)21 b(this)i(code)e(for)681 +3055 y(examples)f(showing)i(the)f(use)g(of)g(the)g(sockets)g +(interface.)681 3364 y Fy(4.1)99 b(High-level)26 b(interface)681 +3595 y FD(For)18 b(convenience,)g(and)g(to)g(avoid)f(some)i(of)f(the)g +(messy)g(details)f(of)h(the)g(socket)g(interface,)681 +3694 y(we)f(pr)o(ovide)f(a)g(high)i(level)f(socket)g(interface.)23 +b(These)17 b(r)o(outines)g(attempt)f(to)i(make)e(it)h(easy)681 +3794 y(to)22 b(write)h(simple)g(clients)f(and)g(servers)g(without)i +(having)e(to)h(think)g(of)g(many)f(of)g(the)h(de-)681 +3894 y(tails)e(of)g(initiating)i(socket)e(connections.)29 +b(W)-8 b(e)21 b(welcome)h(suggested)f(impr)o(ovements)h(to)681 +3993 y(this)h(interface,)e(including)i(better)e(names,)h(which)h(right) +g(now)g(ar)o(e)e(solely)i(descriptions)681 4093 y(of)28 +b(the)g(pr)o(ocedur)o(e's)e(action.)48 b(This)29 b(might)g(be)f(\002ne) +g(for)g(people)g(who)h(alr)o(eady)d(under)o(-)681 4193 +y(stand)20 b(sockets,)h(but)g(does)g(not)g(help)g(the)g(new)g +(networking)h(pr)o(ogrammer)-6 b(.)681 4350 y FA(\(socket-connect)37 +b FC(pr)o(otocol-family)18 b(socket-type)h(.)i(ar)o(gs)p +FA(\))86 b Fw(\000)-14 b(!)87 b FC(socket)138 b FD(pr)o(ocedur)o(e)888 +4500 y FA(socket-connect)93 b FD(is)98 b(intended)g(for)g(cr)o(eating)f +(client)h(applications.)888 4599 y FC(pr)o(otocol-family)50 +b FD(is)j(speci\002ed)e(as)h(either)h(the)f FA(protocol-family/)o(int)o +(er)o(ne)o(t)888 4699 y FD(or)85 b FA(protocol-family/u)o(ni)o(x)p +FD(.)211 b FC(socket-type)83 b FD(is)i(speci\002ed)g(as)f(either)888 +4799 y FA(socket-type/strea)o(m)45 b FD(or)51 b FA(socket-type/dat)o +(agr)o(am)o FD(.)110 b(See)50 b FA(socket)e FD(for)j(a)888 +4898 y(mor)o(e)21 b(complete)g(description)g(of)f(these)h(terms.)2071 +5147 y(90)p eop +%%Page: 91 99 +91 98 bop 573 614 a FD(The)19 b(variable)f FC(ar)o(gs)h +FD(list)h(is)f(meant)g(to)h(specify)f(pr)o(otocol)g(family)h +(speci\002c)f(informa-)573 714 y(tion.)47 b(For)29 b(Internet)e +(sockets,)j(this)f(consists)g(of)f(two)g(ar)o(guments:)40 +b(a)27 b(host)i(name)573 814 y(and)20 b(a)g(port)h(number)-6 +b(.)26 b(For)21 b(Unix)f(sockets,)i(this)f(consists)h(of)f(a)f +(pathname.)573 952 y FA(socket-connect)e FD(r)o(eturns)24 +b(a)g FA(socket)e FD(which)j(can)f(be)g(used)h(for)f(input)h(and)e +(out-)573 1052 y(put)c(fr)o(om)f(a)g(r)o(emote)g(server)-6 +b(.)24 b(See)18 b FA(socket)e FD(for)j(a)f(description)h(of)g(the)g +FC(socket)f(r)o(ecord)p FD(.)365 1259 y FA(\(bind-listen-acce)o(pt)o +(-lo)o(op)37 b FC(pr)o(otocol-family)13 b(pr)o(oc)i(ar)o(g)p +FA(\))42 b Fw(\000)-14 b(!)43 b FC(does-not-r)o(eturn)87 +b FD(pr)o(ocedur)o(e)573 1406 y FA(bind-listen-acce)o(pt)o(-lo)o(op)26 +b FD(is)33 b(intended)g(for)g(cr)o(eating)f(server)g(application-)573 +1505 y(s.)c FC(pr)o(otocol-family)19 b FD(is)j(speci\002ed)f(as)h +(either)f(the)h FA(protocol-family/)o(in)o(te)o(rne)o(t)15 +b FD(or)573 1605 y FA(protocol-family/)o(un)o(ix)p FD(.)23 +b FC(pr)o(oc)f FD(is)g(a)g(pr)o(ocedur)o(e)e(of)i(two)h(ar)o(guments:) +28 b(a)22 b FA(socket)573 1705 y FD(and)17 b(a)h(socket-addr)o(ess.)23 +b FC(ar)o(g)17 b FD(speci\002es)h(a)g(port)g(number)g(for)f(Internet)h +(sockets)h(or)f(a)573 1804 y(pathname)23 b(for)g(Unix)g(sockets.)34 +b(See)22 b FA(socket)f FD(for)i(a)g(mor)o(e)g(complete)g(description) +573 1904 y(of)e(these)f(terms.)573 2042 y FC(pr)o(oc)g +FD(is)i(called)f(with)h(a)g(socket)f(and)h(a)f(socket)h(addr)o(ess)e +(each)h(time)h(ther)o(e)e(is)i(a)f(con-)573 2142 y(nection)36 +b(fr)o(om)f(a)f(client)i(application.)68 b(The)35 b(socket)h(allows)g +(communications)573 2241 y(with)30 b(the)f(client.)51 +b(The)29 b(socket)h(addr)o(ess)d(speci\002es)j(the)f(addr)o(ess)f(of)h +(the)g(r)o(emote)573 2341 y(client.)573 2479 y(This)23 +b(pr)o(ocedur)o(e)d(does)j(not)g(r)o(eturn,)f(but)g(loops)h +(inde\002nitely)g(accepting)f(connec-)573 2579 y(tions)g(fr)o(om)e +(client)h(pr)o(ograms.)365 2897 y Fy(4.2)99 b(Sockets)365 +3144 y FA(\(create-socket)38 b FC(pr)o(otocol-family)18 +b(type)i([pr)o(otocol])p FA(\))84 b Fw(\000)-14 b(!)87 +b FC(socket)270 b FD(pr)o(ocedur)o(e)365 3244 y FA(\(create-socket-pa)o +(ir)37 b FC(type)p FA(\))86 b Fw(\000)-15 b(!)88 b FC([socket)1960 +3256 y Fx(1)2017 3244 y FC(socket)2217 3256 y Fx(2)2254 +3244 y FC(])573 b FD(pr)o(ocedur)o(e)365 3343 y FA(\(close-socket)39 +b FC(socket)p FA(\))86 b Fw(\000)-14 b(!)87 b FC(unde\002ned)998 +b FD(pr)o(ocedur)o(e)573 3471 y(A)27 b(socket)i(is)f(one)h(end)f(of)f +(a)h(network)h(connection.)48 b(Thr)o(ee)27 b(speci\002c)h(pr)o +(operties)573 3570 y(of)h(sockets)h(ar)o(e)e(speci\002ed)h(at)f(cr)o +(eation)h(time:)43 b(the)29 b(pr)o(otocol-family)-9 b(,)31 +b(type,)g(and)573 3670 y(pr)o(otocol.)573 3808 y(The)21 +b FC(pr)o(otocol-family)d FD(speci\002es)k(the)f(pr)o(otocol)h(family)f +(to)g(be)g(used)g(with)h(the)f(sock-)573 3908 y(et.)j(This)17 +b(also)g(determines)g(the)g(addr)o(ess)e(family)i(of)g(socket)g(addr)o +(esses,)f(which)i(ar)o(e)573 4007 y(described)f(in)h(mor)o(e)g(detail)f +(below)-8 b(.)26 b(Scsh)18 b(curr)o(ently)f(supports)h(the)h(Unix)e +(internal)573 4107 y(pr)o(otocols)k(and)f(the)h(Internet)g(pr)o +(otocols)g(using)h(the)f(following)h(constants:)756 4284 +y FA(protocol-family)o(/u)o(nsp)o(ec)o(ifi)o(ed)756 4384 +y(protocol-family)o(/u)o(nix)756 4483 y(protocol-family)o(/i)o(nte)o +(rn)o(et)573 4699 y FD(The)h FC(type)f FD(speci\002es)h(the)g(style)g +(of)g(communication.)33 b(Examples)23 b(that)f(your)i(oper)o(-)573 +4799 y(ating)18 b(system)h(pr)o(obably)e(pr)o(ovides)g(ar)o(e)g(str)o +(eam)g(and)g(datagram)g(sockets.)25 b(Others)573 4898 +y(maybe)20 b(available)g(depending)g(on)i(your)f(system.)26 +b(T)-7 b(ypical)20 b(values)g(ar)o(e:)1756 5147 y(91)p eop -%%Page: 91 97 -91 96 bop 756 614 a FA(socket-type/str)o(ea)o(m)756 714 -y(socket-type/dat)o(ag)o(ram)756 814 y(socket-type/raw)573 -1007 y FD(The)19 b FC(pr)o(otocol)e FD(speci\002es)i(a)g(particular)f -(pr)o(otocol)h(to)g(use)h(within)g(a)e(pr)o(otocol)i(family)573 -1107 y(and)15 b(type.)24 b(Usually)16 b(only)g(one)h(choice)f(exists,)g -(but)g(it's)h(pr)o(obably)e(safest)g(to)h(set)g(this)573 -1207 y(explicitly)-9 b(.)33 b(See)23 b(the)g(pr)o(otocol)h(database)e -(r)o(outines)h(for)h(information)g(on)g(looking)573 1306 -y(up)d(pr)o(otocol)g(constants.)573 1437 y(New)48 b(sockets)h(ar)o(e)e -(typically)i(cr)o(eated)e(with)i FA(create-socket)p FD(.)103 -b(However)-6 b(,)573 1537 y FA(create-socket-pa)o(ir)14 -b FD(can)19 b(also)i(be)f(used)g(to)g(cr)o(eate)f(a)g(pair)h(of)g -(connected)g(sock-)573 1637 y(ets)36 b(in)g(the)g FA(protocol-family/u) -o(nix)29 b FD(pr)o(otocol-family)-9 b(.)71 b(The)36 b(value)f(of)h(a)g -(r)o(e-)573 1736 y(turned)20 b(socket)h(is)h(a)e FC(socket)g(r)o(ecord) -p FD(,)g(de\002ned)h(to)g(have)f(the)h(following)h(str)o(uctur)o(e:)756 -1899 y FA(\(define-record)37 b(socket)843 1998 y(family)1392 -b(;)43 b(protocol)d(family)843 2098 y(inport)1392 b(;)43 -b(input-port)843 2198 y(outport\))1304 b(;)43 b(output-port)573 -2391 y FD(The)26 b FA(family)e FD(speci\002es)j(the)f(pr)o(otocol)h -(family)g(of)f(the)h(socket.)43 b(The)26 b FA(inport)e -FD(and)573 2491 y FA(outport)h FD(\002elds)j(ar)o(e)f(ports)i(that)f -(can)g(be)g(used)f(for)h(input)h(and)f(output,)i(r)o(espec-)573 -2591 y(tively)-9 b(.)48 b(For)29 b(a)e(str)o(eam)h(socket,)i(they)f(ar) -o(e)e(only)i(usable)f(after)f(a)h(connection)i(has)573 -2690 y(been)18 b(established)g(via)g FA(connect-socket)13 -b FD(or)19 b FA(accept-connecti)o(on)p FD(.)f(For)h(a)f(data-)573 -2790 y(gram)j(socket,)g FC(outport)f FD(can)h(be)g(immediately)g(using) -h FA(send-message)p FD(,)16 b(and)21 b FC(inport)573 -2890 y FD(can)f(be)h(used)f(after)g FA(bind)f FD(has)i(cr)o(eated)d(a)j -(local)f(addr)o(ess.)573 3021 y FA(close-socket)j FD(pr)o(ovides)28 -b(a)g(convenient)h(way)g(to)f(close)h(a)f(socket's)h(port.)49 -b(It)28 b(is)573 3120 y(pr)o(eferr)o(ed)14 b(to)j(explicitly)g(closing) -i(the)e(inport)g(and)g(outport)h(because)e(using)i FA(close)573 -3220 y FD(on)j(sockets)h(is)f(not)g(curr)o(ently)f(portable)h(acr)o -(oss)f(operating)h(systems.)365 3510 y Fy(4.3)99 b(Socket)26 -b(addresses)365 3724 y FD(The)i(format)g(of)g(a)g(socket-addr)o(ess)e -(depends)i(on)g(the)h(addr)o(ess)d(family)i(of)g(the)g(socket.)365 -3824 y(Addr)o(ess-family-speci\002c)21 b(r)o(outines)j(ar)o(e)e(pr)o -(ovided)g(to)i(convert)f(pr)o(otocol-speci\002c)h(ad-)365 -3924 y(dr)o(esses)i(to)i(socket)f(addr)o(esses.)43 b(The)27 -b(value)f(r)o(eturned)g(by)h(these)g(r)o(outines)g(is)h(a)e -FC(socket-)365 4023 y(addr)o(ess)21 b(r)o(ecord)p FD(,)f(de\002ned)g -(to)h(have)f(the)h(following)i(visible)e(str)o(uctur)o(e:)573 -4207 y FA(\(define-record)38 b(socket-address)660 4307 -y(family\))1348 b(;)43 b(address)e(family)490 4515 y -FD(The)21 b FA(family)d FD(is)j(one)g(of)g(the)g(following)h -(constants:)573 4699 y FA(address-family/u)o(ns)o(pec)o(if)o(ied)573 -4799 y(address-family/u)o(ni)o(x)573 4898 y(address-family/i)o(nt)o -(ern)o(et)1756 5147 y FD(91)p eop -%%Page: 92 98 -92 97 bop 681 614 a FA(\(unix-address->s)o(oc)o(ket)o(-a)o(dd)o(res)o -(s)37 b FC(pathname)p FA(\))56 b Fw(\000)-14 b(!)57 b -FC(socket-addr)o(ess)86 b FD(pr)o(ocedur)o(e)888 751 -y FA(unix-address->soc)o(ke)o(t-a)o(dd)o(res)o(s)33 b -FD(r)o(eturns)38 b(a)g FC(socket-addr)o(ess)g FD(based)g(on)i(the)888 -851 y(string)e FC(pathname)n FD(.)75 b(Ther)o(e)36 b(is)h(a)g(system)g -(dependent)g(limit)g(on)h(the)f(length)h(of)888 951 y -FC(pathname)o FD(.)681 1135 y FA(\(internet-addres)o(s-)o(>so)o(ck)o -(et)o(-ad)o(dr)o(ess)f FC(host-addr)o(ess)14 b(service-port)p -FA(\))43 b Fw(\000)-15 b(!)44 b FC(socket-addr)o(ess)86 -b FD(pr)o(ocedur)o(e)888 1272 y FA(internet-address-)o(>s)o(ock)o(et)o -(-ad)o(dr)o(ess)28 b FD(r)o(eturns)34 b(a)h FC(socket-addr)o(ess)e -FD(based)h(on)888 1372 y(an)25 b(integer)g FC(host-addr)o(ess)f -FD(and)g(an)h(integer)g FC(service-port)p FD(.)38 b(Besides)24 -b(being)i(a)e(32-bit)888 1471 y(host)29 b(addr)o(ess,)g(an)f(Internet)g -(host)h(addr)o(ess)d(can)i(also)h(be)f(one)g(of)g(the)h(following)888 -1571 y(constants:)1071 1733 y FA(internet-address)o(/an)o(y)1071 -1833 y(internet-address)o(/lo)o(op)o(ba)o(ck)1071 1932 -y(internet-address)o(/br)o(oa)o(dc)o(ast)888 2125 y FD(The)h(use)f(of)h -FA(internet-addres)o(s/a)o(ny)23 b FD(is)30 b(described)e(below)i(in)g -FA(bind-socket)p FD(.)888 2225 y FA(internet-address/)o(lo)o(opb)o(ac)o -(k)11 b FD(is)17 b(an)f(addr)o(ess)f(that)i(always)f(speci\002es)h(the) -g(local)888 2324 y(machine.)47 b FA(internet-address)o(/br)o(oa)o(dca)o -(st)21 b FD(is)28 b(used)g(for)f(network)i(br)o(oadcast)888 -2424 y(communications.)888 2555 y(For)f(information)g(on)h(obtaining)f -(a)f(host's)i(addr)o(ess,)e(see)g(the)h FA(host-info)c -FD(func-)888 2654 y(tion.)681 2839 y FA(\(socket-address-)o(>u)o(nix)o -(-a)o(dd)o(res)o(s)37 b FC(socket-addr)o(ess)p FA(\))56 -b Fw(\000)-14 b(!)57 b FC(pathname)86 b FD(pr)o(ocedur)o(e)681 -2939 y FA(\(socket-address-)o(>i)o(nte)o(rn)o(et)o(-ad)o(dr)o(ess)37 -b FC(socket-addr)o(ess)p FA(\))42 b Fw(\000)-14 b(!)43 -b FC([host-addr)o(ess)14 b(service-port])86 b FD(pr)o(ocedur)o(e)888 -3076 y(The)227 b(r)o(outines)h FA(socket-address-)o(>in)o(te)o(rne)o -(t-)o(ad)o(dre)o(ss)220 b FD(and)888 3175 y FA(socket-address->u)o(ni)o -(x-a)o(dd)o(res)o(s)74 b FD(r)o(eturn)81 b(the)f(addr)o -(ess-family-speci\002c)888 3275 y(addr)o(esses.)94 b(Be)43 -b(awar)o(e)g(that)g(most)i(implementations)h(don't)e(corr)o(ectly)f(r)o -(e-)888 3375 y(turn)e(anything)g(mor)o(e)f(than)g(an)g(empty)g(string)h -(for)f(addr)o(esses)e(in)j(the)f(Unix)888 3474 y(addr)o(ess-family)-9 -b(.)681 3764 y Fy(4.4)99 b(Socket)25 b(primitives)681 -3978 y FD(The)30 b(pr)o(ocedur)o(es)f(in)i(this)h(section)f(ar)o(e)e -(pr)o(esented)h(in)h(the)g(or)o(der)e(in)j(which)f(a)f(typical)681 -4078 y(pr)o(ogram)24 b(will)i(use)f(them.)39 b(Consult)26 -b(a)e(text)h(on)g(network)h(systems)g(pr)o(ogramming)f(for)681 -4178 y(mor)o(e)18 b(information)h(on)h(sockets.)1744 -4147 y Fs(1)1802 4178 y FD(The)f(last)f(two)h(tutorials)g(ar)o(e)e(fr)o -(eely)g(available)h(as)g(part)p 681 4250 1146 4 v 771 -4306 a Fr(1)800 4330 y Fv(Some)f(r)o(ecommended)d(ones)j(ar)o(e:)812 -4446 y Fc(\017)41 b Fv(\223Unix)17 b(Network)g(Pr)o(ogramming\224)g(by) -f(W)-6 b(.)17 b(Richar)o(d)g(Stevens)812 4554 y Fc(\017)41 -b Fv(\223An)19 b(Intr)o(oductory)g(4.3BSD)g(Interpr)o(ocess)g -(Communication)g(T)-6 b(utorial.\224)28 b(\(r)o(eprinted)18 -b(in)h(UNIX)h(Pr)o(o-)888 4633 y(grammer)5 b('s)17 b(Supplementary)f -(Documents)h(V)-7 b(olume)16 b(1,)g(PS1:7\))812 4741 -y Fc(\017)41 b Fv(\223An)25 b(Advanced)f(4.3BSD)h(Interpr)o(ocess)h -(Communication)g(T)-6 b(utorial.\224)48 b(\(r)o(eprinted)24 -b(in)i(UNIX)g(Pr)o(o-)888 4819 y(grammer)5 b('s)17 b(Supplementary)f -(Documents)h(V)-7 b(olume)16 b(1,)g(PS1:8\))2071 5147 -y FD(92)p eop -%%Page: 93 99 -93 98 bop 365 614 a FD(of)22 b(BSD.)e(In)i(the)g(absence)e(of)i(these,) -f(your)h(Unix)f(manual)h(pages)f(for)g(socket)h(might)g(be)f(a)365 -714 y(good)h(starting)f(point)g(for)g(information.)365 -864 y FA(\(connect-socket)38 b FC(socket)20 b(socket-addr)o(ess)p -FA(\))86 b Fw(\000)-14 b(!)87 b FC(unde\002ned)415 b -FD(pr)o(ocedur)o(e)573 1005 y FA(connect-socket)52 b -FD(sets)58 b(up)g(a)f(connection)i(fr)o(om)f(a)f FC(socket)g -FD(to)i(a)e(r)o(emote)573 1105 y FC(socket-addr)o(ess)o -FD(.)62 b(A)32 b(connection)j(has)e(dif)o(fer)o(ent)d(meanings)k -(depending)f(on)g(the)573 1205 y(socket)22 b(type.)30 -b(A)22 b(str)o(eam)g(socket)g(must)h(be)f(connected)g(befor)o(e)f(use.) -30 b(A)22 b(datagram)573 1304 y(socket)h(can)f(be)g(connected)g -(multiple)h(times,)g(but)f(need)g(not)h(be)f(connected)h(at)f(all)573 -1404 y(if)f(the)h(r)o(emote)f(addr)o(ess)f(is)h(speci\002ed)g(with)i -(each)d FA(send-message)p FD(,)d(described)j(be-)573 -1504 y(low)-8 b(.)26 b(Also,)20 b(datagram)e(sockets)i(may)f(be)g -(disassociated)g(fr)o(om)g(a)g(r)o(emote)g(addr)o(ess)573 -1603 y(by)i(connecting)h(to)f(a)f(null)h(r)o(emote)g(addr)o(ess.)365 -1795 y FA(\(bind-socket)39 b FC(socket)20 b(socket-addr)o(ess)p -FA(\))86 b Fw(\000)-14 b(!)87 b FC(unde\002ned)546 b -FD(pr)o(ocedur)o(e)573 1937 y FA(bind-socket)24 b FD(assigns)29 -b(a)f(certain)g(local)g FC(socket-addr)o(ess)f FD(to)i(a)f -FC(socket)p FD(.)48 b(Binding)29 b(a)573 2037 y(socket)h(r)o(eserves)f -(the)h(local)g(addr)o(ess.)52 b(T)-8 b(o)31 b(r)o(eceive)d(connections) -k(after)d(binding)573 2136 y(the)23 b(socket,)h(use)f -FA(listen-socket)18 b FD(for)k(str)o(eam)h(sockets)g(and)g -FA(receive-message)573 2236 y FD(for)d(datagram)g(sockets.)573 -2369 y(Binding)e(an)f(Internet)h(socket)g(with)g(a)f(host)h(addr)o(ess) -e(of)i FA(internet-address)o(/a)o(ny)573 2469 y FD(indicates)f(that)h -(the)g(caller)f(does)g(not)i(car)o(e)d(to)i(specify)f(fr)o(om)h(which)g -(local)g(network)573 2568 y(interface)i(connections)i(ar)o(e)d(r)o -(eceived.)24 b(Binding)d(an)g(Internet)g(socket)g(with)g(a)g(ser)o(-) -573 2668 y(vice)h(port)h(number)g(of)f(zer)o(o)g(indicates)g(that)h -(the)g(caller)f(has)g(no)i(pr)o(efer)o(ence)c(as)i(to)573 -2768 y(the)f(port)g(number)g(assigned.)573 2901 y(Binding)27 -b(a)e(socket)i(in)g(the)f(Unix)g(addr)o(ess)f(family)h(cr)o(eates)e(a)i -(socket)h(special)e(\002le)573 3000 y(in)f(the)f(\002le)g(system)h -(that)f(must)h(be)f(deleted)f(befor)o(e)g(the)i(addr)o(ess)d(can)i(be)g -(r)o(eused.)573 3100 y(See)d FA(delete-file)p FD(.)365 -3292 y FA(\(listen-socket)38 b FC(socket)21 b(backlog)p -FA(\))86 b Fw(\000)-15 b(!)88 b FC(unde\002ned)686 b -FD(pr)o(ocedur)o(e)573 3434 y FA(listen-socket)21 b FD(allows)27 -b(a)e(str)o(eam)h FC(socket)g FD(to)h(start)f(r)o(eceiving)f -(connections,)k(al-)573 3533 y(lowing)19 b(a)e(queue)g(of)h(up)f(to)h -FC(backlog)f FD(connection)i(r)o(equests.)24 b(Queued)17 -b(connections)573 3633 y(may)k(be)f(accepted)f(by)i FA -(accept-connectio)o(n)p FD(.)365 3825 y FA(\(accept-connectio)o(n)37 -b FC(socket)p FA(\))87 b Fw(\000)-14 b(!)87 b FC([new-socket)20 -b(socket-addr)o(ess])192 b FD(pr)o(ocedur)o(e)573 3967 -y FA(accept-connectio)o(n)24 b FD(r)o(eceives)30 b(a)g(connection)i(on) -f(a)f FC(socket)p FD(,)j(r)o(eturning)d(a)g(new)573 4066 -y(socket)19 b(that)g(can)f(be)h(used)g(for)f(this)i(connection)g(and)e -(the)h(r)o(emote)g(socket)g(addr)o(ess)573 4166 y(associated)h(with)h -(the)g(connection.)365 4358 y FA(\(socket-local-add)o(re)o(ss)37 -b FC(socket)p FA(\))87 b Fw(\000)-15 b(!)88 b FC(socket-addr)o(ess)503 -b FD(pr)o(ocedur)o(e)365 4458 y FA(\(socket-remote-ad)o(dr)o(ess)37 -b FC(socket)p FA(\))86 b Fw(\000)-14 b(!)87 b FC(socket-addr)o(ess)460 -b FD(pr)o(ocedur)o(e)573 4599 y(Sockets)42 b(can)g(be)g(associated)g -(with)h(a)f(local)g(addr)o(ess)f(or)h(a)g(r)o(emote)g(addr)o(ess)573 -4699 y(or)33 b(both.)62 b FA(socket-local-ad)o(dr)o(ess)26 -b FD(r)o(eturns)32 b(the)h(local)g FC(socket-addr)o(ess)e -FD(r)o(ecor)o(d)573 4799 y(associated)46 b(with)i FC(socket)o -FD(.)104 b FA(socket-remote-add)o(res)o(s)41 b FD(r)o(eturns)46 -b(the)h(r)o(emote)573 4898 y FC(socket-addr)o(ess)20 -b FD(r)o(ecor)o(d)f(associated)h(with)h FC(socket)p FD(.)1756 -5147 y(93)p eop -%%Page: 94 100 -94 99 bop 681 614 a FA(\(shutdown-socket)37 b FC(socket)20 +%%Page: 92 100 +92 99 bop 1071 614 a FA(socket-type/stre)o(am)1071 714 +y(socket-type/data)o(gra)o(m)1071 814 y(socket-type/raw)888 +1007 y FD(The)19 b FC(pr)o(otocol)f FD(speci\002es)h(a)f(particular)g +(pr)o(otocol)i(to)f(use)g(within)h(a)f(pr)o(otocol)g(family)888 +1107 y(and)d(type.)23 b(Usually)16 b(only)h(one)f(choice)g(exists,)h +(but)f(it's)g(pr)o(obably)f(safest)g(to)h(set)g(this)888 +1207 y(explicitly)-9 b(.)34 b(See)22 b(the)i(pr)o(otocol)g(database)d +(r)o(outines)j(for)f(information)h(on)g(looking)888 1306 +y(up)d(pr)o(otocol)g(constants.)888 1437 y(New)49 b(sockets)g(ar)o(e)e +(typically)i(cr)o(eated)d(with)j FA(create-socket)p FD(.)104 +b(However)-6 b(,)888 1537 y FA(create-socket-pai)o(r)14 +b FD(can)20 b(also)g(be)g(used)g(to)h(cr)o(eate)d(a)i(pair)f(of)i +(connected)f(sock-)888 1637 y(ets)36 b(in)h(the)f FA(protocol-family/)o +(uni)o(x)30 b FD(pr)o(otocol-family)-9 b(.)71 b(The)35 +b(value)h(of)g(a)f(r)o(e-)888 1736 y(turned)21 b(socket)g(is)g(a)f +FC(socket)h(r)o(ecord)p FD(,)f(de\002ned)g(to)h(have)g(the)g(following) +h(str)o(uctur)o(e:)1071 1899 y FA(\(define-record)38 +b(socket)1158 1998 y(family)1392 b(;)44 b(protocol)c(family)1158 +2098 y(inport)1392 b(;)44 b(input-port)1158 2198 y(outport\))1304 +b(;)44 b(output-port)888 2391 y FD(The)27 b FA(family)d +FD(speci\002es)i(the)h(pr)o(otocol)g(family)f(of)g(the)h(socket.)43 +b(The)27 b FA(inport)c FD(and)888 2491 y FA(outport)14 +b FD(\002elds)j(ar)o(e)e(ports)j(that)e(can)h(be)f(used)h(for)f(input)i +(and)e(output,)i(r)o(espective-)888 2591 y(ly)-9 b(.)36 +b(For)24 b(a)g(str)o(eam)f(socket,)i(they)g(ar)o(e)d(only)j(usable)f +(after)f(a)h(connection)h(has)f(been)888 2690 y(established)e(via)g +FA(connect-socket)16 b FD(or)22 b FA(accept-connection)o +FD(.)i(For)e(a)f(datagram)888 2790 y(socket,)31 b FC(outport)c +FD(can)h(be)g(immediately)g(using)h FA(send-message)p +FD(,)c(and)j FC(inport)f FD(can)888 2890 y(be)21 b(used)f(after)g +FA(bind)f FD(has)i(cr)o(eated)d(a)j(local)f(addr)o(ess.)888 +3021 y FA(close-socket)k FD(pr)o(ovides)k(a)f(convenient)j(way)e(to)h +(close)g(a)f(socket's)h(port.)48 b(It)29 b(is)888 3120 +y(pr)o(eferr)o(ed)14 b(to)k(explicitly)f(closing)h(the)f(inport)h(and)f +(outport)g(because)f(using)i FA(close)888 3220 y FD(on)k(sockets)f(is)g +(not)h(curr)o(ently)e(portable)g(acr)o(oss)g(operating)h(systems.)681 +3510 y Fy(4.3)99 b(Socket)25 b(addresses)681 3724 y FD(The)j(format)g +(of)g(a)f(socket-addr)o(ess)g(depends)g(on)i(the)f(addr)o(ess)f(family) +h(of)g(the)g(socket.)681 3824 y(Addr)o(ess-family-speci\002c)21 +b(r)o(outines)i(ar)o(e)f(pr)o(ovided)h(to)g(convert)h(pr)o +(otocol-speci\002c)f(ad-)681 3924 y(dr)o(esses)j(to)h(socket)h(addr)o +(esses.)42 b(The)27 b(value)g(r)o(eturned)e(by)i(these)h(r)o(outines)f +(is)g(a)g FC(socket-)681 4023 y(addr)o(ess)20 b(r)o(ecord)p +FD(,)g(de\002ned)g(to)i(have)e(the)h(following)h(visible)f(str)o(uctur) +o(e:)888 4207 y FA(\(define-record)38 b(socket-address)976 +4307 y(family\))1348 b(;)43 b(address)e(family)805 4515 +y FD(The)21 b FA(family)d FD(is)j(one)h(of)e(the)h(following)h +(constants:)888 4699 y FA(address-family/un)o(sp)o(eci)o(fi)o(ed)888 +4799 y(address-family/un)o(ix)888 4898 y(address-family/in)o(te)o(rne)o +(t)2071 5147 y FD(92)p eop +%%Page: 93 101 +93 100 bop 365 614 a FA(\(unix-address->so)o(ck)o(et-)o(ad)o(dre)o(ss) +37 b FC(pathname)p FA(\))55 b Fw(\000)-14 b(!)57 b FC(socket-addr)o +(ess)87 b FD(pr)o(ocedur)o(e)573 753 y FA(unix-address->so)o(ck)o(et-)o +(ad)o(dre)o(ss)32 b FD(r)o(eturns)39 b(a)f FC(socket-addr)o(ess)g +FD(based)g(on)h(the)573 853 y(string)f FC(pathname)n +FD(.)74 b(Ther)o(e)36 b(is)i(a)e(system)i(dependent)e(limit)i(on)g(the) +f(length)h(of)573 952 y FC(pathname)n FD(.)365 1139 y +FA(\(internet-address)o(->)o(soc)o(ke)o(t-a)o(dd)o(re)o(ss)f +FC(host-addr)o(ess)15 b(service-port)p FA(\))42 b Fw(\000)-14 +b(!)44 b FC(socket-addr)o(ess)86 b FD(pr)o(ocedur)o(e)573 +1278 y FA(internet-address)o(->)o(soc)o(ke)o(t-a)o(dd)o(re)o(ss)28 +b FD(r)o(eturns)35 b(a)f FC(socket-addr)o(ess)g FD(based)g(on)573 +1378 y(an)25 b(integer)g FC(host-addr)o(ess)e FD(and)i(an)g(integer)g +FC(service-port)o FD(.)38 b(Besides)25 b(being)g(a)g(32-bit)573 +1477 y(host)k(addr)o(ess,)f(an)g(Internet)g(host)h(addr)o(ess)e(can)h +(also)g(be)g(one)h(of)f(the)g(following)573 1577 y(constants:)756 +1740 y FA(internet-addres)o(s/)o(any)756 1840 y(internet-addres)o(s/)o +(loo)o(pb)o(ack)756 1940 y(internet-addres)o(s/)o(bro)o(ad)o(cas)o(t) +573 2135 y FD(The)h(use)h(of)f FA(internet-address/)o(an)o(y)23 +b FD(is)30 b(described)f(below)g(in)h FA(bind-socket)p +FD(.)573 2235 y FA(internet-address)o(/l)o(oop)o(ba)o(ck)10 +b FD(is)17 b(an)g(addr)o(ess)e(that)h(always)h(speci\002es)g(the)g +(local)573 2334 y(machine.)47 b FA(internet-addres)o(s/b)o(ro)o(ad)o +(cas)o(t)22 b FD(is)28 b(used)f(for)h(network)g(br)o(oadcast)573 +2434 y(communications.)573 2566 y(For)g(information)g(on)g(obtaining)h +(a)d(host's)j(addr)o(ess,)e(see)h(the)f FA(host-info)d +FD(func-)573 2665 y(tion.)365 2853 y FA(\(socket-address->)o(un)o(ix-)o +(ad)o(dre)o(ss)37 b FC(socket-addr)o(ess)p FA(\))56 b +Fw(\000)-14 b(!)57 b FC(pathname)86 b FD(pr)o(ocedur)o(e)365 +2952 y FA(\(socket-address->)o(in)o(ter)o(ne)o(t-a)o(dd)o(re)o(ss)37 +b FC(socket-addr)o(ess)p FA(\))42 b Fw(\000)-14 b(!)44 +b FC([host-addr)o(ess)14 b(service-port])86 b FD(pr)o(ocedur)o(e)573 +3091 y(The)227 b(r)o(outines)g FA(socket-address->i)o(nt)o(er)o(net)o +(-a)o(ddr)o(es)o(s)221 b FD(and)573 3190 y FA(socket-address->)o(un)o +(ix-)o(ad)o(dre)o(ss)74 b FD(r)o(eturn)80 b(the)h(addr)o +(ess-family-speci\002c)573 3290 y(addr)o(esses.)93 b(Be)44 +b(awar)o(e)e(that)i(most)h(implementations)g(don't)g(corr)o(ectly)e(r)o +(e-)573 3390 y(turn)d(anything)h(mor)o(e)f(than)g(an)g(empty)h(string)f +(for)g(addr)o(esses)f(in)h(the)h(Unix)573 3489 y(addr)o(ess-family)-9 +b(.)365 3781 y Fy(4.4)99 b(Socket)26 b(primitives)365 +3995 y FD(The)31 b(pr)o(ocedur)o(es)e(in)i(this)g(section)h(ar)o(e)d +(pr)o(esented)g(in)j(the)e(or)o(der)g(in)h(which)h(a)e(typical)365 +4095 y(pr)o(ogram)25 b(will)g(use)g(them.)39 b(Consult)26 +b(a)f(text)f(on)i(network)g(systems)g(pr)o(ogramming)f(for)365 +4194 y(mor)o(e)19 b(information)g(on)g(sockets.)1428 +4164 y Fs(1)1487 4194 y FD(The)f(last)h(two)g(tutorials)g(ar)o(e)e(fr)o +(eely)g(available)g(as)h(part)p 365 4245 1146 4 v 456 +4301 a Fr(1)485 4325 y Fv(Some)e(r)o(ecommended)f(ones)h(ar)o(e:)496 +4443 y Fc(\017)42 b Fv(\223Unix)17 b(Network)g(Pr)o(ogramming\224)f(by) +h(W)-6 b(.)16 b(Richar)o(d)i(Stevens)496 4552 y Fc(\017)42 +b Fv(\223An)18 b(Intr)o(oductory)h(4.3BSD)g(Interpr)o(ocess)h +(Communication)f(T)-6 b(utorial.\224)28 b(\(r)o(eprinted)18 +b(in)h(UNIX)g(Pr)o(o-)573 4631 y(grammer)5 b('s)17 b(Supplementary)e +(Documents)i(V)-7 b(olume)16 b(1,)h(PS1:7\))496 4741 +y Fc(\017)42 b Fv(\223An)25 b(Advanced)f(4.3BSD)h(Interpr)o(ocess)h +(Communication)g(T)-6 b(utorial.\224)47 b(\(r)o(eprinted)25 +b(in)g(UNIX)h(Pr)o(o-)573 4819 y(grammer)5 b('s)17 b(Supplementary)e +(Documents)i(V)-7 b(olume)16 b(1,)h(PS1:8\))1756 5147 +y FD(93)p eop +%%Page: 94 102 +94 101 bop 681 614 a FD(of)21 b(BSD.)g(In)h(the)f(absence)g(of)g +(these,)h(your)g(Unix)f(manual)g(pages)g(for)g(socket)h(might)g(be)g(a) +681 714 y(good)f(starting)g(point)h(for)e(information.)681 +864 y FA(\(connect-socket)37 b FC(socket)21 b(socket-addr)o(ess)p +FA(\))85 b Fw(\000)-14 b(!)87 b FC(unde\002ned)415 b +FD(pr)o(ocedur)o(e)888 1005 y FA(connect-socket)52 b +FD(sets)58 b(up)g(a)g(connection)h(fr)o(om)e(a)g FC(socket)h +FD(to)g(a)g(r)o(emote)888 1105 y FC(socket-addr)o(ess)o +FD(.)k(A)33 b(connection)h(has)f(dif)o(fer)o(ent)e(meanings)j +(depending)e(on)i(the)888 1205 y(socket)23 b(type.)30 +b(A)22 b(str)o(eam)f(socket)i(must)g(be)e(connected)i(befor)o(e)e(use.) +30 b(A)21 b(datagram)888 1304 y(socket)i(can)f(be)g(connected)h +(multiple)f(times,)h(but)g(need)f(not)h(be)f(connected)g(at)g(all)888 +1404 y(if)g(the)f(r)o(emote)g(addr)o(ess)f(is)i(speci\002ed)f(with)h +(each)f FA(send-message)p FD(,)16 b(described)21 b(be-)888 +1504 y(low)-8 b(.)26 b(Also,)20 b(datagram)e(sockets)i(may)g(be)f +(disassociated)g(fr)o(om)g(a)g(r)o(emote)g(addr)o(ess)888 +1603 y(by)i(connecting)h(to)f(a)f(null)i(r)o(emote)e(addr)o(ess.)681 +1795 y FA(\(bind-socket)38 b FC(socket)21 b(socket-addr)o(ess)p +FA(\))86 b Fw(\000)-15 b(!)88 b FC(unde\002ned)545 b +FD(pr)o(ocedur)o(e)888 1937 y FA(bind-socket)24 b FD(assigns)29 +b(a)f(certain)g(local)g FC(socket-addr)o(ess)g FD(to)h(a)e +FC(socket)p FD(.)49 b(Binding)29 b(a)888 2037 y(socket)i(r)o(eserves)e +(the)h(local)g(addr)o(ess.)52 b(T)-8 b(o)30 b(r)o(eceive)f(connections) +i(after)e(binding)888 2136 y(the)24 b(socket,)f(use)g +FA(listen-socket)18 b FD(for)23 b(str)o(eam)f(sockets)i(and)e +FA(receive-message)888 2236 y FD(for)f(datagram)e(sockets.)888 +2369 y(Binding)f(an)g(Internet)f(socket)h(with)g(a)f(host)i(addr)o(ess) +d(of)h FA(internet-address/)o(an)o(y)888 2469 y FD(indicates)h(that)f +(the)h(caller)f(does)h(not)g(car)o(e)e(to)i(specify)g(fr)o(om)f(which)i +(local)e(network)888 2568 y(interface)j(connections)i(ar)o(e)e(r)o +(eceived.)j(Binding)f(an)e(Internet)h(socket)g(with)h(a)e(ser)o(-)888 +2668 y(vice)j(port)f(number)h(of)g(zer)o(o)e(indicates)i(that)g(the)f +(caller)g(has)h(no)g(pr)o(efer)o(ence)d(as)j(to)888 2768 +y(the)e(port)g(number)g(assigned.)888 2901 y(Binding)27 +b(a)f(socket)g(in)h(the)f(Unix)g(addr)o(ess)f(family)h(cr)o(eates)f(a)h +(socket)g(special)g(\002le)888 3000 y(in)e(the)f(\002le)h(system)g +(that)f(must)h(be)f(deleted)f(befor)o(e)g(the)h(addr)o(ess)f(can)h(be)f +(r)o(eused.)888 3100 y(See)e FA(delete-file)p FD(.)681 +3292 y FA(\(listen-socket)38 b FC(socket)20 b(backlog)p +FA(\))86 b Fw(\000)-14 b(!)87 b FC(unde\002ned)686 b +FD(pr)o(ocedur)o(e)888 3434 y FA(listen-socket)21 b FD(allows)27 +b(a)f(str)o(eam)f FC(socket)h FD(to)h(start)f(r)o(eceiving)g +(connections,)j(al-)888 3533 y(lowing)19 b(a)e(queue)h(of)f(up)h(to)f +FC(backlog)g FD(connection)i(r)o(equests.)24 b(Queued)18 +b(connections)888 3633 y(may)j(be)g(accepted)e(by)i FA(accept-connecti) +o(on)p FD(.)681 3825 y FA(\(accept-connecti)o(on)37 b +FC(socket)p FA(\))86 b Fw(\000)-14 b(!)87 b FC([new-socket)21 +b(socket-addr)o(ess])191 b FD(pr)o(ocedur)o(e)888 3967 +y FA(accept-connection)24 b FD(r)o(eceives)29 b(a)h(connection)i(on)f +(a)g FC(socket)o FD(,)i(r)o(eturning)e(a)f(new)888 4066 +y(socket)20 b(that)e(can)h(be)f(used)h(for)g(this)g(connection)i(and)d +(the)h(r)o(emote)f(socket)i(addr)o(ess)888 4166 y(associated)g(with)i +(the)f(connection.)681 4358 y FA(\(socket-local-ad)o(dr)o(ess)37 +b FC(socket)p FA(\))86 b Fw(\000)-14 b(!)87 b FC(socket-addr)o(ess)503 +b FD(pr)o(ocedur)o(e)681 4458 y FA(\(socket-remote-a)o(dd)o(res)o(s)37 +b FC(socket)p FA(\))87 b Fw(\000)-14 b(!)87 b FC(socket-addr)o(ess)459 +b FD(pr)o(ocedur)o(e)888 4599 y(Sockets)43 b(can)f(be)g(associated)f +(with)i(a)f(local)h(addr)o(ess)d(or)j(a)f(r)o(emote)g(addr)o(ess)888 +4699 y(or)33 b(both.)62 b FA(socket-local-add)o(res)o(s)26 +b FD(r)o(eturns)33 b(the)f(local)h FC(socket-addr)o(ess)f +FD(r)o(ecor)o(d)888 4799 y(associated)47 b(with)g FC(socket)p +FD(.)104 b FA(socket-remote-ad)o(dr)o(ess)40 b FD(r)o(eturns)46 +b(the)i(r)o(emote)888 4898 y FC(socket-addr)o(ess)20 +b FD(r)o(ecor)o(d)f(associated)h(with)i FC(socket)o FD(.)2071 +5147 y(94)p eop +%%Page: 95 103 +95 102 bop 365 614 a FA(\(shutdown-socket)37 b FC(socket)21 b(how-to)p FA(\))85 b Fw(\000)-14 b(!)87 b FC(unde\002ned)616 -b FD(pr)o(ocedur)o(e)888 781 y FA(shutdown-socket)19 -b FD(shuts)27 b(down)f(part)e(of)h(a)g(full-duplex)g(socket.)39 -b(The)26 b(method)888 881 y(of)21 b(shutting)h(done)f(is)g(speci\002ed) -g(by)f(the)h FC(how-to)e FD(ar)o(gument,)h(one)i(of:)1071 -1098 y FA(shutdown/receive)o(s)1071 1198 y(shutdown/sends)1071 -1298 y(shutdown/sends+r)o(ece)o(iv)o(es)681 1851 y Fy(4.5)99 -b(Performing)24 b(input)h(and)g(output)g(on)g(sockets)681 -2128 y FA(\(receive-message)37 b FC(socket)15 b(length)g([\003ags])p -FA(\))43 b Fw(\000)-15 b(!)44 b FC([string-or-)p FA(#f)p -FD(socket-addr)o(ess])83 b(pr)o(ocedur)o(e)681 2227 y -FA(\(receive-message)o(!)37 b FC(socket)16 b(string)g([start])e([end])h -([\003ags])p FA(\))43 b Fw(\000)-14 b(!)43 b FC([count-or-)p -FA(#f)p FD(socket-addr)o(ess])83 b(pr)o(ocedur)o(e)681 -2327 y FA(\(receive-message)o(/p)o(art)o(ia)o(l)37 b -FC(socket)16 b(length)f([\003ags])p FA(\))42 b Fw(\000)-14 -b(!)44 b FC([string-or-)p FA(#f)p FD(socket-addr)o(ess])83 -b(pr)o(ocedur)o(e)681 2427 y FA(\(receive-message)o(!/)o(par)o(ti)o(al) -37 b FC(socket)16 b(string)f([start])g([end])g([\003ags])p -FA(\))43 b Fw(\000)-15 b(!)44 b FC([count-or-)p FA(#f)p -FD(socket-addr)o(ess])83 b(pr)o(ocedur)o(e)681 2602 y -FA(\(send-message)38 b FC(socket)16 b(string)f([start])g([end])g -([\003ags])g([socket-addr)o(ess])p FA(\))42 b Fw(\000)-15 -b(!)44 b FC(unde\002ned)87 b FD(pr)o(ocedur)o(e)681 2701 -y FA(\(send-message/pa)o(rt)o(ial)37 b FC(socket)15 b(string)h([start]) -f([end])g([\003ags])g([socket-addr)o(ess])p FA(\))41 -b Fw(\000)-14 b(!)44 b FC(count)86 b FD(pr)o(ocedur)o(e)888 -2839 y(For)23 b(most)h(uses,)f(standar)o(d)e(input)i(and)f(output)h(r)o -(outines)g(such)g(as)g FA(read-string)888 2938 y FD(and)i -FA(write-string)20 b FD(should)26 b(suf)o(\002ce.)37 -b(However)-6 b(,)26 b(in)f(some)h(cases)e(an)h(extended)888 -3038 y(interface)c(is)g(r)o(equir)o(ed.)26 b(The)21 b -FA(receive-message)15 b FD(and)21 b FA(send-message)16 -b FD(calls)22 b(par)o(-)888 3138 y(allel)37 b(the)h FA(read-string)33 -b FD(and)j FA(write-string)d FD(calls)k(with)h(a)f(similar)g(naming)888 -3237 y(scheme.)888 3396 y(One)i(additional)g(featur)o(e)e(of)h(these)h -(r)o(outines)g(is)g(that)g FA(receive-message)32 b FD(r)o(e-)888 -3495 y(turns)21 b(the)f(r)o(emote)g FC(socket-addr)o(ess)f -FD(and)h FC(send-message)g FD(takes)g(an)g(optional)i(r)o(emote)888 -3595 y FA(socket-address)p FD(.)56 b(This)34 b(allows)f(a)g(pr)o(ogram) -f(to)h(know)h(the)f(sour)o(ce)g(of)g(input)888 3695 y(fr)o(om)20 -b(a)g(datagram)e(socket)j(and)f(to)g(use)g(a)g(datagram)f(socket)h(for) -g(output)h(without)888 3794 y(\002rst)g(connecting)h(it.)888 -3953 y(All)j(of)g(these)g(pr)o(ocedur)o(es)f(take)g(an)h(optional)h -FC(\003ags)f FD(\002eld.)38 b(This)25 b(ar)o(gument)g(is)g(an)888 -4053 y(integer)c(bit-mask,)g(composed)g(by)g(or)6 b('ing)21 -b(together)g(the)g(following)i(constants:)1071 4270 y -FA(message/out-of-b)o(and)1071 4370 y(message/peek)1071 -4469 y(message/dont-rou)o(te)888 4746 y FD(See)29 b FA(read-string)d -FD(and)j FA(write-string)c FD(for)k(a)h(mor)o(e)f(detailed)g -(description)h(of)888 4845 y(the)21 b(ar)o(guments)g(and)f(r)o(eturn)g -(values.)2071 5147 y(94)p eop -%%Page: 95 101 -95 100 bop 365 614 a Fy(4.6)99 b(Socket)26 b(options)365 -845 y FA(\(socket-option)38 b FC(socket)21 b(level)g(option)p -FA(\))85 b Fw(\000)-14 b(!)87 b FC(value)699 b FD(pr)o(ocedur)o(e)365 -944 y FA(\(set-socket-optio)o(n)37 b FC(socket)21 b(level)g(option)f -(value)p FA(\))86 b Fw(\000)-14 b(!)87 b FC(unde\002ned)174 -b FD(pr)o(ocedur)o(e)573 1065 y FA(socket-option)19 b -FD(and)24 b FA(set-socket-option)18 b FD(allow)25 b(the)g(inspection)g -(and)g(mod-)573 1164 y(i\002cation,)30 b(r)o(espectively)-9 -b(,)29 b(of)f(several)f(options)i(available)e(on)i(sockets.)48 -b(The)28 b FC(level)573 1264 y FD(ar)o(gument)d(speci\002es)g(what)g -(pr)o(otocol)h(level)f(is)g(to)h(be)f(examined)f(or)i(af)o(fected.)36 -b(A)573 1363 y(level)30 b(of)h FA(level/socket)26 b FD(speci\002es)31 -b(the)f(highest)i(possible)f(level)g(that)g(is)g(avail-)573 -1463 y(able)24 b(on)h(all)f(socket)g(types.)37 b(A)24 -b(speci\002c)g(pr)o(otocol)h(number)f(can)g(also)h(be)f(used)g(as)573 -1563 y(pr)o(ovided)19 b(by)i FA(protocol-info)p FD(,)15 -b(described)20 b(below)-8 b(.)573 1691 y(Ther)o(e)25 -b(ar)o(e)f(several)g(dif)o(fer)o(ent)g(classes)h(of)h(socket)g -(options.)41 b(The)26 b(\002rst)g(class)f(con-)573 1791 -y(sists)k(of)g(boolean)g(options)h(which)f(can)f(be)h(either)f(tr)o(ue) -h(or)f(false.)49 b(Examples)28 b(of)573 1890 y(this)21 -b(option)h(type)f(ar)o(e:)756 2048 y FA(socket/debug)756 -2148 y(socket/accept-c)o(on)o(nec)o(t)756 2247 y(socket/reuse-ad)o(dr)o -(ess)756 2347 y(socket/keep-ali)o(ve)756 2446 y(socket/dont-rou)o(te) -756 2546 y(socket/broadcas)o(t)756 2646 y(socket/use-loop)o(-b)o(ack) -756 2745 y(socket/oob-inli)o(ne)756 2845 y(socket/use-priv)o(il)o(ege)o -(d)756 2945 y(socket/cant-sig)o(na)o(l)756 3044 y(tcp/no-delay)573 -3231 y FD(V)-8 b(alue)17 b(options)h(ar)o(e)e(another)i(category)f(of)g -(socket)g(options.)26 b(Options)18 b(of)g(this)g(type)573 -3330 y(ar)o(e)h(an)i(integer)g(value.)j(Examples)d(of)f(this)i(option)g -(type)e(ar)o(e:)756 3488 y FA(socket/send-buf)o(fe)o(r)756 -3587 y(socket/receive-)o(bu)o(ffe)o(r)756 3687 y(socket/send-low)o(-w)o -(ate)o(r)756 3786 y(socket/receive-)o(lo)o(w-w)o(at)o(er)756 -3886 y(socket/error)756 3986 y(socket/type)756 4085 y(ip/time-to-live) -756 4185 y(tcp/max-segment)573 4371 y FD(A)d(thir)o(d)h(option)h(type)e -(speci\002es)h(how)h(long)g(for)e(data)g(to)h(linger)g(after)f(a)g -(socket)i(has)573 4471 y(been)24 b(closed.)37 b(Ther)o(e)24 -b(is)h(only)h(one)f(option)h(of)e(this)i(type:)33 b FA(socket/linger)p -FD(.)f(It)24 b(is)573 4571 y(set)i(with)g(either)g FA(#f)p -FD(to)f(disable)g(it)h(or)f(an)h(integer)g(number)f(of)h(seconds)g(to)g -(linger)573 4670 y(and)20 b(r)o(eturns)g(a)h(value)f(of)h(the)f(same)h -(type)g(upon)g(inspection.)573 4799 y(The)46 b(fourth)h(and)f(\002nal)h -(option)h(type)e(of)g(this)i(time)f(is)f(a)g(timeout)i(option.)573 -4898 y(Ther)o(e)25 b(ar)o(e)g(two)i(examples)e(of)h(this)h(option)h -(type:)36 b FA(socket/send-tim)o(eou)o(t)20 b FD(and)1756 +b FD(pr)o(ocedur)o(e)573 781 y FA(shutdown-socket)19 +b FD(shuts)26 b(down)g(part)f(of)g(a)g(full-duplex)f(socket.)40 +b(The)25 b(method)573 881 y(of)c(shutting)h(done)f(is)g(speci\002ed)f +(by)h(the)g FC(how-to)e FD(ar)o(gument,)h(one)h(of:)756 +1098 y FA(shutdown/receiv)o(es)756 1198 y(shutdown/sends)756 +1298 y(shutdown/sends+)o(re)o(cei)o(ve)o(s)365 1851 y +Fy(4.5)99 b(Performing)25 b(input)g(and)f(output)h(on)g(sockets)365 +2128 y FA(\(receive-message)37 b FC(socket)16 b(length)f([\003ags])p +FA(\))42 b Fw(\000)-14 b(!)43 b FC([string-or-)p FA(#f)p +FD(socket-addr)o(ess])84 b(pr)o(ocedur)o(e)365 2227 y +FA(\(receive-message!)37 b FC(socket)15 b(string)h([start])f([end])g +([\003ags])p FA(\))42 b Fw(\000)-14 b(!)44 b FC([count-or-)p +FA(#f)p FD(socket-addr)o(ess])83 b(pr)o(ocedur)o(e)365 +2327 y FA(\(receive-message/)o(pa)o(rti)o(al)37 b FC(socket)15 +b(length)g([\003ags])p FA(\))43 b Fw(\000)-14 b(!)43 +b FC([string-or-)p FA(#f)p FD(socket-addr)o(ess])84 b(pr)o(ocedur)o(e) +365 2427 y FA(\(receive-message!)o(/p)o(art)o(ia)o(l)38 +b FC(socket)15 b(string)h([start])f([end])g([\003ags])p +FA(\))42 b Fw(\000)-14 b(!)43 b FC([count-or-)p FA(#f)p +FD(socket-addr)o(ess])84 b(pr)o(ocedur)o(e)365 2602 y +FA(\(send-message)39 b FC(socket)15 b(string)h([start])f([end])g +([\003ags])g([socket-addr)o(ess])p FA(\))41 b Fw(\000)-14 +b(!)43 b FC(unde\002ned)87 b FD(pr)o(ocedur)o(e)365 2701 +y FA(\(send-message/par)o(ti)o(al)37 b FC(socket)16 b(string)f([start]) +g([end])g([\003ags])g([socket-addr)o(ess])p FA(\))42 +b Fw(\000)-15 b(!)44 b FC(count)87 b FD(pr)o(ocedur)o(e)573 +2839 y(For)23 b(most)g(uses,)g(standar)o(d)e(input)j(and)e(output)h(r)o +(outines)g(such)g(as)f FA(read-string)573 2938 y FD(and)30 +b FA(write-string)c FD(should)31 b(suf)o(\002ce.)54 b(However)-6 +b(,)33 b(in)e(some)g(cases)f(an)g(extend-)573 3038 y(ed)d(interface)f +(is)h(r)o(equir)o(ed.)44 b(The)27 b FA(receive-message)21 +b FD(and)27 b FA(send-message)c FD(calls)573 3138 y(parallel)f(the)i +FA(read-string)19 b FD(and)k FA(write-string)18 b FD(calls)24 +b(with)g(a)f(similar)h(naming)573 3237 y(scheme.)573 +3396 y(One)d(additional)g(featur)o(e)e(of)i(these)h(r)o(outines)f(is)h +(that)f FA(receive-message)15 b FD(r)o(eturn-)573 3495 +y(s)38 b(the)g(r)o(emote)f FC(socket-addr)o(ess)g FD(and)g +FC(send-message)h FD(takes)g(an)f(optional)i(r)o(emote)573 +3595 y FA(socket-address)p FD(.)56 b(This)33 b(allows)h(a)e(pr)o(ogram) +h(to)g(know)h(the)f(sour)o(ce)f(of)h(input)573 3695 y(fr)o(om)20 +b(a)f(datagram)g(socket)h(and)g(to)h(use)f(a)g(datagram)e(socket)j(for) +f(output)g(without)573 3794 y(\002rst)h(connecting)h(it.)573 +3953 y(All)j(of)g(these)g(pr)o(ocedur)o(es)e(take)i(an)f(optional)i +FC(\003ags)f FD(\002eld.)38 b(This)26 b(ar)o(gument)e(is)i(an)573 +4053 y(integer)21 b(bit-mask,)f(composed)h(by)g(or)6 +b('ing)22 b(together)f(the)g(following)h(constants:)756 +4270 y FA(message/out-of-)o(ba)o(nd)756 4370 y(message/peek)756 +4469 y(message/dont-ro)o(ut)o(e)573 4746 y FD(See)29 +b FA(read-string)c FD(and)k FA(write-string)c FD(for)30 +b(a)f(mor)o(e)h(detailed)e(description)j(of)573 4845 +y(the)21 b(ar)o(guments)f(and)h(r)o(eturn)f(values.)1756 5147 y(95)p eop -%%Page: 96 102 -96 101 bop 888 614 a FA(socket/receive-ti)o(me)o(out)o -FD(.)20 b(These)g(ar)o(e)f(set)h(with)h(a)f(r)o(eal)f(number)h(of)h -(micr)o(osec-)888 714 y(onds)h(r)o(esolution)f(and)f(r)o(eturns)h(a)f -(value)g(of)h(the)g(same)f(type)h(upon)g(inspection.)681 -1006 y Fy(4.7)99 b(Database-information)24 b(entries)681 -1242 y FA(\(host-info)39 b FC(name-or-socket-addr)o(ess)p +%%Page: 96 104 +96 103 bop 681 614 a Fy(4.6)99 b(Socket)25 b(options)681 +845 y FA(\(socket-option)38 b FC(socket)20 b(level)h(option)p +FA(\))86 b Fw(\000)-14 b(!)87 b FC(value)698 b FD(pr)o(ocedur)o(e)681 +944 y FA(\(set-socket-opti)o(on)37 b FC(socket)20 b(level)h(option)f +(value)p FA(\))87 b Fw(\000)-14 b(!)87 b FC(unde\002ned)173 +b FD(pr)o(ocedur)o(e)888 1065 y FA(socket-option)20 b +FD(and)k FA(set-socket-optio)o(n)18 b FD(allow)25 b(the)g(inspection)h +(and)e(mod-)888 1164 y(i\002cation,)31 b(r)o(espectively)-9 +b(,)28 b(of)g(several)g(options)h(available)e(on)h(sockets.)49 +b(The)28 b FC(level)888 1264 y FD(ar)o(gument)d(speci\002es)g(what)h +(pr)o(otocol)f(level)g(is)h(to)f(be)g(examined)g(or)g(af)o(fected.)36 +b(A)888 1363 y(level)31 b(of)f FA(level/socket)c FD(speci\002es)31 +b(the)g(highest)h(possible)f(level)f(that)h(is)g(avail-)888 +1463 y(able)24 b(on)h(all)f(socket)h(types.)36 b(A)24 +b(speci\002c)h(pr)o(otocol)f(number)h(can)f(also)g(be)g(used)g(as)888 +1563 y(pr)o(ovided)c(by)h FA(protocol-info)p FD(,)15 +b(described)20 b(below)-8 b(.)888 1691 y(Ther)o(e)25 +b(ar)o(e)f(several)h(dif)o(fer)o(ent)e(classes)j(of)g(socket)f +(options.)42 b(The)25 b(\002rst)h(class)g(con-)888 1791 +y(sists)k(of)e(boolean)h(options)h(which)g(can)e(be)g(either)h(tr)o(ue) +f(or)h(false.)48 b(Examples)28 b(of)888 1890 y(this)22 +b(option)g(type)e(ar)o(e:)1071 2048 y FA(socket/debug)1071 +2148 y(socket/accept-co)o(nne)o(ct)1071 2247 y(socket/reuse-add)o(res)o +(s)1071 2347 y(socket/keep-aliv)o(e)1071 2446 y(socket/dont-rout)o(e) +1071 2546 y(socket/broadcast)1071 2646 y(socket/use-loop-)o(bac)o(k) +1071 2745 y(socket/oob-inlin)o(e)1071 2845 y(socket/use-privi)o(leg)o +(ed)1071 2945 y(socket/cant-sign)o(al)1071 3044 y(tcp/no-delay)888 +3231 y FD(V)-8 b(alue)17 b(options)i(ar)o(e)d(another)h(category)g(of)g +(socket)h(options.)25 b(Options)19 b(of)e(this)h(type)888 +3330 y(ar)o(e)i(an)g(integer)h(value.)k(Examples)20 b(of)h(this)g +(option)h(type)f(ar)o(e:)1071 3488 y FA(socket/send-buff)o(er)1071 +3587 y(socket/receive-b)o(uff)o(er)1071 3687 y(socket/send-low-)o(wat)o +(er)1071 3786 y(socket/receive-l)o(ow-)o(wa)o(te)o(r)1071 +3886 y(socket/error)1071 3986 y(socket/type)1071 4085 +y(ip/time-to-live)1071 4185 y(tcp/max-segment)888 4371 +y FD(A)d(thir)o(d)f(option)i(type)f(speci\002es)g(how)g(long)h(for)f +(data)e(to)j(linger)f(after)e(a)i(socket)g(has)888 4471 +y(been)25 b(closed.)37 b(Ther)o(e)24 b(is)h(only)g(one)g(option)h(of)f +(this)g(type:)33 b FA(socket/linger)p FD(.)f(It)25 b(is)888 +4571 y(set)h(with)g(either)g FA(#f)p FD(to)f(disable)g(it)h(or)g(an)f +(integer)h(number)g(of)g(seconds)g(to)g(linger)888 4670 +y(and)21 b(r)o(eturns)f(a)g(value)g(of)h(the)g(same)g(type)f(upon)i +(inspection.)888 4799 y(The)47 b(fourth)g(and)f(\002nal)g(option)i +(type)e(of)h(this)g(time)g(is)g(a)f(timeout)h(option.)888 +4898 y(Ther)o(e)26 b(ar)o(e)e(two)j(examples)f(of)g(this)h(option)g +(type:)36 b FA(socket/send-timeo)o(ut)19 b FD(and)2071 +5147 y(96)p eop +%%Page: 97 105 +97 104 bop 573 614 a FA(socket/receive-t)o(im)o(eou)o(t)p +FD(.)19 b(These)h(ar)o(e)f(set)i(with)g(a)e(r)o(eal)g(number)i(of)f +(micr)o(osec-)573 714 y(onds)h(r)o(esolution)h(and)e(r)o(eturns)g(a)g +(value)h(of)f(the)h(same)g(type)f(upon)i(inspection.)365 +1006 y Fy(4.7)99 b(Database-information)25 b(entries)365 +1242 y FA(\(host-info)40 b FC(name-or-socket-addr)o(ess)p FA(\))85 b Fw(\000)-14 b(!)87 b FC(host-info)583 b FD(pr)o(ocedur)o(e) -681 1342 y FA(\(network-info)38 b FC(name-or-socket-addr)o(ess)p -FA(\))85 b Fw(\000)-14 b(!)87 b FC(network-info)319 b -FD(pr)o(ocedur)o(e)681 1441 y FA(\(service-info)38 b -FC(name-or-number)18 b([pr)o(otocol-name])p FA(\))56 -b Fw(\000)-15 b(!)59 b FC(service-info)88 b FD(pr)o(ocedur)o(e)681 +365 1342 y FA(\(network-info)39 b FC(name-or-socket-addr)o(ess)p +FA(\))85 b Fw(\000)-15 b(!)88 b FC(network-info)319 b +FD(pr)o(ocedur)o(e)365 1441 y FA(\(service-info)39 b +FC(name-or-number)17 b([pr)o(otocol-name])p FA(\))56 +b Fw(\000)-14 b(!)59 b FC(service-info)88 b FD(pr)o(ocedur)o(e)365 1541 y FA(\(protocol-info)38 b FC(name-or-number)p FA(\))87 -b Fw(\000)-15 b(!)88 b FC(pr)o(otocol-info)493 b FD(pr)o(ocedur)o(e)888 -1664 y FA(host-info)22 b FD(allows)k(a)g(pr)o(ogram)f(to)h(look)g(up)g -(a)f(host)h(entry)g(based)f(on)h(either)g(its)888 1764 -y(string)d FC(name)f FD(or)f FC(socket-addr)o(ess)o FD(.)29 -b(The)22 b(value)f(r)o(eturned)f(by)i(this)h(r)o(outine)f(is)g(a)f -FC(host-)888 1864 y(info)g(r)o(ecord)p FD(,)f(de\002ned)h(to)g(have)f -(the)h(following)h(str)o(uctur)o(e:)1071 2027 y FA(\(define-record)38 -b(host-info)1158 2127 y(name)1480 b(;)44 b(Host)e(name)1158 -2227 y(aliases)1348 b(;)44 b(Alternative)39 b(names)1158 -2326 y(addresses\))1216 b(;)44 b(Host)e(addresses)888 -2522 y(host-info)17 b FD(could)k(fail)f(and)h(raise)f(an)h(err)o(or)e -(for)i(one)g(of)g(the)g(following)h(r)o(easons:)1071 -2685 y FA(herror/host-not-)o(fou)o(nd)1071 2785 y(herror/try-again)1071 -2885 y(herror/no-recove)o(ry)1071 2984 y(herror/no-data)1071 -3084 y(herror/no-addres)o(s)888 3280 y(network-info)27 -b FD(allows)32 b(a)f(pr)o(ogram)g(to)h(look)h(up)e(a)h(network)g(entry) -g(based)e(on)888 3379 y(either)21 b(its)h(string)f FC(name)g -FD(or)h FC(socket-addr)o(ess)o FD(.)k(The)21 b(value)f(r)o(eturned)g -(by)h(this)h(r)o(outine)888 3479 y(is)f(a)g FC(network-info)f(r)o -(ecord)p FD(,)g(de\002ned)h(to)g(have)f(the)h(following)h(str)o(uctur)o -(e:)1071 3642 y FA(\(define-record)38 b(network-info)1158 -3742 y(name)1480 b(;)44 b(Network)c(name)1158 3842 y(aliases)1348 -b(;)44 b(Alternative)39 b(names)1158 3941 y(net\))1480 -b(;)44 b(Network)c(number)888 4137 y(service-info)21 -b FD(allows)27 b(a)e(pr)o(ogram)g(to)h(look)h(up)f(a)f(service)g(entry) -h(based)f(on)h(ei-)888 4237 y(ther)e(its)g(string)h FC(name)e -FD(or)h(integer)g FC(port)o FD(.)35 b(The)24 b(value)f(r)o(eturned)g -(by)g(this)i(r)o(outine)f(is)888 4336 y(a)d FC(service-info)g(r)o -(ecord)p FD(,)f(de\002ned)g(to)h(have)f(the)h(following)i(str)o(uctur)o -(e:)1071 4500 y FA(\(define-record)38 b(service-info)1158 -4599 y(name)1480 b(;)44 b(Service)c(name)1158 4699 y(aliases)1348 -b(;)44 b(Alternative)39 b(names)1158 4799 y(port)1480 -b(;)44 b(Port)e(number)1158 4898 y(protocol\))1260 b(;)44 -b(Protocol)c(name)2071 5147 y FD(96)p eop -%%Page: 97 103 -97 102 bop 573 614 a FA(protocol-info)12 b FD(allows)19 -b(a)f(pr)o(ogram)f(to)h(look)h(up)f(a)g(pr)o(otocol)g(entry)g(based)f -(on)i(ei-)573 714 y(ther)i(its)g(string)h FC(name)f FD(or)g(integer)g -FC(number)q FD(.)26 b(The)21 b(value)g(r)o(eturned)f(by)h(this)h(r)o -(outine)573 814 y(is)f(a)f FC(pr)o(otocol-info)f(r)o(ecord)p -FD(,)h(de\002ned)h(to)g(have)f(the)h(following)h(str)o(uctur)o(e:)756 -980 y FA(\(define-record)37 b(protocol-info)843 1079 -y(name)1480 b(;)43 b(Protocol)d(name)843 1179 y(aliases)1348 -b(;)43 b(Alternative)c(names)843 1279 y(number\))1348 -b(;)43 b(Protocol)d(number\))1756 5147 y FD(97)p eop -%%Page: 98 104 -98 103 bop 681 1265 a Fz(Chapter)44 b(5)681 1707 y FE(Strings)51 -b(and)i(characters)681 2190 y FD(Scsh)28 b(pr)o(ovides)f(a)h(set)g(of)h -(pr)o(ocedur)o(es)d(for)i(pr)o(ocessing)h(strings)g(and)e(characters.) -47 b(The)681 2290 y(pr)o(ocedur)o(es)38 b(pr)o(ovided)h(match)h(r)o -(egular)f(expr)o(essions,)45 b(sear)o(ch)39 b(strings,)46 -b(parse)39 b(\002le-)681 2390 y(names,)20 b(and)h(manipulate)f(sets)h -(of)g(characters.)805 2517 y(Also)43 b(see)e(chapters)h(6)f(and)h(7)f -(on)i(r)o(ecor)o(d)d(I/O,)i(\002eld)g(parsing,)47 b(and)42 -b(the)g(awk)681 2616 y(loop.)26 b(The)19 b(pr)o(ocedur)o(es)f -(documented)i(ther)o(e)e(allow)i(you)h(to)f(r)o(ead)e(character)o -(-delimited)681 2716 y(r)o(ecor)o(ds)k(fr)o(om)i(ports,)h(use)f(r)o -(egular)f(expr)o(essions)h(to)h(split)f(the)h(r)o(ecor)o(ds)d(into)j -(\002elds)g(\(for)681 2816 y(example,)k(splitting)h(a)f(string)g(at)f -(every)g(occurr)o(ence)g(of)g(colon)i(or)f(white-space\),)g(and)681 -2915 y(loop)21 b(over)g(str)o(eams)f(of)h(these)g(r)o(ecor)o(ds)e(in)i -(a)f(convenient)i(way)-9 b(.)681 3199 y Fy(5.1)99 b(String)25 -b(manipulation)681 3417 y FD(Strings)33 b(ar)o(e)e(the)h(basic)h -(communication)h(medium)f(for)f(Unix)g(pr)o(ocesses,)j(so)e(a)f(shell) -681 3516 y(language)20 b(must)i(have)e(r)o(easonable)f(facilities)i -(for)f(manipulating)i(them.)681 3774 y FB(5.1.1)81 b(Regular)19 -b(expressions)681 3960 y FD(The)24 b(following)i(functions)f(perform)f -(r)o(egular)f(expr)o(ession)h(matching.)37 b(The)24 b(code)g(uses)681 -4060 y(Henry)d(Spencer)6 b('s)20 b(r)o(egular)f(expr)o(ession)i -(package.)681 4211 y FA(\(string-match)38 b FC(r)o(egexp)20 -b(string)g([start])p FA(\))86 b Fw(\000)-14 b(!)87 b -FC(match)19 b(or)i(false)389 b FD(pr)o(ocedur)o(e)888 -4354 y(Sear)o(ch)20 b FC(string)i FD(starting)g(at)f(position)i -FC(start)o FD(,)f(looking)h(for)f(a)f(match)g(for)h FC(r)o(egexp)n -FD(.)28 b(If)22 b(a)888 4454 y(match)d(is)h(found,)f(r)o(eturn)g(a)f -(match)h(str)o(uctur)o(e)g(describing)g(the)g(match,)g(otherwise)888 -4553 y FA(#f)p FD(.)25 b FC(Start)20 b FD(defaults)g(to)h(0.)681 -4849 y FA(\(regexp-match?)38 b FC(obj)p FA(\))87 b Fw(\000)-15 -b(!)88 b FC(boolean)1135 b FD(pr)o(ocedur)o(e)2071 5147 -y(98)p eop -%%Page: 99 105 -99 104 bop 573 614 a FD(Is)21 b(the)g(object)g(a)f(r)o(egular)g(expr)o -(ession)g(match?)365 894 y FA(\(match:start)39 b FC(match)19 -b([match-number])p FA(\))85 b Fw(\000)-14 b(!)87 b FC(\002xnum)20 -b(or)h(false)299 b FD(pr)o(ocedur)o(e)573 1028 y(Returns)31 -b(the)g(start)f(position)i(of)e(the)h(match)f(denoted)g(by)h -FC(match-number)o FD(.)55 b(The)573 1127 y(whole)21 b(r)o(egexp)e(is)i -(0.)j(Each)c(further)g(number)g(r)o(epr)o(esents)f(positions)j -(enclosed)e(by)573 1227 y FA(\(...\))f FD(sections.)26 -b FC(Match-number)20 b FD(defaults)g(to)h(0.)573 1356 -y(If)k(the)h(r)o(egular)e(expr)o(ession)h(matches)h(as)f(a)g(whole,)i -(but)f(a)f(particular)f(par)o(enthe-)573 1456 y(sized)c(sub-expr)o -(ession)g(does)h(not)h(match,)e(then)h FA(match:start)c -FD(r)o(eturns)j FA(#f)p FD(.)365 1736 y FA(\(match:end)40 -b FC(match)19 b([match-number])p FA(\))85 b Fw(\000)-14 -b(!)87 b FC(\002xnum)643 b FD(pr)o(ocedur)o(e)573 1869 -y(Returns)55 b(the)g(end)g(position)h(of)f(the)g(match)g(denoted)f(by)h -FC(match-number)o FD(.)573 1969 y FC(Match-number)20 -b FD(defaults)g(to)h(0)g(\(the)f(whole)i(match\).)573 -2098 y(If)j(the)h(r)o(egular)e(expr)o(ession)h(matches)h(as)f(a)g -(whole,)i(but)f(a)f(particular)f(par)o(enthe-)573 2198 -y(sized)c(sub-expr)o(ession)g(does)h(not)h(match,)e(then)h -FA(match:end)c FD(r)o(eturns)k FA(#f)p FD(.)365 2477 -y FA(\(match:substring)37 b FC(match)19 b([match-number])p -FA(\))85 b Fw(\000)-14 b(!)87 b FC(string)21 b(or)g(false)164 -b FD(pr)o(ocedur)o(e)573 2611 y(Returns)33 b(the)f(substring)h(matched) -f(by)g(match)g FC(match-number)o FD(.)60 b FC(Match-number)573 -2711 y FD(defaults)20 b(to)h(0)f(\(the)h(whole)g(match\).)k(If)c(ther)o -(e)f(was)h(no)g(match,)g(r)o(eturns)f(false.)490 2973 -y(Regular)g(expr)o(ession)g(matching)g(compiles)h(patterns)f(into)g -(special)g(data)f(str)o(uctur)o(es)365 3073 y(which)26 -b(can)f(be)g(ef)o(\002ciently)g(used)f(to)i(match)f(against)g(strings.) -40 b(The)25 b(over)o(head)e(of)i(com-)365 3172 y(piling)e(patterns)e -(that)g(will)h(be)f(used)h(for)f(multiple)h(sear)o(ches)e(can)h(be)g -(avoided)g(by)g(these)365 3272 y(lower)o(-level)f(r)o(outines:)365 -3414 y FA(\(make-regexp)39 b FC(str)p FA(\))87 b Fw(\000)-14 -b(!)87 b FC(r)o(e)1416 b FD(pr)o(ocedur)o(e)573 3548 -y(Generate)20 b(a)g(compiled)h(r)o(egular)f(expr)o(ession)g(fr)o(om)h -(the)f(given)i(string.)365 3827 y FA(\(regexp?)41 b FC(obj)p -FA(\))87 b Fw(\000)-15 b(!)88 b FC(boolean)1397 b FD(pr)o(ocedur)o(e) -573 3961 y(Is)21 b(the)g(object)g(a)f(r)o(egular)g(expr)o(ession?)365 -4241 y FA(\(regexp-exec)39 b FC(r)o(egexp)20 b(str)h([start])p -FA(\))85 b Fw(\000)-14 b(!)87 b FC(match)19 b(or)i(false)544 -b FD(pr)o(ocedur)o(e)573 4375 y(Apply)26 b(the)g(r)o(egular)e(expr)o -(ession)i FC(r)o(egexp)f FD(to)h(the)g(string)h FC(str)f -FD(starting)h(at)e(position)573 4474 y FC(start)p FD(.)g(If)20 -b(the)g(match)h(succeeds)f(it)g(r)o(eturns)g(a)g(r)o(egexp-match,)e -(otherwise)j FA(#f)p FD(.)k FC(Start)573 4574 y FD(defaults)20 -b(to)h(0.)365 4854 y FA(\(regexp-quote)39 b FC(str)p -FA(\))86 b Fw(\000)-14 b(!)87 b FC(string)1233 b FD(pr)o(ocedur)o(e) -1756 5147 y(99)p eop -%%Page: 100 106 -100 105 bop 888 614 a FD(Returns)24 b(a)f(r)o(egular)e(expr)o(ession)i -(that)g(matches)g(the)g(string)h FC(str)f FD(exactly)-9 -b(.)31 b(In)24 b(other)888 714 y(wor)o(ds,)18 b(it)g(quotes)h(the)f(r)o -(egular)f(expr)o(ession,)h(pr)o(epending)f(backslashes)h(to)g(all)g -(the)888 814 y(special)j(r)o(egexp)e(characters)h(in)h -FC(str)p FD(.)1071 986 y FA(\(regexp-quote)38 b("*Hello*)i(world."\)) -1245 1086 y Fn(=)-14 b Fw(\))44 b FA("\\\\*Hello\\\\*)38 -b(world\\\\.")681 1378 y(\(regexp-substitu)o(te)f FC(port)19 -b(match)f(.)h(items)p FA(\))76 b Fw(\000)-14 b(!)77 b -FC(string)19 b(or)h(unde\002ned)87 b FD(pr)o(ocedur)o(e)888 -1523 y(This)21 b(pr)o(ocedur)o(e)d(can)i(be)g(used)f(to)i(perform)f -(string)g(substitutions)i(based)d(on)i(r)o(eg-)888 1622 -y(ular)33 b(expr)o(ession)g(matches.)62 b(The)33 b(r)o(esults)g(of)g -(the)g(substitution)i(can)d(be)h(either)888 1722 y(output)22 -b(to)f(a)f(port)h(or)g(r)o(eturned)e(as)i(a)f(string.)888 -1858 y(The)h FC(match)d FD(ar)o(gument)i(is)h(a)f(r)o(egular)f(expr)o -(ession)h(match)g(str)o(uctur)o(e)g(that)g(contr)o(ols)888 -1958 y(the)j(substitution.)33 b(If)22 b FC(port)g FD(is)h(an)g(output)g -(port,)g(the)g FC(items)f FD(ar)o(e)g(written)h(out)g(to)g(the)888 -2057 y(port:)988 2230 y Fw(\017)41 b FD(If)20 b(an)h(item)g(is)g(a)f -(string,)i(it)f(is)g(copied)f(dir)o(ectly)g(to)h(the)g(port.)988 -2366 y Fw(\017)41 b FD(If)26 b(an)h(item)f(is)h(an)g(integer)-6 -b(,)27 b(the)g(corr)o(esponding)g(submatch)g(fr)o(om)f -FC(match)f FD(is)1071 2466 y(written)c(to)g(the)g(port.)988 -2602 y Fw(\017)41 b FD(If)16 b(an)g(item)h(is)g FA('pre)p -FD(,)e(the)i(pr)o(e\002x)e(of)i(the)f(matched)g(string)i(\(the)e(text)g -(pr)o(eceding)1071 2702 y(the)21 b(match\))f(is)h(written)h(to)f(the)g -(port.)988 2838 y Fw(\017)41 b FD(If)20 b(an)h(item)g(is)g -FA('post)p FD(,)e(the)h(suf)o(\002x)h(of)f(the)h(matched)g(string)g(is) -g(written.)888 3010 y(If)j FC(port)f FD(is)i FA(#f)p -FD(,)f(nothing)h(is)g(written,)g(and)e(a)h(string)h(is)f(constr)o -(ucted)h(and)e(r)o(eturned)888 3110 y(instead.)681 3311 -y FA(\(regexp-substitu)o(te)o(/gl)o(ob)o(al)37 b FC(port)15 -b(r)o(egexp)g(string)h(.)f(items)p FA(\))43 b Fw(\000)-14 -b(!)44 b FC(string)15 b(or)h(unde\002ned)87 b FD(pr)o(ocedur)o(e)888 -3455 y(This)23 b(pr)o(ocedur)o(e)d(is)i(similar)h(to)f -FA(regexp-substitut)o(e)p FD(,)16 b(but)22 b(can)g(be)f(used)h(to)g -(per)o(-)888 3555 y(form)k(r)o(epeated)d(match/substitute)j(operations) -g(over)g(a)e(string.)41 b(It)25 b(has)h(the)f(fol-)888 -3655 y(lowing)d(dif)o(fer)o(ences)d(with)i FA(regexp-substitute)o -FD(:)988 3827 y Fw(\017)41 b FD(It)17 b(takes)g(a)g(r)o(egular)f(expr)o -(ession)h(and)g(string)g(to)h(be)f(matched)g(as)g(parameters,)1071 -3927 y(instead)j(of)h(a)f(completed)h(match)g(str)o(uctur)o(e.)988 -4063 y Fw(\017)41 b FD(If)23 b(the)g(r)o(egular)e(expr)o(ession)i -(doesn't)h(match)f(the)g(string,)h(this)g(pr)o(ocedur)o(e)d(is)1071 -4163 y(the)g(identity)g(transform\227it)g(r)o(eturns)f(or)h(outputs)h -(the)f(string.)988 4299 y Fw(\017)41 b FD(If)25 b(an)g(item)h(is)g -FA('post)p FD(,)e(the)h(pr)o(ocedur)o(e)f(r)o(ecurses)g(on)i(the)f(suf) -o(\002x)g(string)h(\(the)1071 4399 y(text)f(fr)o(om)h -FC(string)f FD(following)i(the)f(match\).)40 b(Including)27 -b(a)e FA('post)e FD(in)k(the)e(list)1071 4498 y(of)c(items)g(is)g(how)h -(one)f(gets)g(multiple)g(match/substitution)i(operations.)988 -4634 y Fw(\017)41 b FD(If)27 b(an)g(item)h(is)g(a)f(pr)o(ocedur)o(e,)g -(it)g(is)h(applied)f(to)g(the)h(match)f(str)o(uctur)o(e)g(for)h(a)1071 -4734 y(given)20 b(match.)25 b(The)19 b(pr)o(ocedur)o(e)e(r)o(eturns)i -(a)g(string)h(to)g(be)e(used)i(in)f(the)h(r)o(esult.)888 -4898 y(Some)h(examples:)2051 5147 y(100)p eop -%%Page: 101 107 -101 106 bop 573 614 a Fh(;;;)40 b(Replace)h(occurrences)g(of)f -("Cotton")h(with)f("Jin".)573 706 y(\(regexp-substitute/global)45 -b(#f)39 b("Cotton")i(s)1593 797 y('pre)f("Jin")g('post\))573 -980 y(;;;)g(mm/dd/yy)h(->)e(dd/mm/yy)j(date)e(conversion.)573 -1071 y(\(regexp-substitute/global)45 b(#f)39 b -("\([0-9]+\)/\([0-9]+\)/\([0-9]+\))q(")45 b(;)39 b(mm/dd/yy)1593 -1162 y(s)g(;)h(Source)g(string)1593 1254 y('pre)g(2)f("/")h(1)g("/")g -(3)f('post\))573 1436 y(;;;)h("9/29/61")h(->)f("Sep)g(29,)g(1961")g -(date)g(conversion.)573 1528 y(\(regexp-substitute/global)45 -b(#f)39 b("\([0-9]+\)/\([0-9]+\)/\([0-9]+\))q(")45 b(;)39 -b(mm/dd/yy)1593 1619 y(s)g(;)h(Source)g(string)808 1802 -y('pre)808 1893 y(;;)g(Sleazy)g(converter)i(--)d(ignores)i("year)g -(2000")f(issue,)h(and)e(blows)i(up)f(if)808 1984 y(;;)g(month)g(is)g -(out)g(of)g(range.)808 2076 y(\(lambda)h(\(m\))887 2167 -y(\(let)f(\(\(mon)g(\(vector-ref)i('#\("Jan")f("Feb")f("Mar")h("Apr")f -("May")g("Jun")1907 2258 y("Jul")g("Aug")g("Sep")h("Oct")f("Nov")g -("Dec"\))1789 2350 y(\(-)g(\(string->number)i(\(match:substring)h(m)d -(1\)\))f(1\)\)\))1122 2441 y(\(day)h(\(match:substring)j(m)c(2\)\))1122 -2532 y(\(year)h(\(match:substring)j(m)d(3\)\)\))965 2623 -y(\(string-append)j(mon)c(")h(")f(day)h(",)g(19")g(year\)\)\))808 -2715 y('post\))573 2897 y(;;;)g(Remove)g(potentially)i(offensive)f -(substrings)h(from)e(string)h(S.)573 2989 y(\(regexp-substitute/global) -k(#f)39 b("Windows|tcl|Intel")44 b(s)1593 3080 y('pre)c('post\))365 -3466 y FB(5.1.2)81 b(Other)20 b(string)h(manipulation)c(facilities)365 -3664 y FA(\(index)41 b FC(string)21 b(char)f([start])p -FA(\))86 b Fw(\000)-14 b(!)87 b FC(\002xnum)20 b(or)h(false)732 -b FD(pr)o(ocedur)o(e)365 3764 y FA(\(rindex)41 b FC(string)21 -b(char)f([start])p FA(\))86 b Fw(\000)-15 b(!)88 b FC(\002xnum)20 -b(or)h(false)688 b FD(pr)o(ocedur)o(e)573 3884 y(These)17 -b(pr)o(ocedur)o(es)e(sear)o(ch)g(thr)o(ough)j FC(string)f -FD(looking)h(for)f(an)f(occurr)o(ence)g(of)h(char)o(-)573 -3983 y(acter)j FC(char)o FD(.)26 b FA(index)18 b FD(sear)o(ches)i -(left-to-right;)g FA(rindex)f FD(sear)o(ches)g(right-to-left.)573 -4111 y FA(index)j FD(r)o(eturns)i(the)g(smallest)h(index)f -Fo(i)g FD(of)g FC(string)g FD(gr)o(eater)f(than)h(or)h(equal)f(to)h -FC(start)573 4211 y FD(such)e(that)g FC(string)p Fn([)p -Fo(i)p Fn(])k(=)f FC(char)p FD(.)31 b(The)23 b(default)f(for)g -FC(start)h FD(is)g(zer)o(o.)31 b(If)22 b(ther)o(e)g(is)i(no)f(such)573 -4310 y(match,)d FA(index)f FD(r)o(eturns)h(false.)573 -4438 y FA(rindex)38 b FD(r)o(eturns)i(the)h(lar)o(gest)f(index)h -Fo(i)f FD(of)h FC(string)g FD(less)g(than)g FC(start)f -FD(such)i(that)573 4538 y FC(string)p Fn([)p Fo(i)p Fn(])28 -b(=)f FC(char)p FD(.)33 b(The)24 b(default)e(for)h FC(start)h -FD(is)f FA(\(string-length)38 b FC(string)p FA(\))p FD(.)33 -b(If)23 b(ther)o(e)573 4638 y(is)e(no)g(such)h(match,)e -FA(rindex)e FD(r)o(eturns)j(false.)490 4799 y(I)d(should)i(pr)o(obably) -d(snarf)h(all)h(the)f(MIT)g(Scheme)g(string)h(functions,)h(and)e(stick) -h(them)365 4898 y(in)j(a)e(package.)k(Unix)d(pr)o(ograms)f(need)g(to)i -(mung)f(character)e(strings)j(a)e(lot.)1735 5147 y(101)p -eop -%%Page: 102 108 -102 107 bop 805 614 a FD(MIT)20 b(string)i(match)f(commands:)888 -714 y FA([sub]string-match)o(-f)o(orw)o(ar)o(d,b)o(ac)o(kwa)o(rd)o([-)o -(ci])888 814 y([sub]string-prefi)o(x,)o(suf)o(fi)o(x[-)o(ci)o(]?)888 -913 y([sub]string-find-)o(ne)o(xt,)o(pr)o(evi)o(ou)o(s-c)o(ha)o(r[)o -(-ci)o(])888 1013 y([sub]string-find-)o(ne)o(xt,)o(pr)o(evi)o(ou)o(s-c) -o(ha)o(r-)o(in-)o(se)o(t)888 1112 y([sub]string-repla)o(ce)o([!])888 -1212 y(...)p Fu(etc.)681 1312 y FD(These)f(ar)o(e)g(not)h(curr)o(ently) -g(pr)o(ovided.)681 1473 y FA(\(substitute-env-)o(va)o(rs)37 -b FC(fname)p FA(\))87 b Fw(\000)-14 b(!)87 b FC(string)816 -b FD(pr)o(ocedur)o(e)888 1627 y(Replace)24 b(occurr)o(ences)f(of)i -(envir)o(onment)g(variables)e(with)i(their)f(values.)36 -b(An)24 b(en-)888 1726 y(vir)o(onment)19 b(variable)d(is)j(denoted)e -(by)h(a)g(dollar)f(sign)i(followed)f(by)g(alphanumeric)888 -1826 y(chars)j(and)f(underscor)o(es,)g(or)h(is)g(surr)o(ounded)f(by)h -(braces.)1071 2018 y FA(\(substitute-env-)o(var)o(s)37 -b("$USER/.login"\))1237 2117 y Fn(=)-14 b Fw(\))104 b -FA("shivers/.login)o(")1071 2217 y(\(substitute-env-)o(var)o(s)37 -b("$)p Fw(f)p FA(USER)p Fw(g)p FA(_log"\))77 b Fn(=)-14 -b Fw(\))104 b FA("shivers_log")681 2732 y FB(5.1.3)81 -b(Manipulating)17 b(\002le-names)681 2939 y FD(These)26 -b(pr)o(ocedur)o(es)f(do)h(not)h(access)f(the)h(\002le-system)g(at)f -(all;)i(they)f(mer)o(ely)f(operate)f(on)681 3039 y(\002le-name)f -(strings.)38 b(Much)25 b(of)g(this)g(str)o(uctur)o(e)f(is)h(patterned)f -(after)f(the)i(gnu)h(emacs)e(de-)681 3139 y(sign.)59 -b(Per)o(haps)31 b(a)g(mor)o(e)g(sophisticated)h(system)h(would)f(be)f -(better)-6 b(,)33 b(something)h(like)681 3238 y(the)22 -b(pathname)g(abstractions)h(of)h(C)t Fv(O)t(M)t(M)t(O)t(N)j -FD(L)t Fv(I)t(S)t(P)e FD(or)e(MIT)e(Scheme.)30 b(However)-6 -b(,)23 b(being)681 3338 y(Unix-speci\002c,)d(we)h(can)f(be)g(a)h -(little)g(less)g(general.)681 3636 y FB(T)-9 b(erminology)681 -3843 y FD(These)30 b(pr)o(ocedur)o(es)e(car)o(efully)g(adher)o(e)h(to)h -(the)i(P)t Fv(O)t(S)t(I)t(X)h FD(standar)o(d)c(for)g(\002le-name)h(r)o -(eso-)681 3943 y(lution,)f(which)e(occasionally)h(entails)e(some)i -(slightly)g(odd)e(things.)45 b(This)27 b(section)g(will)681 -4042 y(describe)20 b(these)h(r)o(ules,)f(and)h(give)f(some)i(basic)e -(terminology)-9 b(.)805 4185 y(A)17 b FC(\002le-name)g +b Fw(\000)-14 b(!)87 b FC(pr)o(otocol-info)494 b FD(pr)o(ocedur)o(e)573 +1664 y FA(host-info)22 b FD(allows)k(a)f(pr)o(ogram)g(to)h(look)h(up)e +(a)g(host)i(entry)f(based)e(on)j(either)e(its)573 1764 +y(string)d FC(name)g FD(or)g FC(socket-addr)o(ess)o FD(.)28 +b(The)22 b(value)f(r)o(eturned)g(by)h(this)g(r)o(outine)g(is)g(a)g +FC(host-)573 1864 y(info)f(r)o(ecord)p FD(,)f(de\002ned)g(to)h(have)g +(the)f(following)j(str)o(uctur)o(e:)756 2027 y FA(\(define-record)37 +b(host-info)843 2127 y(name)1480 b(;)43 b(Host)f(name)843 +2227 y(aliases)1348 b(;)43 b(Alternative)c(names)843 +2326 y(addresses\))1216 b(;)43 b(Host)f(addresses)573 +2522 y(host-info)17 b FD(could)k(fail)f(and)g(raise)h(an)f(err)o(or)g +(for)g(one)i(of)e(the)h(following)h(r)o(easons:)756 2685 +y FA(herror/host-not)o(-f)o(oun)o(d)756 2785 y(herror/try-agai)o(n)756 +2885 y(herror/no-recov)o(er)o(y)756 2984 y(herror/no-data)756 +3084 y(herror/no-addre)o(ss)573 3280 y(network-info)27 +b FD(allows)32 b(a)f(pr)o(ogram)g(to)h(look)g(up)g(a)f(network)h(entry) +g(based)f(on)573 3379 y(either)21 b(its)g(string)h FC(name)f +FD(or)g FC(socket-addr)o(ess)o FD(.)26 b(The)21 b(value)g(r)o(eturned)f +(by)h(this)h(r)o(outine)573 3479 y(is)f(a)f FC(network-info)h(r)o +(ecord)p FD(,)f(de\002ned)g(to)h(have)g(the)g(following)h(str)o(uctur)o +(e:)756 3642 y FA(\(define-record)37 b(network-info)843 +3742 y(name)1480 b(;)43 b(Network)e(name)843 3842 y(aliases)1348 +b(;)43 b(Alternative)c(names)843 3941 y(net\))1480 b(;)43 +b(Network)e(number)573 4137 y(service-info)21 b FD(allows)26 +b(a)f(pr)o(ogram)g(to)i(look)f(up)g(a)f(service)h(entry)g(based)f(on)h +(ei-)573 4237 y(ther)e(its)g(string)g FC(name)g FD(or)g(integer)g +FC(port)o FD(.)35 b(The)23 b(value)g(r)o(eturned)g(by)h(this)g(r)o +(outine)g(is)573 4336 y(a)c FC(service-info)h(r)o(ecord)p +FD(,)f(de\002ned)h(to)g(have)f(the)h(following)h(str)o(uctur)o(e:)756 +4500 y FA(\(define-record)37 b(service-info)843 4599 +y(name)1480 b(;)43 b(Service)e(name)843 4699 y(aliases)1348 +b(;)43 b(Alternative)c(names)843 4799 y(port)1480 b(;)43 +b(Port)f(number)843 4898 y(protocol\))1260 b(;)43 b(Protocol)d(name) +1756 5147 y FD(97)p eop +%%Page: 98 106 +98 105 bop 888 614 a FA(protocol-info)13 b FD(allows)19 +b(a)e(pr)o(ogram)g(to)i(look)g(up)f(a)f(pr)o(otocol)i(entry)f(based)f +(on)h(ei-)888 714 y(ther)j(its)h(string)f FC(name)g FD(or)h(integer)f +FC(number)q FD(.)26 b(The)21 b(value)f(r)o(eturned)g(by)h(this)h(r)o +(outine)888 814 y(is)f(a)g FC(pr)o(otocol-info)e(r)o(ecord)p +FD(,)h(de\002ned)g(to)h(have)f(the)h(following)i(str)o(uctur)o(e:)1071 +980 y FA(\(define-record)38 b(protocol-info)1158 1079 +y(name)1480 b(;)44 b(Protocol)c(name)1158 1179 y(aliases)1348 +b(;)44 b(Alternative)39 b(names)1158 1279 y(number\))1348 +b(;)44 b(Protocol)c(number\))2071 5147 y FD(98)p eop +%%Page: 99 107 +99 106 bop 365 1302 a Fz(Chapter)45 b(5)365 1782 y FE(Strings)52 +b(and)g(characters)365 2303 y FD(Scsh)28 b(pr)o(ovides)g(a)g(set)g(of)g +(pr)o(ocedur)o(es)f(for)h(pr)o(ocessing)g(strings)h(and)f(characters.) +47 b(The)365 2402 y(pr)o(ocedur)o(es)39 b(pr)o(ovided)g(match)h(r)o +(egular)f(expr)o(essions,)45 b(sear)o(ch)39 b(strings,)45 +b(parse)40 b(\002le-)365 2502 y(names,)21 b(and)f(manipulate)h(sets)g +(of)f(characters.)490 2666 y(Also)j(see)f(chapters)g(6,)h(7)f(and)g(8)h +(on)g(r)o(egular)o(-expr)o(essions,)e(r)o(ecor)o(d)g(I/O,)i(\002eld)g +(pars-)365 2766 y(ing,)h(and)e(the)g(awk)h(loop.)31 b(The)22 +b(pr)o(ocedur)o(es)f(documented)h(ther)o(e)g(allow)h(you)g(to)g(sear)o +(ch)365 2866 y(and)33 b(pattern-match)e(strings,)37 b(r)o(ead)31 +b(character)o(-delimited)f(r)o(ecor)o(ds)h(fr)o(om)i(ports,)j(use)365 +2965 y(r)o(egular)f(expr)o(essions)g(to)h(split)g(the)g(r)o(ecor)o(ds)e +(into)i(\002elds)g(\(for)f(example,)j(splitting)f(a)365 +3065 y(string)27 b(at)f(every)f(occurr)o(ence)g(of)h(colon)h(or)f +(white-space\),)g(and)g(loop)g(over)g(str)o(eams)g(of)365 +3165 y(these)21 b(r)o(ecor)o(ds)e(in)j(a)e(convenient)h(way)-9 +b(.)365 3545 y Fy(5.1)99 b(String)26 b(manipulation)365 +3811 y FD(Strings)33 b(ar)o(e)e(the)i(basic)f(communication)i(medium)f +(for)g(Unix)f(pr)o(ocesses,)j(so)e(a)f(shell)365 3911 +y(language)21 b(must)g(have)f(r)o(easonable)g(facilities)g(for)h +(manipulating)g(them.)365 4264 y FB(5.1.1)81 b(Manipulating)18 +b(\002le-names)365 4500 y FD(These)27 b(pr)o(ocedur)o(es)d(do)j(not)g +(access)f(the)g(\002le-system)h(at)f(all;)j(they)e(mer)o(ely)e(operate) +h(on)365 4599 y(\002le-name)f(strings.)38 b(Much)24 b(of)h(this)h(str)o +(uctur)o(e)e(is)h(patterned)e(after)h(the)h(gnu)g(emacs)f(de-)365 +4699 y(sign.)59 b(Per)o(haps)31 b(a)g(mor)o(e)h(sophisticated)g(system) +g(would)g(be)g(better)-6 b(,)33 b(something)g(like)365 +4799 y(the)23 b(pathname)f(abstractions)g(of)j(C)t Fv(O)t(M)t(M)t(O)t +(N)i FD(L)t Fv(I)t(S)t(P)e FD(or)d(MIT)g(Scheme.)30 b(However)-6 +b(,)22 b(being)365 4898 y(Unix-speci\002c,)e(we)h(can)g(be)f(a)g +(little)h(less)g(general.)1756 5147 y(99)p eop +%%Page: 100 108 +100 107 bop 681 614 a FB(T)-9 b(erminology)681 802 y +FD(These)30 b(pr)o(ocedur)o(es)e(car)o(efully)g(adher)o(e)h(to)h(the)i +(P)t Fv(O)t(S)t(I)t(X)h FD(standar)o(d)c(for)g(\002le-name)h(r)o(eso-) +681 901 y(lution,)f(which)e(occasionally)h(entails)e(some)i(slightly)g +(odd)e(things.)45 b(This)27 b(section)g(will)681 1001 +y(describe)20 b(these)h(r)o(ules,)f(and)h(give)f(some)i(basic)e +(terminology)-9 b(.)805 1129 y(A)17 b FC(\002le-name)g FD(is)h(either)f(the)h(\002le-system)g(r)o(oot)f(\(\223/\224\),)g(or)g -(a)g(series)g(of)h(slash-terminated)681 4285 y(dir)o(ectory)27 +(a)g(series)g(of)h(slash-terminated)681 1228 y(dir)o(ectory)27 b(components,)k(followed)d(by)g(a)f(a)h(\002le)g(component.)48 -b(Root)29 b(is)f(the)g(only)h(\002le-)681 4384 y(name)20 +b(Root)29 b(is)f(the)g(only)h(\002le-)681 1328 y(name)20 b(that)h(may)g(end)f(in)i(slash.)k(Some)20 b(examples:)1053 -4608 y(File)h(name)396 b(Dir)20 b(components)208 b(File)21 -b(component)p 1003 4641 2220 4 v 1053 4711 a FA(src/des/main.c)138 -b(\("src")41 b("des"\))228 b("main.c")1053 4810 y(/src/des/main.c)94 -b(\("")42 b("src")f("des"\))98 b("main.c")1053 4910 y(main.c)490 -b(\(\))709 b("main.c")2051 5147 y FD(102)p eop -%%Page: 103 109 -103 108 bop 490 614 a FD(Note)24 b(that)g(the)g(r)o(elative)f -(\002lename)h FA(src/des/main.c)18 b FD(and)23 b(the)i(absolute)e -(\002lename)365 714 y FA(/src/des/main.c)17 b FD(ar)o(e)k -(distinguished)j(by)f(the)g(pr)o(esence)e(of)i(the)g(r)o(oot)f -(component)i FA("")365 814 y FD(in)e(the)e(absolute)h(path.)490 -1002 y(Multiple)h(embedded)f(slashes)h(within)i(a)d(path)h(have)g(the)g -(same)g(meaning)h(as)f(a)f(sin-)365 1101 y(gle)27 b(slash.)42 -b(Mor)o(e)26 b(than)g(two)h(leading)f(slashes)h(at)f(the)h(beginning)g -(of)g(a)e(path)i(have)e(the)365 1201 y(same)d(meaning)h(as)f(a)g -(single)h(leading)f(slash\227they)h(indicate)f(that)h(the)f -(\002le-name)g(is)h(an)365 1301 y(absolute)d(one,)g(with)g(the)g(path)f -(leading)g(fr)o(om)g(r)o(oot.)25 b(However)-6 b(,)21 -b(P)t Fv(O)t(S)t(I)t(X)i FD(permits)d(the)g(OS)365 1400 -y(to)j(give)f(special)g(meaning)h(to)g FC(two)f FD(leading)g(slashes.) -31 b(For)23 b(this)g(r)o(eason,)f(the)g(r)o(outines)h(in)365 -1500 y(this)f(section)f(do)g(not)h(simplify)f(two)g(leading)g(slashes)g -(to)g(a)f(single)i(slash.)490 1688 y(A)e(\002le-name)g(in)h +1526 y(File)h(name)396 b(Dir)20 b(components)208 b(File)21 +b(component)p 1003 1560 2220 4 v 1053 1629 a FA(src/des/main.c)138 +b(\("src")41 b("des"\))228 b("main.c")1053 1729 y(/src/des/main.c)94 +b(\("")42 b("src")f("des"\))98 b("main.c")1053 1829 y(main.c)490 +b(\(\))709 b("main.c")805 2024 y FD(Note)24 b(that)g(the)h(r)o(elative) +d(\002lename)i FA(src/des/main.c)18 b FD(and)24 b(the)g(absolute)g +(\002lename)681 2124 y FA(/src/des/main.c)16 b FD(ar)o(e)22 +b(distinguished)h(by)g(the)g(pr)o(esence)f(of)g(the)h(r)o(oot)g +(component)h FA("")681 2223 y FD(in)d(the)g(absolute)g(path.)805 +2351 y(Multiple)h(embedded)f(slashes)i(within)g(a)f(path)g(have)f(the)i +(same)f(meaning)g(as)g(a)g(sin-)681 2451 y(gle)k(slash.)43 +b(Mor)o(e)25 b(than)i(two)g(leading)f(slashes)h(at)f(the)g(beginning)i +(of)e(a)g(path)g(have)g(the)681 2550 y(same)c(meaning)h(as)f(a)g +(single)h(leading)f(slash\227they)h(indicate)f(that)g(the)h +(\002le-name)f(is)g(an)681 2650 y(absolute)d(one,)h(with)g(the)g(path)f +(leading)h(fr)o(om)f(r)o(oot.)25 b(However)-6 b(,)21 +b(P)t Fv(O)t(S)t(I)t(X)i FD(permits)d(the)f(OS)681 2750 +y(to)k(give)f(special)g(meaning)h(to)g FC(two)f FD(leading)g(slashes.) +31 b(For)22 b(this)h(r)o(eason,)f(the)h(r)o(outines)g(in)681 +2849 y(this)e(section)h(do)f(not)g(simplify)g(two)h(leading)e(slashes)i +(to)f(a)f(single)h(slash.)805 2977 y(A)f(\002le-name)g(in)h FC(dir)o(ectory)e(form)h FD(is)h(either)f(a)g(\002le-name)g(terminated) -g(by)g(a)g(slash,)g FC(e.g.)p FD(,)365 1788 y(\223)p -FA(/src/des/)p FD(\224,)14 b(or)19 b(the)f(empty)h(string,)g(\223\224.) -24 b(The)18 b(empty)g(string)h(corr)o(esponds)f(to)h(the)g(cur)o(-)365 -1887 y(r)o(ent)g(working)h(dir)o(ectory)-9 b(,)18 b(whose)i -(\002le-name)f(is)h(dot)f(\(\223)p FA(.)p FD(\224\).)k(W)-8 -b(orking)20 b(backwar)o(ds)e(fr)o(om)365 1987 y(the)g(append-a-slash)e -(r)o(ule,)i(we)g(extend)f(the)h(syntax)g(of)i(P)t Fv(O)t(S)t(I)t(X)h -FD(\002le-names)d(to)g(de\002ne)f(the)365 2087 y(empty)22 -b(string)f(to)h(be)f(a)f(\002le-name)h(form)g(of)g(the)h(r)o(oot)f(dir) -o(ectory)f(\223)p FA(/)p FD(\224.)25 b(\(However)-6 b(,)20 -b(\223)p FA(/)p FD(\224)g(is)365 2186 y(also)26 b(acceptable)d(as)j(a)e -(\002le-name)h(form)h(for)f(r)o(oot.\))39 b(So)25 b(the)h(empty)f -(string)h(has)f(two)h(in-)365 2286 y(terpr)o(etations:)f(as)19 -b(a)h(\002le-name)f(form,)h(it)h(is)f(the)g(\002le-system)g(r)o(oot;)g -(as)g(a)g(dir)o(ectory)f(form,)365 2386 y(it)24 b(is)g(the)f(curr)o -(ent)g(working)h(dir)o(ectory)-9 b(.)33 b(Slash)23 b(is)h(also)f(an)g -(ambiguous)h(form:)31 b FA(/)23 b FD(is)h(both)365 2485 -y(a)d(dir)o(ectory-form)e(and)i(a)f(\002le-name)g(form.)490 -2673 y(The)51 b(dir)o(ectory)g(form)g(of)h(a)f(\002le-name)g(is)g(very) -g(rar)o(ely)f(used.)118 b(Almost)52 b(all)365 2773 y(of)61 -b(the)f(pr)o(ocedur)o(es)f(in)h(scsh)h(name)f(dir)o(ectories)g(by)g -(giving)h(their)g(\002le-name)365 2873 y(form)45 b(\(without)g(the)f -(trailing)g(slash\),)50 b(not)45 b(their)f(dir)o(ectory)g(form.)95 -b(So,)50 b(you)45 b(say)365 2972 y(\223)p FA(/usr/include)p -FD(\224,)23 b(and)j(\223)p FA(.)p FD(\224,)h(not)g(\223)p -FA(/usr/include/)p FD(\224)21 b(and)26 b(\223\224.)43 -b(The)27 b(sole)g(exceptions)365 3072 y(ar)o(e)h FA(file-name-as-dir)o -(ec)o(tor)o(y)23 b FD(and)28 b FA(directory-as-file)o(-na)o(me)o -FD(,)d(whose)30 b(jobs)g(ar)o(e)365 3171 y(to)35 b(convert)f -(back-and-forth)f(between)h(these)g(forms,)k(and)c FA(file-name-direc)o -(tor)o(y)p FD(,)365 3271 y(whose)23 b(job)f(it)g(is)g(to)g(split)g(out) -g(the)g(dir)o(ectory)e(portion)j(of)f(a)f(\002le-name.)27 -b(However)-6 b(,)22 b(most)365 3371 y(pr)o(ocedur)o(es)k(that)h(expect) -f(a)h(dir)o(ectory)g(ar)o(gument)f(will)i(coer)o(ce)f(a)f(\002le-name)h -(in)h(dir)o(ec-)365 3470 y(tory)f(form)g(to)g(\002le-name)g(form)f(if)h -(it)g(does)g(not)g(have)f(a)h(trailing)g(slash.)43 b(Bear)26 -b(in)h(mind)365 3570 y(that)g(the)f(ambiguous)h(case,)g(empty)g -(string,)h(will)f(be)g(interpr)o(eted)e(in)i(\002le-name)f(form,)365 -3670 y FC(i.e.)p FD(,)21 b(as)f(r)o(oot.)365 4084 y FB(Procedures)365 -4354 y FA(\(file-name-direct)o(or)o(y?)37 b FC(fname)p -FA(\))87 b Fw(\000)-14 b(!)87 b FC(boolean)726 b FD(pr)o(ocedur)o(e)365 -4454 y FA(\(file-name-non-di)o(re)o(cto)o(ry)o(?)38 b -FC(fname)p FA(\))86 b Fw(\000)-14 b(!)87 b FC(boolean)552 -b FD(pr)o(ocedur)o(e)573 4599 y(These)18 b(pr)o(edicates)e(r)o(eturn)i -(tr)o(ue)g(if)g(the)h(string)f(is)h(in)g(dir)o(ectory)e(form,)i(or)f -(\002le-name)573 4699 y(form)24 b(\(see)f(the)h(above)f(discussion)i -(of)e(these)h(two)g(forms\).)34 b(Note)24 b(that)g(they)g(both)573 -4799 y(r)o(eturn)19 b(tr)o(ue)h(on)g(the)g(ambiguous)g(case)f(of)h -(empty)g(string,)g(which)h(is)f(both)g(a)f(dir)o(ec-)573 -4898 y(tory)i(\(curr)o(ent)f(working)h(dir)o(ectory\),)f(and)g(a)g -(\002le)h(name)g(\(the)f(\002le-system)i(r)o(oot\).)1735 -5147 y(103)p eop -%%Page: 104 110 -104 109 bop 1202 601 a FD(File)21 b(name)177 b FA(...-directory?)94 -b(...-non-director)o(y?)p 1152 634 2130 4 v 1202 704 -a("src/des")139 b(#f)622 b(#t)1202 804 y("src/des/")95 -b(#t)622 b(#f)1202 903 y("/")403 b(#t)622 b(#f)1202 1003 -y(".")403 b(#f)622 b(#t)1202 1103 y("")447 b(#t)622 b(#t)681 -1287 y(\(file-name-as-di)o(re)o(cto)o(ry)37 b FC(fname)p -FA(\))87 b Fw(\000)-15 b(!)88 b FC(string)685 b FD(pr)o(ocedur)o(e)888 -1424 y(Convert)29 b(a)g(\002le-name)f(to)h(dir)o(ectory)f(form.)50 -b(Basically)-9 b(,)30 b(add)e(a)g(trailing)h(slash)g(if)888 -1524 y(needed:)1071 1642 y FA(\(file-name-as-di)o(rec)o(to)o(ry)37 -b("src/des"\))123 b Fn(=)-14 b Fw(\))103 b FA("src/des/")1071 -1742 y(\(file-name-as-di)o(rec)o(to)o(ry)37 b("src/des/"\))79 -b Fn(=)-14 b Fw(\))103 b FA("src/des/")1071 1919 y(.)p -FD(,)20 b FA(/)p FD(,)g(and)g FA("")g FD(ar)o(e)g(special:)1071 -2019 y FA(\(file-name-as-di)o(rec)o(to)o(ry)37 b("."\))387 -b Fn(=)-14 b Fw(\))103 b FA("")1071 2119 y(\(file-name-as-di)o(rec)o -(to)o(ry)37 b("/"\))387 b Fn(=)-14 b Fw(\))103 b FA("/")1071 -2218 y(\(file-name-as-di)o(rec)o(to)o(ry)37 b(""\))431 -b Fn(=)-14 b Fw(\))103 b FA("/")681 2497 y(\(directory-as-fi)o(le)o -(-na)o(me)37 b FC(fname)p FA(\))87 b Fw(\000)-15 b(!)88 -b FC(string)685 b FD(pr)o(ocedur)o(e)888 2634 y(Convert)21 -b(a)g(dir)o(ectory)f(to)h(a)f(simple)i(\002le-name.)j(Basically)-9 -b(,)20 b(kill)h(a)g(trailing)g(slash)g(if)888 2734 y(one)h(is)f(pr)o -(esent:)1071 2874 y FA(\(directory-as-fi)o(le-)o(na)o(me)37 -b("foo/bar/"\))79 b Fn(=)-14 b Fw(\))103 b FA("foo/bar")1071 -3052 y(/)20 b FD(and)h FA("")f FD(ar)o(e)f(special:)1071 -3151 y FA(\(directory-as-fi)o(le-)o(na)o(me)37 b("/"\))387 -b Fn(=)-14 b Fw(\))103 b FA("/")1071 3251 y(\(directory-as-fi)o(le-)o -(na)o(me)37 b(""\))431 b Fn(=)-14 b Fw(\))103 b FA(".")20 -b FD(\()p FC(i.e.)o FD(,)h(the)g(cwd\))681 3529 y FA(\(file-name-absol) -o(ut)o(e?)37 b FC(fname)p FA(\))87 b Fw(\000)-14 b(!)87 -b FC(boolean)769 b FD(pr)o(ocedur)o(e)888 3667 y(Does)20 -b FC(fname)g FD(begin)g(with)g(a)f(r)o(oot)g(or)h FA(~)f -FD(component?)26 b(\(Recognising)21 b FA(~)e FD(as)h(a)f(home-)888 -3766 y(dir)o(ectory)h(speci\002cation)h(is)g(an)g(extension)h(of)g(P)t -Fv(O)t(S)t(I)t(X)j FD(r)o(ules.\))1071 3907 y FA(\(file-name-absol)o -(ute)o(?)37 b("/usr/shivers"\))77 b Fn(=)-14 b Fw(\))104 -b FA(#t)1071 4006 y(\(file-name-absol)o(ute)o(?)37 b("src/des"\))297 -b Fn(=)-14 b Fw(\))104 b FA(#f)1071 4106 y(\(file-name-absol)o(ute)o(?) +g(by)h(a)e(slash,)i FC(e.g.)o FD(,)681 3077 y(\223)p +FA(/src/des/)p FD(\224,)14 b(or)k(the)h(empty)f(string,)h(\223\224.)24 +b(The)18 b(empty)h(string)g(corr)o(esponds)f(to)h(the)f(cur)o(-)681 +3176 y(r)o(ent)g(working)j(dir)o(ectory)-9 b(,)18 b(whose)i +(\002le-name)f(is)g(dot)h(\(\223)p FA(.)p FD(\224\).)i(W)-8 +b(orking)21 b(backwar)o(ds)c(fr)o(om)681 3276 y(the)h(append-a-slash)e +(r)o(ule,)i(we)g(extend)f(the)h(syntax)g(of)h(P)t Fv(O)t(S)t(I)t(X)j +FD(\002le-names)17 b(to)h(de\002ne)g(the)681 3376 y(empty)j(string)h +(to)f(be)g(a)g(\002le-name)g(form)g(of)g(the)g(r)o(oot)g(dir)o(ectory)f +(\223)p FA(/)p FD(\224.)26 b(\(However)-6 b(,)20 b(\223)p +FA(/)p FD(\224)g(is)681 3475 y(also)25 b(acceptable)f(as)h(a)g +(\002le-name)g(form)g(for)g(r)o(oot.\))39 b(So)26 b(the)f(empty)h +(string)g(has)f(two)h(in-)681 3575 y(terpr)o(etations:)e(as)c(a)f +(\002le-name)h(form,)g(it)g(is)g(the)g(\002le-system)h(r)o(oot;)f(as)g +(a)f(dir)o(ectory)g(form,)681 3675 y(it)k(is)h(the)g(curr)o(ent)e +(working)j(dir)o(ectory)-9 b(.)32 b(Slash)23 b(is)h(also)g(an)f +(ambiguous)h(form:)31 b FA(/)23 b FD(is)g(both)681 3774 +y(a)d(dir)o(ectory-form)g(and)g(a)g(\002le-name)h(form.)805 +3902 y(The)51 b(dir)o(ectory)g(form)g(of)g(a)g(\002le-name)g(is)g(very) +g(rar)o(ely)f(used.)116 b(Almost)52 b(al-)681 4002 y(l)37 +b(of)g(the)h(pr)o(ocedur)o(es)d(in)j(scsh)g(name)f(dir)o(ectories)f(by) +i(giving)g(their)f(\002le-name)g(for)o(-)681 4101 y(m)52 +b(\(without)h(the)f(trailing)g(slash\),)60 b(not)53 b(their)f(dir)o +(ectory)f(form.)119 b(So,)60 b(you)52 b(say)681 4201 +y(\223)p FA(/usr/include)p FD(\224,)22 b(and)k(\223)p +FA(.)p FD(\224,)h(not)h(\223)p FA(/usr/include/)p FD(\224)20 +b(and)27 b(\223\224.)43 b(The)27 b(sole)g(exceptions)681 +4301 y(ar)o(e)g FA(file-name-as-dire)o(cto)o(ry)22 b +FD(and)29 b FA(directory-as-fil)o(e-)o(nam)o(e)p FD(,)c(whose)30 +b(jobs)f(ar)o(e)681 4400 y(to)34 b(convert)h(back-and-forth)d(between)i +(these)h(forms,)i(and)d FA(file-name-directo)o(ry)o FD(,)681 +4500 y(whose)22 b(job)h(it)e(is)h(to)g(split)g(out)g(the)g(dir)o +(ectory)f(portion)h(of)g(a)f(\002le-name.)28 b(However)-6 +b(,)21 b(most)681 4599 y(pr)o(ocedur)o(es)e(that)h(expect)g(a)g(dir)o +(ectory)g(ar)o(gument)g(will)i(coer)o(ce)d(a)i(\002le-name)f(in)h(dir)o +(ecto-)681 4699 y(ry)g(form)g(to)h(\002le-name)f(form)g(if)g(it)h(does) +f(not)h(have)f(a)g(trailing)g(slash.)28 b(Bear)20 b(in)h(mind)h(that) +681 4799 y(the)e(ambiguous)h(case,)f(empty)g(string,)h(will)g(be)f +(interpr)o(eted)f(in)h(\002le-name)g(form,)g FC(i.e.)p +FD(,)g(as)681 4898 y(r)o(oot.)2051 5147 y(100)p eop +%%Page: 101 109 +101 108 bop 365 614 a FB(Procedures)365 835 y FA(\(file-name-direct)o +(or)o(y?)37 b FC(fname)p FA(\))87 b Fw(\000)-14 b(!)87 +b FC(boolean)726 b FD(pr)o(ocedur)o(e)365 935 y FA(\(file-name-non-di)o +(re)o(cto)o(ry)o(?)38 b FC(fname)p FA(\))86 b Fw(\000)-14 +b(!)87 b FC(boolean)552 b FD(pr)o(ocedur)o(e)573 1064 +y(These)18 b(pr)o(edicates)e(r)o(eturn)i(tr)o(ue)g(if)g(the)h(string)f +(is)h(in)g(dir)o(ectory)e(form,)i(or)f(\002le-name)573 +1163 y(form)24 b(\(see)f(the)h(above)f(discussion)i(of)e(these)h(two)g +(forms\).)34 b(Note)24 b(that)g(they)g(both)573 1263 +y(r)o(eturn)19 b(tr)o(ue)h(on)g(the)g(ambiguous)g(case)f(of)h(empty)g +(string,)g(which)h(is)f(both)g(a)f(dir)o(ec-)573 1363 +y(tory)i(\(curr)o(ent)f(working)h(dir)o(ectory\),)f(and)g(a)g(\002le)h +(name)g(\(the)f(\002le-system)i(r)o(oot\).)886 1506 y(File)f(name)178 +b FA(...-directory?)94 b(...-non-directo)o(ry?)p 836 +1539 2130 4 v 886 1609 a("src/des")140 b(#f)622 b(#t)886 +1709 y("src/des/")96 b(#t)622 b(#f)886 1808 y("/")404 +b(#t)622 b(#f)886 1908 y(".")404 b(#f)622 b(#t)886 2008 +y("")448 b(#t)622 b(#t)365 2224 y(\(file-name-as-dir)o(ec)o(tor)o(y)37 +b FC(fname)p FA(\))87 b Fw(\000)-14 b(!)87 b FC(string)686 +b FD(pr)o(ocedur)o(e)573 2374 y(Convert)29 b(a)f(\002le-name)h(to)g +(dir)o(ectory)f(form.)49 b(Basically)-9 b(,)30 b(add)e(a)g(trailing)i +(slash)f(if)573 2474 y(needed:)756 2613 y FA(\(file-name-as-d)o(ir)o +(ect)o(or)o(y)38 b("src/des"\))122 b Fn(=)-14 b Fw(\))104 +b FA("src/des/")756 2713 y(\(file-name-as-d)o(ir)o(ect)o(or)o(y)38 +b("src/des/"\))78 b Fn(=)-14 b Fw(\))104 b FA("src/des/")756 +2890 y(.)p FD(,)20 b FA(/)p FD(,)g(and)g FA("")g FD(ar)o(e)f(special:) +756 2990 y FA(\(file-name-as-d)o(ir)o(ect)o(or)o(y)38 +b("."\))386 b Fn(=)-14 b Fw(\))104 b FA("")756 3089 y(\(file-name-as-d) +o(ir)o(ect)o(or)o(y)38 b("/"\))386 b Fn(=)-14 b Fw(\))104 +b FA("/")756 3189 y(\(file-name-as-d)o(ir)o(ect)o(or)o(y)38 +b(""\))430 b Fn(=)-14 b Fw(\))104 b FA("/")365 3525 y +(\(directory-as-fil)o(e-)o(nam)o(e)37 b FC(fname)p FA(\))87 +b Fw(\000)-14 b(!)87 b FC(string)686 b FD(pr)o(ocedur)o(e)573 +3675 y(Convert)21 b(a)f(dir)o(ectory)g(to)h(a)g(simple)g(\002le-name.) +26 b(Basically)-9 b(,)19 b(kill)j(a)e(trailing)i(slash)f(if)573 +3775 y(one)g(is)g(pr)o(esent:)756 3936 y FA(\(directory-as-f)o(il)o +(e-n)o(am)o(e)38 b("foo/bar/"\))78 b Fn(=)-14 b Fw(\))104 +b FA("foo/bar")756 4113 y(/)20 b FD(and)g FA("")g FD(ar)o(e)f(special:) +756 4213 y FA(\(directory-as-f)o(il)o(e-n)o(am)o(e)38 +b("/"\))386 b Fn(=)-14 b Fw(\))104 b FA("/")756 4313 +y(\(directory-as-f)o(il)o(e-n)o(am)o(e)38 b(""\))430 +b Fn(=)-14 b Fw(\))104 b FA(".")19 b FD(\()p FC(i.e.)p +FD(,)h(the)h(cwd\))365 4649 y FA(\(file-name-absolu)o(te)o(?)38 +b FC(fname)p FA(\))86 b Fw(\000)-14 b(!)87 b FC(boolean)770 +b FD(pr)o(ocedur)o(e)573 4799 y(Does)20 b FC(fname)f +FD(begin)h(with)g(a)f(r)o(oot)h(or)f FA(~)h FD(component?)26 +b(\(Recognising)21 b FA(~)e FD(as)g(a)g(home-)573 4898 +y(dir)o(ectory)h(speci\002cation)h(is)g(an)g(extension)g(of)i(P)t +Fv(O)t(S)t(I)t(X)h FD(r)o(ules.\))1735 5147 y(101)p eop +%%Page: 102 110 +102 109 bop 1071 601 a FA(\(file-name-absol)o(ute)o(?)37 +b("/usr/shivers"\))77 b Fn(=)-14 b Fw(\))104 b FA(#t)1071 +701 y(\(file-name-absol)o(ute)o(?)37 b("src/des"\))297 +b Fn(=)-14 b Fw(\))104 b FA(#f)1071 800 y(\(file-name-absol)o(ute)o(?) 37 b("~/src/des"\))209 b Fn(=)-14 b Fw(\))104 b FA(#t)1071 -4283 y FD(Non-obvious)22 b(case:)1071 4383 y FA(\(file-name-absol)o -(ute)o(?)37 b(""\))605 b Fn(=)-14 b Fw(\))104 b FA(#t)20 -b FD(\()p FC(i.e.)o FD(,)h(r)o(oot\))681 4662 y FA(\(file-name-direc)o +978 y FD(Non-obvious)22 b(case:)1071 1077 y FA(\(file-name-absol)o(ute) +o(?)37 b(""\))605 b Fn(=)-14 b Fw(\))104 b FA(#t)20 b +FD(\()p FC(i.e.)o FD(,)h(r)o(oot\))681 1360 y FA(\(file-name-direc)o (to)o(ry)37 b FC(fname)p FA(\))87 b Fw(\000)-14 b(!)87 b FC(string)21 b(or)f(false)559 b FD(pr)o(ocedur)o(e)888 -4799 y(Return)30 b(the)g(dir)o(ectory)e(component)j(of)e +1499 y(Return)30 b(the)g(dir)o(ectory)e(component)j(of)e FC(fname)g FD(in)h(dir)o(ectory)f(form.)51 b(If)29 b(the)g(\002le-)888 -4898 y(name)21 b(is)g(alr)o(eady)e(in)i(dir)o(ectory)f(form,)h(r)o -(eturn)f(it)h(as-is.)2051 5147 y(104)p eop -%%Page: 105 111 -105 110 bop 756 601 a FA(\(file-name-dire)o(ct)o(ory)37 -b("/usr/bdc"\))165 b Fn(=)-14 b Fw(\))104 b FA("/usr/")756 -701 y(\(file-name-dire)o(ct)o(ory)37 b("/usr/bdc/"\))121 -b Fn(=)-14 b Fw(\))104 b FA("/usr/bdc/")756 800 y(\(file-name-dire)o -(ct)o(ory)37 b("bdc/.login"\))77 b Fn(=)-14 b Fw(\))104 -b FA("bdc/")756 900 y(\(file-name-dire)o(ct)o(ory)37 -b("main.c"\))253 b Fn(=)-14 b Fw(\))104 b FA("")756 1077 -y FD(Root)21 b(has)g(no)h(dir)o(ectory)e(component:)756 -1177 y FA(\(file-name-dire)o(ct)o(ory)37 b("/"\))473 -b Fn(=)-14 b Fw(\))104 b FA("")756 1277 y(\(file-name-dire)o(ct)o(ory) -37 b(""\))517 b Fn(=)-14 b Fw(\))104 b FA("")365 1589 -y(\(file-name-nondir)o(ec)o(tor)o(y)37 b FC(fname)p FA(\))87 -b Fw(\000)-14 b(!)87 b FC(string)686 b FD(pr)o(ocedur)o(e)573 -1735 y(Return)21 b(non-dir)o(ectory)g(component)h(of)e(fname.)756 -1886 y FA(\(file-name-nond)o(ir)o(ect)o(or)o(y)38 b("/usr/ian"\))165 -b Fn(=)-14 b Fw(\))104 b FA("ian")756 1986 y(\(file-name-nond)o(ir)o -(ect)o(or)o(y)38 b("/usr/ian/"\))121 b Fn(=)-14 b Fw(\))104 -b FA("")756 2085 y(\(file-name-nond)o(ir)o(ect)o(or)o(y)38 -b("ian/.login"\))77 b Fn(=)-14 b Fw(\))104 b FA(".login")756 -2185 y(\(file-name-nond)o(ir)o(ect)o(or)o(y)38 b("main.c"\))253 -b Fn(=)-14 b Fw(\))104 b FA("main.c")756 2285 y(\(file-name-nond)o(ir)o -(ect)o(or)o(y)38 b(""\))517 b Fn(=)-14 b Fw(\))104 b -FA("")756 2384 y(\(file-name-nond)o(ir)o(ect)o(or)o(y)38 -b("/"\))473 b Fn(=)-14 b Fw(\))104 b FA("/")365 2696 -y(\(split-file-name)37 b FC(fname)p FA(\))87 b Fw(\000)-14 -b(!)87 b FC(string)21 b(list)864 b FD(pr)o(ocedur)o(e)573 -2842 y(Split)20 b(a)h(\002le-name)f(into)i(its)f(components.)756 -2994 y FA(\(split-file-nam)o(e)37 b("src/des/main.c"\))922 -3093 y Fn(=)-14 b Fw(\))266 b FA(\("src")41 b("des")h("main.c"\))756 -3251 y(\(split-file-nam)o(e)37 b("/src/des/main.c")o(\))922 -3351 y Fn(=)-14 b Fw(\))135 b FA(\("")43 b("src")e("des")h("main.c"\)) -756 3509 y(\(split-file-nam)o(e)37 b("main.c"\))922 3609 -y Fn(=)-14 b Fw(\))789 b FA(\("main.c"\))756 3767 y(\(split-file-nam)o -(e)37 b("/"\))922 3866 y Fn(=)-14 b Fw(\))103 b FA(\(""\))365 -4178 y(\(path-list->file-)o(na)o(me)37 b FC(path-list)19 -b([dir])p FA(\))86 b Fw(\000)-14 b(!)87 b FC(string)522 -b FD(pr)o(ocedur)o(e)573 4324 y(Inverse)20 b(of)h FA(split-file-name)p -FD(.)756 4500 y FA(\(path-list->fil)o(e-)o(nam)o(e)37 -b('\("src")k("des")h("main.c"\)\))930 4599 y Fn(=)-14 -b Fw(\))87 b FA("src/des/main.c")756 4699 y(\(path-list->fil)o(e-)o -(nam)o(e)37 b('\("")42 b("src")g("des")f("main.c"\)\))930 -4799 y Fn(=)-14 b Fw(\))87 b FA("/src/des/main.c)o(")1735 -5147 y FD(105)p eop -%%Page: 106 112 -106 111 bop 1071 614 a FD(Optional)21 b FC(dir)g FD(ar)o(g)f(anchors)h -(r)o(elative)e(path-lists:)1071 714 y FA(\(path-list->file)o(-na)o(me) -37 b('\("src")k("des")g("main.c"\))2030 814 y("/usr/shivers"\))1245 -913 y Fn(=)-14 b Fw(\))87 b FA("/usr/shivers/src)o(/d)o(es/)o(ma)o(in)o -(.c")888 1082 y FD(The)21 b(optional)h FC(dir)e FD(ar)o(gument)g(is)i -(usefully)f FA(\(cwd\))p FD(.)681 1375 y FA(\(file-name-exten)o(si)o -(on)37 b FC(fname)p FA(\))87 b Fw(\000)-14 b(!)87 b FC(string)816 -b FD(pr)o(ocedur)o(e)888 1518 y(Return)22 b(the)e(\002le-name's)h -(extension.)1071 1639 y FA(\(file-name-exten)o(sio)o(n)37 -b("main.c"\))341 b Fn(=)-14 b Fw(\))104 b FA(".c")1071 -1739 y(\(file-name-exten)o(sio)o(n)37 b("main.c.old"\))165 -b Fn(=)-14 b Fw(\))104 b FA(".old")1071 1838 y(\(file-name-exten)o(sio) -o(n)37 b("/usr/shivers"\))77 b Fn(=)-14 b Fw(\))104 b -FA("")1071 1988 y FD(W)-8 b(eir)o(d)20 b(cases:)1071 -2087 y FA(\(file-name-exten)o(sio)o(n)37 b("foo."\))124 -b Fn(=)-14 b Fw(\))104 b FA(".")1071 2187 y(\(file-name-exten)o(sio)o -(n)37 b("foo.."\))80 b Fn(=)-14 b Fw(\))104 b FA(".")1071 -2336 y FD(Dot)21 b(\002les)h(ar)o(e)d(not)i(extensions:)1071 -2436 y FA(\(file-name-exten)o(sio)o(n)37 b("/usr/shivers/.lo)o(gi)o -(n"\))76 b Fn(=)-14 b Fw(\))104 b FA("")681 2740 y(\(file-name-sans-)o -(ex)o(ten)o(si)o(on)37 b FC(fname)p FA(\))87 b Fw(\000)-14 -b(!)87 b FC(string)598 b FD(pr)o(ocedur)o(e)888 2882 -y(Return)22 b(everything)f(but)g(the)f(extension.)1071 -3025 y FA(\(file-name-sans-)o(ext)o(en)o(si)o(on)37 b("main.c"\))254 -b Fn(=)-14 b Fw(\))103 b FA("main")1071 3125 y(\(file-name-sans-)o(ext) -o(en)o(si)o(on)37 b("main.c.old"\))78 b Fn(=)-14 b Fw(\))103 -b FA("main.c"")1071 3224 y(\(file-name-sans-)o(ext)o(en)o(si)o(on)37 -b("/usr/shivers"\))1237 3324 y Fn(=)-14 b Fw(\))104 b -FA("/usr/shivers")1071 3473 y FD(W)-8 b(eir)o(d)20 b(cases:)1071 -3573 y FA(\(file-name-sans-)o(ext)o(en)o(si)o(on)37 b("foo."\))124 -b Fn(=)-14 b Fw(\))103 b FA("foo")1071 3672 y(\(file-name-sans-)o(ext)o -(en)o(si)o(on)37 b("foo.."\))80 b Fn(=)-14 b Fw(\))103 -b FA("foo.")1071 3850 y FD(Dot)21 b(\002les)h(ar)o(e)d(not)i -(extensions:)1071 3950 y FA(\(file-name-sans-)o(ext)o(en)o(si)o(on)37 -b("/usr/shivers/.lo)o(gi)o(n"\))1237 4049 y Fn(=)-14 -b Fw(\))104 b FA("/usr/shivers/.)o(log)o(in)888 4263 -y FD(Note)40 b(that)f(appending)g(the)h(r)o(esults)f(of)h -FA(file-name-exten)o(sio)o(n)33 b FD(and)39 b FA(file-)888 -4363 y(name-sans-extensi)o(on)14 b FD(in)21 b(all)g(cases)f(pr)o -(oduces)g(the)h(original)g(\002le-name.)681 4656 y FA -(\(parse-file-name)37 b FC(fname)p FA(\))86 b Fw(\000)-14 -b(!)87 b FC([dir)21 b(name)f(extension])502 b FD(pr)o(ocedur)o(e)888 -4799 y(Let)31 b Fo(f)40 b FD(be)31 b FA(\(file-name-nondi)o(re)o(cto)o -(ry)37 b FC(fname)p FA(\))p FD(.)56 b(This)32 b(function)g(r)o(eturns)f -(the)888 4898 y(thr)o(ee)20 b(values:)2051 5147 y(106)p -eop -%%Page: 107 113 -107 112 bop 672 614 a Fw(\017)42 b FA(\(file-name-dire)o(ct)o(ory)37 -b FC(fname)p FA(\))672 748 y Fw(\017)42 b FA(\(file-name-sans)o(-e)o -(xte)o(ns)o(ion)37 b FC(f)p FA(\)\))672 883 y Fw(\017)42 -b FA(\(file-name-exte)o(ns)o(ion)37 b FC(f)p FA(\))573 -1051 y FD(The)d(inverse)g(of)g FA(parse-file-name)p FD(,)d(in)k(all)f -(cases,)j(is)d FA(string-append)p FD(.)61 b(The)573 1151 -y(boundary)20 b(case)h(of)f FA(/)h FD(was)f(chosen)i(to)f(pr)o(eserve)e -(this)j(inverse.)365 1445 y FA(\(replace-extensio)o(n)37 +1599 y(name)21 b(is)g(alr)o(eady)e(in)i(dir)o(ectory)f(form,)h(r)o +(eturn)f(it)h(as-is.)1071 1739 y FA(\(file-name-direc)o(tor)o(y)37 +b("/usr/bdc"\))166 b Fn(=)-14 b Fw(\))103 b FA("/usr/")1071 +1839 y(\(file-name-direc)o(tor)o(y)37 b("/usr/bdc/"\))122 +b Fn(=)-14 b Fw(\))103 b FA("/usr/bdc/")1071 1938 y(\(file-name-direc)o +(tor)o(y)37 b("bdc/.login"\))78 b Fn(=)-14 b Fw(\))103 +b FA("bdc/")1071 2038 y(\(file-name-direc)o(tor)o(y)37 +b("main.c"\))254 b Fn(=)-14 b Fw(\))103 b FA("")1071 +2216 y FD(Root)22 b(has)f(no)g(dir)o(ectory)f(component:)1071 +2315 y FA(\(file-name-direc)o(tor)o(y)37 b("/"\))474 +b Fn(=)-14 b Fw(\))103 b FA("")1071 2415 y(\(file-name-direc)o(tor)o(y) +37 b(""\))518 b Fn(=)-14 b Fw(\))103 b FA("")681 2697 +y(\(file-name-nondi)o(re)o(cto)o(ry)37 b FC(fname)p FA(\))87 +b Fw(\000)-15 b(!)88 b FC(string)685 b FD(pr)o(ocedur)o(e)888 +2837 y(Return)22 b(non-dir)o(ectory)e(component)i(of)f(fname.)1071 +2977 y FA(\(file-name-nondi)o(rec)o(to)o(ry)37 b("/usr/ian"\))166 +b Fn(=)-14 b Fw(\))103 b FA("ian")1071 3077 y(\(file-name-nondi)o(rec)o +(to)o(ry)37 b("/usr/ian/"\))122 b Fn(=)-14 b Fw(\))103 +b FA("")1071 3176 y(\(file-name-nondi)o(rec)o(to)o(ry)37 +b("ian/.login"\))78 b Fn(=)-14 b Fw(\))103 b FA(".login")1071 +3276 y(\(file-name-nondi)o(rec)o(to)o(ry)37 b("main.c"\))254 +b Fn(=)-14 b Fw(\))103 b FA("main.c")1071 3376 y(\(file-name-nondi)o +(rec)o(to)o(ry)37 b(""\))518 b Fn(=)-14 b Fw(\))103 b +FA("")1071 3475 y(\(file-name-nondi)o(rec)o(to)o(ry)37 +b("/"\))474 b Fn(=)-14 b Fw(\))103 b FA("/")681 3757 +y(\(split-file-name)37 b FC(fname)p FA(\))86 b Fw(\000)-14 +b(!)87 b FC(string)21 b(list)864 b FD(pr)o(ocedur)o(e)888 +3897 y(Split)21 b(a)f(\002le-name)h(into)g(its)g(components.)1071 +4037 y FA(\(split-file-name)37 b("src/des/main.c")o(\))1237 +4137 y Fn(=)-14 b Fw(\))267 b FA(\("src")41 b("des")g("main.c"\))1071 +4295 y(\(split-file-name)c("/src/des/main.c)o("\))1237 +4395 y Fn(=)-14 b Fw(\))136 b FA(\("")42 b("src")g("des")f("main.c"\)) +1071 4553 y(\(split-file-name)c("main.c"\))1237 4652 +y Fn(=)-14 b Fw(\))790 b FA(\("main.c"\))1071 4810 y(\(split-file-name) +37 b("/"\))1237 4910 y Fn(=)-14 b Fw(\))104 b FA(\(""\))2051 +5147 y FD(102)p eop +%%Page: 103 111 +103 110 bop 365 756 a FA(\(path-list->file-)o(na)o(me)37 +b FC(path-list)19 b([dir])p FA(\))86 b Fw(\000)-14 b(!)87 +b FC(string)522 b FD(pr)o(ocedur)o(e)573 890 y(Inverse)20 +b(of)h FA(split-file-name)p FD(.)756 1049 y FA(\(path-list->fil)o(e-)o +(nam)o(e)37 b('\("src")k("des")h("main.c"\)\))930 1148 +y Fn(=)-14 b Fw(\))87 b FA("src/des/main.c")756 1248 +y(\(path-list->fil)o(e-)o(nam)o(e)37 b('\("")42 b("src")g("des")f +("main.c"\)\))930 1348 y Fn(=)-14 b Fw(\))87 b FA("/src/des/main.c)o(") +756 1547 y FD(Optional)21 b FC(dir)g FD(ar)o(g)e(anchors)i(r)o(elative) +f(path-lists:)756 1647 y FA(\(path-list->fil)o(e-)o(nam)o(e)37 +b('\("src")k("des")h("main.c"\))1714 1746 y("/usr/shivers"\))930 +1846 y Fn(=)-14 b Fw(\))87 b FA("/usr/shivers/sr)o(c/)o(de)o(s/m)o(ai)o +(n.c)o(")573 2005 y FD(The)21 b(optional)g FC(dir)g FD(ar)o(gument)f +(is)h(usefully)g FA(\(cwd\))p FD(.)365 2284 y FA(\(file-name-extens)o +(io)o(n)38 b FC(fname)p FA(\))86 b Fw(\000)-14 b(!)87 +b FC(string)817 b FD(pr)o(ocedur)o(e)573 2418 y(Return)21 +b(the)g(\002le-name's)g(extension.)756 2536 y FA(\(file-name-exte)o(ns) +o(ion)37 b("main.c"\))341 b Fn(=)-14 b Fw(\))103 b FA(".c")756 +2636 y(\(file-name-exte)o(ns)o(ion)37 b("main.c.old"\))165 +b Fn(=)-14 b Fw(\))103 b FA(".old")756 2735 y(\(file-name-exte)o(ns)o +(ion)37 b("/usr/shivers"\))77 b Fn(=)-14 b Fw(\))103 +b FA("")756 2882 y FD(W)-8 b(eir)o(d)20 b(cases:)756 +2982 y FA(\(file-name-exte)o(ns)o(ion)37 b("foo."\))124 +b Fn(=)-14 b Fw(\))103 b FA(".")756 3081 y(\(file-name-exte)o(ns)o(ion) +37 b("foo.."\))80 b Fn(=)-14 b Fw(\))103 b FA(".")756 +3228 y FD(Dot)21 b(\002les)g(ar)o(e)e(not)j(extensions:)756 +3328 y FA(\(file-name-exte)o(ns)o(ion)37 b("/usr/shivers/.l)o(og)o(in") +o(\))77 b Fn(=)-14 b Fw(\))103 b FA("")365 3614 y(\(file-name-sans-e)o +(xt)o(ens)o(io)o(n)38 b FC(fname)p FA(\))86 b Fw(\000)-14 +b(!)87 b FC(string)599 b FD(pr)o(ocedur)o(e)573 3748 +y(Return)21 b(everything)g(but)g(the)g(extension.)756 +3888 y FA(\(file-name-sans)o(-e)o(xte)o(ns)o(ion)37 b("main.c"\))253 +b Fn(=)-14 b Fw(\))104 b FA("main")756 3988 y(\(file-name-sans)o(-e)o +(xte)o(ns)o(ion)37 b("main.c.old"\))77 b Fn(=)-14 b Fw(\))104 +b FA("main.c"")756 4087 y(\(file-name-sans)o(-e)o(xte)o(ns)o(ion)37 +b("/usr/shivers"\))922 4187 y Fn(=)-14 b Fw(\))103 b +FA("/usr/shivers")756 4334 y FD(W)-8 b(eir)o(d)20 b(cases:)756 +4434 y FA(\(file-name-sans)o(-e)o(xte)o(ns)o(ion)37 b("foo."\))123 +b Fn(=)-14 b Fw(\))104 b FA("foo")756 4533 y(\(file-name-sans)o(-e)o +(xte)o(ns)o(ion)37 b("foo.."\))79 b Fn(=)-14 b Fw(\))104 +b FA("foo.")756 4711 y FD(Dot)21 b(\002les)g(ar)o(e)e(not)j +(extensions:)756 4810 y FA(\(file-name-sans)o(-e)o(xte)o(ns)o(ion)37 +b("/usr/shivers/.l)o(og)o(in)o("\))922 4910 y Fn(=)-14 +b Fw(\))103 b FA("/usr/shivers/.l)o(ogi)o(n)1735 5147 +y FD(103)p eop +%%Page: 104 112 +104 111 bop 888 752 a FD(Note)40 b(that)f(appending)g(the)h(r)o(esults) +f(of)h FA(file-name-exten)o(sio)o(n)33 b FD(and)39 b +FA(file-)888 852 y(name-sans-extensi)o(on)14 b FD(in)21 +b(all)g(cases)f(pr)o(oduces)g(the)h(original)g(\002le-name.)681 +1158 y FA(\(parse-file-name)37 b FC(fname)p FA(\))86 +b Fw(\000)-14 b(!)87 b FC([dir)21 b(name)f(extension])502 +b FD(pr)o(ocedur)o(e)888 1304 y(Let)31 b Fo(f)40 b FD(be)31 +b FA(\(file-name-nondi)o(re)o(cto)o(ry)37 b FC(fname)p +FA(\))p FD(.)56 b(This)32 b(function)g(r)o(eturns)f(the)888 +1404 y(thr)o(ee)20 b(values:)988 1580 y Fw(\017)41 b +FA(\(file-name-direc)o(tor)o(y)c FC(fname)p FA(\))988 +1718 y Fw(\017)k FA(\(file-name-sans-)o(ext)o(en)o(si)o(on)c +FC(f)p FA(\)\))988 1856 y Fw(\017)k FA(\(file-name-exten)o(sio)o(n)c +FC(f)p FA(\))888 2033 y FD(The)d(inverse)h(of)f FA(parse-file-name)o +FD(,)e(in)i(all)g(cases,)j(is)e FA(string-append)p FD(.)60 +b(The)888 2132 y(boundary)21 b(case)f(of)h FA(/)f FD(was)h(chosen)g(to) +g(pr)o(eserve)f(this)h(inverse.)681 2438 y FA(\(replace-extensi)o(on)37 b FC(fname)21 b(ext)p FA(\))86 b Fw(\000)-14 b(!)87 b -FC(string)782 b FD(pr)o(ocedur)o(e)573 1588 y(This)26 -b(pr)o(ocedur)o(e)e(r)o(eplaces)g FC(fname)p FD('s)i(extension)h(with)f -FC(ext)p FD(.)40 b(It)26 b(is)g(exactly)f(equiva-)573 -1687 y(lent)c(to)756 1829 y FA(\(string-append)37 b(\(file-name-sans-e) -o(xt)o(ens)o(io)o(n)h FC(fname)p FA(\))43 b FC(ext)o -FA(\))365 2182 y(\(simplify-file-na)o(me)37 b FC(fname)p -FA(\))87 b Fw(\000)-15 b(!)88 b FC(string)860 b FD(pr)o(ocedur)o(e)573 -2325 y(Removes)29 b(leading)g(and)f(internal)h(occurr)o(ences)e(of)i -(dot.)49 b(A)28 b(trailing)h(dot)g(is)g(left)573 2424 -y(alone,)g(as)e(the)h(par)o(ent)e(could)i(be)f(a)h(symlink.)47 -b(Removes)28 b(internal)g(and)f(trailing)573 2524 y(double-slashes.)37 -b(A)25 b(leading)g(double-slash)f(is)h(left)g(alone,)h(in)f(accor)o -(dance)e(with)575 2624 y(P)t Fv(O)t(S)t(I)t(X)r FD(.)30 -b(However)-6 b(,)22 b(triple)g(and)f(mor)o(e)h(leading)f(slashes)i(ar)o -(e)d(r)o(educed)g(to)i(a)g(single)573 2723 y(slash,)k(in)g(accor)o -(dance)d(with)28 b(P)t Fv(O)t(S)t(I)t(X)r FD(.)41 b(Double-dots)25 -b(\(par)o(ent)f(dir)o(ectory\))g(ar)o(e)g(left)573 2823 -y(alone,)i(in)g(case)e(they)i(come)f(after)f(symlinks)j(or)f(appear)d -(in)j(a)f FA(/../)p FC(machine)m FA(/...)573 2922 y FD(\223super)o(-r)o -(oot\224)19 b(form)h(\(which)k(P)t Fv(O)t(S)t(I)t(X)g -FD(permits\).)365 3117 y FA(\(resolve-file-nam)o(e)37 -b FC(fname)21 b([dir])p FA(\))86 b Fw(\000)-14 b(!)87 -b FC(string)731 b FD(pr)o(ocedur)o(e)672 3260 y Fw(\017)42 -b FD(Do)21 b FA(~)f FD(expansion.)672 3394 y Fw(\017)42 -b FD(If)23 b FC(dir)g FD(is)h(given,)h(convert)f(a)f(r)o(elative)f -(\002le-name)i(to)g(an)f(absolute)h(\002le-name,)756 -3493 y(r)o(elative)19 b(to)i(dir)o(ectory)f FC(dir)p -FD(.)365 3688 y FA(\(expand-file-name)37 b FC(fname)21 -b([dir])p FA(\))86 b Fw(\000)-15 b(!)87 b FC(string)775 -b FD(pr)o(ocedur)o(e)573 3831 y(Resolve)21 b(and)g(simplify)g(the)g -(\002le-name.)365 4125 y FA(\(home-dir)40 b FC([user])p -FA(\))87 b Fw(\000)-14 b(!)87 b FC(string)1301 b FD(pr)o(ocedur)o(e)573 -4267 y FA(home-dir)17 b FD(r)o(eturns)i FC(user)q FD('s)i(home)f(dir)o -(ectory)-9 b(.)25 b FC(User)20 b FD(defaults)f(to)i(the)f(curr)o(ent)f -(user)-6 b(.)756 4428 y FA(\(home-dir\))471 b Fn(=)-14 -b Fw(\))103 b FA("/user1/lecturer/)o(sh)o(ive)o(rs)o(")756 -4528 y(\(home-dir)39 b("ctkwan"\))80 b Fn(=)-14 b Fw(\))103 -b FA("/user0/research/)o(ct)o(kwa)o(n")365 4849 y(\(home-file)40 -b FC([user])21 b(fname)p FA(\))87 b Fw(\000)-15 b(!)88 -b FC(string)1033 b FD(pr)o(ocedur)o(e)1735 5147 y(107)p -eop -%%Page: 108 114 -108 113 bop 888 614 a FD(Returns)21 b(\002le-name)e FC(fname)h -FD(r)o(elative)f(to)h FC(user)q FD('s)g(home)h(dir)o(ectory;)e -FC(user)i FD(defaults)e(to)888 714 y(the)i(curr)o(ent)f(user)-6 -b(.)1071 836 y FA(\(home-file)39 b("man"\))473 b Fn(=)-14 -b Fw(\))104 b FA("/usr/shivers/ma)o(n")1071 936 y(\(home-file)39 -b("fcmlau")i("man"\))80 b Fn(=)-14 b Fw(\))104 b FA("/usr/fcmlau/man)o -(")805 1217 y FD(The)26 b(general)e FA(substitute-env-va)o(rs)19 -b FD(string)26 b(pr)o(ocedur)o(e,)e(de\002ned)h(in)h(the)f(pr)o(evi-) -681 1317 y(ous)c(section,)g(is)g(also)g(fr)o(equently)g(useful)g(for)f -(expanding)h(\002le-names.)681 1600 y Fy(5.2)99 b(ASCII)24 -b(encoding)681 1841 y FA(\(char->ascii)38 b FC(character)p +FC(string)781 b FD(pr)o(ocedur)o(e)888 2585 y(This)27 +b(pr)o(ocedur)o(e)c(r)o(eplaces)i FC(fname)p FD('s)h(extension)g(with)h +FC(ext)o FD(.)41 b(It)25 b(is)h(exactly)f(equiva-)888 +2684 y(lent)c(to)1071 2835 y FA(\(string-append)38 b(\(file-name-sans-) +o(ex)o(ten)o(si)o(on)f FC(fname)p FA(\))43 b FC(ext)p +FA(\))681 3211 y(\(simplify-file-n)o(am)o(e)38 b FC(fname)p +FA(\))86 b Fw(\000)-14 b(!)87 b FC(string)860 b FD(pr)o(ocedur)o(e)888 +3357 y(Removes)30 b(leading)e(and)g(internal)h(occurr)o(ences)f(of)g +(dot.)50 b(A)28 b(trailing)h(dot)f(is)h(left)888 3457 +y(alone,)g(as)f(the)g(par)o(ent)e(could)i(be)f(a)g(symlink.)48 +b(Removes)28 b(internal)g(and)f(trailing)888 3557 y(double-slashes.)38 +b(A)24 b(leading)h(double-slash)g(is)g(left)f(alone,)i(in)f(accor)o +(dance)e(with)890 3656 y(P)t Fv(O)t(S)t(I)t(X)r FD(.)31 +b(However)-6 b(,)21 b(triple)h(and)g(mor)o(e)f(leading)h(slashes)g(ar)o +(e)f(r)o(educed)f(to)i(a)f(single)888 3756 y(slash,)27 +b(in)f(accor)o(dance)d(with)28 b(P)t Fv(O)t(S)t(I)t(X)r +FD(.)40 b(Double-dots)26 b(\(par)o(ent)e(dir)o(ectory\))g(ar)o(e)f +(left)888 3856 y(alone,)k(in)e(case)g(they)g(come)h(after)e(symlinks)j +(or)e(appear)f(in)h(a)g FA(/../)p FC(machine)n FA(/...)888 +3955 y FD(\223super)o(-r)o(oot\224)19 b(form)i(\(which)i(P)t +Fv(O)t(S)t(I)t(X)h FD(permits\).)681 4162 y FA(\(resolve-file-na)o(me) +37 b FC(fname)21 b([dir])p FA(\))86 b Fw(\000)-15 b(!)88 +b FC(string)730 b FD(pr)o(ocedur)o(e)988 4308 y Fw(\017)41 +b FD(Do)21 b FA(~)g FD(expansion.)988 4446 y Fw(\017)41 +b FD(If)23 b FC(dir)h FD(is)g(given,)g(convert)g(a)f(r)o(elative)g +(\002le-name)g(to)h(an)g(absolute)g(\002le-name,)1071 +4546 y(r)o(elative)19 b(to)j(dir)o(ectory)d FC(dir)p +FD(.)681 4752 y FA(\(expand-file-nam)o(e)37 b FC(fname)21 +b([dir])p FA(\))86 b Fw(\000)-14 b(!)87 b FC(string)774 +b FD(pr)o(ocedur)o(e)888 4898 y(Resolve)22 b(and)e(simplify)h(the)g +(\002le-name.)2051 5147 y(104)p eop +%%Page: 105 113 +105 112 bop 365 763 a FA(\(absolute-file-na)o(me)37 b +FC(fname)21 b([dir])p FA(\))86 b Fw(\000)-15 b(!)88 b +FC(string)687 b FD(pr)o(ocedur)o(e)573 904 y(Convert)25 +b(\002le-name)f FC(fname)g FD(into)i(an)e(absolute)h(\002le)g(name,)g +(r)o(elative)e(to)i(dir)o(ectory)573 1003 y FC(dir)p +FD(,)35 b(which)e(defaults)f(to)h(the)g(curr)o(ent)e(working)j(dir)o +(ectory)-9 b(.)60 b(The)32 b(\002le)h(name)f(is)573 1103 +y(simpli\002ed)21 b(befor)o(e)f(being)h(r)o(eturned.)573 +1235 y(This)g(pr)o(ocedur)o(e)e(does)i(not)g(tr)o(eat)f(a)g(leading)g +(tilde)h(character)e(specially)-9 b(.)365 1525 y FA(\(home-dir)40 +b FC([user])p FA(\))87 b Fw(\000)-14 b(!)87 b FC(string)1301 +b FD(pr)o(ocedur)o(e)573 1665 y FA(home-dir)17 b FD(r)o(eturns)i +FC(user)q FD('s)i(home)f(dir)o(ectory)-9 b(.)25 b FC(User)20 +b FD(defaults)f(to)i(the)f(curr)o(ent)f(user)-6 b(.)756 +1822 y FA(\(home-dir\))471 b Fn(=)-14 b Fw(\))103 b FA +("/user1/lecturer/)o(sh)o(ive)o(rs)o(")756 1922 y(\(home-dir)39 +b("ctkwan"\))80 b Fn(=)-14 b Fw(\))103 b FA("/user0/research/)o(ct)o +(kwa)o(n")365 2234 y(\(home-file)40 b FC([user])21 b(fname)p +FA(\))87 b Fw(\000)-15 b(!)88 b FC(string)1033 b FD(pr)o(ocedur)o(e)573 +2374 y(Returns)20 b(\002le-name)g FC(fname)g FD(r)o(elative)e(to)i +FC(user)r FD('s)g(home)g(dir)o(ectory;)f FC(user)i FD(defaults)e(to)573 +2474 y(the)i(curr)o(ent)f(user)-6 b(.)756 2592 y FA(\(home-file)39 +b("man"\))473 b Fn(=)-14 b Fw(\))103 b FA("/usr/shivers/man)o(")756 +2692 y(\(home-file)39 b("fcmlau")h("man"\))81 b Fn(=)-14 +b Fw(\))103 b FA("/usr/fcmlau/man")490 2964 y FD(The)25 +b(general)g FA(substitute-env-v)o(ars)18 b FD(string)26 +b(pr)o(ocedur)o(e,)f(de\002ned)g(in)g(the)h(pr)o(evi-)365 +3064 y(ous)c(section,)f(is)g(also)g(fr)o(equently)f(useful)h(for)g +(expanding)f(\002le-names.)365 3314 y FB(5.1.2)81 b(Other)20 +b(string)h(manipulation)c(facilities)365 3521 y FA(\(index)41 +b FC(string)21 b(char)f([start])p FA(\))86 b Fw(\000)-14 +b(!)87 b FC(\002xnum)20 b(or)h(false)732 b FD(pr)o(ocedur)o(e)365 +3621 y FA(\(rindex)41 b FC(string)21 b(char)f([start])p +FA(\))86 b Fw(\000)-15 b(!)88 b FC(\002xnum)20 b(or)h(false)688 +b FD(pr)o(ocedur)o(e)573 3745 y(These)17 b(pr)o(ocedur)o(es)e(sear)o +(ch)g(thr)o(ough)j FC(string)f FD(looking)h(for)f(an)f(occurr)o(ence)g +(of)h(char)o(-)573 3845 y(acter)j FC(char)o FD(.)26 b +FA(index)18 b FD(sear)o(ches)i(left-to-right;)g FA(rindex)f +FD(sear)o(ches)g(right-to-left.)573 3977 y FA(index)j +FD(r)o(eturns)i(the)g(smallest)h(index)f Fo(i)g FD(of)g +FC(string)g FD(gr)o(eater)f(than)h(or)h(equal)f(to)h +FC(start)573 4077 y FD(such)e(that)g FC(string)p Fn([)p +Fo(i)p Fn(])k(=)f FC(char)p FD(.)31 b(The)23 b(default)f(for)g +FC(start)h FD(is)g(zer)o(o.)31 b(If)22 b(ther)o(e)g(is)i(no)f(such)573 +4177 y(match,)d FA(index)f FD(r)o(eturns)h(false.)573 +4309 y FA(rindex)38 b FD(r)o(eturns)i(the)h(lar)o(gest)f(index)h +Fo(i)f FD(of)h FC(string)g FD(less)g(than)g FC(start)f +FD(such)i(that)573 4409 y FC(string)p Fn([)p Fo(i)p Fn(])28 +b(=)f FC(char)p FD(.)33 b(The)24 b(default)e(for)h FC(start)h +FD(is)f FA(\(string-length)38 b FC(string)p FA(\))p FD(.)33 +b(If)23 b(ther)o(e)573 4508 y(is)e(no)g(such)h(match,)e +FA(rindex)e FD(r)o(eturns)j(false.)490 4674 y(I)d(should)i(pr)o(obably) +d(snarf)h(all)h(the)f(MIT)g(Scheme)g(string)h(functions,)h(and)e(stick) +h(them)365 4774 y(in)j(a)e(package.)k(Unix)d(pr)o(ograms)f(need)g(to)i +(mung)f(character)e(strings)j(a)e(lot.)490 4898 y(MIT)g(string)h(match) +g(commands:)1735 5147 y(105)p eop +%%Page: 106 114 +106 113 bop 888 614 a FA([sub]string-match)o(-f)o(orw)o(ar)o(d,b)o(ac)o +(kwa)o(rd)o([-)o(ci])888 714 y([sub]string-prefi)o(x,)o(suf)o(fi)o(x[-) +o(ci)o(]?)888 814 y([sub]string-find-)o(ne)o(xt,)o(pr)o(evi)o(ou)o(s-c) +o(ha)o(r[)o(-ci)o(])888 913 y([sub]string-find-)o(ne)o(xt,)o(pr)o(evi)o +(ou)o(s-c)o(ha)o(r-)o(in-)o(se)o(t)888 1013 y([sub]string-repla)o(ce)o +([!])888 1112 y(...)p Fu(etc.)681 1212 y FD(These)20 +b(ar)o(e)g(not)h(curr)o(ently)g(pr)o(ovided.)681 1362 +y FA(\(substitute-env-)o(va)o(rs)37 b FC(fname)p FA(\))87 +b Fw(\000)-14 b(!)87 b FC(string)816 b FD(pr)o(ocedur)o(e)888 +1505 y(Replace)24 b(occurr)o(ences)f(of)i(envir)o(onment)g(variables)e +(with)i(their)f(values.)36 b(An)24 b(en-)888 1604 y(vir)o(onment)19 +b(variable)d(is)j(denoted)e(by)h(a)g(dollar)f(sign)i(followed)f(by)g +(alphanumeric)888 1704 y(chars)j(and)f(underscor)o(es,)g(or)h(is)g +(surr)o(ounded)f(by)h(braces.)1071 1863 y FA(\(substitute-env-)o(var)o +(s)37 b("$USER/.login"\))1237 1963 y Fn(=)-14 b Fw(\))104 +b FA("shivers/.login)o(")1071 2063 y(\(substitute-env-)o(var)o(s)37 +b("$)p Fw(f)p FA(USER)p Fw(g)p FA(_log"\))77 b Fn(=)-14 +b Fw(\))104 b FA("shivers_log")681 2500 y Fy(5.2)99 b(ASCII)24 +b(encoding)681 2741 y FA(\(char->ascii)38 b FC(character)p FA(\))87 b Fw(\000)-15 b(!)87 b FC(integer)1029 b FD(pr)o(ocedur)o(e) -681 1941 y FA(\(ascii->char)38 b FC(integer)p FA(\))87 +681 2840 y FA(\(ascii->char)38 b FC(integer)p FA(\))87 b Fw(\000)-14 b(!)87 b FC(character)1028 b FD(pr)o(ocedur)o(e)888 -2066 y(These)36 b(ar)o(e)f(identical)g(to)i FA(char->integer)30 +2965 y(These)36 b(ar)o(e)f(identical)g(to)i FA(char->integer)30 b FD(and)35 b FA(integer->char)c FD(except)k(that)888 -2166 y(they)21 b(use)g(the)i(A)t Fv(S)t(C)t(I)t(I)h FD(encoding.)681 -2466 y Fy(5.3)99 b(Character)24 b(sets)681 2683 y FD(Scsh)d(pr)o -(ovides)f(a)h FA(char-set)c FD(type)k(for)g(expr)o(essing)g(sets)g(of)g -(characters.)k(These)c(sets)g(ar)o(e)681 2783 y(used)d(by)g(some)h(of)g -(the)f(delimited-input)g(pr)o(ocedur)o(es)f(\(section)i(7.1\).)k(The)18 -b(character)f(set)681 2882 y(package)i(that)i(scsh)g(uses)g(was)g -(taken)g(fr)o(om)f(Pr)o(oject)h(Mac's)f(MIT)g(Scheme.)681 -3033 y FA(\(char-set?)39 b FC(x)p FA(\))86 b Fw(\000)-14 -b(!)87 b FC(boolean)1367 b FD(pr)o(ocedur)o(e)888 3176 -y(Returns)22 b(tr)o(ue)f(if)f(the)h(object)g FC(x)f FD(is)h(a)g -(character)e(set.)681 3450 y FB(5.3.1)81 b(Creating)19 -b(character)g(sets)681 3660 y FA(\(char-set)40 b FC(char)1261 -3672 y Fx(1)1298 3660 y FC(.)12 b(.)g(.)g FA(\))88 b -Fw(\000)-15 b(!)88 b FC(char-set)1155 b FD(pr)o(ocedur)o(e)888 -3785 y(Return)22 b(a)e(character)f(set)i(containing)h(the)f(given)g -(characters.)681 3980 y FA(\(chars->char-set)37 b FC(chars)p -FA(\))86 b Fw(\000)-14 b(!)87 b FC(char-set)955 b FD(pr)o(ocedur)o(e) -888 4123 y(Return)22 b(a)e(character)f(set)i(containing)h(the)f -(characters)e(in)i(the)g(list)h FC(chars)o FD(.)681 4318 -y FA(\(string->char-se)o(t)37 b FC(s)p FA(\))87 b Fw(\000)-14 -b(!)87 b FC(char-set)1056 b FD(pr)o(ocedur)o(e)888 4461 -y(Return)22 b(a)e(character)f(set)i(containing)h(the)f(characters)e(in) -i(the)g(string)h FC(s)p FD(.)681 4656 y FA(\(predicate->char)o(-s)o(et) -37 b FC(pr)o(ed)p FA(\))86 b Fw(\000)-14 b(!)87 b FC(char-set)811 -b FD(pr)o(ocedur)o(e)888 4799 y(Returns)31 b(a)e(character)f(set)h -(containing)i(every)e(character)f FC(c)h FD(such)h(that)f -FA(\()p FC(pr)o(ed)43 b(c)o FA(\))888 4898 y FD(r)o(eturns)21 -b(tr)o(ue.)2051 5147 y(108)p eop -%%Page: 109 115 -109 114 bop 365 614 a FA(\(ascii-range->cha)o(r-)o(set)37 +3065 y(they)21 b(use)g(the)i(A)t Fv(S)t(C)t(I)t(I)h FD(encoding.)681 +3363 y Fy(5.3)99 b(Character)24 b(sets)681 3579 y FD(Scsh)31 +b(pr)o(ovides)g(a)g FA(char-set)d FD(type)j(for)g(expr)o(essing)g(sets) +g(of)h(characters.)56 b(These)31 b(sets)681 3678 y(ar)o(e)22 +b(used)h(by)g(some)h(of)f(the)h(delimited-input)f(pr)o(ocedur)o(es)f +(\(section)h(8.1\).)32 b(Scsh's)23 b(char)o(-)681 3778 +y(acter)h(set)h(package)e(was)i(adapted)e(and)i(extended)f(fr)o(om)g +(Pr)o(oject)h(Mac's)f(MIT)g(Scheme)681 3878 y(package.)j(Note)21 +b(that)h(the)g(character)e(type)h(used)h(in)g(the)f(curr)o(ent)g +(implementation)i(cor)o(-)681 3977 y(r)o(esponds)h(to)g(the)h(ASCII)e +(character)f(set\227but)j(you)f(would)h(be)f(wise)h(not)g(to)f(build)g +(this)681 4077 y(assumption)e(into)f(your)g(code)g(if)f(you)i(can)e +(help)h(it.)2323 4047 y Fs(1)681 4227 y FA(\(char-set?)39 +b FC(x)p FA(\))86 b Fw(\000)-14 b(!)87 b FC(boolean)1367 +b FD(pr)o(ocedur)o(e)888 4369 y(Is)21 b(the)g(object)g +FC(x)g FD(a)f(character)f(set?)p 681 4424 1146 4 v 771 +4481 a Fr(1)800 4504 y Fv(Actually)-7 b(,)15 b(it's)h(slightly)f +(uglier)g(than)f(that,)g(albeit)h(somewhat)g(mor)o(e)f(useful.)20 +b(The)14 b(curr)o(ent)h(character)h(type)681 4583 y(corr)o(esponds)k +(to)g(an)f(eight-bit)g(superset)h(of)g(ASCII.)g(The)f +Fi(ascii->char)j Fv(and)e Fi(char->ascii)j Fv(functions)d(will)681 +4662 y(pr)o(eserve)13 b(this)g(eighth)f(bit.)19 b(However)-5 +b(,)14 b(none)f(of)h(the)e(the)h(high)g(128)h(characters)g(appear)g(in) +f(any)h(of)f(the)g(standar)o(d)681 4741 y(character)26 +b(sets)e(de\002ned)g(in)h(section)g(5.3.4,)i(except)e(for)g +Fi(char-set:full)p Fv(.)49 b(If)26 b(someone)e(would)i(email)f(the)681 +4819 y(authors)19 b(a)g(listing)g(of)g(the)e(full)j(Latin-1)e +(de\002nition,)h(we'll)h(be)e(happy)g(to)h(upgrade)f(these)g(sets')h +(de\002nitions)f(to)681 4898 y(make)e(them)f(Latin-1)i(compliant.)2051 +5147 y FD(106)p eop +%%Page: 107 115 +107 114 bop 365 614 a FA(\(char-set=)40 b FC(cs)911 626 +y Fx(1)969 614 y FC(cs)1035 626 y Fx(2)1072 614 y FC(.)12 +b(.)g(.)g FA(\))88 b Fw(\000)-15 b(!)87 b FC(boolean)1082 +b FD(pr)o(ocedur)o(e)573 741 y(Ar)o(e)19 b(the)i(character)e(sets)i +(equal?)365 911 y FA(\(char-set<=)39 b FC(cs)954 923 +y Fx(1)1012 911 y FC(cs)1078 923 y Fx(2)1116 911 y FC(.)12 +b(.)g(.)g FA(\))87 b Fw(\000)-14 b(!)87 b FC(boolean)1038 +b FD(pr)o(ocedur)o(e)573 1038 y(Returns)21 b(tr)o(ue)g(if)g(every)f +(character)f(set)i FC(cs)1898 1050 y Fp(i)1946 1038 y +FD(is)g(a)g(subset)g(of)f(character)g(set)g FC(cs)2983 +1050 y Fp(i)p Fx(+1)3095 1038 y FD(.)365 1207 y FA(\(char-set-fold)38 +b FC(kons)21 b(knil)g(cs)p FA(\))87 b Fw(\000)-14 b(!)87 +b FC(object)903 b FD(pr)o(ocedur)o(e)573 1334 y(This)26 +b(is)g(the)f(fundamental)g(iterator)g(for)g(character)f(sets.)40 +b(Applies)25 b(the)h(function)573 1434 y FC(kons)19 b +FD(acr)o(oss)g(the)g(character)e(set)j FC(cs)f FD(using)h(initial)f +(state)g(value)g FC(knil)p FD(.)25 b(That)19 b(is,)g(if)g +FC(cs)g FD(is)573 1534 y(the)24 b(empty)h(set,)g(the)g(pr)o(ocedur)o(e) +d(r)o(eturns)i FC(knil)p FD(.)37 b(Otherwise,)26 b(some)f(element)f +FC(c)h FD(of)573 1633 y FC(cs)19 b FD(is)h(chosen;)g(let)f +FC(cs')h FD(be)f(the)g(r)o(emaining,)g(unchosen)i(characters.)i(The)d +(pr)o(ocedur)o(e)573 1733 y(r)o(eturns)756 1832 y FA(\(char-set-fold)37 +b FC(kons)44 b FA(\()p FC(kons)f(c)h(knil)p FA(\))f FC(cs')p +FA(\))573 1932 y FD(For)21 b(example,)f(we)g(could)h(de\002ne)g +FA(char-set-members)14 b FD(\(see)20 b(below\))h(as)756 +2032 y FA(\(lambda)40 b(\(cs\))i(\(char-set-fold)c(cons)k('\(\))g +(cs\)\))756 2185 y Fl(Remark:)91 b Fk(This)28 b(pr)o(ocedur)o(e)f(was)i +(formerly)d(named)k Fj(reduce-char-set)42 b Fk(.)756 +2276 y(The)19 b(old)h(binding)f(is)h(still)f(pr)o(ovided,)f(but)i(is)f +(depr)o(ecated)g(and)h(will)g(pr)o(obably)756 2367 y(vanish)f(in)g(a)g +(futur)o(e)f(r)o(elease.)365 2589 y FA(\(char-set-for-eac)o(h)37 +b FC(p)21 b(cs)p FA(\))87 b Fw(\000)-15 b(!)87 b FC(unde\002ned)852 +b FD(pr)o(ocedur)o(e)573 2716 y(Apply)20 b(pr)o(ocedur)o(e)f +FC(p)h FD(to)i(each)e(character)f(in)i(the)g(character)e(set)i +FC(cs)p FD(.)26 b(Note)21 b(that)f(the)573 2816 y(or)o(der)27 +b(in)i(which)h FC(p)e FD(is)h(applied)e(to)i(the)g(characters)e(in)i +(the)g(set)f(is)h(not)g(speci\002ed,)573 2915 y(and)20 +b(may)h(even)f(change)h(fr)o(om)f(application)h(to)g(application.)365 +3169 y FB(5.3.1)81 b(Creating)20 b(character)f(sets)365 +3363 y FA(\(char-set)40 b FC(char)946 3375 y Fx(1)983 +3363 y FC(.)12 b(.)g(.)g FA(\))87 b Fw(\000)-14 b(!)87 +b FC(char-set)1156 b FD(pr)o(ocedur)o(e)573 3480 y(Return)21 +b(a)f(character)g(set)g(containing)i(the)f(given)g(characters.)365 +3650 y FA(\(chars->char-set)37 b FC(chars)p FA(\))87 +b Fw(\000)-14 b(!)87 b FC(char-set)955 b FD(pr)o(ocedur)o(e)573 +3777 y(Return)21 b(a)f(character)g(set)g(containing)i(the)f(characters) +f(in)h(the)g(list)g FC(chars)p FD(.)365 3946 y FA(\(string->char-set)37 +b FC(s)p FA(\))87 b Fw(\000)-14 b(!)87 b FC(char-set)1056 +b FD(pr)o(ocedur)o(e)573 4073 y(Return)21 b(a)f(character)g(set)g +(containing)i(the)f(characters)f(in)h(the)g(string)g +FC(s)q FD(.)365 4243 y FA(\(predicate->char-)o(se)o(t)38 +b FC(pr)o(ed)p FA(\))85 b Fw(\000)-14 b(!)87 b FC(char-set)812 +b FD(pr)o(ocedur)o(e)573 4370 y(Returns)30 b(a)f(character)f(set)i +(containing)g(every)f(character)f FC(c)h FD(such)h(that)g +FA(\()p FC(pr)o(ed)42 b(c)p FA(\))573 4469 y FD(r)o(eturns)20 +b(tr)o(ue.)365 4639 y FA(\(ascii-range->cha)o(r-)o(set)37 b FC(lower)21 b(upper)p FA(\))87 b Fw(\000)-15 b(!)87 -b FC(char-set)472 b FD(pr)o(ocedur)o(e)573 745 y(Returns)21 +b FC(char-set)472 b FD(pr)o(ocedur)o(e)573 4766 y(Returns)21 b(a)g(character)e(set)i(containing)h(every)e(character)f(whose)24 -b(A)t Fv(S)t(C)t(I)t(I)g FD(code)c(lies)573 845 y(in)h(the)g(half-open) -f(range)h Fn([)p FC(lower)p Fo(;)14 b FC(upper)p Fn(\))p -FD(.)365 1102 y FB(5.3.2)81 b(Querying)20 b(character)f(sets)365 -1299 y FA(\(char-set-members)37 b FC(char-set)p FA(\))86 -b Fw(\000)-14 b(!)87 b FC(character-list)647 b FD(pr)o(ocedur)o(e)573 -1418 y(This)21 b(pr)o(ocedur)o(e)e(r)o(eturns)h(a)g(list)i(of)f(the)f -(members)h(of)g FC(char-set)o FD(.)365 1554 y FA(\(char-set-contain)o -(s?)37 b FC(char-set)20 b(char)p FA(\))86 b Fw(\000)-14 -b(!)87 b FC(boolean)587 b FD(pr)o(ocedur)o(e)573 1677 -y(This)21 b(pr)o(ocedur)o(e)e(tests)i FC(char)f FD(for)h(membership)g -(in)g(set)g FC(char-set)o FD(.)756 1824 y Fl(Remark:)226 -b Fk(Pr)o(evious)62 b(r)o(eleases)e(of)j(scsh)f(called)g(this)h(pr)o -(ocedur)o(e)756 1915 y Fh(char-set-member?)p Fk(,)25 -b(r)o(eversing)19 b(the)k(or)o(der)c(of)i(the)h(ar)o(guments.)31 -b(This)21 b(made)756 2006 y(sense,)34 b(but)e(was)h(unfortunately)f -(the)h(r)o(everse)c(or)o(der)h(in)i(which)h(the)g(ar)o(gu-)756 -2098 y(ments)g(appear)h(in)g(MIT)f(Scheme.)68 b(A)34 -b(r)o(easonable)f(ar)o(gument)g(or)o(der)f(was)756 2189 -y(not)23 b(backwar)o(ds-compatible)g(with)h(MIT)f(Scheme;)j(on)d(the)h -(other)f(hand,)i(the)756 2280 y(MIT)d(Scheme)h(ar)o(gument)f(or)o(der)f -(was)i(counter)o(-intuitive)f(and)h(at)h(odds)d(with)756 -2372 y(common)j(mathematical)i(notation)f(and)g(the)f -Fh(member)i Fk(family)d(of)h(R4RS)g(pr)o(o-)756 2463 -y(cedur)o(es.)756 2566 y(W)-7 b(e)18 b(sought)g(to)h(escape)g(the)g -(dilemma)f(by)g(shifting)h(to)g(a)g(new)g(name.)365 2868 -y FB(5.3.3)81 b(Character)19 b(set)h(algebra)365 3065 -y FA(\(char-set-invert)37 b FC(char-set)p FA(\))86 b -Fw(\000)-14 b(!)87 b FC(char-set)868 b FD(pr)o(ocedur)o(e)365 -3164 y FA(\(char-set-union)38 b FC(char-set)1327 3176 -y Fx(1)1385 3164 y FC(char-set)1649 3176 y Fx(2)1687 -3164 y FA(\))86 b Fw(\000)-14 b(!)87 b FC(char-set)552 -b FD(pr)o(ocedur)o(e)365 3264 y FA(\(char-set-interse)o(ct)o(ion)37 -b FC(char-set)1632 3276 y Fx(1)1690 3264 y FC(char-set)1954 -3276 y Fx(2)1992 3264 y FA(\))86 b Fw(\000)-14 b(!)87 -b FC(char-set)247 b FD(pr)o(ocedur)o(e)365 3364 y FA -(\(char-set-differe)o(nc)o(e)38 b FC(char-set)1545 3376 -y Fx(1)1603 3364 y FC(char-set)1867 3376 y Fx(2)1905 -3364 y FA(\))86 b Fw(\000)-14 b(!)87 b FC(char-set)334 -b FD(pr)o(ocedur)o(e)573 3483 y(These)31 b(pr)o(ocedur)o(es)e -(implement)j(set)f(complement,)j(union,)h(intersection,)f(and)573 -3583 y(dif)o(fer)o(ence)18 b(for)j(character)e(sets.)365 -3840 y FB(5.3.4)81 b(Standard)19 b(character)g(sets)365 -4023 y FD(Several)h(character)f(sets)i(ar)o(e)e(pr)o(ede\002ned)g(for)i -(convenience:)p 433 4139 2729 4 v 433 4239 4 100 v 486 -4209 a FA(char-set:upper-ca)o(se)268 b FD(A\226Z)p 3158 -4239 V 433 4339 V 486 4309 a FA(char-set:lower-ca)o(se)g -FD(a\226z)p 3158 4339 V 433 4438 V 486 4408 a FA(char-set:numeric)399 -b FD(0\2269)p 3158 4438 V 433 4538 V 486 4508 a FA(char-set:whitespa)o -(ce)268 b FD(space,)19 b(newline,)i(tab,)f(linefeed,)g(page,)g(r)o -(eturn)p 3158 4538 V 433 4638 V 486 4608 a FA(char-set:not-whit)o(esp)o -(ac)o(e)94 b FD(Complement)21 b(of)g FA(char-set:whitesp)o(ac)o(e)p -3158 4638 V 433 4737 V 486 4707 a(char-set:alphabet)o(ic)268 -b FD(A\226Z)20 b(and)g(a\226z)p 3158 4737 V 433 4837 -V 486 4807 a FA(char-set:alphanum)o(eri)o(c)181 b FD(Alphabetic)19 -b(or)i(numeric)p 3158 4837 V 433 4936 V 486 4907 a FA(char-set:graphic) -399 b FD(Printing)21 b(characters)f(and)g(space)p 3158 -4936 V 433 4940 2729 4 v 1735 5147 a(109)p eop -%%Page: 110 116 -110 115 bop 681 614 a FA(\(char-upper-case)o(?)37 b FC(character)p +b(A)t Fv(S)t(C)t(I)t(I)g FD(code)c(lies)573 4865 y(in)h(the)g +(half-open)f(range)h Fn([)p FC(lower)p Fo(;)14 b FC(upper)p +Fn(\))p FD(.)1735 5147 y(107)p eop +%%Page: 108 116 +108 115 bop 681 614 a FB(5.3.2)81 b(Querying)20 b(character)f(sets)681 +822 y FA(\(char-set-member)o(s)37 b FC(char-set)p FA(\))86 +b Fw(\000)-14 b(!)87 b FC(character-list)647 b FD(pr)o(ocedur)o(e)888 +946 y(This)22 b(pr)o(ocedur)o(e)c(r)o(eturns)j(a)f(list)h(of)g(the)g +(members)g(of)f FC(char-set)p FD(.)681 1087 y FA(\(char-set-contai)o +(ns)o(?)38 b FC(char-set)20 b(char)p FA(\))86 b Fw(\000)-14 +b(!)87 b FC(boolean)586 b FD(pr)o(ocedur)o(e)888 1220 +y(This)22 b(pr)o(ocedur)o(e)c(tests)j FC(char)g FD(for)f(membership)h +(in)h(set)e FC(char-set)p FD(.)1071 1378 y Fl(Remark:)227 +b Fk(Pr)o(evious)61 b(r)o(eleases)g(of)h(scsh)h(called)f(this)h(pr)o +(ocedur)o(e)1071 1469 y Fj(char-set-member?)p Fk(,)25 +b(r)o(eversing)20 b(the)i(or)o(der)d(of)j(the)g(ar)o(guments.)30 +b(This)22 b(made)1071 1560 y(sense,)34 b(but)f(was)f(unfortunately)g +(the)h(r)o(everse)d(or)o(der)g(in)i(which)h(the)f(ar)o(gu-)1071 +1652 y(ments)i(appear)f(in)h(MIT)f(Scheme.)68 b(A)34 +b(r)o(easonable)f(ar)o(gument)h(or)o(der)d(was)1071 1743 +y(not)24 b(backwar)o(ds-compatible)f(with)h(MIT)f(Scheme;)i(on)f(the)g +(other)f(hand,)i(the)1071 1834 y(MIT)d(Scheme)h(ar)o(gument)g(or)o(der) +d(was)j(counter)o(-intuitive)g(and)g(at)g(odds)e(with)1071 +1926 y(common)j(mathematical)i(notation)f(and)g(the)g +Fj(member)g Fk(family)e(of)h(R4RS)h(pr)o(o-)1071 2017 +y(cedur)o(es.)1071 2125 y(W)-7 b(e)18 b(sought)h(to)g(escape)f(the)h +(dilemma)f(by)h(shifting)g(to)f(a)h(new)h(name.)681 2365 +y FA(\(char-set-size)38 b FC(cs)p FA(\))86 b Fw(\000)-14 +b(!)87 b FC(integer)1183 b FD(pr)o(ocedur)o(e)888 2506 +y(Returns)22 b(the)f(number)g(of)f(elements)h(in)h(character)d(set)i +FC(cs)p FD(.)681 2697 y FA(\(char-set-every?)37 b FC(pr)o(ed)20 +b(cs)p FA(\))86 b Fw(\000)-14 b(!)87 b FC(boolean)914 +b FD(pr)o(ocedur)o(e)681 2796 y FA(\(char-set-any?)38 +b FC(pr)o(ed)19 b(cs)p FA(\))87 b Fw(\000)-14 b(!)87 +b FC(object)1059 b FD(pr)o(ocedur)o(e)888 2937 y(The)34 +b FA(char-set-every?)28 b FD(pr)o(ocedur)o(e)k(r)o(eturns)i(tr)o(ue)g +(if)f(pr)o(edicate)f FC(pr)o(ed)i FD(r)o(eturns)888 3037 +y(tr)o(ue)21 b(of)g(every)f(character)f(in)i(the)g(character)f(set)g +FC(cs)p FD(.)888 3170 y(Likewise,)j FA(char-set-any?)17 +b FD(applies)22 b FC(pr)o(ed)g FD(to)g(every)g(character)f(in)i +(character)e(set)888 3269 y FC(cs)p FD(,)f(and)f(r)o(eturns)g(the)h +(\002rst)g(tr)o(ue)f(value)g(it)h(\002nds.)26 b(If)19 +b(no)h(character)e(pr)o(oduces)h(a)g(tr)o(ue)888 3369 +y(value,)h(it)h(r)o(eturns)f(false.)888 3502 y(The)f(or)o(der)e(in)i +(which)h(these)e(pr)o(ocedur)o(es)f(sequence)i(thr)o(ough)g(the)g +(elements)f(of)h FC(cs)888 3601 y FD(is)i(not)h(speci\002ed.)681 +3869 y FB(5.3.3)81 b(Character)o(-set)17 b(algebra)681 +4076 y FA(\(char-set-invert)37 b FC(char-set)p FA(\))86 +b Fw(\000)-14 b(!)87 b FC(char-set)867 b FD(pr)o(ocedur)o(e)681 +4176 y FA(\(char-set-union)37 b FC(char-set)1642 4188 +y Fx(1)1680 4176 y FC(.)12 b(.)g(.)g FA(\))87 b Fw(\000)-14 +b(!)87 b FC(char-set)774 b FD(pr)o(ocedur)o(e)681 4276 +y FA(\(char-set-inters)o(ec)o(tio)o(n)37 b FC(char-set)1948 +4288 y Fx(1)2006 4276 y FC(char-set)2270 4288 y Fx(2)2307 +4276 y FC(.)12 b(.)g(.)g FA(\))88 b Fw(\000)-15 b(!)87 +b FC(char-set)147 b FD(pr)o(ocedur)o(e)681 4375 y FA(\(char-set-differ) +o(en)o(ce)37 b FC(char-set)1860 4387 y Fx(1)1918 4375 +y FC(char-set)2183 4387 y Fx(2)2220 4375 y FC(.)12 b(.)g(.)g +FA(\))87 b Fw(\000)-14 b(!)87 b FC(char-set)234 b FD(pr)o(ocedur)o(e) +888 4500 y(These)31 b(pr)o(ocedur)o(es)f(implement)h(set)h(complement,) +i(union,)g(intersection,)g(and)888 4599 y(dif)o(fer)o(ence)23 +b(for)h(character)f(sets.)38 b(The)25 b(union,)h(intersection,)h(and)d +(dif)o(fer)o(ence)e(op-)888 4699 y(erations)h(ar)o(e)e(n-ary)-9 +b(,)21 b(associating)i(to)g(the)f(left;)h(the)f(dif)o(fer)o(ence)e +(function)j(r)o(equir)o(es)888 4799 y(at)29 b(least)f(one)h(ar)o +(gument,)h(while)g(union)g(and)e(intersection)i(may)e(be)h(applied)f +(to)888 4898 y(zer)o(o)20 b(ar)o(guments.)2051 5147 y(108)p +eop +%%Page: 109 117 +109 116 bop 365 614 a FA(\(char-set-adjoin)37 b FC(cs)21 +b(char)1338 626 y Fx(1)1375 614 y FC(.)12 b(.)g(.)g FA(\))87 +b Fw(\000)-14 b(!)87 b FC(char-set)764 b FD(pr)o(ocedur)o(e)365 +714 y FA(\(char-set-delete)37 b FC(cs)21 b(char)1338 +726 y Fx(1)1375 714 y FC(.)12 b(.)g(.)g FA(\))87 b Fw(\000)-14 +b(!)87 b FC(char-set)764 b FD(pr)o(ocedur)o(e)573 862 +y(Add/delete)19 b(the)i FC(char)1312 874 y Fp(i)1360 +862 y FD(characters)e(to/fr)o(om)i(character)f(set)g +FC(cs)q FD(.)365 1162 y FB(5.3.4)81 b(Standard)19 b(character)g(sets) +365 1360 y FD(Several)h(character)f(sets)i(ar)o(e)e(pr)o(ede\002ned)g +(for)i(convenience:)p 591 1525 2414 4 v 591 1624 4 100 +v 644 1594 a FA(char-set:lower-c)o(as)o(e)181 b FD(Lower)o(-case)19 +b(alphabetic)h(chars)p 3001 1624 V 591 1724 V 644 1694 +a FA(char-set:upper-c)o(as)o(e)181 b FD(Upper)o(-case)18 +b(alphabetic)i(chars)p 3001 1724 V 591 1823 V 644 1794 +a FA(char-set:alphabe)o(ti)o(c)181 b FD(Alphabetic)20 +b(chars)p 3001 1823 V 591 1923 V 644 1893 a FA(char-set:numeric)311 +b FD(Decimal)21 b(digits:)26 b(0\2269)p 3001 1923 V 591 +2023 V 644 1993 a FA(char-set:alphanu)o(me)o(ric)93 b +FD(Alphabetic)20 b(or)h(numeric)p 3001 2023 V 591 2122 +V 644 2092 a FA(char-set:graphic)311 b FD(Printing)22 +b(characters)d(except)h(space)p 3001 2122 V 591 2222 +V 644 2192 a FA(char-set:printin)o(g)268 b FD(Printing)22 +b(characters)d(including)j(space)p 3001 2222 V 591 2322 +V 644 2292 a FA(char-set:whitesp)o(ac)o(e)181 b FD(Whitespace)20 +b(characters)p 3001 2322 V 591 2421 V 644 2391 a FA(char-set:control) +311 b FD(Contr)o(ol)21 b(characters)p 3001 2421 V 591 +2521 V 644 2491 a FA(char-set:punctua)o(ti)o(on)137 b +FD(Punctuation)21 b(characters)p 3001 2521 V 591 2621 +V 644 2591 a FA(char-set:hex-dig)o(it)224 b FD(A)20 b(hexadecimal)g +(digit:)26 b(0\2269,)19 b(A\226F)-8 b(,)20 b(a\226f)p +3001 2621 V 591 2720 V 644 2690 a FA(char-set:blank)399 +b FD(Blank)20 b(characters)p 3001 2720 V 591 2820 V 644 +2790 a FA(char-set:ascii)399 b FD(A)20 b(character)f(in)j(the)f(ASCII)e +(set.)p 3001 2820 V 591 2919 V 644 2889 a FA(char-set:empty)399 +b FD(Empty)21 b(set)p 3001 2919 V 591 3019 V 644 2989 +a FA(char-set:full)443 b FD(All)20 b(characters)p 3001 +3019 V 591 3022 2414 4 v 365 3221 a(The)27 b(\002rst)g(eleven)f(of)h +(these)f(corr)o(espond)h(to)g(the)f(character)f(classes)i(de\002ned)f +(in)h(Posix.)365 3321 y(Note)32 b(that)g(ther)o(e)f(may)g(be)g +(characters)g(in)h FA(char-set:alphabe)o(ti)o(c)26 b +FD(that)31 b(ar)o(e)f(neither)365 3420 y(upper)20 b(or)g(lower)g +(case\227this)g(might)h(occur)e(in)i(implementations)g(that)f(use)g(a)f +(character)365 3520 y(type)31 b(richer)f(than)h(ASCII,)e(such)i(as)g +(Unicode.)55 b(A)30 b(\223graphic)g(character)6 b(\224)29 +b(is)i(one)g(that)365 3620 y(would)d(put)g(ink)g(on)g(your)f(page.)45 +b(While)28 b(the)f(exact)g(composition)i(of)e(these)h(sets)g(may)365 +3719 y(vary)19 b(depending)g(upon)h(the)f(character)f(type)h(pr)o +(ovided)f(by)i(the)f(Scheme)g(system)h(upon)365 3819 +y(which)i(scsh)g(is)f(r)o(unning,)h(her)o(e)e(ar)o(e)g(the)h +(de\002nitions)h(for)f(some)g(of)g(the)g(sets)g(in)h(an)f(ASCII)365 +3919 y(character)f(set:)p 365 4139 2922 4 v 365 4239 +4 100 v 418 4209 a(char)o(-set:alphabetic)167 b(A\226Z)20 +b(and)h(a\226z)p 3284 4239 V 365 4339 V 418 4309 a(char)o(-set:lower)o +(-case)155 b(a\226z)p 3284 4339 V 365 4438 V 418 4408 +a(char)o(-set:upper)o(-case)143 b(A\226Z)p 3284 4438 +V 365 4538 V 418 4508 a(char)o(-set:graphic)267 b(Alphanumeric)21 +b(+)g(punctuation)p 3284 4538 V 365 4638 V 418 4608 a(char)o +(-set:whitespace)135 b(Space,)19 b(newline,)i(tab,)f(page,)g(vertical)g +(tab,)g(carriage)g(r)o(eturn)p 3284 4638 V 365 4737 V +418 4707 a(char)o(-set:blank)341 b(Space)20 b(and)g(tab)p +3284 4737 V 365 4837 V 418 4807 a(char)o(-set:contr)o(ol)289 +b(ASCII)20 b(0\22631)f(and)h(127)p 3284 4837 V 365 4936 +V 418 4907 a(char)o(-set:punctuation)99 b FA(!"#$\045&'\(\)*+,-./:;)o +(<=)o(>?)o(@[\\)o(]^)o(_`{)o(|})o(~)p 3284 4936 V 365 +4940 2922 4 v 1735 5147 a FD(109)p eop +%%Page: 110 118 +110 117 bop 681 614 a FA(\(char-alphabetic)o(?)37 b FC(character)p FA(\))86 b Fw(\000)-14 b(!)87 b FC(boolean)796 b FD(pr)o(ocedur)o(e)681 714 y FA(\(char-lower-case)o(?)37 b FC(character)p FA(\))86 b Fw(\000)-14 b(!)87 b FC(boolean)796 b FD(pr)o(ocedur)o(e)681 -814 y FA(\(char-numeric?)81 b FC(character)p FA(\))86 +814 y FA(\(char-upper-case)o(?)37 b FC(character)p FA(\))86 +b Fw(\000)-14 b(!)87 b FC(boolean)796 b FD(pr)o(ocedur)o(e)681 +913 y FA(\(char-numeric?)81 b FC(character)p FA(\))86 b Fw(\000)-14 b(!)87 b FC(boolean)883 b FD(pr)o(ocedur)o(e)681 -913 y FA(\(char-whitespace)o(?)37 b FC(character)p FA(\))86 -b Fw(\000)-14 b(!)87 b FC(boolean)796 b FD(pr)o(ocedur)o(e)681 -1013 y FA(\(char-alphabetic)o(?)37 b FC(character)p FA(\))86 -b Fw(\000)-14 b(!)87 b FC(boolean)796 b FD(pr)o(ocedur)o(e)681 -1112 y FA(\(char-alphanumer)o(ic)o(?)38 b FC(character)p +1013 y FA(\(char-alphanumer)o(ic)o(?)38 b FC(character)p FA(\))86 b Fw(\000)-15 b(!)88 b FC(boolean)708 b FD(pr)o(ocedur)o(e)681 -1212 y FA(\(char-graphic?)38 b FC(character)p FA(\))86 -b Fw(\000)-15 b(!)88 b FC(boolean)926 b FD(pr)o(ocedur)o(e)888 -1353 y(These)21 b(pr)o(edicates)e(ar)o(e)g(de\002ned)i(in)g(terms)g(of) -g(the)f(above)h(character)e(sets.)2053 5147 y(1)-5 b(10)p +1112 y FA(\(char-graphic?)38 b FC(character)p FA(\))86 +b Fw(\000)-15 b(!)88 b FC(boolean)926 b FD(pr)o(ocedur)o(e)681 +1212 y FA(\(char-printing?)37 b FC(character)p FA(\))86 +b Fw(\000)-14 b(!)87 b FC(boolean)883 b FD(pr)o(ocedur)o(e)681 +1312 y FA(\(char-whitespace)o(?)37 b FC(character)p FA(\))86 +b Fw(\000)-14 b(!)87 b FC(boolean)796 b FD(pr)o(ocedur)o(e)681 +1411 y FA(\(char-blank?)38 b FC(character)p FA(\))87 +b Fw(\000)-15 b(!)87 b FC(boolean)1014 b FD(pr)o(ocedur)o(e)681 +1511 y FA(\(char-control?)38 b FC(character)p FA(\))86 +b Fw(\000)-15 b(!)88 b FC(boolean)926 b FD(pr)o(ocedur)o(e)681 +1611 y FA(\(char-punctuatio)o(n?)37 b FC(character)p +FA(\))86 b Fw(\000)-14 b(!)87 b FC(boolean)752 b FD(pr)o(ocedur)o(e)681 +1710 y FA(\(char-hex-digit?)37 b FC(character)p FA(\))86 +b Fw(\000)-14 b(!)87 b FC(boolean)839 b FD(pr)o(ocedur)o(e)681 +1810 y FA(\(char-ascii?)38 b FC(character)p FA(\))87 +b Fw(\000)-15 b(!)87 b FC(boolean)1014 b FD(pr)o(ocedur)o(e)888 +1955 y(These)21 b(pr)o(edicates)e(ar)o(e)g(de\002ned)i(in)g(terms)g(of) +g(the)f(above)h(character)e(sets.)681 2242 y FB(5.3.5)81 +b(Linear)o(-update)16 b(character)o(-set)h(operations)681 +2433 y FD(These)46 b(pr)o(ocedur)o(es)e(have)h(a)h(hybrid)g(pur)o +(e-functional/side-ef)o(fecting)e(semantics:)681 2532 +y(they)22 b(ar)o(e)e(allowed,)h(but)h(not)g(r)o(equir)o(ed,)e(to)i +(side-ef)o(fect)d(one)j(of)g(their)g(parameters)e(in)i(or)o(-)681 +2632 y(der)g(to)g(constr)o(uct)i(their)e(r)o(esult.)31 +b(An)22 b(implementation)i(may)e(legally)h(implement)g(these)681 +2732 y(pr)o(ocedur)o(es)18 b(as)h(pur)o(e,)g(side-ef)o(fect-fr)o(ee)d +(functions,)21 b(or)e(it)i(may)e(implement)i(them)f(using)681 +2831 y(side)h(ef)o(fects,)f(depending)i(upon)g(the)f(details)h(of)f +(what)h(is)g(the)g(most)g(ef)o(\002cient)f(or)h(simple)681 +2931 y(to)f(implement)g(in)h(terms)f(of)f(the)h(underlying)h(r)o(epr)o +(esentation.)805 3062 y(What)f(this)h(means)g(is)f(that)h(clients)f(of) +h(these)f(pr)o(ocedur)o(es)e FC(may)i(not)f FD(r)o(ely)h(upon)h(these) +681 3162 y(pr)o(ocedur)o(es)14 b(working)k(by)f(side)f(ef)o(fect.)22 +b(For)17 b(example,)f(this)i(is)f(not)g(guaranteed)e(to)i(work:)681 +3363 y FA(\(let)42 b(\(\(cs)g(\(char-set)e(#\\a)i(#\\b)g(#\\c\)\)\))768 +3463 y(\(char-set-adjoin)o(!)c(cs)k(#\\d\))768 3562 y(cs\))g(;)h(Could) +f(be)h(either)e({a,b,c})g(or)h({a,b,c,d}.)681 3764 y +FD(However)-6 b(,)20 b(this)i(is)f(well-de\002ned:)681 +3966 y FA(\(let)42 b(\(\(cs)g(\(char-set)e(#\\a)i(#\\b)g(#\\c\)\)\))768 +4065 y(\(char-set-adjoin)o(!)c(cs)k(#\\d\)\))g(;)h({a,b,c,d})681 +4267 y FD(So)19 b(clients)i(of)e(these)h(pr)o(ocedur)o(es)e(write)i(in) +g(a)f(functional)h(style,)g(but)g(must)g(additionally)681 +4366 y(be)26 b(sur)o(e)f(that,)i(when)g(the)f(pr)o(ocedur)o(e)f(is)h +(called,)h(ther)o(e)e(ar)o(e)g(no)h(other)h(live)f(pointers)h(to)681 +4466 y(the)21 b(potentially-modi\002ed)g(character)e(set)i(\(hence)f +(the)h(term)g(\223linear)f(update\224\).)805 4597 y(Ther)o(e)g(ar)o(e)f +(two)j(bene\002ts)f(to)g(this)g(convention:)805 4799 +y Fw(\017)41 b FD(Implementations)34 b(ar)o(e)d(fr)o(ee)g(to)i(pr)o +(ovide)f(the)h(most)g(ef)o(\002cient)f(possible)h(imple-)888 +4898 y(mentation,)22 b(either)e(functional)h(or)g(side-ef)o(fecting.) +2053 5147 y(1)-5 b(10)p eop +%%Page: 111 119 +111 118 bop 490 614 a Fw(\017)41 b FD(Pr)o(ogrammers)18 +b(may)g(nonetheless)h(continue)h(to)e(assume)h(that)f(character)e(sets) +j(ar)o(e)573 714 y(pur)o(ely)28 b(functional)h(data)f(str)o(uctur)o +(es:)41 b(they)29 b(may)g(be)g(r)o(eliably)f(shar)o(ed)f(without)573 +814 y(needing)21 b(to)g(be)f(copied,)h(uniqui\002ed,)g(and)f(so)i +(forth.)490 1005 y(In)34 b(practice,)i(these)d(pr)o(ocedur)o(es)f(ar)o +(e)h(most)h(useful)g(for)g(ef)o(\002ciently)f(constr)o(ucting)365 +1104 y(character)23 b(sets)h(in)g(a)g(side-ef)o(fecting)e(manner)-6 +b(,)24 b(in)h(some)f(limited)g(local)g(context,)h(befor)o(e)365 +1204 y(passing)j(the)g(character)e(set)i(outside)f(the)h(local)g +(constr)o(uction)h(scope)f(to)f(be)h(used)f(in)h(a)365 +1303 y(functional)21 b(manner)-6 b(.)490 1428 y(Scsh)19 +b(pr)o(ovides)f(no)i(assistance)e(in)i(checking)f(the)g(linearity)g(of) +g(the)h(potentially)f(side-)365 1528 y(ef)o(fected)g(parameters)g +(passed)i(to)g(these)g(functions)h(\227)f(ther)o(e's)f(no)i(linear)e +(type)h(checker)365 1627 y(or)g(r)o(un-time)g(mechanism)h(for)e +(detecting)h(violations.)365 1777 y FA(\(char-set-copy)38 +b FC(cs)p FA(\))87 b Fw(\000)-14 b(!)87 b FC(char-set)1153 +b FD(pr)o(ocedur)o(e)573 1918 y(Returns)29 b(a)f(copy)h(of)f(the)g +(character)f(set)i FC(cs)p FD(.)48 b(\223Copy\224)28 +b(means)h(that)f(if)g(either)g(the)573 2017 y(input)c(parameter)d(or)j +(the)f(r)o(esult)g(value)g(of)g(this)h(pr)o(ocedur)o(e)d(is)j(passed)e +(to)i(one)g(of)573 2117 y(the)i(linear)o(-update)e(pr)o(ocedur)o(es)g +(described)h(below)-8 b(,)28 b(the)e(other)g(character)e(set)i(is)573 +2217 y(guaranteed)j(not)i(to)g(be)f(alter)o(ed.)52 b(\(A)30 +b(system)h(that)f(pr)o(ovides)f(pur)o(e-functional)573 +2316 y(implementations)22 b(of)g(the)f(r)o(est)g(of)g(the)g(linear)o +(-operator)f(suite)h(could)h(implement)573 2416 y(this)f(pr)o(ocedur)o +(e)e(as)i(the)f(identity)i(function.\))365 2607 y FA +(\(char-set-adjoin!)37 b FC(cs)21 b(char)1381 2619 y +Fx(1)1418 2607 y FC(.)12 b(.)g(.)g FA(\))88 b Fw(\000)-14 +b(!)87 b FC(char-set)720 b FD(pr)o(ocedur)o(e)573 2748 +y(Add)27 b(the)h FC(char)1055 2760 y Fp(i)1111 2748 y +FD(characters)f(to)h(character)f(set)h FC(cs)p FD(,)i(and)e(r)o(eturn)f +(the)i(r)o(esult.)47 b(This)573 2848 y(pr)o(ocedur)o(e)19 +b(is)i(allowed,)f(but)h(not)g(r)o(equir)o(ed,)e(to)j(side-ef)o(fect)c +FC(cs)p FD(.)365 3039 y FA(\(char-set-delete!)37 b FC(cs)21 +b(char)1381 3051 y Fx(1)1418 3039 y FC(.)12 b(.)g(.)g +FA(\))88 b Fw(\000)-14 b(!)87 b FC(char-set)720 b FD(pr)o(ocedur)o(e) +573 3180 y(Remove)19 b(the)f FC(char)1169 3192 y Fp(i)1215 +3180 y FD(characters)f(to)i(character)d(set)j FC(cs)p +FD(,)f(and)g(r)o(eturn)f(the)i(r)o(esult.)24 b(This)573 +3279 y(pr)o(ocedur)o(e)19 b(is)i(allowed,)f(but)h(not)g(r)o(equir)o +(ed,)e(to)j(side-ef)o(fect)c FC(cs)p FD(.)365 3470 y +FA(\(char-set-invert!)37 b FC(char-set)p FA(\))86 b Fw(\000)-14 +b(!)87 b FC(char-set)824 b FD(pr)o(ocedur)o(e)365 3570 +y FA(\(char-set-union!)37 b FC(char-set)1371 3582 y Fx(1)1429 +3570 y FC(char-set)1693 3582 y Fx(2)1730 3570 y FC(.)12 +b(.)g(.)g FA(\))88 b Fw(\000)-15 b(!)87 b FC(char-set)409 +b FD(pr)o(ocedur)o(e)365 3670 y FA(\(char-set-interse)o(ct)o(ion)o(!)37 +b FC(char-set)1676 3682 y Fx(1)1734 3670 y FC(char-set)1998 +3682 y Fx(2)2035 3670 y FC(.)12 b(.)g(.)g FA(\))88 b +Fw(\000)-15 b(!)88 b FC(char-set)103 b FD(pr)o(ocedur)o(e)365 +3769 y FA(\(char-set-differe)o(nc)o(e!)37 b FC(char-set)1589 +3781 y Fx(1)1647 3769 y FC(char-set)1911 3781 y Fx(2)1948 +3769 y FC(.)12 b(.)g(.)g FA(\))87 b Fw(\000)-14 b(!)87 +b FC(char-set)191 b FD(pr)o(ocedur)o(e)573 3910 y(These)31 +b(pr)o(ocedur)o(es)e(implement)j(set)f(complement,)j(union,)h +(intersection,)f(and)573 4010 y(dif)o(fer)o(ence)19 b(for)j(character)e +(sets.)30 b(They)22 b(ar)o(e)e(allowed,)i(but)g(not)h(r)o(equir)o(ed,)e +(to)h(side-)573 4110 y(ef)o(fect)g(their)h(\002rst)h(parameter)-6 +b(.)33 b(The)23 b(union,)j(intersection,)e(and)g(dif)o(fer)o(ence)d +(oper)o(-)573 4209 y(ations)g(ar)o(e)f(n-ary)-9 b(,)19 +b(associating)i(to)h(the)f(left.)1740 5147 y(1)-5 b(1)g(1)p eop -%%Page: 111 117 -111 116 bop 365 1272 a Fz(Chapter)45 b(6)365 1723 y FE(Reading)53 -b(delimited)e(strings)365 2214 y FD(Scsh)21 b(pr)o(ovides)g(a)f(set)h -(of)g(pr)o(ocedur)o(es)e(that)i(r)o(ead)f(delimited)g(strings)i(fr)o -(om)f(input)h(ports.)365 2314 y(Ther)o(e)17 b(ar)o(e)f(pr)o(ocedur)o -(es)g(to)i(r)o(ead)d(a)i(single)i(line)f(of)f(text)g(\(terminated)g(by) -h(a)f(newline)h(char)o(-)365 2414 y(acter\),)24 b(a)g(single)h -(paragraph)e(\(terminated)h(by)g(a)g(blank)h(line\),)g(and)f(general)g -(delimited)365 2513 y(strings)e(\(terminated)e(by)h(a)f(character)f -(belonging)j(to)f(an)g(arbitrary)e(character)h(set\).)490 -2648 y(These)k(pr)o(ocedur)o(es)f(can)i(be)f(applied)g(to)h(any)g -(Scheme)f(input)h(port.)37 b(However)-6 b(,)25 b(the)365 -2748 y(scsh)h(virtual)f(machine)h(has)f(native-code)g(support)g(for)g -(performing)h(delimited)f(r)o(eads)365 2848 y(on)i(Unix)g(ports,)h(and) -e(these)h(input)g(operations)f(should)i(be)e(particularly)g -(fast\227much)365 2947 y(faster)33 b(than)h(doing)h(the)f(equivalent)g -(character)o(-at-a-time)c(operation)k(fr)o(om)f(Scheme)365 -3047 y(code.)490 3182 y(All)19 b(of)h(the)g(delimited)f(input)i -(operations)f(described)e(below)i(take)f(a)h FA(handle-delim)365 -3281 y FD(parameter)-6 b(,)30 b(which)h(determines)e(what)h(the)g(pr)o -(ocedur)o(e)e(does)i(with)g(the)g(terminating)365 3381 -y(delimiter)19 b(character)-6 b(.)23 b(Ther)o(e)18 b(ar)o(e)g(four)g -(possible)i(choices)f(for)g(a)f FA(handle-delim)c FD(param-)365 -3481 y(eter:)p 573 3550 2428 4 v 573 3649 4 100 v 626 -3619 a FA(handle-delim)p 1199 3649 V 98 w FD(Meaning)p -2997 3649 V 573 3653 2428 4 v 573 3669 V 573 3769 4 100 -v 626 3739 a FA('trim)p 1199 3769 V 406 w FD(Ignor)o(e)21 -b(delimiter)f(character)-6 b(.)p 2997 3769 V 573 3868 -V 626 3838 a FA('peek)p 1199 3868 V 406 w FD(Leave)19 -b(delimiter)i(character)e(in)j(input)f(str)o(eam.)p 2997 -3868 V 573 3968 V 626 3938 a FA('concat)p 1199 3968 V +%%Page: 112 120 +112 119 bop 681 1270 a Fz(Chapter)44 b(6)681 1718 y FE +(Pattern-matching)52 b(strings)f(with)681 1967 y(regular)i(expressions) +681 2455 y FD(Scsh)16 b(pr)o(ovides)g(a)f(rich)i(facility)f(for)g +(matching)h(r)o(egular)o(-expr)o(ession)d(patterns)i(in)g(strings.)681 +2555 y(The)21 b(system)g(is)g(composed)g(of)g(several)f(pieces:)805 +2759 y Fw(\017)41 b FD(An)29 b(s-expr)o(ession)g(notation)h(for)f +(writing)h(down)g(general)f(r)o(egular)f(expr)o(ession-)888 +2859 y(s.)46 b(In)28 b(most)h(systems,)h(r)o(egexp)c(patterns)h(ar)o(e) +f(encoded)h(as)h(string)g(literals,)h(such)888 2958 y(as)d +FA("g\(oo|ee\)se")p FD(.)37 b(In)26 b(scsh,)i(they)e(ar)o(e)f(written)i +(using)g(s-expr)o(essions,)g(such)f(as)888 3058 y FA(\(:)43 +b("g")f(\(|)h("oo")f("ee"\))g("se"\))p FD(,)20 b(and)i(ar)o(e)f(called) +h FC(sr)o(e')-5 b(s)p FD(.)31 b(The)23 b(sr)o(e)e(notation)j(has)888 +3157 y(several)i(advantages)f(over)h(the)g(traditional)g(string-based)g +(notation.)43 b(It's)26 b(mor)o(e)888 3257 y(expr)o(essive,)c(can)h(be) +f(commented,)i(and)e(can)h(be)f(indented)h(to)g(expose)g(the)g(str)o +(uc-)888 3357 y(tur)o(e)d(of)h(the)g(form.)805 3533 y +Fw(\017)41 b FD(An)16 b(abstract)f(data)g(type)g(\(ADT\))g(r)o(epr)o +(esentation)g(for)h(r)o(egexp)e(values.)24 b(T)-7 b(raditional)888 +3633 y(r)o(egular)o(-expr)o(ession)26 b(systems)i(compute)g(r)o(egular) +f(expr)o(essions)g(fr)o(om)h(r)o(un-time)888 3733 y(values)j(using)h +(strings.)57 b(This)32 b(can)f(be)f(awkwar)o(d.)56 b(Scsh,)33 +b(instead,)g(pr)o(ovides)e(a)888 3832 y(separate)f(data)h(type)g(for)h +(r)o(egexps,)h(with)f(a)f(set)h(of)f(basic)g(constr)o(uctor)i(and)e +(ac-)888 3932 y(cessor)24 b(functions;)i(r)o(egular)d(expr)o(essions)h +(can)f(be)h(dynamically)g(computed)f(and)888 4031 y(manipulated)e +(using)g(these)g(functions.)805 4208 y Fw(\017)41 b FD(Some)17 +b(tools)g(that)f(work)h(on)g(the)f(r)o(egexp)f(ADT)-5 +b(:)16 b(case-sensitve)f(to)i(case-insensitive)888 4308 +y(r)o(egexp)j(transform,)g(a)h(r)o(egexp)e(simpli\002er)-6 +b(,)21 b(and)f(so)i(forth.)805 4484 y Fw(\017)41 b FD(Parsers)20 +b(and)h(unparsers)f(that)h(can)f(convert)h(between)f(external)g(r)o +(epr)o(esentations)888 4584 y(and)h(the)g(r)o(egexp)e(ADT)-6 +b(.)20 b(The)h(supported)f(external)g(r)o(epr)o(esentations)g(ar)o(e) +988 4760 y FB(\226)41 b FD(Posix)21 b(strings)988 4898 +y FB(\226)41 b FD(S-expr)o(ession)20 b(notation)i(\(that)e(is,)h(sr)o +(e's\))2053 5147 y(1)-5 b(12)p eop +%%Page: 113 121 +113 120 bop 573 614 a FD(Being)21 b(able)f(to)i(convert)f(r)o(egexps)e +(to)j(Posix)f(strings)h(allows)g(implementations)g(to)573 +714 y(implement)f(r)o(egexp)f(matching)h(using)h(standar)o(d)d(Posix)i +(C-based)f(engines.)490 951 y Fw(\017)41 b FD(Macr)o(o)27 +b(support)i(for)g(the)g(s-expr)o(ession)g(notation.)51 +b(The)29 b FA(rx)f FD(macr)o(o)g(pr)o(ovides)g(a)573 +1050 y(new)f(special)f(form)h(that)g(allows)g(you)h(to)f(embed)f(r)o +(egexps)g(in)h(the)g(s-expr)o(ession)573 1150 y(notation)21 +b(within)f(a)f(Scheme)h(pr)o(ogram.)k(Evaluating)19 b(the)h(macr)o(o)f +(form)g(pr)o(oduces)573 1250 y(a)f(r)o(egexp)f(ADT)h(value)f(which)i +(can)f(be)g(used)g(by)h(Scheme)e(pattern-matching)h(pr)o(o-)573 +1349 y(cedur)o(es)h(and)i(other)g(r)o(egexp)e(consumers.)490 +1586 y Fw(\017)41 b FD(Pattern-matching)23 b(and)g(sear)o(ching)h(pr)o +(ocedur)o(es.)31 b(Spencer)6 b('s)23 b(Posix)i(r)o(egexp)d(en-)573 +1686 y(gine)h(is)h(linked)f(in)h(to)f(the)g(r)o(untime;)i(the)f(r)o +(egexp)d(code)i(uses)g(this)h(engine)g(to)f(pr)o(o-)573 +1785 y(vide)d(text)h(matching.)490 2065 y(The)g(r)o(egexp)f(language)h +(supported)h(is)f(a)g(complete)h(superset)f(of)g(Posix)h(functional-) +365 2164 y(ity)-9 b(,)21 b(pr)o(oviding:)490 2444 y Fw(\017)41 +b FD(sequencing)22 b(and)e(choice)h(\()p FA(|)p FD(\))490 +2681 y Fw(\017)41 b FD(r)o(epetition)20 b(\()p FA(*)p +FD(,)g FA(+)p FD(,)g FA(?)p FD(,)g Fw(f)p Fo(m)p FA(,)p +Fo(n)p Fw(g)p FD(\))490 2917 y Fw(\017)41 b FD(character)19 +b(classes)i(\()p FC(e.g.)o FD(,)f FA([aeiou])p FD(\))e(and)i(wildcar)o +(d)f(\()p FA(.)p FD(\))490 3154 y Fw(\017)41 b FD(beginning/end)22 +b(of)f(string)g(anchors)g(\()p FA(^)p FD(,)f FA($)p FD(\))490 +3391 y Fw(\017)41 b FD(beginning/end)22 b(of)f(line)g(anchors)490 +3628 y Fw(\017)41 b FD(beginning/end)22 b(of)f(wor)o(d)f(anchors)490 +3865 y Fw(\017)41 b FD(case-sensitivity)21 b(contr)o(ol)490 +4101 y Fw(\017)41 b FD(submatch-marking)365 4515 y Fy(6.1)99 +b(Summary)24 b(SRE)h(syntax)365 4799 y FD(The)f(following)i(\002gur)o +(es)d(give)h(a)g(summary)g(of)g(the)g(SRE)g(syntax;)h(the)f(next)g +(section)h(is)f(a)365 4898 y(friendlier)c(tutorial)h(intr)o(oduction.) +1737 5147 y(1)-5 b(13)p eop +%%Page: 114 122 +114 121 bop 681 654 2865 4 v 681 4775 4 4121 v 759 783 +a FC(string)758 b FD(Literal)21 b(match\227interpr)o(eted)g(r)o +(elative)f(to)j(the)f(curr)o(en-)1720 882 y(t)31 b(case-sensitivity)f +(lexical)h(context)f(\(default)g(is)h(case-)1720 982 +y(sensitive\))759 1181 y FA(\()p FC(string1)42 b(string2)i +FA(...\))165 b FD(Set)49 b(of)h(chars,)56 b FC(e.g.)o +FD(,)h FA(\("abc")41 b("XYZ"\))p FD(.)110 b(Interpr)o(et-)1720 +1281 y(ed)31 b(r)o(elative)f(to)i(the)f(curr)o(ent)g(case-sensitivity)g +(lexical)1720 1380 y(context.)759 1580 y FA(\(*)43 b +FC(sr)o(e)h FA(...\))515 b FD(0)20 b(or)h(mor)o(e)f(matches)759 +1679 y FA(\(+)43 b FC(sr)o(e)h FA(...\))515 b FD(1)20 +b(or)h(mor)o(e)f(matches)759 1779 y FA(\(?)43 b FC(sr)o(e)h +FA(...\))515 b FD(0)20 b(or)h(1)f(matches)759 1878 y +FA(\(=)43 b FC(n)g(sr)o(e)h FA(...\))426 b FC(n)21 b +FD(matches)759 1978 y FA(\(>=)42 b FC(n)i(sr)o(e)g FA(...\))382 +b FC(n)21 b FD(or)g(mor)o(e)f(matches)759 2078 y FA(\(**)42 +b FC(n)i(m)f(sr)o(e)h FA(...\))274 b FC(n)21 b FD(to)g +FC(m)f FD(matches)975 2177 y FC(N)g FD(and)g FC(m)h FD(ar)o(e)e(Scheme) +h(expr)o(essions)h(pr)o(oducing)g(non-negative)g(integers.)975 +2277 y FC(M)g FD(may)g(also)f(be)h FA(#f)p FD(,)f(meaning)h +(\223in\002nity)-9 b(.\224)759 2476 y FA(\(|)43 b FC(sr)o(e)h +FA(...\))515 b FD(Choice)21 b(\()p FA(or)e FD(is)j(R5RS)e(symbol;)759 +2576 y FA(\(or)42 b FC(sr)o(e)i FA(...\))472 b(|)20 b +FD(is)h(not)h(speci\002ed)e(by)h(R5RS.\))759 2775 y FA(\(:)43 +b FC(sr)o(e)h FA(...\))515 b FD(Sequence)20 b(\()p FA(seq)f +FD(is)i(legal)759 2875 y FA(\(seq)42 b FC(sr)o(e)i FA(...\))428 +b FD(Common)22 b(Lisp)f(symbol\))759 3074 y FA(\(submatch)40 +b FC(sr)o(e)k FA(...\))210 b FD(Number)o(ed)19 b(submatch)759 +3273 y FA(\(dsm)42 b FC(pr)o(e)h(post)g(sr)o(e)h FA(...\))98 +b FD(Deleted)20 b(submatches)975 3373 y FC(Pr)o(e)g FD(and)h +FC(post)f FD(ar)o(e)f(numerals.)759 3573 y FA(\(uncase)41 +b FC(sr)o(e)i FA(...\))298 b FD(Case-folded)19 b(match)759 +3673 y FA(\(w/case)41 b FC(sr)o(e)i FA(...\))298 b FD(Intr)o(oduce)20 +b(a)g(lexical)g(case-sensitivity)759 3772 y FA(\(w/nocase)40 +b FC(sr)o(e)k FA(...\))210 b FD(context.)759 3971 y FA(,@)p +FC(exp)757 b FD(Dynamically)21 b(computed)g(r)o(egexp)759 +4071 y FA(,)p FC(exp)801 b FD(Same)20 b(as)g(,@)p FC(exp)o +FD(,)h(but)g(no)g(submatch)g(info)975 4171 y FC(Exp)e +FD(must)j(pr)o(oduce)d(a)i(character)-6 b(,)18 b(string,)k(char)o +(-set,)d(or)i(r)o(egexp.)759 4371 y FA(bos)42 b(eos)655 +b FD(Beginning/end)22 b(of)e(string)759 4470 y FA(bol)42 +b(eol)655 b FD(Beginning/end)22 b(of)e(line)759 4570 +y FA(bow)42 b(eow)655 b FD(Beginning/end)22 b(of)e(wor)o(d)1371 +4752 y(Figur)o(e)h(6.1:)j(SRE)d(syntax)f(summary)i(\(part)d(1\))p +3542 4775 V 681 4778 2865 4 v 2053 5147 a(1)-5 b(14)p +eop +%%Page: 115 123 +115 122 bop 365 625 2865 4 v 365 2652 4 2027 v 443 753 +a FA(\(word)42 b FC(sr)o(e)i FA(...\))380 b FD(\(:)25 +b(bow)c FC(sr)o(e)g FD(.)12 b(.)g(.)39 b(eow\))443 853 +y FA(\(word+)i FC(cset-sr)o(e)j FA(...\))183 b(\(word)41 +b(\(+)i(\(&)g(\(|)g(alphanumeric)38 b("_"\))1923 952 +y(\(|)43 b FC(cset-sr)o(e)g FA(...\)\)\)\))443 1052 y(word)781 +b(\(word+)41 b(any\))443 1251 y(\(posix-string)e FC(string)p +FA(\))99 b FD(Escape)19 b(for)i(Posix)g(string)h(notation)443 +1450 y FC(char)812 b FD(Singleton)21 b(char)g(set)443 +1550 y FC(class-name)591 b FD(alphanumeric,)20 b(whitespace,)g +FC(etc.)659 1650 y FD(These)d(two)g(forms)f(ar)o(e)g(interpr)o(eted)f +(subject)h(to)h(the)g(lexical)f(case-sensitivity)659 +1749 y(context.)443 1949 y FA(\(~)43 b FC(cset-sr)o(e)h +FA(...\))357 b FD(Complement-of-union)22 b(\()p FA([^...])p +FD(\))443 2048 y FA(\(-)43 b FC(cset-sr)o(e)h FA(...\))357 +b FD(Dif)o(fer)o(ence)443 2148 y FA(\(&)43 b FC(cset-sr)o(e)h +FA(...\))357 b FD(Intersection)443 2347 y FA(\(/)43 b +FC(range-spec)g FA(...\))250 b FD(Character)26 b(range\227interpr)o +(eted)g(subject)h(to)h(the)g(lexi-)1400 2447 y(cal)20 +b(case-sensitivy)h(context)1056 2628 y(Figur)o(e)f(6.2:)25 +b(SRE)20 b(syntax)h(summary)g(\(part)f(2\))p 3226 2652 +V 365 2655 2865 4 v 365 2905 V 365 4805 4 1900 v 443 +3033 a FC(class-name)87 b FA(::=)49 b(any)946 3133 y(|)87 +b(nonl)946 3233 y(|)g(lower-case)183 b(|)43 b(lower)946 +3332 y(|)87 b(upper-case)183 b(|)43 b(upper)946 3432 +y(|)87 b(alphabetic)183 b(|)43 b(alpha)946 3532 y(|)87 +b(numeric)315 b(|)43 b(digit)e(|)i(num)946 3631 y(|)87 +b(alphanumeric)95 b(|)43 b(alnum)946 3731 y(|)87 b(punctuation)139 +b(|)43 b(punct)946 3830 y(|)87 b(graphic)315 b(|)43 b(graph)946 +3930 y(|)87 b(whitespace)183 b(|)43 b(space)e(|)i(white)946 +4030 y(|)87 b(printing)271 b(|)43 b(print)946 4129 y(|)87 +b(control)315 b(|)43 b(cntrl)946 4229 y(|)87 b(hex-digit)227 +b(|)43 b(xdigit)e(|)i(hex)946 4329 y(|)87 b(ascii)394 +4499 y FC(range-spec)43 b FA(::=)f FC(string)i FA(|)f +FC(char)394 4599 y FD(The)20 b(chars)h(ar)o(e)e(taken)i(in)g(pairs)f +(to)h(form)g(inclusive)g(ranges.)796 4781 y(Figur)o(e)f(6.3:)k(SRE)d +(character)o(-class)d(names)j(and)f(range)h(specs.)p +3226 4805 V 365 4808 2865 4 v 1737 5147 a(1)-5 b(15)p +eop +%%Page: 116 124 +116 123 bop 681 1566 2865 4 v 681 3864 4 2299 v 709 1682 +a FA()39 b(::=)k(\(~)g()c(...\))173 +b(Set)42 b(complement-of-un)o(ion)1276 1781 y(|)h(\(-)g()c +(...\))173 b(Set)42 b(difference)1276 1881 y(|)h(\(&)g()c +(...\))173 b(Intersection)1276 1981 y(|)43 b(\(|)g()c(...\)) +173 b(Set)42 b(union)1276 2080 y(|)h(\(/)g()38 +b(...\))86 b(Range)1276 2280 y(|)43 b(\(\))519 +b(Constant)40 b(set)1276 2379 y(|)j()695 b(Singleton)40 +b(constant)g(set)1276 2479 y(|)j()607 b(For)42 +b(1-char)f(string)g("c")1276 2678 y(|)i()431 +b(Constant)40 b(set)1276 2877 y(|)j(,)695 b()41 +b(evals)h(to)g(a)i(char-set,)1276 2977 y(|)f(,@)651 +b(char,)41 b(single-char)e(string,)2322 3077 y(or)j(re-char-set)d +(regexp.)1276 3276 y(|)k(\(uncase)d(\))127 +b(Case-folding)1276 3376 y(|)43 b(\(w/case)d(\))1276 +3475 y(|)j(\(w/nocase)d(\))709 3741 y FD(Figur)o(e)24 +b(6.4:)31 b(applied)24 b(to)g(SRE's)h(that)f(specify)g(character)f +(sets.)36 b(These)24 b(ar)o(e)f(the)i(\223type-)709 3840 +y(checking\224)c(r)o(ules)g(for)f(character)o(-set)f(SRE's.)p +3542 3864 V 681 3867 2865 4 v 2053 5147 a(1)-5 b(16)p +eop +%%Page: 117 125 +117 124 bop 365 614 a Fy(6.2)99 b(Examples)365 810 y +FA(\(-)43 b(alpha)f(\("aeiouAEIOU"\)\))691 b(;)43 b(Various)e(forms)g +(of)365 910 y(\(-)i(alpha)f(\("aeiou"\))d(\("AEIOU"\)\))476 +b(;)43 b(non-vowel)d(letter)365 1010 y(\(w/nocase)g(\(-)j(alpha)e +(\("aeiou"\)\)\))365 1109 y(\(-)i(\(/"azAZ"\))d(\("aeiouAEIOU"\)\))365 +1209 y(\(w/nocase)g(\(-)j(\(/"az"\))e(\("aeiou"\)\)\))365 +1408 y(;;;)i(Upper-case)c(letter,)i(lower-case)e(vowel,)i(or)i(digit) +365 1508 y(\(|)g(upper)f(\("aeiou"\))d(digit\))365 1607 +y(\(|)k(\(/"AZ09"\))d(\("aeiou"\)\))365 1807 y(;;;)j(Not)f(an)h(SRE,)f +(but)g(Scheme)f(code)h(containing)e(some)h(embedded)g(SREs.)365 +1906 y(\(let*)h(\(\(ws)g(\(rx)g(\(+)h(whitespace\)\)\))735 +b(;)44 b(Seq)e(of)h(whitespace)670 2006 y(\(date)f(\(rx)g(\(:)h(\(|)g +("Jan")e("Feb")h("Mar")f(...\))129 b(;)44 b(A)f(month/day)d(date.)1237 +2106 y(,ws)1237 2205 y(\(|)j(\("123456789"\))517 b(;)44 +b(1-9)1368 2305 y(\(:)f(\("12"\))e(digit\))389 b(;)44 +b(10-29)1368 2404 y("30")e("31"\)\)\)\)\))475 b(;)44 +b(30-31)452 2604 y(;;)f(Now)g(we)f(can)h(use)f(DATE)g(several)f(times:) +452 2703 y(\(rx)i(...)f(,date)g(...)g(\(*)h(...)f(,date)g(...\))627 +2803 y(...)g(....)g(,date\)\))365 3002 y(;;;)h(More)f(Scheme)f(code)365 +3102 y(\(define)g(\(csl)h(re\))696 b(;)43 b(A)g(comma-separated)38 +b(list)k(of)g(RE's)g(is)452 3201 y(\(rx)h(\(|)g("")914 +b(;)43 b(either)e(zero)h(of)h(them)f(\(empty)f(string\),)f(or)758 +3301 y(\(:)i(,re)740 b(;)43 b(one)g(RE,)f(followed)e(by)888 +3401 y(\(*)j(",)g(")g(,re\)\)\)\)\))171 b(;)43 b(Zero)f(or)h(more)f +(comma-space-RE)c(matches.)365 3600 y(\(csl)k(\(rx)h(\(|)f("John")f +("Paul")h("George")e("Ringo"\)\)\))365 3958 y Fy(6.3)99 +b(A)25 b(short)g(tutorial)365 4201 y FD(S-expr)o(ession)18 +b(r)o(egexps)f(ar)o(e)g(called)h(\224SRE\224s.)24 b(Keep)18 +b(in)h(mind)g(that)g(they)g(ar)o(e)e FC(not)h FD(Scheme)365 +4301 y(expr)o(essions;)i(they)g(ar)o(e)e(another)-6 b(,)20 +b(separate)e(notation)j(that)f(is)g(expr)o(essed)e(using)j(the)f(un-) +365 4400 y(derlying)33 b(framework)f(of)g(s-expr)o(ession)g(list)g(str) +o(uctur)o(e:)48 b(lists,)36 b(symbols,)g FC(etc.)60 b +FD(SRE's)365 4500 y(can)24 b(be)f FC(embedded)g FD(inside)h(of)g +(Scheme)g(expr)o(essions)f(using)i(special)e(forms)h(that)g(extend)365 +4599 y(Scheme's)h(syntax)g(\(such)g(as)f(the)h FA(rx)f +FD(macr)o(o\);)i(ther)o(e)e(ar)o(e)f(places)h(in)i(the)f(SRE)f(grammar) +365 4699 y(wher)o(e)g(one)h(may)f(place)f(a)h(Scheme)g(expr)o(ession.) +36 b(In)24 b(these)h(ways,)g(SRE's)f(and)g(Scheme)365 +4799 y(expr)o(essions)d(can)f(be)g(intertwined.)25 b(But)20 +b(this)h(isn't)h(fundamental;)d(SRE's)i(may)f(be)g(used)365 +4898 y(in)27 b(a)f(completely)g(Scheme-independent)g(context.)42 +b(By)26 b(simply)h(r)o(estricting)f(the)h(nota-)1737 +5147 y(1)-5 b(17)p eop +%%Page: 118 126 +118 125 bop 681 614 a FD(tion)32 b(to)g(eliminate)g(two)g(special)f +(Scheme-embedding)g(forms,)j(they)e(can)g(be)f(a)g(com-)681 +714 y(pletely)21 b(independent)f(notation.)681 992 y +FB(Constant)28 b(strings)82 b FD(The)29 b(simplest)i(SRE)e(is)h(a)f +(string,)j(denoting)e(a)f(constant)i(r)o(egexp.)681 1092 +y(For)21 b(example,)f(the)g(SRE)1063 1301 y FA("Spot")681 +1509 y FD(matches)25 b(only)i(the)f(string)g Fo(<)-28 +b(<)p FD(capital-S,)24 b(little-p,)i(little-o,)h(little-t)p +Fo(>)-28 b(>)p FD(.)40 b(Ther)o(e)25 b(is)h(no)g(in-)681 +1609 y(terpr)o(etation)20 b(of)g(the)h(characters)f(in)h(the)g(string)g +(at)g(all\227the)f(SRE)1063 1818 y FA(".*[")681 2027 +y FD(matches)h(the)f(string)i Fo(<)-28 b(<)p FD(period,)20 +b(asterisk,)g(open-bracket)p Fo(>)-28 b(>)p FD(.)681 +2305 y FB(Simple)20 b(character)g(sets)82 b FD(T)-8 b(o)23 +b(specify)f(a)f(set)i(of)f(characters,)f(write)h(a)g(list)g(whose)h +(single)681 2405 y(element)e(is)g(a)f(string)i(containing)f(the)g +(set's)g(elements.)26 b(So)21 b(the)g(SRE)1063 2613 y +FA(\("aeiou"\))681 2822 y FD(only)30 b(matches)f(a)f(vowel.)50 +b(One)30 b(way)f(to)g(think)h(of)f(this,)i(notationally)-9 +b(,)32 b(is)d(that)g(the)g(set)681 2922 y(brackets)20 +b(ar)o(e)f FA(\(")h FD(and)g FA("\))p FD(.)681 3200 y +FB(W)m(ild)i(card)82 b FD(Another)23 b(simple)h(SRE)e(is)i(the)f +(symbol)h FA(any)p FD(,)e(which)h(matches)g(any)g(single)681 +3300 y(character)o(\227including)c(newline)j(and)g(A)t +Fv(S)t(C)t(I)t(I)i FD(nul.)681 3578 y FB(Sequences)80 +b FD(W)-8 b(e)18 b(can)g(form)g(sequences)g(of)g(SRE's)g(with)h(the)f +(SRE)f FA(\(:)43 b FC(sr)o(e)h FA(...\))p FD(.)23 b(So)18 +b(the)681 3678 y(SRE)1063 3887 y FA(\(:)42 b("x")h(any)f("z"\))681 +4095 y FD(matches)24 b(any)f(thr)o(ee-character)e(string)k(starting)f +(with)g(\223x\224)f(and)g(ending)i(with)f(\223z\224.)33 +b(As)681 4195 y(we'll)27 b(see)f(shortly)-9 b(,)29 b(many)e(SRE)g +(forms)g(have)f(bodies)h(that)g(ar)o(e)e(implicit)j(sequences)f(of)681 +4295 y(other)f(SRE's,)g(analogous)g(to)g(the)g(manner)f(in)h(which)h +(the)e(body)h(of)f(a)g(Scheme)h FA(lambda)681 4394 y +FD(or)e FA(let)f FD(expr)o(ession)h(is)g(an)g(implicit)h +FA(begin)d FD(sequence.)36 b(The)24 b(r)o(egexp)e FA(\(seq)42 +b FC(sr)o(e)i FA(...\))23 b FD(is)681 4494 y(completely)k(equivalent)f +(to)h FA(\(:)43 b FC(sr)o(e)h FA(...\))p FD(;)27 b(it's)g(included)g +(in)g(or)o(der)e(to)i(have)f(a)g(syntax)681 4593 y(that)20 +b(doesn't)i(r)o(equir)o(e)d FA(:)i FD(to)g(be)f(a)h(legal)f(symbol)2233 +4563 y Fs(1)p 681 4661 1146 4 v 771 4717 a Fr(1)800 4741 +y Fv(That)d(is,)h(for)h(use)e(within)h(s-expr)o(ession)g(syntax)g +(frameworks)g(that,)f(unlike)h(R5RS,)g(don't)f(allow)i(for)g +Fi(:)f Fv(as)681 4819 y(a)f(legal)h(symbol.)23 b(A)17 +b(Common)f(Lisp)i(embedding)d(of)j(SREs,)f(for)h(example,)f(would)h +(need)e(to)h(use)g Fi(seq)i Fv(instead)681 4898 y(of)e +Fi(:)p Fv(.)2053 5147 y FD(1)-5 b(18)p eop +%%Page: 119 127 +119 126 bop 365 614 a Fy(6.4)99 b(Choices)365 832 y FD(The)23 +b(SRE)g FA(\(|)43 b FC(sr)o(e)h FA(...\))21 b FD(is)j(a)f(r)o(egexp)e +(that)i(matches)h(anything)g(any)f(of)g(the)g FC(sr)o(e)h +FD(r)o(egexps)365 932 y(match.)i(So)21 b(the)f(r)o(egular)g(expr)o +(ession)747 1127 y FA(\(|)43 b("sasha")e("Pete"\))365 +1323 y FD(matches)21 b(either)g(the)g(string)g(\223sasha\224)f(or)g +(the)h(string)h(\223Pete\224.)i(The)d(r)o(egexp)747 1518 +y FA(\(|)43 b(\("aeiou"\))d(\("0123456789"\)\))365 1714 +y FD(is)21 b(the)g(same)g(as)747 1909 y FA(\("aeiou0123456789)o("\))365 +2105 y FD(The)d(r)o(egexp)f FA(\(or)42 b FC(sr)o(e)i +FA(...\))16 b FD(is)j(completely)f(equivalent)g(to)h +FA(\(|)42 b FC(sr)o(e)i FA(...\))p FD(;)17 b(it's)i(included)365 +2204 y(in)j(or)o(der)d(to)i(have)g(a)f(syntax)h(that)f(doesn't)i(r)o +(equir)o(e)d FA(|)i FD(to)g(be)f(a)g(legal)h(symbol.)365 +2463 y FB(Repetition)80 b FD(Ther)o(e)23 b(ar)o(e)f(several)h(SRE)g +(forms)h(that)f(match)h(multiple)g(occur)o(ences)f(of)g(a)365 +2562 y(r)o(egular)j(expr)o(ession.)45 b(For)28 b(example,)g(the)f(SRE)g +FA(\(*)43 b FC(sr)o(e)h FA(...\))26 b FD(matches)h(zer)o(o)f(or)i(mor)o +(e)365 2662 y(occur)o(ences)21 b(of)g(the)h(sequence)f +FA(\(:)43 b FC(sr)o(e)h FA(...\))p FD(.)26 b(Her)o(e)20 +b(is)i(the)f(complete)h(list)g(of)f(SRE)g(r)o(epe-)365 +2761 y(tition)h(forms:)623 2884 y(SRE)744 b(means)341 +b(at)20 b(least)100 b(no)21 b(mor)o(e)g(than)p 573 2917 +2420 4 v 623 2987 a FA(\(*)42 b FC(sr)o(e)i FA(...\))449 +b FD(zer)o(o-or)o(-mor)o(e)313 b(0)320 b(in\002nity)623 +3087 y FA(\(+)42 b FC(sr)o(e)i FA(...\))449 b FD(one-or)o(-mor)o(e)339 +b(1)320 b(in\002nity)623 3186 y FA(\(?)42 b FC(sr)o(e)i +FA(...\))449 b FD(zer)o(o-or)o(-one)370 b(0)547 b(1)623 +3286 y FA(\(=)42 b FC(fr)o(om)h(sr)o(e)h FA(...\))250 +b FD(exactly-n)346 b FC(fr)o(om)434 b(fr)o(om)623 3385 +y FA(\(>=)42 b FC(fr)o(om)h(sr)o(e)h FA(...\))206 b FD(n-or)o(-mor)o(e) +310 b FC(fr)o(om)320 b FD(in\002nity)623 3485 y FA(\(**)42 +b FC(fr)o(om)h(to)g(sr)o(e)h FA(...\))98 b FD(n-to-m)432 +b FC(fr)o(om)524 b(to)490 3655 y FD(A)22 b FC(fr)o(om)f +FD(\002eld)h(is)h(a)e(Scheme)h(expr)o(ession)g(that)g(pr)o(oduces)f(an) +h(integer)-6 b(.)30 b(A)22 b FC(to)f FD(\002eld)i(is)f(a)365 +3755 y(Scheme)f(expr)o(ession)f(that)h(pr)o(oduces)f(either)g(an)h +(integer)-6 b(,)20 b(or)h(false,)f(meaning)h(in\002nity)-9 +b(.)490 3882 y(While)29 b(it)h(is)f(illegal)g(for)g(the)g +FC(fr)o(om)g FD(or)g FC(to)f FD(\002elds)h(to)h(be)f(negative,)h(it)f +FC(is)h FD(allowed)f(for)365 3981 y FC(fr)o(om)19 b FD(to)h(be)g(gr)o +(eater)e(than)i FC(to)f FD(in)h(a)g FA(**)e FD(form\227this)j(simply)g +(pr)o(oduces)d(a)i(r)o(egexp)e(that)i(will)365 4081 y(never)h(match)f +(anything.)490 4208 y(As)36 b(an)g(example,)j(we)d(can)f(describe)h +(the)g(names)g(of)g(car/cdr)f(access)h(functions)365 +4308 y(\(\224car\224,)c(\224cdr\224,)g(\224cadr\224,)g(\224cdar\224,)g +(\224caar\224)d(,)34 b(\224cddr\224,)e(\224caaadr\224,)e +FC(etc.)p FD(\))57 b(with)32 b(either)g(of)365 4408 y(the)21 +b(SREs)747 4603 y FA(\(:)43 b("c")f(\(+)h(\(|)g("a")f("d"\)\))g("r"\)) +747 4703 y(\(:)h("c")f(\(+)h(\("ad"\)\))e("r"\))365 4898 +y FD(W)-8 b(e)21 b(can)g(limit)g(the)g(a/d)f(chains)i(to)f(4)f +(characters)f(or)i(less)g(with)h(the)f(SRE)1737 5147 +y(1)-5 b(19)p eop +%%Page: 120 128 +120 127 bop 1063 614 a FA(\(:)42 b("c")h(\(**)f(1)h(4)g(\("ad"\)\))e +("r"\))805 818 y FD(Some)21 b(boundary)g(cases:)1063 +996 y FA(\(**)42 b(5)h(2)g("foo"\))347 b(;)43 b(Will)f(never)f(match) +1063 1096 y(\(**)h(0)h(0)g("foo"\))347 b(;)43 b(Matches)d(the)j(empty)e +(string)681 1398 y FB(Character)49 b(classes)81 b FD(Ther)o(e)51 +b(is)g(a)g(special)f(set)h(of)h(SRE's)f(that)g(form)g(\223character)681 +1497 y(classes\224\227basically)-9 b(,)28 b(a)g(r)o(egexp)f(that)h +(matches)g(one)g(character)f(fr)o(om)h(some)g(speci\002ed)681 +1597 y(set)d(of)h(characters.)38 b(Ther)o(e)25 b(ar)o(e)f(operators)h +(to)h(take)f(the)h(intersection,)h(union,)h(comple-)681 +1697 y(ment,)19 b(and)g(dif)o(fer)o(ence)e(of)i(character)f(classes)h +(to)g(pr)o(oduce)f(a)h(new)h(character)d(class.)25 b(\(Ex-)681 +1796 y(cept)e(for)h(union,)i(these)e(capabilities)g(ar)o(e)f(not)h(pr)o +(ovided)f(for)h(general)g(r)o(egexps)f(as)h(they)681 +1896 y(ar)o(e)19 b(computationally)j(intractable)e(in)h(the)g(general)f +(case.\))805 2020 y(A)29 b(single)h(character)e(is)h(the)g(simplest)h +(character)e(class:)42 b FA(#\\x)28 b FD(is)i(a)e(character)g(class)681 +2120 y(that)c(matches)g(only)h(the)f(character)f(\223x\224.)34 +b(A)24 b(string)g(that)h(has)f(only)h(one)f(letter)g(is)g(also)h(a)681 +2220 y(character)19 b(class:)25 b FA("x")20 b FD(is)h(the)g(same)g(SRE) +f(as)h FA(#\\x)p FD(.)805 2344 y(The)d(character)o(-set)e(notation)k +FA(\()p FC(string)o FA(\))e FD(we've)g(seen)g(is)h(a)e(primitive)i +(character)d(class,)681 2444 y(as)22 b(is)g(the)h(wildcar)o(d)e +FA(any)p FD(.)28 b(When)23 b(ar)o(guments)f(to)h(the)f(choice)h +(operator)-6 b(,)21 b FA(|)p FD(,)h(ar)o(e)f(all)h(char)o(-)681 +2543 y(acter)g(classes,)i(then)g(the)g(choice)f(form)h(is)g(itself)f(a) +g(character)o(-class.)31 b(So)23 b(these)h(SREs)f(ar)o(e)681 +2643 y(all)d(character)o(-classes:)888 2822 y FA(\("aeiou"\))888 +2921 y(\(|)43 b(#\\a)f(#\\e)h(#\\i)f(#\\o)g(#\\u\))888 +3021 y(\(|)h(\("aeiou"\))d(\("1234567890"\)\))681 3199 +y FD(However)-6 b(,)20 b(these)h(SRE's)g(ar)o(e)e FC(not)h +FD(character)o(-classes:)888 3378 y FA("aeiou")888 3477 +y(\(|)43 b("foo")f(#\\x\))805 3681 y FD(The)27 b FA(\(~)42 +b FC(cset-sr)o(e)i FA(...\))25 b FD(char)g(class)i(matches)f(one)h +(character)d(not)j(in)g(the)f(speci\002ed)681 3780 y(classes:)888 +3959 y FA(\(~)43 b(\("0248"\))d(\("1359"\)\))681 4137 +y FD(matches)21 b(any)f(character)g(that)g(is)h(not)h(a)e(digit.)805 +4262 y(Mor)o(e)g(compactly)-9 b(,)21 b(we)g(can)g(use)g(the)h +FA(/)e FD(operator)h(to)g(specify)g(character)f(sets)h(by)g(giv-)681 +4361 y(ing)f(the)f(endpoints)h(of)f(contiguous)i(ranges,)e(wher)o(e)f +(the)i(endpoints)g(ar)o(e)d(speci\002ed)i(by)h(a)681 +4461 y(sequence)h(of)g(strings)g(and)f(characters.)25 +b(For)c(example,)e(any)i(of)g(these)g(char)f(classes)888 +4599 y FA(\(/)43 b(#\\A)f(#\\Z)86 b(#\\a)43 b(#\\z)86 +b(#\\0)42 b(#\\9\))888 4699 y(\(/)h("AZ")f(#\\a)g(#\\z)h("09"\))888 +4799 y(\(/)g("AZ")f(#\\a)g("z09"\))888 4898 y(\(/"AZaz09"\))2051 +5147 y FD(120)p eop +%%Page: 121 129 +121 128 bop 365 614 a FD(matches)33 b(a)e(letter)h(or)g(a)g(digit.)60 +b(The)32 b(range)g(endpoints)h(ar)o(e)e(taken)h(in)g(pairs)g(to)g(form) +365 714 y(inclusive)d(ranges)e(of)h(characters.)45 b(Note)28 +b(that)f(the)h(exact)f(set)h(of)f(characters)g(included)365 +814 y(in)21 b(a)f(range)f(is)i(dependent)f(on)h(the)f(underlying)h +(implementation's)g(character)e(type,)h(so)365 913 y(ranges)h(may)g +(not)g(be)f(portable)h(acr)o(oss)f(dif)o(fer)o(ent)e(implementations.) +490 1044 y(Ther)o(e)25 b(is)h(a)f(wide)h(selection)h(of)f(pr)o +(ede\002ned,)f(named)h(character)e(classes)i(that)g(may)365 +1143 y(be)c(used.)29 b(One)22 b(such)h(SRE)e(is)i(the)f(wildcar)o(d)e +FA(any)p FD(.)28 b FA(nonl)21 b FD(is)h(a)f(character)g(class)h +(matching)365 1243 y(anything)g(but)f(newline;)g(it)g(is)g(equivalent)g +(to)573 1390 y FA(\(~)43 b(#\\newline\))365 1538 y FD(and)21 +b(is)g(useful)f(as)h(a)f(wildcar)o(d)g(in)h(line-oriented)g(matching.) +490 1668 y(Ther)o(e)28 b(ar)o(e)g(also)i(pr)o(ede\002ned)e(named)h +(char)g(classes)g(for)g(the)h(standar)o(d)e(Posix)i(and)365 +1768 y(Gnu)22 b(character)d(classes:)623 1895 y(scsh)i(name)243 +b(Posix/ctype)e(Alternate)20 b(name)100 b(Comment)p 573 +1928 2909 4 v 623 1998 a FA(lower-case)182 b(lower)623 +2098 y(upper-case)g(upper)623 2197 y(alphabetic)g(alpha)623 +2297 y(numeric)314 b(digit)468 b(num)623 2396 y(alphanumeric)94 +b(alnum)468 b(alphanum)623 2496 y(punctuation)138 b(punct)623 +2596 y(graphic)314 b(graph)623 2695 y(blank)402 b FD(\(Gnu)21 +b(extension\))623 2795 y FA(whitespace)182 b(space)468 +b(white)449 b FD(\223)p FA(space)p FD(\224)18 b(is)j(depr)o(ecated.)623 +2895 y FA(printing)270 b(print)623 2994 y(control)314 +b(cntrl)623 3094 y(hex-digit)226 b(xdigit)424 b(hex)623 +3193 y(ascii)402 b FD(\(Gnu)21 b(extension\))365 3340 +y(See)h(the)h(scsh)g(character)o(-set)d(documentation)j(or)g(the)g +(Posix)g(isalpha\(3\))e(man)i(page)f(for)365 3440 y(the)f(exact)f +(de\002nitions)i(of)f(these)g(sets.)490 3570 y(Y)-8 b(ou)30 +b(can)f(use)h(either)f(the)g(long)h(scsh)g(name)f(or)h(the)f(shorter)h +(Posix)g(and)f(alternate)365 3670 y(names)24 b(to)f(r)o(efer)f(to)h +(these)h(char)e(classes.)33 b(The)23 b(standar)o(d)f(Posix)i(name)f +(\223)p FA(space)p FD(\224)d(is)j(pr)o(o-)365 3769 y(vided,)29 +b(but)e(depr)o(ecated,)g(since)g(it)h(is)g(ambiguous.)47 +b(It)27 b(means)h(\223whitespace,\224)g(the)g(set)365 +3869 y(of)22 b(whitespace)f(characters,)g(not)h(the)g(singleton)h(set)f +(of)f(the)h FA(#\\space)d FD(character)-6 b(.)27 b(If)21 +b(you)365 3968 y(want)e(a)f(short)h(name)g(for)f(the)h(set)g(of)f +(whitespace)h(characters,)e(use)i(the)f(char)o(-class)g(name)365 +4068 y(\223white\224)j(instead.)490 4198 y(Char)c(classes)g(may)h(be)f +(intersected)g(with)h(the)f(operator)g FA(\(&)43 b FC(cset-sr)o(e)h +FA(...\))p FD(,)16 b(and)h(set-)365 4298 y(dif)o(fer)o(ence)i(can)h(be) +g(performed)g(with)i FA(\(-)43 b FC(cset-sr)o(e)g FA(...\))p +FD(.)24 b(These)d(operators)f(ar)o(e)g(partic-)365 4398 +y(ularly)f(useful)f(when)h(you)g(want)g(to)g(specify)f(a)g(set)g(by)h +(negation)g FC(with)f(r)o(espect)g(to)g(a)g(limited)365 +4497 y(universe.)27 b FD(For)21 b(example,)f(the)h(set)f(of)h(all)g +(non-vowel)g(letters)g(is)573 4698 y FA(\(-)43 b(alpha)e(\("aeiou"\))f +(\("AEIOU"\)\))365 4898 y FD(wher)o(eas)20 b(writing)i(a)e(simple)h +(complement)1735 5147 y(121)p eop +%%Page: 122 130 +122 129 bop 888 614 a FA(\(~)43 b(\("aeiouAEIOU"\)\))681 +857 y FD(gives)20 b(a)g(char)f(class)h(that)g(will)h(match)f(any)g +(non-vowel\227including)i(punctuation,)e(dig-)681 956 +y(its,)h(white)g(space,)f(contr)o(ol)h(characters,)e(and)j(A)t +Fv(S)t(C)t(I)t(I)i FD(nul.)805 1112 y(W)-8 b(e)21 b(can)g +FC(compute)e FD(a)i(char)f(class)g(by)h(writing)h(the)f(SRE)888 +1354 y FA(,)p FC(cset-exp)681 1597 y FD(wher)o(e)27 b +FC(cset-exp)f FD(is)i(a)f(Scheme)g(expr)o(ession)g(pr)o(oducing)g(a)g +(value)g(that)g(can)g(be)g(coer)o(ced)681 1696 y(to)d(a)e(character)g +(set:)31 b(a)23 b(character)f(set,)i(character)-6 b(,)22 +b(one-character)g(string,)i(or)f(char)o(-class)681 1796 +y(r)o(egexp)c(value.)25 b(This)c(r)o(egexp)f(matches)h(one)g(character) +e(fr)o(om)h(the)h(set.)805 1951 y(The)47 b(char)o(-class)e(SRE)h +FA(,@)p FC(cset-exp)e FD(is)j(entir)o(ely)f(equivalent)h(to)f +FA(,)p FC(cset-exp)f FD(when)681 2051 y FC(cset-exp)19 +b FD(pr)o(oduces)h(a)g(character)f(set)i(\(but)f(see)g(below)h(for)g +(the)f(mor)o(e)h(general)f(non-char)o(-)681 2150 y(class)g(context,)h +(wher)o(e)f(ther)o(e)g FC(is)h FD(a)g(distinction)h(between)e +FA(,)p FC(exp)g FD(and)g FA(,@)p FC(exp)o FD(.)805 2306 +y(As)28 b(an)f(example)g(of)h(character)o(-class)d(SREs,)k(an)e(SRE)h +(that)f(matches)h(a)f(lower)o(-case)681 2405 y(vowel,)21 +b(upper)o(-case)d(letter)-6 b(,)20 b(or)h(digit)g(is)888 +2648 y FA(\(|)43 b(\("aeiou"\))d(\(/"AZ09"\)\))681 2890 +y FD(or)-6 b(,)20 b(equivalently)888 3133 y FA(\(|)43 +b(\("aeiou"\))d(upper-case)f(numeric\))681 3375 y FD(Boundary)20 +b(cases:)25 b(the)c(empty-complement)g(char)g(class)888 +3617 y FA(\(~\))681 3860 y FD(matches)g(any)f(character;)f(it)i(is)g +(equivalent)g(to)h FA(any)p FD(.)i(The)c(empty-union)i(char)f(class)888 +4102 y FA(\(|\))681 4344 y FD(never)g(matches)g(at)g(all.)27 +b(This)22 b(is)f(rar)o(ely)f(useful)i(for)f(human-written)h(r)o +(egexps,)e(but)h(may)681 4444 y(be)30 b(of)g(occasional)h(utility)h(in) +f(machine-generated)e(r)o(egexps,)i(per)o(haps)f(pr)o(oduced)f(by)681 +4544 y(macr)o(os.)805 4699 y(The)e(r)o(ules)h(for)f(determining)h(if)f +(an)g(SRE)f(is)i(a)f(simple,)i(char)o(-class)c(SRE)i(or)h(a)e(mor)o(e) +681 4799 y(complex)g(SRE)g(form)h(a)e(little)i(\223type)f(system\224)g +(for)g(SRE's.)42 b(See)25 b(the)i(summary)f(section)681 +4898 y(pr)o(eceding)19 b(this)j(one)f(for)g(a)f(complete)h(listing)h +(of)f(these)f(r)o(ules.)2051 5147 y(122)p eop +%%Page: 123 131 +123 130 bop 365 614 a FB(Case)20 b(sensitivity)80 b FD(Ther)o(e)20 +b(ar)o(e)g(thr)o(ee)g(forms)h(that)f(contr)o(ol)h(case)f(sensitivity:) +573 832 y FA(\(uncase)128 b FC(sr)o(e)44 b FA(...\))573 +932 y(\(w/case)128 b FC(sr)o(e)44 b FA(...\))573 1031 +y(\(w/nocase)c FC(sr)o(e)k FA(...\))490 1290 y(uncase)19 +b FD(is)i(a)g(r)o(egexp)f(operator)h(pr)o(oducing)g(a)g(r)o(egexp)f +(that)h(matches)g(any)g(case)g(per)o(-)365 1389 y(mutation)h(of)f(any)f +(string)i(that)f(matches)f FA(\(:)43 b FC(sr)o(e)h FA(...\))p +FD(.)24 b(For)d(example,)f(the)h(r)o(egexp)573 1607 y +FA(\(uncase)41 b("foo"\))365 1825 y FD(matches)21 b(the)g(strings)h +(\223foo\224,)d(\223foO\224,)h(\223fOo\224,)g(\223fOO\224,)g +(\223Foo\224,)g(.)12 b(.)g(.)490 1965 y(Expr)o(essions)23 +b(in)h(SRE)g(notation)g(ar)o(e)f(interpr)o(eted)f(in)i(a)f(lexical)g +(case-sensitivy)g(con-)365 2065 y(text.)i(The)19 b(forms)g +FA(w/case)d FD(and)i FA(w/nocase)e FD(ar)o(e)h(the)i(scoping)g +(operators)g(for)f(this)i(contex-)365 2165 y(t,)25 b(which)g(contr)o +(ols)g(how)g(constant)f(strings)h(and)f(char)o(-class)e(forms)j(ar)o(e) +d(interpr)o(eted)h(in)365 2264 y(their)e(bodies.)26 b(So,)20 +b(for)h(example,)e(the)i(r)o(egexp)573 2482 y FA(\(w/nocase)40 +b("abc")1009 2581 y(\(*)i("FOO")g(\(w/case)f("Bar"\)\))1009 +2681 y(\("aeiou"\)\))365 2899 y FD(de\002nes)e(a)e(case-insensitive)i +(match)f(for)g(all)g(of)g(its)h(elements)g(except)e(for)h(the)h(sub-) +365 2998 y(element)18 b(\224Bar\224,)e(which)i(must)g(match)g(exactly)e +(capital-B,)g(little-a,)h(little-r)-6 b(.)24 b(The)18 +b(default,)365 3098 y(the)j(outermost,)h(top-level)e(context)h(is)g +(case)f(sensitive.)490 3239 y(The)h(lexical)f(case-sensitivity)h +(context)g(af)o(fects)e(the)i(interpr)o(etation)f(of)490 +3456 y Fw(\017)41 b FD(constant)21 b(strings,)h(such)f(as)f +FA("foo")p FD(,)490 3644 y Fw(\017)41 b FD(chars,)20 +b(such)h(as)g FA(#\\x)p FD(,)490 3831 y Fw(\017)41 b +FD(char)20 b(sets,)h(such)g(as)g FA(\("abc"\))p FD(,)c(and)490 +4018 y Fw(\017)41 b FD(ranges,)18 b(such)g(as)g FA(\(/"az"\))d +FD(that)i(appear)g(within)i(that)e(context.)25 b(It)18 +b(does)g(not)h(af)o(fect)573 4118 y(dynamically)32 b(computed)h(r)o +(egexps\227ones)f(that)h(ar)o(e)e(intr)o(oduced)h(by)g(,)p +FC(exp)g FD(and)573 4218 y(,@)p FC(exp)26 b FD(forms.)46 +b(It)27 b(does)g(not)h(af)o(fect)e(named)h(char)o(-classes\227pr)o +(esumably)-9 b(,)26 b(if)h(you)573 4317 y(wr)o(ote)20 +b FA(lower)p FD(,)f(you)i(didn't)g(mean)g FA(alpha)p +FD(.)573 4461 y FA(uncase)16 b FD(is)j FC(not)g FD(the)g(same)f(as)h +FA(w/nocase)p FD(.)i(T)-8 b(o)20 b(point)f(up)g(one)g(distinction,)h +(consider)573 4560 y(the)h(two)g(r)o(egexps)756 4748 +y FA(\(uncase)127 b(\(~)43 b("a"\)\))756 4847 y(\(w/nocase)c(\(~)k +("a"\)\))1735 5147 y FD(123)p eop +%%Page: 124 132 +124 131 bop 805 614 a FD(The)21 b(r)o(egexp)f FA(\(~)43 +b("a"\))19 b FD(matches)i(any)g(character)e(except)h(\223a,\224)f +(which)j(means)f(it)g FC(does)681 714 y FD(match)d(\223A.\224)f(Now)-8 +b(,)20 b FA(\(uncase)40 b FC(r)o(e)p FA(\))18 b FD(matches)h(any)f +(case-permutation)g(of)g(a)g(string)i(that)e FC(r)o(e)681 +814 y FD(matches.)27 b FA(\(~)42 b("a"\))20 b FD(matches)h(\223A,\224)f +(so)h FA(\(uncase)41 b(\(~)i("a"\)\))19 b FD(matches)i(\223A)-6 +b(\224)20 b(and)g(\223a\224\227)681 913 y(and,)g(for)g(that)h(matter)-6 +b(,)20 b(every)g(other)h(character)-6 b(.)24 b(So)d FA(\(uncase)40 +b(\(~)j("a"\)\))19 b FD(is)i(equivalent)681 1013 y(to)g +FA(any)p FD(.)805 1137 y(In)i(contrast,)h FA(\(w/nocase)40 +b(\(~)i("a"\)\))21 b FD(establishes)i(a)g(case-insensitive)g(lexical)f +(con-)681 1237 y(text)d(in)g(which)h(the)g FA("a")d FD(is)j(interpr)o +(eted,)e(making)h(the)h(SRE)f(equivalent)g(to)g FA(\(~)43 +b(\("aA"\)\))p FD(.)681 1485 y FB(Dynamic)20 b(regexps)82 +b FD(SRE)21 b(notation)h(allows)g(you)g(to)g(compute)g(parts)e(of)i(a)f +(r)o(egular)f(ex-)681 1585 y(pr)o(essions)h(at)f(r)o(un)i(time.)j(The)c +(SRE)888 1763 y FA(,)p FC(exp)681 1942 y FD(is)g(a)g(r)o(egexp)f(whose) +h(body)h FC(exp)e FD(is)h(a)g(Scheme)g(expr)o(ession)g(pr)o(oducing)f +(a)h(string,)h(charac-)681 2042 y(ter)-6 b(,)26 b(char)o(-set,)g(or)h +(r)o(egexp)d(as)i(its)h(value.)41 b(Strings)26 b(and)g(characters)f(ar) +o(e)g(converted)g(into)681 2141 y(constant)i(r)o(egexps;)i(char)o +(-sets)c(ar)o(e)g(converted)i(into)g(char)o(-class)f(r)o(egexps;)i(and) +e(r)o(egexp)681 2241 y(values)20 b(ar)o(e)f(substituted)j(in)f(place.)j +(So)d(we)g(can)f(write)h(r)o(egexps)f(like)h(this)888 +2420 y FA(\(:)43 b("feeding)d(the)j(")1019 2519 y(,\(if)f(\(>)h(n)g +(1\))g("geese")d("goose"\)\))681 2698 y FD(This)27 b(is)f(how)i(you)f +(can)f(dr)o(op)f(computed)i(strings,)h(such)f(as)f(someone's)i(name,)f +(or)g(the)681 2798 y(decimal)20 b(numeral)h(for)f(a)g(computed)h +(number)-6 b(,)21 b(into)g(a)g(complex)g(r)o(egexp.)805 +2922 y(If)c(we)g(have)f(a)g(lar)o(ge,)h(complex)g(r)o(egular)e(expr)o +(ession)i(that)g(is)g(used)g(multiple)g(times)h(in)681 +3022 y(some)25 b(other)-6 b(,)26 b(containing)g(r)o(egular)e(expr)o +(ession,)h(we)g(can)g(name)g(it,)g(using)h(the)f(binding)681 +3121 y(forms)c(of)g(the)g(embedding)g(language)f(\()p +FC(e.g.)o FD(,)h(Scheme\),)f(and)h(r)o(efer)e(to)i(it)h(by)f(name)f(in) +i(the)681 3221 y(containing)g(expr)o(ession.)j(For)c(example,)f +(consider)h(the)g(Scheme)f(expr)o(ession)888 3400 y FA(\(let*)42 +b(\(\(ws)g(\(rx)g(\(+)h(whitespace\)\)\))82 b(;)43 b(Seq)f(of)h +(whitespace)1193 3499 y(;;)g(Something)d(like)i("Mar)g(14")1193 +3599 y(\(date)g(\(rx)g(\(:)h(\(|)g("Jan")e("Feb")h("Mar")f(...\))1760 +3698 y(,ws)1760 3798 y(\(|)i(\("123456789"\))256 b(;)43 +b(1-9)1891 3898 y(\(:)g(\("12"\))e(digit\))128 b(;)43 +b(10-29)1891 3997 y("30")652 b(;)43 b(30)1891 4097 y("31"\)\)\)\)\))432 +b(;)43 b(31)976 4197 y(;;)f(Now)h(we)f(can)h(use)f(DATE)g(several)f +(times:)976 4296 y(\(rx)h(...)g(,date)g(...)g(\(*)h(...)f(,date)g +(...\))1150 4396 y(...)g(,date)g(...\)\))681 4575 y FD(wher)o(e)35 +b(the)h FA(\(rx)42 b FC(sr)o(e)i FA(...\))34 b FD(macr)o(o)h(is)h(the)g +(Scheme)g(special)f(form)h(that)g(pr)o(oduces)f(a)681 +4674 y(Scheme)20 b(r)o(egexp)g(value)g(given)h(a)f(body)h(in)g(SRE)g +(notation.)805 4799 y(As)j(we)g(saw)g(in)h(the)f(char)o(-class)f +(section,)i(if)f(a)g(dynamic)g(r)o(egexp)f(is)h(used)g(in)h(a)e(char)o +(-)681 4898 y(class)30 b(context)g(\()p FC(e.g.)o FD(,)j(as)d(an)g(ar)o +(gument)g(to)g(a)g FA(~)g FD(operation\),)i(the)e(expr)o(ession)g(must) +h(be)2051 5147 y(124)p eop +%%Page: 125 133 +125 132 bop 365 614 a FD(coer)o(cable)22 b(not)i(mer)o(ely)e(to)i(a)e +(general)h(r)o(egexp,)f(but)h(to)h(a)e(character)g(sr)o(e\227so)h(it)g +(must)h(be)365 714 y(either)d(a)f(singleton)i(string,)g(a)e(character) +-6 b(,)19 b(a)h(scsh)h(char)g(set,)f(or)h(a)f(char)o(-class)g(r)o +(egexp.)490 842 y(W)-8 b(e)36 b(can)g(also)g(de\002ne)g(and)g(use)g +(functions)h(on)g(r)o(egexps)e(in)i(the)f(host)h(language.)365 +942 y(For)29 b(example,)g(consider)f(the)g(following)i(Scheme)d(expr)o +(essions,)j(containing)f(embed-)365 1041 y(ded)22 b(SRE's)g(\(inside)g +(the)h FA(rx)e FD(macr)o(o)h(expr)o(essions\))g(which)h(in)g(term)f +(contain)h(embedded)365 1141 y(Scheme)e(expr)o(essions)f(computing)i +(dynamic)f(r)o(egexps:)573 1337 y FA(\(define)41 b(\(csl)g(re\))660 +1437 y(;;)i(A)g(comma-separated)37 b(list)42 b(of)h(RE's)f(is)h(either) +660 1537 y(\(rx)f(\(|)h("")740 b(;)43 b(zero)f(of)h(them)f(\(empty)f +(string\),)965 1636 y(\(:)i(,re)565 b(;)43 b(or)g(RE)g(followed)d(by) +1096 1736 y(\(*)j(",)f(")i(,re\)\)\)\)\);)39 b(zero)j(or)h(more)f +(comma-space-RE)c(matches.)573 1935 y(\(rx)k(...)h(,date)e(...)747 +2035 y(,\(csl)h(\(rx)g(\(|)h("John")e("Paul")g("George")f +("Ringo"\)\)\))747 2134 y(...)747 2234 y(,\(csl)i(date\))747 +2334 y(...\))365 2530 y FD(W)-8 b(e)24 b(leave)f(the)h(extension)h(of)e +FA(csl)g FD(to)h(allow)g(for)g(an)f(optional)i(\223and\224)d(between)i +(the)g(last)365 2630 y(two)d(matches)f(as)g(an)g(exer)o(cise)f(for)h +(the)g(inter)o(ested)g(r)o(eader)e(\()p FC(e.g.)o FD(,)i(to)g(match)h +(\223John,)f(Paul,)365 2729 y(Geor)o(ge)h(and)f(Ringo\224\).)490 +2857 y(Note,)g(in)h(passing,)g(one)g(of)g(the)g(nice)f(featur)o(es)f +(of)i(SRE)f(notation:)27 b(they)21 b(can)f(be)g(com-)365 +2957 y(mented,)i(and)f(indented)g(in)i(a)e(fashion)h(to)g(show)g(the)g +(lexical)f(extent)h(of)f(the)h(subexpr)o(es-)365 3057 +y(sions.)490 3184 y(When)17 b(we)f(embed)g(a)h(computed)f(r)o(egexp)f +(inside)i(another)g(r)o(egular)e(expr)o(ession)i(with)365 +3284 y(the)k(,)p FC(exp)f FD(form,)h(we)g(must)h(specify)e(how)i(to)f +(account)g(for)g(the)g(submatches)g(that)g(may)g(be)365 +3384 y(in)h(the)e(computed)h(part.)k(For)c(example,)f(suppose)h(we)g +(have)f(the)h(r)o(egexp)573 3580 y FA(\(rx)42 b(\(submatch)e(\(*)j +("foo"\)\))747 3680 y(\(submatch)d(\(?)j("bar"\)\))747 +3780 y(,\(f)g(x\))747 3879 y(\(submatch)d("baz"\)\))365 +4076 y FD(It's)27 b(clear)e(that)h(the)g(submatch)g(for)g(the)g +FA(\(*)43 b("foo"\))24 b FD(part)h(of)h(the)g(r)o(egexp)f(is)h +(submatch)365 4175 y(#1,)34 b(and)e(the)g FA(\(?)43 b("bar"\))30 +b FD(part)i(is)g(submatch)h(#2.)59 b(But)32 b(what)g(number)h(submatch) +f(is)365 4275 y(the)i FA("baz")d FD(submatch?)63 b(It's)34 +b(not)g(clear)-6 b(.)61 b(Suppose)33 b(the)h(Scheme)f(expr)o(ession)g +FA(\(f)42 b(x\))365 4375 y FD(pr)o(oduces)29 b(a)g(r)o(egular)f(expr)o +(ession)i(that)f(itself)h(has)f(3)g(subforms.)53 b(Ar)o(e)28 +b(these)h(counted)365 4474 y(\(making)22 b(the)g FA("baz")e +FD(submatch)i(#6\),)e(or)i(not)g(counted)g(\(making)g(the)g +FA("bar")d FD(submatch)365 4574 y(#3\)?)490 4702 y(SRE)h(notation)i(pr) +o(ovides)e(for)h(both)g(possibilities.)27 b(The)21 b(SRE)573 +4898 y FA(,)p FC(exp)1735 5147 y FD(125)p eop +%%Page: 126 134 +126 133 bop 681 614 a FD(does)30 b FC(not)h FD(contribute)g(its)g +(submatches)g(to)g(its)g(containing)h(r)o(egexp;)i(it)d(has)g(zer)o(o)e +(sub-)681 714 y(matches.)d(So)21 b(one)h(can)f(r)o(eliably)f(assign)i +(submatch)f(indices)g(to)h(forms)f(appearing)f(after)681 +814 y(a)g FA(,)p FC(exp)g FD(form)h(in)g(a)f(r)o(egexp.)805 +938 y(On)i(the)f(other)g(hand,)f(the)h(SRE)888 1118 y +FA(,@)p FC(exp)681 1297 y FD(\223splices\224)31 b(its)i(r)o(esulting)f +(r)o(egexp)f(into)h(place,)i FC(exposing)e FD(its)g(submatches)g(to)h +(the)f(con-)681 1397 y(taining)26 b(r)o(egexp.)38 b(This)25 +b(is)h(useful)f(if)g(the)h(computed)f(r)o(egexp)f(is)i(de\002ned)f(to)g +(pr)o(oduce)g(a)681 1496 y(certain)20 b(number)h(of)g(submatches\227if) +f(that)h(is)g(part)f(of)h FC(exp)o FD('s)g(\223contract.\224)681 +1745 y FB(String,)16 b(line,)g(and)g(word)h(units)82 +b FD(The)17 b(r)o(egexps)f FA(bos)f FD(and)i FA(eos)e +FD(match)i(the)g(empty)g(string)681 1844 y(at)j(the)h(beginning)h(and)e +(end)h(of)g(the)g(string,)g(r)o(espectively)-9 b(.)805 +1969 y(The)22 b(r)o(egexps)f FA(bol)g FD(and)h FA(eol)f +FD(match)h(the)g(empty)g(string)h(at)f(the)g(beginning)i(and)d(end)681 +2068 y(of)d(a)g(line,)h(r)o(espectively)-9 b(.)23 b(A)18 +b(line)g(begins)h(at)f(the)g(beginning)i(of)e(the)g(string,)i(and)d +(just)i(after)681 2168 y(every)26 b(newline)h(character)-6 +b(.)42 b(A)26 b(line)h(ends)f(at)h(the)f(end)h(of)f(the)h(string,)i +(and)d(just)h(befor)o(e)681 2268 y(every)32 b(newline)h(character)-6 +b(.)60 b(The)33 b(char)f(class)g FA(nonl)f FD(matches)i(any)g +(character)e(except)681 2367 y(newline,)21 b(and)f(is)h(useful)g(in)g +(conjunction)i(with)f(line-based)e(pattern)g(matching.)805 +2492 y(The)i(r)o(egexps)f FA(bow)g FD(and)h FA(eow)f +FD(match)h(the)g(empty)g(string)h(at)f(the)g(beginning)i(and)d(end)681 +2591 y(of)f(a)g(wor)o(d,)g(r)o(espectively)-9 b(.)24 +b(A)c(wor)o(d)g(is)h(a)f(contiguous)i(sequence)f(of)f(characters)f +(that)h(ar)o(e)681 2691 y(either)g(alphanumeric)h(or)g(the)g(underscor) +o(e)e(character)-6 b(.)805 2816 y(The)56 b(r)o(egexp)e +FA(\(word)42 b FC(sr)o(e)h FA(...\))54 b FD(surr)o(ounds)i(the)f +(sequence)h FA(\(:)43 b FC(sr)o(e)h FA(...\))p FD(with)681 +2915 y(bow/eow)22 b(delimiters.)j(It)c(is)g(equivalent)g(to)888 +3095 y FA(\(:)43 b(bow)f FC(sr)o(e)i FA(...)f(eow\))805 +3299 y FD(The)34 b(r)o(egexp)f FA(\(word+)42 b FC(cset-sr)o(e)h +FA(...\))33 b FD(matches)h(a)g(wor)o(d)f(whose)i(body)g(is)f(one)h(or) +681 3399 y(mor)o(e)20 b(wor)o(d)h(characters)e(matched)h(by)h(the)g +(char)o(-set)e(sr)o(e)i FC(cset-sr)o(e)p FD(.)k(It)c(is)g(equivalent)g +(to)888 3578 y FA(\(word)42 b(\(+)h(\(&)f(\(|)h(alphanumeric)c("_"\)) +1411 3678 y(\(|)k FC(cset-sr)o(e)h FA(...\)\)\)\))681 +3857 y FD(For)21 b(example,)f(a)g(wor)o(d)g(not)i(containing)g(x,)e(y) +-9 b(,)20 b(or)h(z)g(is)888 4036 y FA(\(word+)41 b(\(~)i(\("xyz"\)\)\)) +681 4216 y FD(The)21 b(r)o(egexp)e FA(word)g FD(matches)i(one)g(wor)o +(d;)f(it)h(is)g(equivalent)g(to)888 4395 y FA(\(word+)41 +b(any\))805 4699 y Fw(f)p FD(Note)28 b FA(bol)e FD(and)h +FA(eol)f FD(ar)o(e)g(not)j(supported)e(by)g(scsh's)i(curr)o(ent)e(r)o +(egexp)f(sear)o(ch)g(en-)681 4799 y(gine,)19 b(which)g(is)g(Spencer)6 +b('s)18 b(Posix)h(matcher)-6 b(.)24 b(This)19 b(is)g(the)g(only)g +(element)g(of)f(the)h(notation)681 4898 y(that)h(is)i(not)f(supported)g +(by)f(the)h(curr)o(ent)f(scsh)i(r)o(efer)o(ence)c(implementation.)p +Fw(g)2051 5147 y FD(126)p eop +%%Page: 127 135 +127 134 bop 365 614 a FB(Posix)41 b(string)g(notation)82 +b FD(The)41 b(SRE)h FA(\(posix-string)c FC(string)p FA(\))p +FD(,)47 b(wher)o(e)41 b FC(string)h FD(is)g(a)365 714 +y(string)24 b(literal)f(\()p FC(not)g FD(a)g(general)g(Scheme)g(expr)o +(ession\),)g(allows)h(one)g(to)f(use)h(Posix)g(string)365 +814 y(notation)j(for)e(a)g(r)o(egexp.)38 b(It's)26 b(intended)f(as)g +(backwar)o(ds)f(compatibility)i(and)f(is)g(depr)o(e-)365 +913 y(cated.)e(For)17 b(example,)g FA(\(posix-string)38 +b("[aeiou]+|x*|y{3)o(,5})o("\))10 b FD(matches)17 b(a)f(string)365 +1013 y(of)21 b(vowels,)g(a)f(possibly)i(empty)f(string)h(of)e(x's,)h +(or)g(thr)o(ee)f(to)h(\002ve)g(y's.)490 1140 y(Note)31 +b(that)f(par)o(entheses)g(ar)o(e)f(used)h(ambiguously)i(in)f(Posix)g +(notation\227both)i(for)365 1240 y(gr)o(ouping)21 b(and)e(submatch)h +(marking.)26 b(The)20 b FA(\(posix-string)38 b FC(string)p +FA(\))20 b FD(form)g(makes)f(the)365 1339 y(conservative)i(assumption:) +26 b(all)21 b(par)o(entheses)f(intr)o(oduce)g(submatches.)365 +1597 y FB(Deleted)27 b(submatches)80 b FD(Deleted)28 +b(submatches,)j(or)e(\223DSM's,\224)h(ar)o(e)d(a)h(subtle)h(featur)o(e) +365 1696 y(that)c(ar)o(e)e(never)h(r)o(equir)o(ed)f(in)i(expr)o +(essions)g(written)g(by)g(humans.)37 b(They)25 b(can)f(be)h(intr)o(o-) +365 1796 y(duced)d(by)g(the)g(simpli\002er)h(when)g(r)o(educing)e(r)o +(egular)g(expr)o(essions)h(to)h(simpler)f(equiva-)365 +1896 y(lents,)j(and)e(ar)o(e)g(included)g(in)h(the)g(syntax)g(to)g +(give)g(it)g(expr)o(essibility)f(spanning)i(the)f(full)365 +1995 y(r)o(egexp)18 b(ADT)-6 b(.)19 b(They)g(may)g(appear)f(when)h +(unparsing)h(simpli\002ed)g(r)o(egular)e(expr)o(essions)365 +2095 y(that)25 b(have)f(been)h(r)o(un)g(thr)o(ough)h(the)f +(simpli\002er;)i(otherwise)f(you)f(ar)o(e)f(not)h(likely)h(to)f(see)365 +2194 y(them.)h(Feel)21 b(fr)o(ee)e(to)i(skip)g(this)h(section.)490 +2322 y(The)e(r)o(egexp)f(simpli\002er)i(can)f(sometimes)h(eliminate)f +(entir)o(e)g(sub-expr)o(essions)g(fr)o(om)365 2421 y(a)h(r)o(egexp.)j +(For)d(example,)f(the)g(r)o(egexp)573 2616 y FA(\(:)43 +b("foo")e(\(**)h(0)i(0)f("apple"\))d("bar"\))365 2811 +y FD(can)21 b(be)f(simpli\002ed)i(to)573 3007 y FA("foobar")365 +3202 y FD(since)f FA(\(**)43 b(0)g(0)g("apple"\))17 b +FD(will)22 b(always)f(match)f(the)h(empty)g(string.)26 +b(The)21 b(r)o(egexp)573 3397 y FA(\(|)43 b("foo")704 +3497 y(\(:)f("Richard")e(\(|\))j("Nixon"\))704 3596 y("bar"\))365 +3791 y FD(can)21 b(be)f(simpli\002ed)i(to)573 3987 y +FA(\(|)43 b("foo")e("bar"\))365 4182 y FD(The)21 b(empty)g(choice)g +FA(\(|\))f FD(can't)g(match)h(anything,)g(so)h(the)f(whole)573 +4377 y FA(\(:)43 b("Richard")c(\(|\))k("Nixon"\))365 +4572 y FD(sequence)21 b(can't)g(match,)f(and)h(we)g(can)f(r)o(emove)g +(it)h(fr)o(om)f(the)h(choice.)490 4699 y(However)-6 b(,)24 +b(if)g(deleting)g(part)f(of)h(a)f(r)o(egular)g(expr)o(ession)h(r)o +(emoves)f(a)g(submatch)i(for)o(-)365 4799 y(m,)h(any)f(following)h +(submatch)f(forms)g(will)g(have)f(their)h(numbering)h(changed,)f(which) +365 4898 y(would)d(be)e(an)h(err)o(or)-6 b(.)24 b(For)d(example,)f(if)g +(we)h(simplify)1735 5147 y(127)p eop +%%Page: 128 136 +128 135 bop 888 614 a FA(\(:)43 b(\(**)f(0)i(0)f(\(submatch)d +("apple"\)\))1019 714 y(\(submatch)g("bar"\)\))681 891 +y FD(to)888 1068 y FA(\(submatch)g("bar"\))681 1245 y +FD(then)26 b(the)g FA("bar")d FD(submatch)j(changes)g(fr)o(om)f +(submatch)h(#2)f(to)h(submatch)g(#1\227so)f(this)681 +1345 y(is)c(not)g(a)g(legal)f(simpli\002cation.)805 1469 +y(When)29 b(the)g(simpli\002er)h(deletes)e(a)g(sub-r)o(egexp)f(that)i +(contains)g(submatches,)i(it)e(in-)681 1569 y(tr)o(oduces)18 +b(a)h(special)g(r)o(egexp)f(form)i(to)g(account)f(for)g(the)h(missing,) +h(deleted)d(submatches,)681 1669 y(thus)j(keeping)g(the)g(submatch)g +(accounting)g(corr)o(ect.)888 1846 y FA(\(dsm)42 b FC(pr)o(e)h(post)g +(sr)o(e)h FA(...\))681 2023 y FD(is)31 b(a)g(r)o(egexp)e(that)i +(matches)g(the)g(sequence)h FA(\(:)42 b FC(sr)o(e)i FA(...\))p +FD(.)55 b FC(pr)o(e)31 b FD(and)f FC(post)g FD(ar)o(e)g(integer)681 +2122 y(constants.)36 b(The)24 b(DSM)f(form)h(intr)o(oduces)g +FC(pr)o(e)f FD(deleted)g(submatches)i(befor)o(e)d(the)i(body)-9 +b(,)681 2222 y(and)32 b FC(post)g FD(deleted)g(submatches)h(after)e +(the)i(body)-9 b(.)62 b(If)32 b(the)h(body)g FC(\(:)20 +b(sr)o(e)h(.)12 b(.)g(.)g(\))33 b FD(itself)g(has)681 +2322 y FC(body-sm)19 b FD(submatches,)h(then)h(the)f(total)g(number)g +(of)g(submatches)h(for)f(the)g(DSM)f(form)i(is)1737 2487 +y FC(pr)o(e)d Fn(+)g FC(body-sm)f Fn(+)h FC(post)p Fo(:)681 +2652 y FD(These)f(extra,)g(deleted)f(submatches)h(ar)o(e)f(never)h +(assigned)g(string)h(indices)g(in)g(any)f(match)681 2752 +y(values)j(pr)o(oduced)g(when)h(matching)g(the)g(r)o(egexp)f(against)g +(a)h(string.)805 2877 y(As)g(examples,)888 3054 y FA(\(|)43 +b(\(:)g(\(submatch)d("Richard"\))f(\(|\))k("Nixon"\))1019 +3153 y(\(submatch)d("bar"\)\))681 3330 y FD(can)20 b(be)h(simpli\002ed) +g(to)888 3507 y FA(\(dsm)42 b(1)h(0)h(\(submatch)39 b("bar"\)\))681 +3684 y FD(The)21 b(r)o(egexp)888 3862 y FA(\(:)43 b(\(**)f(0)i(0)f +(\(submatch)d("apple"\)\))1019 3961 y(\(submatch)g("bar"\)\))681 +4138 y FD(can)20 b(be)h(simpli\002ed)g(to)888 4315 y +FA(\(dsm)42 b(1)h(0)h(\(submatch)39 b("bar"\)\))681 4616 +y FB(6.4.1)81 b(Embedding)18 b(regexps)i(within)f(Scheme)g(programs)681 +4799 y FD(SRE's)32 b(can)g(be)g(placed)f(in)h(a)g(Scheme)f(pr)o(ogram)h +(using)h(the)f FA(\(rx)42 b FC(sr)o(e)i FA(...\))74 b +FD(Scheme)681 4898 y(form,)20 b(which)i(evaluates)e(to)h(a)f(Scheme)h +(r)o(egexp)e(value.)2051 5147 y(128)p eop +%%Page: 129 137 +129 136 bop 365 614 a FB(Static)19 b(and)h(dynamic)f(regexps)365 +800 y FD(W)-8 b(e)21 b(separate)e(SRE)h(expr)o(essions)g(into)h(two)g +(classes:)k(static)c(and)e(dynamic)i(expr)o(essions.)365 +900 y(A)j FC(static)g FD(expr)o(ession)f(is)i(one)g(that)f(has)g(no)h +(r)o(un-time)f(dependencies;)h(it)f(is)h(a)f(complete,)365 +999 y(self-contained)29 b(description)h(of)g(a)f(r)o(egular)g(set.)52 +b(A)30 b FC(dynamic)e FD(expr)o(ession)h(is)h(one)h(that)365 +1099 y(r)o(equir)o(es)f(r)o(un-time)i(computation)g(to)f(determine)g +(the)g(particular)f(r)o(egular)f(set)i(being)365 1198 +y(described.)e(Ther)o(e)22 b(ar)o(e)f(two)i(places)e(wher)o(e)h(one)h +(can)f(embed)g(r)o(un-time)g(computations)365 1298 y(in)g(an)e(SRE:)490 +1492 y Fw(\017)41 b FD(The)21 b FC(fr)o(om)f FD(or)h +FC(to)f FD(r)o(epetition)g(counts)i(of)f FA(**)p FD(,)e +FA(=)p FD(,)h(and)h FA(>=)f FD(forms;)490 1661 y Fw(\017)41 +b FA(,)p FC(exp)20 b FD(and)g FA(,@)p FC(exp)f FD(forms.)490 +1855 y(A)d(static)g(SRE)g(is)g(one)h(that)f(does)g(not)h(contain)g(any) +f FA(,)p FC(exp)g FD(or)g FA(,@)p FC(exp)f FD(forms,)i(and)f(whose)365 +1955 y FA(**)p FD(,)k FA(=)p FD(,)g(and)g FA(>=)g FD(forms)h(all)g +(contain)g(constant)h(r)o(epetition)e(counts.)490 2082 +y(Scsh's)h FA(rx)e FD(macr)o(o)h(is)h(able,)f(at)g(macr)o(o-expansion)g +(time,)h(to)g(completely)g(parse,)e(sim-)365 2181 y(plify)f(and)g +(translate)g(any)g(static)g(SRE)f(into)i(the)g(equivalent)f(Posix)h +(string)f(which)h(is)g(used)365 2281 y(to)28 b(drive)f(the)h +(underlying)g(C-based)e(matching)i(engine;)k(ther)o(e)26 +b(is)i(no)h(r)o(un-time)f(over)o(-)365 2380 y(head.)i(Dynamic)23 +b(SRE's)f(ar)o(e)f(partially)g(simpli\002ed)i(and)f(then)h(expanded)e +(into)i(Scheme)365 2480 y(code)e(that)f(constr)o(ucts)i(the)f(r)o +(egexp)f(at)g(r)o(un-time.)365 2763 y Fy(6.5)99 b(Regexp)25 +b(functions)365 2979 y FB(6.5.1)81 b(Obsolete,)19 b(deprecated)f +(procedures)365 3165 y FD(These)j(two)g(pr)o(ocedur)o(es)e(ar)o(e)g +(survivors)i(fr)o(om)g(the)g(pr)o(evious,)f(now-obsolete)h(scsh)h(r)o +(eg-)365 3265 y(exp)k(interface.)42 b(Old)27 b(code)f(must)h(open)g +(the)f FA(re-old-funs)c FD(package)k(to)g(access)g(them.)365 +3364 y(They)21 b(should)h(not)f(be)g(used)f(in)h(new)g(code.)365 +3515 y FA(\(string-match)39 b FC(posix-r)o(e-string)19 +b(string)i([start])p FA(\))85 b Fw(\000)-14 b(!)87 b +FC(match)20 b(or)g(false)113 b FD(pr)o(ocedur)o(e)365 +3615 y FA(\(make-regexp)39 b FC(posix-r)o(e-string)p +FA(\))85 b Fw(\000)-14 b(!)87 b FC(r)o(egexp)854 b FD(pr)o(ocedur)o(e) +573 3757 y(These)25 b(ar)o(e)g(old)h(functions)g(included)g(for)f +(backwar)o(ds)f(compatibility)j(with)f(pr)o(e-)573 3857 +y(vious)h(r)o(eleases.)43 b(They)27 b(ar)o(e)f(depr)o(ecated)e(and)j +(will)g(go)h(away)e(at)h(some)g(point)h(in)573 3956 y(the)21 +b(futur)o(e.)573 4091 y(Note)j(that)h(the)f(new)h(r)o(elease)d(has)j +(no)g(\223r)o(egexp)d(compiling\224)j(pr)o(ocedur)o(e)e(at)h(all\227) +573 4190 y(r)o(egexp)18 b(values)i(ar)o(e)e(compiled)i(for)f(the)h +(matching)h(engine)f(on-demand,)f(and)g(the)573 4290 +y(necessary)h(data)g(str)o(uctur)o(es)g(ar)o(e)g(cached)f(inside)i(the) +g(ADT)g(values.)365 4563 y FB(6.5.2)81 b(Standard)19 +b(procedures)g(and)h(syntax)365 4773 y FA(\(rx)43 b FC(sr)o(e)21 +b(.)12 b(.)g(.)g FA(\))87 b Fw(\000)-14 b(!)87 b FC(r)o(egexp)1652 +b FD(Syntax)573 4898 y(This)21 b(allows)h(you)f(to)g(describe)f(a)g(r)o +(egexp)g(value)g(with)h(SRE)g(notation.)1735 5147 y(129)p +eop +%%Page: 130 138 +130 137 bop 681 614 a FA(\(regexp?)40 b FC(x)p FA(\))86 +b Fw(\000)-14 b(!)87 b FC(boolean)1454 b FD(pr)o(ocedur)o(e)888 +757 y(Returns)22 b(tr)o(ue)f(if)f(the)h(value)f(is)h(a)g(r)o(egular)e +(expr)o(ession.)681 951 y FA(\(regexp-search)38 b FC(r)o(e)20 +b(string)h([start)f(\003ags])p FA(\))87 b Fw(\000)-15 +b(!)88 b FC(match-data)17 b(or)k(false)155 b FD(pr)o(ocedur)o(e)681 +1051 y FA(\(regexp-search?)37 b FC(r)o(e)21 b(string)g([start)f +(\003ags])p FA(\))86 b Fw(\000)-14 b(!)87 b FC(boolean)494 +b FD(pr)o(ocedur)o(e)888 1193 y(Sear)o(ch)23 b FC(string)h +FD(starting)h(at)e(position)j FC(start)p FD(,)f(looking)g(for)f(a)g +(match)g(for)g(r)o(egexp)f FC(r)o(e)p FD(.)888 1293 y(If)d(a)f(match)h +(is)g(found,)f(r)o(eturn)g(a)g(match)h(str)o(uctur)o(e)f(describing)h +(the)g(match,)g(other)o(-)888 1393 y(wise)h FA(#f)p FD(.)k +FC(Start)20 b FD(defaults)g(to)i(0.)888 1527 y FC(Flags)c +FD(is)h(the)f(bitwise-or)h(of)f FA(regexp/bos-not-bo)o(l)12 +b FD(and)18 b FA(regexp/eos-not-e)o(ol)o FD(.)888 1626 +y FA(regexp/bos-not-bo)o(l)11 b FD(means)18 b(the)g(beginning)g(of)g +(the)f(string)i(isn't)f(a)f(line-begin.)888 1726 y FA +(regexp/eos-not-eo)o(l)h FD(is)24 b(analogous.)35 b Fw(f)p +FD(Note)23 b(They'r)o(e)g(curr)o(ently)g(ignor)o(ed)h(be-)888 +1826 y(cause)g(begining/end-of-line)i(anchors)f(ar)o(en't)f(supported)g +(by)h(the)g(curr)o(ent)f(im-)888 1925 y(plementation.)p +Fw(g)888 2059 y FD(Use)j FA(regexp-search?)21 b FD(when)27 +b(you)g(don't)g(need)g(submatch)g(information,)h(as)f(it)888 +2159 y(has)d(the)f(potential)h(to)g(be)f FC(signi\002cantly)g +FD(faster)f(on)i(submatch-containing)h(r)o(egex-)888 +2259 y(ps.)888 2393 y(Ther)o(e)c(is)h(no)g(longer)g(a)g(separate)e(r)o +(egexp)g(\223compilation\224)i(function;)g(r)o(egexp)f(val-)888 +2492 y(ues)h(ar)o(e)e(compiled)i(for)f(the)h(C)f(engine)h(on)g(demand,) +f(and)g(the)h(r)o(esulting)g(C)f(str)o(uc-)888 2592 y(tur)o(es)f(ar)o +(e)g(cached)g(in)h(the)g(r)o(egexp)e(str)o(uctur)o(e)i(after)e(the)i +(\002rst)g(use.)681 2787 y FA(\(match:start)38 b FC(m)21 +b([i])p FA(\))86 b Fw(\000)-14 b(!)87 b FC(integer)21 +b(or)g(false)914 b FD(pr)o(ocedur)o(e)681 2886 y FA(\(match:end)60 +b FC(m)20 b([i])p FA(\))86 b Fw(\000)-14 b(!)87 b FC(integer)21 +b(or)g(false)981 b FD(pr)o(ocedur)o(e)681 2986 y FA(\(match:substring) +37 b FC(m)20 b([i])p FA(\))86 b Fw(\000)-14 b(!)87 b +FC(string)21 b(or)g(false)772 b FD(pr)o(ocedur)o(e)888 +3128 y FA(match:start)40 b FD(r)o(eturns)j(the)h(start)f(position)j(of) +d(the)h(submatch)g(denoted)g(by)888 3228 y FC(match-number)o +FD(.)25 b(The)20 b(whole)g(r)o(egexp)f(is)g(0;)h(positive)g(integers)f +(index)h(submatches)888 3328 y(in)i(the)e(r)o(egexp,)g(counting)i +(left-to-right.)j FC(Match-number)c FD(defaults)e(to)j(0.)888 +3462 y(If)43 b(the)g(r)o(egular)e(expr)o(ession)i(matches)g(as)f(a)h +(whole,)48 b(but)43 b(a)g(particular)e(sub-)888 3561 +y(expr)o(ession)21 b(does)g(not)g(match,)g(then)g FA(match:start)16 +b FD(r)o(eturns)k FA(#f)p FD(.)888 3695 y FA(match:end)28 +b FD(is)j(analogous)g(to)h FA(match:start)p FD(,)c(r)o(eturning)j(the)g +(end)g(position)h(of)888 3795 y(the)21 b(indexed)f(submatch.)888 +3929 y FA(match:substring)i FD(r)o(eturns)28 b(the)h(substring)g +(matched)f(r)o(egexp's)f(submatch.)48 b(If)888 4029 y(ther)o(e)20 +b(was)h(no)g(match)g(for)g(the)g(indexed)f(submatch,)g(it)h(r)o(eturns) +g(false.)681 4223 y FA(\(regexp-substitu)o(te)37 b FC(port-or-false)20 +b(match)f(.)i(items)p FA(\))86 b Fw(\000)-14 b(!)87 b +FC(object)240 b FD(pr)o(ocedur)o(e)888 4366 y(This)37 +b(pr)o(ocedur)o(e)e(can)h(be)h(used)f(to)h(perform)f(string)h +(substitutions)i(based)c(on)888 4465 y(r)o(egular)o(-expr)o(ession)21 +b(matches.)32 b(The)23 b(r)o(esults)g(of)g(the)g(substitution)i(can)d +(be)h(either)888 4565 y(output)f(to)f(a)f(port)h(or)g(r)o(eturned)e(as) +i(a)f(string.)888 4699 y(The)g FC(match)e FD(ar)o(gument)h(is)h(a)g(r)o +(egular)o(-expr)o(ession)d(match)j(str)o(uctur)o(e)f(that)g(contr)o +(ols)888 4799 y(the)k(substitution.)33 b(If)22 b FC(port)g +FD(is)h(an)g(output)g(port,)g(the)g FC(items)f FD(ar)o(e)g(written)h +(out)g(to)g(the)888 4898 y(port:)2051 5147 y(130)p eop +%%Page: 131 139 +131 138 bop 672 614 a Fw(\017)42 b FD(If)20 b(an)g(item)i(is)f(a)f +(string,)h(it)g(is)g(copied)g(dir)o(ectly)f(to)h(the)g(port.)672 +832 y Fw(\017)42 b FD(If)26 b(an)g(item)h(is)g(an)f(integer)-6 +b(,)28 b(the)f(corr)o(esponding)f(submatch)h(fr)o(om)f +FC(match)f FD(is)756 931 y(written)c(to)g(the)g(port.)672 +1149 y Fw(\017)42 b FD(If)16 b(an)g(item)h(is)f FA('pre)p +FD(,)g(the)g(pr)o(e\002x)g(of)g(the)h(matched)f(string)h(\(the)f(text)h +(pr)o(eceding)756 1248 y(the)j(match\))h(is)g(written)g(to)g(the)g +(port.)672 1466 y Fw(\017)42 b FD(If)20 b(an)g(item)i(is)f +FA('post)p FD(,)d(the)j(suf)o(\002x)f(of)h(the)g(matched)f(string)i(is) +f(written.)573 1801 y(If)j FC(port)f FD(is)h FA(#f)p +FD(,)g(nothing)i(is)e(written,)h(and)f(a)g(string)g(is)h(constr)o +(ucted)f(and)g(r)o(eturned)573 1900 y(instead.)365 2345 +y FA(\(regexp-substitut)o(e/)o(glo)o(ba)o(l)38 b FC(port-or-false)15 +b(r)o(e)h(str)g(.)f(items)p FA(\))43 b Fw(\000)-14 b(!)44 +b FC(object)87 b FD(pr)o(ocedur)o(e)573 2570 y(This)22 +b(pr)o(ocedur)o(e)e(is)j(similar)f(to)g FA(regexp-substitute)o +FD(,)16 b(but)22 b(can)g(be)g(used)g(to)g(per)o(-)573 +2670 y(form)j(r)o(epeated)f(match/substitute)i(operations)g(over)f(a)g +(string.)40 b(It)26 b(has)f(the)h(fol-)573 2770 y(lowing)c(dif)o(fer)o +(ences)c(with)k FA(regexp-substitut)o(e)p FD(:)672 3105 +y Fw(\017)42 b FD(It)17 b(takes)g(a)f(r)o(egular)g(expr)o(ession)h(and) +g(string)h(to)g(be)f(matched)f(as)h(parameters,)756 3204 +y(instead)j(of)h(a)f(completed)h(match)f(str)o(uctur)o(e.)672 +3421 y Fw(\017)42 b FD(If)22 b(the)h(r)o(egular)f(expr)o(ession)h +(doesn't)g(match)g(the)g(string,)h(this)g(pr)o(ocedur)o(e)d(is)756 +3521 y(the)f(identity)i(transform\227it)f(r)o(eturns)f(or)h(outputs)g +(the)g(string.)672 3738 y Fw(\017)42 b FD(If)24 b(an)i(item)f(is)h +FA('post)p FD(,)e(the)i(pr)o(ocedur)o(e)d(r)o(ecurses)h(on)i(the)g(suf) +o(\002x)f(string)h(\(the)756 3838 y(text)f(fr)o(om)g +FC(string)h FD(following)h(the)f(match\).)40 b(Including)26 +b(a)f FA('post)f FD(in)i(the)g(list)756 3938 y(of)20 +b(items)h(is)h(how)f(one)g(gets)g(multiple)h(match/substitution)g +(operations.)672 4155 y Fw(\017)42 b FD(If)27 b(an)g(item)h(is)f(a)g +(pr)o(ocedur)o(e,)g(it)h(is)g(applied)e(to)i(the)f(match)h(str)o(uctur) +o(e)f(for)g(a)756 4255 y(given)19 b(match.)25 b(The)19 +b(pr)o(ocedur)o(e)f(r)o(eturns)h(a)f(string)i(to)g(be)f(used)g(in)h +(the)f(r)o(esult.)573 4590 y(The)30 b FC(r)o(egexp)f +FD(parameter)g(can)h(be)g(either)g(a)f(compiled)i(r)o(egular)e(expr)o +(ession)h(or)g(a)573 4689 y(string)21 b(specifying)g(a)g(r)o(egular)e +(expr)o(ession.)573 4898 y(Some)i(examples:)1735 5147 +y(131)p eop +%%Page: 132 140 +132 139 bop 888 614 a Fj(;;;)40 b(Replace)h(occurrences)h(of)d +("Cotton")j(with)e("Jin".)888 706 y(\(regexp-substitute/global)45 +b(#f)40 b(\(rx)g("Cotton"\))h(s)1908 797 y('pre)f("Jin")h('post\))888 +980 y(;;;)f(mm/dd/yy)h(->)f(dd/mm/yy)h(date)f(conversion.)888 +1071 y(\(regexp-substitute/global)45 b(#f)40 b(\(rx)g(\(submatch)h(\(+) +f(digit\)\))h("/")f(;)f(1)g(=)h(M)2183 1162 y(\(submatch)h(\(+)f +(digit\)\))h("/")f(;)f(2)g(=)h(D)2183 1254 y(\(submatch)h(\(+)f +(digit\)\)\))159 b(;)39 b(3)g(=)h(Y)1908 1345 y(s)g(;)f(Source)i +(string)1908 1436 y('pre)f(2)g("/")g(1)f("/")h(3)g('post\))888 +1619 y(;;;)g("9/29/61")i(->)d("Sep)h(29,)g(1961")h(date)f(conversion.) +888 1710 y(\(regexp-substitute/global)45 b(#f)40 b(\(rx)g(\(submatch)h +(\(+)f(digit\)\))h("/")f(;)f(1)g(=)h(M)2183 1802 y(\(submatch)h(\(+)f +(digit\)\))h("/")f(;)f(2)g(=)h(D)2183 1893 y(\(submatch)h(\(+)f +(digit\)\)\))159 b(;)39 b(3)g(=)h(Y)1908 1984 y(s)g(;)f(Source)i +(string)1124 2076 y('pre)1124 2167 y(;;)e(Sleazy)i(converter)g(--)f +(ignores)h("year)f(2000")g(issue,)1124 2258 y(;;)f(and)h(blows)h(up)e +(if)h(month)g(is)g(out)g(of)g(range.)1124 2350 y(\(lambda)h(\(m\))1202 +2441 y(\(let)f(\(\(mon)h(\(vector-ref)g('#\("Jan")g("Feb")g("Mar")f +("Apr")h("May")f("Jun")2222 2532 y("Jul")g("Aug")h("Sep")f("Oct")h +("Nov")f("Dec"\))2104 2623 y(\(-)g(\(string->number)j +(\(match:substring)g(m)c(1\)\))h(1\)\)\))1438 2715 y(\(day)g +(\(match:substring)j(m)c(2\)\))1438 2806 y(\(year)h(\(match:substring)j +(m)c(3\)\)\))1281 2897 y(\(string-append)j(mon)e(")f(")h(day)g(",)f +(19")h(year\)\)\))1124 2989 y('post\))888 3171 y(;;;)g(Remove)h +(potentially)h(offensive)f(substrings)g(from)f(string)h(S.)888 +3263 y(\(define)g(\(kill-matches)h(re)e(s\))967 3354 +y(\(regexp-substitute/global)45 b(#f)39 b(s)h('pre)g('post\)\))888 +3537 y(\(kill-matches)j(\(rx)c(\(|)h("Windows")h("tcl")g("Intel"\)\))g +(s\))118 b(;)40 b(Protect)g(the)g(children.)681 3842 +y FA(\(regexp-fold)e FC(r)o(e)21 b(kons)g(knil)g(s)g([\002nish)f +(start])p FA(\))87 b Fw(\000)-15 b(!)88 b FC(object)499 +b FD(pr)o(ocedur)o(e)888 3973 y(The)42 b(following)i(de\002nition)f(is) +f(a)f(bit)h(unwieldy)-9 b(,)48 b(but)42 b(the)g(intuition)h(is)g(sim-) +888 4073 y(ple:)51 b(this)35 b(pr)o(ocedur)o(e)c(uses)j(the)g(r)o +(egexp)e FC(r)o(e)i FD(to)g(divide)f(up)h(string)g FC(s)g +FD(into)g(non-)888 4172 y(matching/matching)26 b(chunks,)f(and)f(then)g +(\223folds\224)f(the)h(pr)o(ocedur)o(e)e FC(kons)i FD(acr)o(oss)888 +4272 y(this)35 b(sequence)g(of)f(chunks.)67 b(It)35 b(is)f(useful)g +(when)h(you)g(wish)g(to)g(operate)f(on)h(a)888 4372 y(string)21 +b(in)g(sub-units)g(de\002ned)f(by)h(some)g(r)o(egular)e(expr)o(ession,) +h(as)g(ar)o(e)f(the)i(r)o(elated)888 4471 y FA(regexp-fold-right)14 +b FD(and)20 b FA(regexp-for-each)15 b FD(pr)o(ocedur)o(es.)888 +4599 y(Sear)o(ch)k(fr)o(om)h FC(start)g FD(\(defaulting)g(to)g(0\))g +(for)g(a)g(match)g(to)h FC(r)o(e)p FD(;)f(call)g(this)h(match)g +FC(m)o FD(.)k(Let)888 4699 y FC(i)e FD(be)f(the)h(index)f(of)h(the)g +(end)f(of)h(the)f(match)h(\(that)f(is,)h FA(\(match:end)40 +b FC(m)j FA(0\)\))p FD(.)30 b(Loop)888 4799 y(as)21 b(follows:)1071 +4898 y FA(\(regexp-fold)39 b FC(r)o(e)k(kons)h FA(\()p +FC(kons)f(start)h(m)f(knil)p FA(\))g FC(s)h(\002nish)g(i)p +FA(\))2051 5147 y FD(132)p eop +%%Page: 133 141 +133 140 bop 573 614 a FD(If)20 b(ther)o(e)g(is)h(no)h(match,)e(r)o +(eturn)g(instead)756 714 y FA(\()p FC(\002nish)43 b(start)g(knil)p +FA(\))573 814 y FC(Finish)21 b FD(defaults)f(to)h FA(\(lambda)41 +b(\(i)h(knil\))g(knil\))p FD(.)573 943 y(In)80 b(other)g(wor)o(ds,)94 +b(we)80 b(divide)f(up)g FC(s)h FD(into)h(a)e(sequence)h(of)g(non-)573 +1043 y(matching/matching)22 b(chunks:)1148 1210 y FC(NM)1291 +1222 y Fx(1)1351 1210 y FC(M)1429 1222 y Fx(1)1490 1210 +y FC(NM)1633 1222 y Fx(1)1693 1210 y FC(M)1771 1222 y +Fx(2)1832 1210 y Fo(:)14 b(:)g(:)23 b FC(NM)2095 1222 +y Fp(k)q Fm(\000)p Fx(1)2244 1210 y FC(M)2322 1222 y +Fp(k)q Fm(\000)p Fx(1)2471 1210 y FC(NM)2614 1222 y Fp(k)573 +1377 y FD(wher)o(e)31 b FC(NM)976 1389 y Fx(1)1045 1377 +y FD(is)h(the)g(initial)g(part)f(of)g FC(s)h FD(that)g(isn't)h(matched) +e(by)g(the)h(r)o(egexp)f FC(r)o(e)p FD(,)573 1477 y FC(M)651 +1489 y Fx(1)715 1477 y FD(is)26 b(the)g(\002rst)h(match,)g +FC(NM)1531 1489 y Fx(2)1595 1477 y FD(is)f(the)g(following)i(part)e(of) +g FC(s)g FD(that)g(isn't)h(matched,)573 1576 y FC(M)651 +1588 y Fx(2)719 1576 y FD(is)k(the)g(second)g(match,)i(and)d(so)h +(forth\227)p FC(NM)2212 1588 y Fp(k)2284 1576 y FD(is)g(the)f(\002nal)h +(non-matching)573 1676 y(chunk)e(of)f FC(s)q FD(.)48 +b(W)-8 b(e)29 b(apply)f FC(kons)g FD(fr)o(om)g(left)g(to)h(right)g(to)g +(build)f(up)h(a)e(r)o(esult,)j(pass-)573 1776 y(ing)f(it)f(one)g +(non-matching/matching)j(chunk)d(each)g(time:)40 b(on)29 +b(an)f(application)573 1875 y FA(\()p FC(kons)43 b(i)h(m)f(knil)p +FA(\))p FD(,)29 b(the)g(non-matching)g(chunk)g(goes)f(fr)o(om)g +FC(i)g FD(to)h FA(\(match:begin)573 1975 y FC(m)43 b +FA(0\))p FD(,)18 b(and)g(the)h(following)h(matching)f(chunk)g(goes)g +(fr)o(om)g FA(\(match:begin)38 b FC(m)43 b FA(0\))573 +2075 y FD(to)19 b FA(\(match:end)40 b FC(m)j FA(0\))p +FD(.)24 b(The)19 b(last)g(non-matching)h(chunk)g FC(NM)2616 +2087 y Fp(k)2676 2075 y FD(is)f(pr)o(ocessed)f(by)573 +2174 y FC(k)p FD(.)25 b(So)c(the)g(computation)g(we)g(perform)f(is)916 +2300 y FA(\()p FC(\002nal)43 b(Q)g FA(\()p FC(kons)h(j)1524 +2327 y Fp(k)1608 2300 y FC(M)1686 2312 y Fp(k)1771 2300 +y FA(...)e(\()p FC(kons)i(J)2212 2321 y Fx(1)2293 2300 +y FC(M)2371 2312 y Fx(1)2452 2300 y FC(knil)p FA(\))g(...\)\))573 +2434 y FD(wher)o(e)23 b FC(J)853 2455 y Fp(i)904 2434 +y FD(is)h(the)g(index)f(of)h(the)g(start)f(of)h FC(NM)2018 +2446 y Fp(i)2045 2434 y FD(,)h FC(M)2169 2446 y Fp(i)2220 +2434 y FD(is)f(a)g(match)f(value)h(describing)573 2533 +y FC(M)651 2545 y Fp(i)679 2533 y FD(,)c(and)h FC(Q)f +FD(is)h(the)g(index)g(of)f(the)h(beginning)h(of)f FC(NM)2268 +2545 y Fp(k)2309 2533 y FD(.)573 2663 y(Hint:)55 b(The)35 +b FA(let-match)c FD(macr)o(o)k(is)g(fr)o(equently)g(useful)g(for)g +(operating)h(on)f(the)573 2763 y(match)21 b(value)f FC(M)h +FD(passed)f(to)h(the)g FC(kons)g FD(function.)365 2944 +y FA(\(regexp-fold-righ)o(t)37 b FC(r)o(e)21 b(kons)g(knil)g(s)g +([\002nish)f(start])p FA(\))87 b Fw(\000)-15 b(!)88 b +FC(object)238 b FD(pr)o(ocedur)o(e)573 3079 y(The)21 +b(right-to-left)f(variant)g(of)h FA(regexp-fold)p FD(.)573 +3209 y(This)e(pr)o(ocedur)o(e)e(r)o(epeatedly)g(matches)i(r)o(egexp)f +FC(r)o(e)h FD(acr)o(oss)g(string)g FC(s)p FD(.)25 b(This)20 +b(divides)573 3308 y FC(s)h FD(up)g(into)g(a)g(sequence)f(of)h +(matching/non-matching)i(chunks:)1148 3476 y FC(NM)1291 +3488 y Fx(1)1351 3476 y FC(M)1429 3488 y Fx(1)1490 3476 +y FC(NM)1633 3488 y Fx(1)1693 3476 y FC(M)1771 3488 y +Fx(2)1832 3476 y Fo(:)14 b(:)g(:)23 b FC(NM)2095 3488 +y Fp(k)q Fm(\000)p Fx(1)2244 3476 y FC(M)2322 3488 y +Fp(k)q Fm(\000)p Fx(1)2471 3476 y FC(NM)2614 3488 y Fp(k)573 +3643 y FD(wher)o(e)e FC(NM)966 3655 y Fx(1)1025 3643 +y FD(is)h(the)g(initial)h(part)e(of)h FC(s)g FD(that)f(isn't)i(matched) +f(by)f(the)h(r)o(egexp)f FC(r)o(e)p FD(,)h FC(M)3192 +3655 y Fx(1)573 3742 y FD(is)k(the)h(\002rst)f(match,)h +FC(NM)1389 3754 y Fx(2)1452 3742 y FD(is)g(the)f(following)i(part)d(of) +h FC(s)g FD(that)g(isn't)h(matched,)g FC(M)3192 3754 +y Fx(2)573 3842 y FD(is)21 b(the)f(second)h(match,)f(and)g(so)h +(forth\227)p FC(NM)2003 3854 y Fp(k)2064 3842 y FD(is)g(the)f(\002nal)h +(non-matching)h(chunk)573 3941 y(of)i FC(s)p FD(.)37 +b(W)-8 b(e)24 b(apply)g FC(kons)h FD(fr)o(om)f(right)g(to)h(left)f(to)h +(build)f(up)g(a)g(r)o(esult,)h(passing)g(it)f(one)573 +4041 y(non-matching/matching)f(chunk)e(each)g(time:)916 +4167 y FA(\()p FC(\002nal)43 b(Q)g FA(\()p FC(kons)h(M)1579 +4179 y Fx(1)1660 4167 y FC(j)1683 4194 y Fx(1)1764 4167 +y FA(...)e(\()p FC(kons)h(M)2256 4179 y Fp(k)2340 4167 +y FC(J)2368 4188 y Fp(k)2452 4167 y FC(knil)p FA(\))h(...\)\))573 +4301 y FD(wher)o(e)24 b(MTCHi)h(is)g(a)f(match)h(value)g(describing)g +(Mi,)g(Ji)g(is)g(the)g(index)g(of)g(the)g(end)573 4400 +y(of)i(NMi)g(\(or)-6 b(,)29 b(equivalently)-9 b(,)29 +b(the)e(beginning)i(of)e(Mi+1\),)h(and)f(Q)g(is)h(the)f(index)h(of)573 +4500 y(the)22 b(beginning)i(of)e(M1.)30 b(In)22 b(other)h(wor)o(ds,)f +(KONS)h(is)f(passed)g(a)g(match,)h(an)f(index)573 4599 +y(describing)j(the)g(following)h(non-matching)h(text,)e(and)f(the)i +(value)e(pr)o(oduced)f(by)573 4699 y(folding)17 b(the)f(following)i +(text.)24 b(The)16 b(FINAL)g(function)h(\224polishes)g(of)o(f\224)e +(the)h(fold)h(op-)573 4799 y(eration)h(by)h(handling)g(the)g(initial)g +(chunk)g(of)f(non-matching)i(text)e(\(NM0,)g(above\).)573 +4898 y(FINISH)i(defaults)g(to)h(\(lambda)f(\(i)h(knil\))g(knil\))1735 +5147 y(133)p eop +%%Page: 134 142 +134 141 bop 888 614 a FD(Example:)25 b(T)-8 b(o)21 b(pick)g(out)g(all)g +(the)g(matches)g(to)g FC(r)o(e)g FD(in)g FC(s)p FD(,)g(say)1071 +792 y FA(\(regexp-fold-rig)o(ht)37 b(re)1899 891 y(\()p +Fo(\025)i FA(\(m)k(i)g(lis\))1986 991 y(\(cons)f(\(match:substring)37 +b(m)43 b(0\))g(lis\)\))2248 1091 y('\(\))f(s\))888 1268 +y FD(Hint:)55 b(The)35 b FA(let-match)d FD(macr)o(o)i(is)i(fr)o +(equently)f(useful)g(for)g(operating)g(on)h(the)888 1368 +y(match)21 b(value)f FC(m)h FD(passed)f(to)h(the)g FA(kons)e +FD(function.)681 1576 y FA(\(regexp-for-each)37 b FC(r)o(e)21 +b(pr)o(oc)e(s)i([start])p FA(\))86 b Fw(\000)-14 b(!)87 +b FC(unde\002ned)554 b FD(pr)o(ocedur)o(e)888 1723 y(Repeatedly)28 +b(match)g(r)o(egexp)f FC(r)o(e)h FD(against)g(string)g +FC(s)q FD(.)47 b(Apply)28 b FC(pr)o(oc)f FD(to)h(each)g(match)888 +1822 y(that)21 b(is)g(pr)o(oduced.)j(Matches)c(do)h(not)h(overlap.)888 +1961 y(Hint:)55 b(The)35 b FA(let-match)d FD(macr)o(o)i(is)i(fr)o +(equently)f(useful)g(for)g(operating)g(on)h(the)888 2061 +y(match)21 b(value)f FC(m)h FD(passed)f(to)h(varpr)o(oc.)681 +2269 y FA(\(let-match)39 b FC(match-exp)18 b(mvars)j(body)f(.)12 +b(.)g(.)g FA(\))87 b Fw(\000)-14 b(!)87 b FC(object)717 +b FD(Syntax)681 2368 y FA(\(if-match)40 b FC(match-exp)18 +b(mvars)i(on-match)f(no-match)p FA(\))85 b Fw(\000)-15 +b(!)88 b FC(object)388 b FD(Syntax)888 2515 y FC(Mvars)26 +b FD(is)f(a)f(list)i(of)f(vars)f(that)h(is)g(bound)h(to)f(the)g(match)g +(and)g(submatches)g(of)g(the)888 2615 y(string;)d FA(#F)d +FD(is)j(allowed)e(as)h(a)f(don't-car)o(e)f(element.)26 +b(For)21 b(example,)1071 2792 y FA(\(let-match)39 b(\(regexp-search)f +(date)k(s\))h(\(whole-date)c(month)i(day)i(year\))1158 +2892 y(...)g FC(body)f FA(...\))888 3070 y FD(matches)f(the)f(r)o +(egexp)f(against)h(string)h FA(s)p FD(,)j(then)d(evaluates)e(the)h +(body)h(of)f(the)888 3169 y FA(let-match)18 b FD(in)23 +b(a)e(scope)h(wher)o(e)f FA(whole-date)d FD(is)k(bound)g(to)g(the)g +(matched)g(string,)888 3269 y(and)29 b FA(month)p FD(,)h +FA(day)e FD(and)h FA(year)f FD(ar)o(e)g(bound)i(to)g(the)g(\002rst,)h +(second)f(and)f(thir)o(d)g(sub-)888 3368 y(matches.)888 +3507 y FA(if-match)16 b FD(is)j(similar)-6 b(,)19 b(but)g(if)g(the)g +(match)g(expr)o(ession)g(is)g(false,)g(then)g(the)g FC(no-match)888 +3607 y FD(expr)o(ession)i(is)g(evaluated;)e(this)i(would)h(be)e(an)h +(err)o(or)e(in)j FA(let-match)p FD(.)681 3815 y FA(\(match-cond)39 +b FC(clause)21 b(.)12 b(.)g(.)g FA(\))87 b Fw(\000)-14 +b(!)87 b FC(object)1224 b FD(Syntax)888 3962 y(This)34 +b(macr)o(o)f(allows)h(one)g(to)g(conditionally)h(attempt)e(a)g +(sequence)h(of)g(pattern)888 4061 y(matches,)j(interspersed)c(with)h +(other)-6 b(,)37 b(general)c(conditional)i(tests.)64 +b(Ther)o(e)32 b(ar)o(e)888 4161 y(four)c(kinds)f(of)h +FA(match-cond)23 b FD(clause,)28 b(one)g(intr)o(oducing)g(a)f(pattern)g +(match,)h(and)888 4260 y(the)h(other)g(thr)o(ee)f(simply)i(being)f(r)o +(egular)f FA(cond)p FD(-style)f(clauses,)j(marked)e(by)h(the)888 +4360 y FA(test)19 b FD(and)i FA(else)e FD(keywor)o(ds:)1071 +4538 y FA(\(match-cond)39 b(\()p FC(match-exp)i(match-vars)g(body)i +FA(...\))f(;)h(As)g(in)g(if-match)1594 4637 y(\(test)f +FC(exp)g(body)h FA(...\))478 b(;)43 b(As)g(in)g(cond)1594 +4737 y(\(test)f FC(exp)g FA(=>)h FC(pr)o(oc)o FA(\))523 +b(;)43 b(As)g(in)f(cond)1594 4836 y(\(else)g FC(body)g +FA(...\)\))609 b(;)43 b(As)g(in)f(cond)2051 5147 y FD(134)p +eop +%%Page: 135 143 +135 142 bop 365 614 a FA(\(flush-submatches)37 b FC(r)o(e)p +FA(\))87 b Fw(\000)-15 b(!)88 b FC(r)o(e)1227 b FD(pr)o(ocedur)o(e)365 +714 y FA(\(uncase)41 b FC(r)o(e)p FA(\))87 b Fw(\000)-14 +b(!)87 b FC(r)o(e)1663 b FD(pr)o(ocedur)o(e)365 814 y +FA(\(simplify-regexp)37 b FC(r)o(e)p FA(\))87 b Fw(\000)-14 +b(!)87 b FC(r)o(e)1271 b FD(pr)o(ocedur)o(e)365 913 y +FA(\(uncase-char-set)37 b FC(cset)p FA(\))87 b Fw(\000)-14 +b(!)87 b FC(r)o(e)1208 b FD(pr)o(ocedur)o(e)365 1013 +y FA(\(uncase-string)38 b FC(str)p FA(\))87 b Fw(\000)-14 +b(!)87 b FC(r)o(e)1329 b FD(pr)o(ocedur)o(e)573 1148 +y(These)71 b(functions)h(map)f(r)o(egexps)g(and)f(char)h(sets)h(to)f +(other)h(r)o(egexps.)573 1248 y FA(flush-submatches)20 +b FD(r)o(eturns)27 b(a)f(r)o(egexp)g(which)i(matches)f(exactly)f(what)i +(its)f(ar)o(-)573 1347 y(gument)21 b(matches,)g(but)g(contains)g(no)h +(submatches.)573 1477 y FA(uncase)h FD(r)o(eturns)j(a)g(r)o(egexp)f +(that)h(matches)g(any)g(case-permutation)f(of)h(its)h(ar)o(gu-)573 +1577 y(ment)21 b(r)o(egexp.)573 1707 y FA(simplify-regexp)14 +b FD(applies)20 b(the)h(simpli\002er)g(to)g(its)h(ar)o(gument.)i(This)e +(is)f(done)f(au-)573 1807 y(tomatically)e(when)h(compiling)h(r)o +(egular)d(expr)o(essions,)h(so)h(this)g(is)f(only)i(useful)e(for)573 +1906 y(pr)o(ogrammers)e(that)h(ar)o(e)e(dir)o(ectly)h(examining)i(the)f +(ADT)f(value)h(with)g(lower)o(-level)573 2006 y(accessors.)573 +2136 y FA(uncase-char-set)59 b FD(maps)64 b(a)h(char)f(set)h(to)h(a)e +(r)o(egular)g(expr)o(ession)h(that)573 2235 y(matches)45 +b(any)h(character)e(fr)o(om)h(that)g(set,)51 b(r)o(egar)o(dless)44 +b(of)h(case.)99 b(Similarly)-9 b(,)573 2335 y FA(uncase-string)24 +b FD(r)o(eturns)30 b(a)f(r)o(egexp)g(that)h(matches)g(any)f +(case-permutation)h(of)573 2435 y(the)g(string.)54 b(For)30 +b(example,)h FA(\(uncase-string)38 b("Knight"\))26 b +FD(r)o(eturns)k(the)g(same)573 2534 y(value)23 b(that)h +FA(\(rx)43 b(\("kK"\))e(\("nN"\))g(\("iI"\))g(\("gG"\))g(\("hH"\))g +(\("tT"\)\))22 b FD(or)i FA(\(rx)573 2634 y(\(w/nocase)40 +b("Knight"\)\))p FD(.)365 2816 y FA(\(sre->regexp)f FC(sr)o(e)p +FA(\))87 b Fw(\000)-14 b(!)87 b FC(r)o(e)1413 b FD(pr)o(ocedur)o(e)365 +2916 y FA(\(regexp->sre)39 b FC(r)o(e)p FA(\))87 b Fw(\000)-14 +b(!)87 b FC(sr)o(e)1413 b FD(pr)o(ocedur)o(e)573 3051 +y(These)28 b(ar)o(e)f(the)h(SRE)g(parser)f(and)g(unparser)-6 +b(.)47 b(That)28 b(is,)i FA(sre->regexp)24 b FD(maps)k(an)573 +3151 y(SRE)33 b(to)g(a)f(r)o(egexp)g(value,)j(and)e FA(regexp->sre)28 +b FD(does)33 b(the)g(inverse.)62 b(The)33 b(latter)573 +3250 y(function)21 b(can)g(be)f(useful)h(for)f(printing)i(out)f(r)o +(egexps)f(in)h(a)f(r)o(eadable)f(format.)573 3394 y FA(\(sre->regexp)38 +b('\(:)43 b("Olin)e(")j(\(?)e("G.)h("\))f("Shivers"\)\))d +Fn(=)-14 b Fw(\))87 b FC(r)o(egexp)573 3494 y FA(\(define)41 +b(re)h(\(re-seq)f(\(re-string)e("Pete)j("\))1401 3593 +y(\(re-repeat)d(1)44 b(#f)e(\(re-string)e("Sz"\)\))1401 +3693 y(\(re-string)f("ilagyi"\)\)\))573 3792 y(\(regexp->sre)f +(\(re-repeat)i(0)j(1)g(re\)\))747 3892 y Fn(=)-14 b Fw(\))87 +b FA('\(?)42 b("Pete")g(\(+)g("Sz"\))g("ilagyi"\))365 +4135 y(\(posix-string->re)o(ge)o(xp)37 b FC(string)p +FA(\))87 b Fw(\000)-14 b(!)87 b FC(r)o(e)913 b FD(pr)o(ocedur)o(e)365 +4235 y FA(\(regexp->posix-st)o(ri)o(ng)37 b FC(r)o(e)p +FA(\))87 b Fw(\000)-14 b(!)87 b FC(string)913 b FD(pr)o(ocedur)o(e)573 +4370 y(These)23 b(two)g(functions)h(ar)o(e)d(the)i(Posix)h(notation)g +(parser)e(and)g(unparser)-6 b(.)31 b(That)22 b(is,)573 +4469 y FA(posix-string->re)o(ge)o(xp)e FD(maps)27 b(a)f(Posix-notation) +j(r)o(egular)c(expr)o(ession,)j(such)573 4569 y(as)16 +b FA("g\(ee|oo\)se")p FD(,)c(to)17 b(a)f(r)o(egexp)g(value,)g(and)g +FA(regexp->posix-str)o(ing)10 b FD(does)16 b(the)573 +4669 y(inverse.)573 4799 y(Y)-8 b(ou)28 b(can)e(use)h(these)f(tools)i +(to)f(map)f(between)h(scsh)g(r)o(egexps)e(and)i(Posix)g(r)o(egexp)573 +4898 y(strings,)22 b(which)f(can)g(be)g(useful)g(if)g(you)g(want)g(to)h +(do)f(conversion)h(between)f(SRE's)1735 5147 y(135)p +eop +%%Page: 136 144 +136 143 bop 888 614 a FD(and)24 b(Posix)g(form.)34 b(For)24 +b(example,)f(you)h(can)g(write)f(a)h(particularly)e(complex)i(r)o(eg-) +888 714 y(exp)c(in)g(SRE)g(form,)f(or)h(compute)g(it)g(using)h(the)f +(ADT)g(constr)o(uctors,)h(then)f(convert)888 814 y(to)f(Posix)f(form,)g +(print)g(it)g(out,)h(cut)f(and)f(paste)h(it)g(into)g(a)g(C)f(or)h +(emacs)g(lisp)g(pr)o(ogram.)888 913 y(Or)k(you)g(can)f(import)g(an)h +(old)f(r)o(egexp)f(fr)o(om)h(some)h(other)g(pr)o(ogram,)e(parse)h(it)g +(into)888 1013 y(an)h(ADT)g(value,)f(r)o(ender)g(it)h(to)h(an)f(SRE,)f +(print)i(it)f(out,)g(then)h(cut)f(and)f(paste)h(it)g(into)888 +1112 y(a)f(scsh)g(pr)o(ogram.)888 1244 y(Note:)988 1408 +y Fw(\017)41 b FD(The)17 b(string)h(parser)f(doesn't)g(handle)g(the)h +(exotica)f(of)g(character)f(class)h(names)1071 1508 y(such)23 +b(as)e FA([[:alnum:]])p FD(;)d(the)23 b(curr)o(ent)e(implementation)i +(was)f(written)h(in)g(in)1071 1607 y(thr)o(ee)d(hours.)988 +1738 y Fw(\017)41 b FD(The)32 b(unparser)f(pr)o(oduces)h(Spencer)o +(-speci\002c)e(strings)j(for)f(bow/eow)h(ele-)1071 1837 +y(ments;)21 b(otherwise,)g(it's)h(Posix)f(all)g(the)f(way)-9 +b(.)681 2178 y Fy(6.6)99 b(The)25 b(regexp)f(ADT)681 +2392 y FD(The)h(following)i(functions)g(may)e(be)g(used)h(to)f(constr)o +(uct)i(and)e(examine)g(scsh's)h(r)o(egexp)681 2492 y(abstract)g(data)g +(type.)45 b(They)27 b(ar)o(e)f(in)i(the)g(following)g(Scheme)f(48)g +(packages:)37 b(r)o(e-adt-lib)681 2591 y(r)o(e-lib)19 +b(scsh)805 2716 y(Each)30 b(basic)f(class)h(of)g(r)o(egexp)f(has)g(a)h +(pr)o(edicate,)g(a)f(basic)h(constr)o(uctor)-6 b(,)33 +b(a)c(\223smart\224)681 2815 y(consr)o(uctor)j(that)g(performs)f +(limited)g(\223peephole\224)g(optimisation)i(on)f(its)g(ar)o(guments,) +681 2915 y(and)24 b(a)g(set)h(of)f(accessors.)37 b(The)25 +b FA(...:tsm)d FD(accessor)i(r)o(eturns)g(the)h(total)g(number)g(of)f +(sub-)681 3015 y(matches)d(contained)f(in)i(the)f(r)o(egular)e(expr)o +(ession.)681 3162 y FA(\(re-seq?)40 b FC(x)p FA(\))86 +b Fw(\000)-14 b(!)87 b FC(boolean)1288 b FD(T)-7 b(ype)20 +b(pr)o(edicate)681 3261 y FA(\(make-re-seq)38 b FC(r)o(e)21 +b(.)12 b(.)g(.)g FA(\))88 b Fw(\000)-15 b(!)88 b FC(r)o(e)1073 +b FD(Basic)20 b(constr)o(uctor)681 3361 y FA(\(re-seq)40 +b FC(r)o(e)21 b(.)12 b(.)g(.)g FA(\))88 b Fw(\000)-15 +b(!)88 b FC(r)o(e)1261 b FD(Smart)20 b(constr)o(uctor)681 +3461 y FA(\(re-seq:elts)38 b FC(r)o(e)p FA(\))87 b Fw(\000)-14 +b(!)87 b FC(r)o(e-list)1359 b FD(Accessor)681 3560 y +FA(\(re-seq:tsm)39 b FC(r)o(e)p FA(\))87 b Fw(\000)-15 +b(!)88 b FC(integer)1364 b FD(Accessor)681 3707 y FA(\(re-choice?)39 +b FC(x)p FA(\))86 b Fw(\000)-14 b(!)87 b FC(boolean)1157 +b FD(T)-7 b(ype)20 b(pr)o(edicate)681 3807 y FA(\(make-re-choice)37 +b FC(r)o(e-list)p FA(\))87 b Fw(\000)-15 b(!)88 b FC(r)o(e)929 +b FD(Basic)20 b(constr)o(uctor)681 3907 y FA(\(re-choice)39 +b FC(r)o(e)21 b(.)12 b(.)g(.)g FA(\))87 b Fw(\000)-14 +b(!)87 b FC(r)o(e)1131 b FD(Smart)20 b(constr)o(uctor)681 +4006 y FA(\(re-choice:elts)37 b FC(r)o(e)p FA(\))87 b +Fw(\000)-14 b(!)87 b FC(r)o(e-list)1228 b FD(Accessor)681 +4106 y FA(\(re-choice:tsm)38 b FC(r)o(e)p FA(\))86 b +Fw(\000)-14 b(!)87 b FC(integer)1234 b FD(Accessor)681 +4253 y FA(\(re-repeat?)39 b FC(x)p FA(\))86 b Fw(\000)-14 +b(!)87 b FC(boolean)1157 b FD(T)-7 b(ype)20 b(pr)o(edicate)681 +4353 y FA(\(make-re-repeat)37 b FC(fr)o(om)20 b(to)h(body)p +FA(\))86 b Fw(\000)-15 b(!)88 b FC(r)o(e)1005 b FD(Accessor)681 +4452 y FA(\(re-repeat:from)37 b FC(r)o(e)p FA(\))87 b +Fw(\000)-14 b(!)87 b FC(integer)1190 b FD(Accessor)681 +4552 y FA(\(re-repeat:to)38 b FC(r)o(e)p FA(\))87 b Fw(\000)-14 +b(!)87 b FC(integer)1277 b FD(Accessor)681 4652 y FA(\(re-repeat:tsm)38 +b FC(r)o(e)p FA(\))86 b Fw(\000)-14 b(!)87 b FC(integer)1234 +b FD(Accessor)681 4799 y FA(\(re-submatch?)38 b FC(x)p +FA(\))86 b Fw(\000)-14 b(!)87 b FC(boolean)1070 b FD(T)-7 +b(ype)20 b(pr)o(edicate)681 4898 y FA(\(make-re-submatc)o(h)37 +b FC(body)20 b([pr)o(e-dsm)f(post-dsm])p FA(\))85 b Fw(\000)-14 +b(!)87 b FC(r)o(e)508 b FD(Accessor)2051 5147 y(136)p +eop +%%Page: 137 145 +137 144 bop 365 614 a FA(\(re-submatch:pre-)o(ds)o(m)38 +b FC(r)o(e)p FA(\))86 b Fw(\000)-14 b(!)87 b FC(integer)973 +b FD(Accessor)365 714 y FA(\(re-submatch:post)o(-d)o(sm)37 +b FC(r)o(e)p FA(\))87 b Fw(\000)-14 b(!)87 b FC(integer)929 +b FD(Accessor)365 814 y FA(\(re-submatch:tsm)37 b FC(r)o(e)p +FA(\))87 b Fw(\000)-14 b(!)87 b FC(integer)1147 b FD(Accessor)365 +962 y FA(\(re-string?)39 b FC(x)p FA(\))87 b Fw(\000)-15 +b(!)88 b FC(boolean)1157 b FD(T)-7 b(ype)20 b(pr)o(edicate)365 +1062 y FA(\(make-re-string)38 b FC(chars)p FA(\))86 b +Fw(\000)-14 b(!)87 b FC(r)o(e)949 b FD(Basic)21 b(constr)o(uctor)365 +1161 y FA(\(re-string)40 b FC(chars)p FA(\))86 b Fw(\000)-14 +b(!)87 b FC(r)o(e)1167 b FD(Basic)21 b(constr)o(uctor)365 +1261 y FA(\(re-string:chars)37 b FC(r)o(e)p FA(\))87 +b Fw(\000)-14 b(!)87 b FC(string)1179 b FD(Accessor)365 +1410 y FA(\(re-char-set?)39 b FC(x)p FA(\))86 b Fw(\000)-14 +b(!)87 b FC(boolean)1070 b FD(T)-7 b(ype)20 b(pr)o(edicate)365 +1509 y FA(\(make-re-char-set)37 b FC(cset)p FA(\))87 +b Fw(\000)-15 b(!)88 b FC(r)o(e)912 b FD(Basic)21 b(constr)o(uctor)365 +1609 y FA(\(re-char-set)39 b FC(cset)p FA(\))87 b Fw(\000)-15 +b(!)88 b FC(r)o(e)1130 b FD(Basic)21 b(constr)o(uctor)365 +1709 y FA(\(re-char-set:cset)37 b FC(r)o(e)p FA(\))87 +b Fw(\000)-15 b(!)88 b FC(char-set)1073 b FD(Accessor)365 +1857 y FA(\(re-dsm?)41 b FC(x)p FA(\))86 b Fw(\000)-14 +b(!)87 b FC(boolean)1288 b FD(T)-7 b(ype)20 b(pr)o(edicate)365 +1957 y FA(\(make-re-dsm)39 b FC(body)20 b(pr)o(e-dsm)f(post-dsm)p +FA(\))86 b Fw(\000)-15 b(!)87 b FC(r)o(e)482 b FD(Basic)21 +b(constr)o(uctor)365 2056 y FA(\(re-dsm)41 b FC(body)20 +b(pr)o(e-dsm)f(post-dsm)p FA(\))86 b Fw(\000)-15 b(!)88 +b FC(r)o(e)670 b FD(Smart)20 b(constr)o(uctor)365 2156 +y FA(\(re-dsm:body)39 b FC(r)o(e)p FA(\))87 b Fw(\000)-14 +b(!)87 b FC(r)o(e)1493 b FD(Accessor)365 2256 y FA(\(re-dsm:pre-dsm)38 +b FC(r)o(e)p FA(\))87 b Fw(\000)-15 b(!)87 b FC(integer)1191 +b FD(Accessor)365 2355 y FA(\(re-dsm:post-dsm)37 b FC(r)o(e)p +FA(\))87 b Fw(\000)-14 b(!)87 b FC(integer)1147 b FD(Accessor)365 +2455 y FA(\(re-dsm:tsm)39 b FC(r)o(e)p FA(\))87 b Fw(\000)-14 +b(!)87 b FC(integer)1365 b FD(Accessor)365 2604 y FA(re-bos)2351 +b FD(r)o(egexp)365 2703 y FA(re-eos)g FD(r)o(egexp)365 +2803 y FA(re-bol)g FD(r)o(egexp)365 2902 y FA(re-eol)g +FD(r)o(egexp)365 3002 y FA(re-bow)g FD(r)o(egexp)365 +3102 y FA(re-eow)g FD(r)o(egexp)573 3242 y(These)21 b(variables)e(ar)o +(e)h(bound)h(to)g(the)g(primitive)g(anchor)g(r)o(egexps.)365 +3432 y FA(\(re-bos?)41 b FC(object)p FA(\))86 b Fw(\000)-14 +b(!)87 b FC(boolean)1304 b FD(pr)o(ocedur)o(e)365 3531 +y FA(\(re-eos?)41 b FC(object)p FA(\))86 b Fw(\000)-14 +b(!)87 b FC(boolean)1304 b FD(pr)o(ocedur)o(e)365 3631 +y FA(\(re-bol?)41 b FC(object)p FA(\))86 b Fw(\000)-14 +b(!)87 b FC(boolean)1304 b FD(pr)o(ocedur)o(e)365 3731 +y FA(\(re-eol?)41 b FC(object)p FA(\))86 b Fw(\000)-14 +b(!)87 b FC(boolean)1304 b FD(pr)o(ocedur)o(e)365 3830 +y FA(\(re-bow?)41 b FC(object)p FA(\))86 b Fw(\000)-14 +b(!)87 b FC(boolean)1304 b FD(pr)o(ocedur)o(e)365 3930 +y FA(\(re-eow?)41 b FC(object)p FA(\))86 b Fw(\000)-14 +b(!)87 b FC(boolean)1304 b FD(pr)o(ocedur)o(e)573 4070 +y(These)21 b(pr)o(edicates)e(r)o(ecognise)h(the)h(associated)f +(primitive)h(anchor)g(r)o(egexp.)365 4260 y FA(re-trivial)2175 +b FD(r)o(egexp)365 4359 y FA(\(re-trivial?)39 b FC(r)o(e)p +FA(\))87 b Fw(\000)-14 b(!)87 b FC(boolean)1258 b FD(pr)o(ocedur)o(e) +573 4500 y(The)27 b(variable)e FA(re-trivial)e FD(is)k(bound)g(to)g(a)g +(r)o(egular)e(expr)o(ession)i(that)g(matches)573 4599 +y(the)h(empty)g(string)h(\(corr)o(esponding)f(to)g(the)g(SRE)g +FA("")f FD(or)i FA(\(:\))p FD(\);)g(it)g(is)f(r)o(ecognised)573 +4699 y(by)19 b(the)g(associated)g(pr)o(edicate.)k(Note)c(that)g(the)g +(pr)o(edicate)e(is)i(only)h(guaranteed)e(to)573 4799 +y(r)o(ecognise)27 b(this)h(particular)e(trivial)h(r)o(egexp;)i(other)f +(trivial)f(r)o(egexps)f(built)i(using)573 4898 y(other)21 +b(constr)o(uctors)h(may)f(or)f(may)h(not)h(pr)o(oduce)d(a)i(tr)o(ue)f +(value.)1735 5147 y(137)p eop +%%Page: 138 146 +138 145 bop 681 614 a FA(re-empty)2262 b FD(r)o(egexp)681 +714 y FA(\(re-empty?)39 b FC(r)o(e)p FA(\))87 b Fw(\000)-14 +b(!)87 b FC(boolean)1345 b FD(pr)o(ocedur)o(e)888 846 +y(The)18 b(variable)e FA(re-empty)f FD(is)j(bound)g(to)g(a)f(r)o +(egular)g(expr)o(ession)g(that)h(never)f(match-)888 946 +y(es)h(\(corr)o(esponding)f(to)h(the)g(SRE)f FA(\(|\))p +FD(\);)g(it)h(is)f(r)o(ecognised)h(by)f(the)h(associated)f(pr)o(ed-)888 +1045 y(icate.)29 b(Note)22 b(that)g(the)h(pr)o(edicate)d(is)i(only)h +(guaranteed)e(to)h(r)o(ecognise)g(this)h(partic-)888 +1145 y(ular)29 b(empty)g(r)o(egexp;)j(other)e(empty)f(r)o(egexps)f +(built)h(using)h(other)g(constr)o(uctors)888 1245 y(may)21 +b(or)g(may)g(not)g(pr)o(oduce)f(a)g(tr)o(ue)h(value.)681 +1422 y FA(re-any)2350 b FD(r)o(egexp)681 1521 y FA(\(re-any?)40 +b FC(r)o(e)p FA(\))87 b Fw(\000)-14 b(!)87 b FC(boolean)1432 +b FD(pr)o(ocedur)o(e)888 1654 y(The)16 b(variable)f FA(re-any)e +FD(is)k(bound)f(to)g(a)g(r)o(egular)e(expr)o(ession)i(that)g(matches)g +(the)g(any)888 1753 y(character)i(\(corr)o(esponding)h(to)g(the)h(SRE)f +FA(any)p FD(\);)e(it)j(is)f(r)o(ecognised)g(by)g(the)h(associat-)888 +1853 y(ed)g(pr)o(edicate.)j(Note)e(that)f(the)g(pr)o(edicate)f(is)h +(only)i(guaranteed)d(to)h(r)o(ecognise)g(this)888 1952 +y(particular)j(any-character)g(r)o(egexp)g(value;)i(other)f +(any-character)f(r)o(egexps)g(built)888 2052 y(using)f(other)f(constr)o +(uctors)h(may)f(or)g(may)f(not)i(pr)o(oduce)d(a)i(tr)o(ue)g(value.)681 +2229 y FA(re-nonl)2306 b FD(r)o(egexp)681 2329 y FA(re-word)g +FD(r)o(egexp)888 2461 y(The)30 b(variable)f FA(re-any)e +FD(is)j(bound)g(to)g(a)f(r)o(egular)g(expr)o(ession)g(that)h(matches)g +(the)888 2561 y(any)21 b(non-newline)h(character)d(\(corr)o(esponding)i +(to)g(the)g(SRE)g FA(\(~)42 b(#\\newline\))p FD(\).)888 +2689 y(Similarly)-9 b(,)38 b FA(re-word)32 b FD(is)k(bound)f(to)g(a)g +(r)o(egular)e(expr)o(ession)i(that)g(matches)g(any)888 +2789 y(wor)o(d)21 b(\(corr)o(esponding)f(to)h(the)g(SRE)g +FA(word)p FD(\).)681 2966 y FA(\(regexp?)40 b FC(object)p +FA(\))87 b Fw(\000)-14 b(!)87 b FC(boolean)1303 b FD(pr)o(ocedur)o(e) +888 3098 y(Is)21 b(the)g(object)g(a)g(r)o(egexp?)681 +3275 y FA(\(re-tsm)40 b FC(r)o(e)p FA(\))87 b Fw(\000)-14 +b(!)87 b FC(integer)1491 b FD(pr)o(ocedur)o(e)888 3407 +y(Return)22 b(the)e(total)h(number)g(of)g(submatches)g(contained)g(in)g +(the)g(r)o(egexp.)681 3585 y FA(\(clean-up-cres\))81 +b Fw(\000)-15 b(!)88 b FC(unde\002ned)1197 b FD(pr)o(ocedur)o(e)888 +3717 y(The)20 b(curr)o(ent)e(scsh)i(implementation)h(should)f(call)f +(this)h(function)h(periodically)e(to)888 3816 y(r)o(elease)e(C-heap)g +(storage)h(associated)g(with)h(compiled)f(r)o(egexps.)24 +b(Hopefully)-9 b(,)18 b(this)888 3916 y(pr)o(ocedur)o(e)h(will)j(be)e +(r)o(emoved)g(at)g(a)g(later)h(date.)681 4201 y Fy(6.7)99 +b(Syntax-hacking)25 b(tools)681 4415 y FD(The)18 b(Scheme)f(48)g +(package)g FA(rx-syntax-tools)12 b FD(exports)18 b(several)f(tools)i +(for)f(macr)o(o)f(writ-)681 4515 y(ers)33 b(that)g(want)h(to)f(use)h +(SREs)f(in)h(their)f(macr)o(os.)63 b(In)34 b(the)f(functions)i +(de\002ned)e(below)-8 b(,)681 4615 y FC(compar)o(e)16 +b FD(and)h FC(r)o(ename)g FD(parameters)f(ar)o(e)g(as)h(passed)g(to)h +(Clinger)o(-Rees)f(explicit-r)o(enaming)681 4714 y(low-level)k(macr)o +(os.)681 4855 y FA(\(if-sre-form)38 b FC(form)21 b(conseq-form)g +(alt-form)p FA(\))86 b Fw(\000)-14 b(!)87 b FC(form)665 +b FD(Syntax)2051 5147 y(138)p eop +%%Page: 139 147 +139 146 bop 573 614 a FD(If)20 b FC(form)g FD(is)g(a)g(legal)g(SRE,)f +(this)i(is)g(equivalent)f(to)h(the)f(expr)o(ession)g +FC(conseq-form)p FD(,)g(oth-)573 714 y(erwise)h(it)g(expands)f(to)h +FC(alt-form)o FD(.)573 847 y(This)29 b(is)g(useful)g(for)f(high-level)h +(macr)o(o)f(authors)h(who)h(want)e(to)h(write)g(a)f(macr)o(o)573 +946 y(wher)o(e)d(one)h(\002eld)f(in)h(the)f(macr)o(o)g(can)g(be)g(an)h +(SRE)f(or)g(possibly)i(something)g(else.)573 1046 y FC(E.g.)o +FD(,)18 b(we)h(might)g(have)f(a)g(conditional)i(form)e(wher)o(ein)g(if) +h(the)f(test)h(part)f(of)g(one)h(arm)573 1146 y(is)f(an)f(SRE,)g(it)h +(expands)f(to)h(a)f(r)o(egexp)f(match)i(on)g(some)g(implied)g(value,)f +(otherwise)573 1245 y(the)29 b(form)g(is)g(evaluated)e(as)i(a)g +(boolean)g(Scheme)f(expr)o(ession.)50 b(For)29 b(example,)h(a)573 +1345 y(conditional)17 b(macr)o(o)e(might)i(expand)e(into)i(code)e +(containing)i(the)f(following)i(form,)573 1445 y(which)k(in)f(turn)g +(would)g(have)f(one)h(of)g(two)h(possible)f(expansions:)594 +1567 y FA(\(if-sre-form)38 b(test-exp)738 b(;)43 b(If)g(TEST-EXP)d(is)j +(SRE,)681 1667 y(\(regexp-search?)37 b(\(rx)43 b(test-exp\))c(line\))j +(;)h(match)f(it)g(w/the)g(line,)681 1766 y(test-exp\))1173 +b(;)43 b(otw)f(it's)g(a)i(text)d(exp.)365 1945 y(\(sre-form?)f +FC(form)20 b(r)o(ename)h(compar)o(e)p FA(\))86 b Fw(\000)-15 +b(!)87 b FC(boolean)691 b FD(pr)o(ocedur)o(e)573 2086 +y(This)50 b(pr)o(ocedur)o(e)e(is)i(for)g(low-level)g(macr)o(os)f(doing) +i(things)g(equivalent)f(to)573 2186 y FA(if-sre-form)p +FD(.)21 b(It)g(r)o(eturns)f(tr)o(ue)h(if)f(the)h(form)g(is)g(a)f(legal) +h(SRE.)573 2319 y(Note)h(that)f(neither)h FA(sre-form)c +FD(nor)k FA(if-sre-form)17 b FD(does)22 b(a)f(deep)f(r)o(ecursion)i +(over)573 2419 y(the)e(form)g(in)g(the)g(case)f(wher)o(e)g(the)h(form)g +(is)g(a)f(list.)26 b(They)19 b(simply)i(check)f(the)g(car)f(of)573 +2518 y(the)i(form)g(for)f(one)h(of)g(the)g(legal)f(SRE)h(keywor)o(ds.) +365 2709 y FA(\(parse-sre)40 b FC(sr)o(e-form)20 b(compar)o(e)g(r)o +(ename)p FA(\))87 b Fw(\000)-15 b(!)88 b FC(r)o(e)754 +b FD(pr)o(ocedur)o(e)365 2809 y FA(\(parse-sres)39 b +FC(sr)o(e-forms)21 b(compar)o(e)f(r)o(ename)p FA(\))86 +b Fw(\000)-14 b(!)87 b FC(r)o(e)679 b FD(pr)o(ocedur)o(e)573 +2950 y(Parse)24 b FA(sre-form)d FD(into)k(an)f(ADT)-6 +b(.)24 b(Note)g(that)g(if)g(the)h(SRE)f(is)h(dynamic\227contains)573 +3050 y FA(,)p FC(exp)h FD(or)i FA(,@)p FC(exp)e FD(forms,)k(or)e(has)g +(r)o(epeat)e(operators)h(whose)h(fr)o(om/to)g(counts)h(ar)o(e)573 +3149 y(not)20 b(constants\227then)g(the)f(r)o(eturned)f(ADT)h(will)h +(have)e FC(Scheme)i(expr)o(essions)g FD(in)f(the)573 +3249 y(corr)o(esponding)29 b(slots)g(of)g(the)g(r)o(egexp)e(r)o(ecor)o +(ds)g(instead)i(of)g(the)f(corr)o(esponding)573 3348 +y(integer)-6 b(,)26 b(char)o(-set,)f(or)h(r)o(egexp.)39 +b(In)25 b(other)h(wor)o(ds,)g(we)g(use)g(the)f(ADT)g(as)h(its)g(own)573 +3448 y(AST)-6 b(.)19 b(It's)i(called)f(a)h(\223hack.\224)573 +3581 y FA(parse-sres)13 b FD(parses)j(a)g(list)i(of)e(SRE)h(forms)g +(that)g(comprise)g(an)g(implicit)h(sequence.)365 3772 +y FA(\(regexp->scheme)38 b FC(r)o(e)21 b(r)o(ename)p +FA(\))86 b Fw(\000)-14 b(!)87 b FC(Scheme-expr)o(ession)486 +b FD(pr)o(ocedur)o(e)573 3913 y(Returns)20 b(a)f(Scheme)h(expr)o +(ession)f(that)h(will)g(constr)o(uct)h(the)f(r)o(egexp)e +FC(r)o(e)i FD(using)h(ADT)573 4013 y(constr)o(uctors)h(such)f(as)f +FA(make-re-sequence)p FD(,)14 b FA(make-re-repeat)p FD(,)h(and)20 +b(so)i(forth.)573 4145 y(If)k(the)h(r)o(egexp)e(is)h(static,)i(it)f +(will)g(be)f(simpli\002ed)h(and)f(pr)o(e-translated)e(to)j(a)f(Posix) +573 4245 y(string)21 b(as)g(well,)g(which)g(will)h(be)e(part)g(of)h +(the)g(constr)o(ucted)g(r)o(egexp)e(value.)365 4436 y +FA(\(static-regexp?)38 b FC(r)o(e)p FA(\))87 b Fw(\000)-15 +b(!)87 b FC(boolean)1128 b FD(pr)o(ocedur)o(e)573 4577 +y(Is)21 b(the)g(r)o(egexp)e(a)h(static)h(one?)1735 5147 +y(139)p eop +%%Page: 140 148 +140 147 bop 681 1273 a Fz(Chapter)44 b(7)681 1723 y FE(Reading)52 +b(delimited)g(strings)681 2214 y FD(Scsh)21 b(pr)o(ovides)f(a)h(set)g +(of)g(pr)o(ocedur)o(es)e(that)i(r)o(ead)e(delimited)i(strings)h(fr)o +(om)e(input)i(ports.)681 2314 y(Ther)o(e)16 b(ar)o(e)g(pr)o(ocedur)o +(es)g(to)i(r)o(ead)e(a)h(single)h(line)g(of)g(text)f(\(terminated)g(by) +g(a)g(newline)h(char)o(-)681 2414 y(acter\),)24 b(a)g(single)h +(paragraph)e(\(terminated)g(by)i(a)f(blank)g(line\),)h(and)f(general)g +(delimited)681 2513 y(strings)d(\(terminated)f(by)h(a)f(character)g +(belonging)i(to)f(an)f(arbitrary)g(character)f(set\).)805 +2648 y(These)25 b(pr)o(ocedur)o(es)e(can)h(be)h(applied)e(to)i(any)g +(Scheme)f(input)h(port.)38 b(However)-6 b(,)25 b(the)681 +2748 y(scsh)h(virtual)f(machine)g(has)h(native-code)e(support)i(for)f +(performing)g(delimited)h(r)o(eads)681 2848 y(on)h(Unix)f(ports,)i(and) +e(these)h(input)g(operations)g(should)g(be)f(particularly)g +(fast\227much)681 2947 y(faster)33 b(than)h(doing)g(the)g(equivalent)g +(character)o(-at-a-time)c(operation)k(fr)o(om)f(Scheme)681 +3047 y(code.)805 3182 y(All)20 b(of)g(the)f(delimited)h(input)g +(operations)g(described)f(below)h(take)f(a)g FA(handle-delim)681 +3282 y FD(parameter)-6 b(,)30 b(which)g(determines)g(what)g(the)g(pr)o +(ocedur)o(e)d(does)j(with)h(the)e(terminating)681 3381 +y(delimiter)19 b(character)-6 b(.)23 b(Ther)o(e)18 b(ar)o(e)f(four)i +(possible)g(choices)h(for)e(a)g FA(handle-delim)c FD(param-)681 +3481 y(eter:)p 888 3549 2428 4 v 888 3649 4 100 v 941 +3619 a FA(handle-delim)p 1514 3649 V 98 w FD(Meaning)p +3313 3649 V 888 3652 2428 4 v 888 3669 V 888 3769 4 100 +v 941 3739 a FA('trim)p 1514 3769 V 406 w FD(Ignor)o(e)21 +b(delimiter)g(character)-6 b(.)p 3313 3769 V 888 3868 +V 941 3838 a FA('peek)p 1514 3868 V 406 w FD(Leave)20 +b(delimiter)h(character)e(in)i(input)g(str)o(eam.)p 3313 +3868 V 888 3968 V 941 3938 a FA('concat)p 1514 3968 V 318 w FD(Append)f(delimiter)h(character)e(to)i(r)o(eturned)f(value.)p -2997 3968 V 573 4068 V 626 4038 a FA('split)p 1199 4068 -V 362 w FD(Return)h(delimiter)g(as)f(second)h(value.)p -2997 4068 V 573 4071 2428 4 v 365 4195 a(The)28 b(\002rst)g(case,)h -FA('trim)p FD(,)e(is)h(the)g(standar)o(d)e(default)h(for)h(all)f(the)h -(r)o(outines)g(described)f(in)365 4295 y(this)21 b(section.)26 -b(The)21 b(last)f(thr)o(ee)g(cases)f(allow)i(the)g(pr)o(ogrammer)e(to)i -(distinguish)h(between)365 4394 y(strings)h(that)f(ar)o(e)e(terminated) -h(by)h(a)g(delimiter)f(character)-6 b(,)21 b(and)g(strings)i(that)e(ar) -o(e)g(termi-)365 4494 y(nated)f(by)h(an)g(end-of-\002le.)365 -4651 y FA(\(read-line)40 b FC([port)19 b(handle-newline])p -FA(\))87 b Fw(\000)-14 b(!)87 b FC(string)21 b(or)g(eof-object)306 -b FD(pr)o(ocedur)o(e)573 4799 y(Reads)20 b(and)g(r)o(eturns)g(one)h -(line)g(of)g(text;)f(on)h(eof,)f(r)o(eturns)g(the)h(eof)f(object.)26 -b(A)20 b(line)h(is)573 4898 y(terminated)f(by)h(newline)g(or)g(eof.) -1740 5147 y(1)-5 b(1)g(1)p eop -%%Page: 112 118 -112 117 bop 888 614 a FC(handle-newline)19 b FD(determines)f(what)h -FA(read-line)c FD(does)j(with)h(the)g(newline)g(or)g(EOF)888 -714 y(that)29 b(terminates)g(the)g(line;)j(it)d(takes)g(the)g(general)f -(set)h(of)f(values)h(described)e(for)888 814 y(the)22 -b(general)e FA(handle-delim)d FD(case)j(above,)h(and)f(defaults)h(to)g -FA('trim)f FD(\(discar)o(d)f(the)888 913 y(newline\).)35 -b(Using)24 b(this)h(ar)o(gument)e(allows)i(one)f(to)g(tell)g(whether)g -(or)g(not)g(the)g(last)888 1013 y(line)d(of)g(input)g(in)h(a)e(\002le)h -(is)g(newline)g(terminated.)681 1305 y FA(\(read-paragraph)37 -b FC([port)20 b(handle-delim])p FA(\))85 b Fw(\000)-14 -b(!)87 b FC(string)21 b(or)f(eof)387 b FD(pr)o(ocedur)o(e)888 -1446 y(This)19 b(pr)o(ocedur)o(e)e(skips)i(blank)f(lines,)h(then)g(r)o -(eads)e(text)h(fr)o(om)g(a)g(port)h(until)g(a)f(blank)888 -1546 y(line)25 b(or)f(eof)g(is)h(found.)35 b(A)24 b(\223blank)g -(line\224)g(is)h(a)e(\(possibly)i(empty\))f(line)h(composed)888 -1645 y(only)e(of)e(white)h(space.)27 b(The)22 b FC(handle-delim)e -FD(parameter)g(determines)h(how)i(the)e(ter)o(-)888 1745 -y(minating)33 b(blank)f(line)g(is)g(handled.)58 b(It)31 -b(is)h(described)f(above,)j(and)d(defaults)g(to)888 1845 -y FA('trim)p FD(.)24 b(The)c FA('peek)f FD(option)j(is)f(not)h -(available.)805 2012 y(The)17 b(following)h(pr)o(ocedur)o(es)c(r)o(ead) -h(in)i(strings)h(fr)o(om)e(ports)g(delimited)h(by)f(characters)681 -2112 y(belonging)34 b(to)g(a)e(speci\002c)h(set.)62 b(See)33 -b(section)g(5.3)f(for)h(information)h(on)f(character)f(set)681 -2211 y(manipulation.)681 2361 y FA(\(read-delimited)37 -b FC(char-set)20 b([port)g(handle-delim])p FA(\))85 b -Fw(\000)-14 b(!)87 b FC(string)21 b(or)g(eof)101 b FD(pr)o(ocedur)o(e) -888 2503 y(Read)46 b(until)i(we)e(encounter)h(one)g(of)f(the)h(chars)f -(in)h FC(char-set)f FD(or)h(eof.)102 b(The)888 2602 y -FC(handle-delim)19 b FD(parameter)f(determines)i(how)h(the)g -(terminating)f(character)f(is)h(han-)888 2702 y(dled.)25 -b(It)c(is)g(described)f(above,)g(and)g(defaults)g(to)h -FA('trim)p FD(.)888 2835 y(The)g FC(char-set)f FD(ar)o(gument)h(may)f -(be)h(a)f(charset,)g(a)h(string,)g(a)f(character)-6 b(,)19 -b(or)i(a)g(charac-)888 2935 y(ter)g(pr)o(edicate;)d(it)j(is)g(coer)o -(ced)f(to)h(a)f(charset.)681 3127 y FA(\(read-delimited!)37 -b FC(char-set)15 b(buf)h([port)f(handle-delim)f(start)i(end])p -FA(\))43 b Fw(\000)-15 b(!)44 b FC(nchars)16 b(or)g(eof)g(or)g(#f)86 -b FD(pr)o(ocedur)o(e)888 3268 y(A)21 b(side-ef)o(fecting)e(variant)h -(of)h FA(read-delimited)p FD(.)888 3402 y(The)26 b(data)f(is)i(written) -f(into)h(the)f(string)h FC(buf)g FD(at)e(the)h(indices)h(in)f(the)g -(half-open)g(in-)888 3501 y(terval)h Fn([)p FC(start)o -Fo(;)14 b FC(end)p Fn(\))p FD(;)31 b(the)c(default)f(interval)h(is)g -(the)g(whole)h(string:)39 b FC(start)c Fn(=)f(0)26 b -FD(and)888 3601 y FC(end)k Fn(=)g FA(\(string-length)38 -b FC(buf)p FA(\))p FD(.)f(The)24 b(values)g(of)h FC(start)f -FD(and)g FC(end)g FD(must)h(specify)g(a)888 3700 y(well-de\002ned)c -(interval)f(in)h FC(str)p FD(,)g FC(i.e.)p FD(,)f Fn(0)j -Fw(\024)g FC(start)f Fw(\024)h FC(end)g Fw(\024)g FA(\(string-length)37 -b FC(buf)q FA(\))p FD(.)888 3834 y(It)21 b(r)o(eturns)e -FC(nbytes)q FD(,)h(the)g(number)g(of)h(bytes)f(r)o(ead.)k(If)19 -b(the)i(buf)o(fer)d(\002lled)j(up)f(without)888 3933 -y(a)32 b(delimiter)f(character)f(being)i(found,)i FA(#f)d -FD(is)h(r)o(eturned.)57 b(If)32 b(the)f(port)h(is)g(at)f(eof)888 -4033 y(when)22 b(the)f(r)o(ead)e(starts,)h(the)h(eof)f(object)i(is)f(r) -o(eturned.)888 4166 y(If)h(an)f(integer)h(is)g(r)o(eturned)f(\()p -FC(i.e.)p FD(,)g(the)h(r)o(ead)f(is)h(successfully)g(terminated)f(by)h -(r)o(ead-)888 4266 y(ing)35 b(a)e(delimiter)h(character\),)h(then)f -(the)g FC(handle-delim)e FD(parameter)g(determines)888 -4365 y(how)24 b(the)e(terminating)h(character)e(is)i(handled.)30 -b(It)23 b(is)f(described)g(above,)g(and)g(de-)888 4465 -y(faults)f(to)g FA('trim)p FD(.)681 4657 y FA(\(\045read-delimited)o(!) -37 b FC(char-set)15 b(buf)i(gobble?)f([port)f(start)g(end])p -FA(\))43 b Fw(\000)-14 b(!)43 b FC([char-or-eof-or-#f)14 -b(integer])87 b FD(pr)o(ocedur)o(e)888 4799 y(This)20 -b(low-level)f(delimited)g(r)o(eader)d(uses)k(an)e(alternate)g -(interface.)24 b(It)19 b(r)o(eturns)f(two)888 4898 y(values:)25 -b FC(terminator)c FD(and)f FC(num-r)o(ead)o FD(.)2053 -5147 y(1)-5 b(12)p eop -%%Page: 113 119 -113 118 bop 573 614 a FB(terminator)40 b FD(A)20 b(value)g(describing)h -(why)g(the)g(r)o(ead)e(was)i(terminated:)805 842 y(Character)f(or)g -(eof-object)166 b Fw(\))g FD(Read)21 b(terminated)f(by)h(this)g(value.) -805 941 y FA(#f)912 b Fw(\))166 b FD(Filled)21 b(buf)o(fer)e(without)j -(\002nding)g(a)e(delimiter)-6 b(.)573 1090 y FB(num-read)39 -b FD(Number)21 b(of)g(characters)e(r)o(ead)g(into)j FC(buf)p -FD(.)573 1256 y(If)31 b(the)g(r)o(ead)f(is)i(successfully)g(terminated) -e(by)i(r)o(eading)e(a)h(delimiter)g(character)-6 b(,)573 -1356 y(then)27 b(the)g FC(gobble?)f FD(parameter)f(determines)i(what)f -(to)h(do)g(with)g(the)g(terminating)573 1456 y(character)-6 -b(.)23 b(If)c(tr)o(ue,)g(the)h(character)e(is)h(r)o(emoved)g(fr)o(om)g -(the)g(input)h(str)o(eam;)e(if)i(false,)573 1555 y(the)29 -b(character)e(is)i(left)g(in)g(the)g(input)g(str)o(eam)f(wher)o(e)h(a)f -(subsequent)h(r)o(ead)f(oper)o(-)573 1655 y(ation)h(will)g(r)o(etrieve) -e(it.)48 b(In)29 b(either)g(case,)g(the)g(character)d(is)j(also)g(the)f -(\002rst)h(value)573 1755 y(r)o(eturned)19 b(by)i(the)g(pr)o(ocedur)o -(e)e(call.)365 1945 y FA(\(skip-char-set)38 b FC(skip-chars)20 -b([port])p FA(\))85 b Fw(\000)-14 b(!)87 b FC(integer)697 -b FD(pr)o(ocedur)o(e)573 2087 y(Skip)20 b(characters)f(occurring)i(in)g -(the)g(set)f FC(skip-chars)o FD(;)h(r)o(eturn)e(the)i(number)f(of)h -(char)o(-)573 2186 y(acters)c(skipped.)24 b(The)17 b -FC(skip-chars)g FD(ar)o(gument)g(may)h(be)f(a)g(charset,)g(a)g(string,) -i(a)e(char)o(-)573 2286 y(acter)-6 b(,)19 b(or)i(a)f(character)g(pr)o -(edicate;)e(it)j(is)g(coer)o(ced)f(to)h(a)f(charset.)1737 -5147 y(1)-5 b(13)p eop -%%Page: 114 120 -114 119 bop 681 1307 a Fz(Chapter)44 b(7)681 1792 y FE(A)-14 -b(wk,)51 b(record)h(I/O,)g(and)g(\002eld)681 2041 y(parsing)681 -2567 y FD(Unix)33 b(pr)o(ograms)g(fr)o(equently)g(pr)o(ocess)g(str)o -(eams)g(of)g(r)o(ecor)o(ds,)i(wher)o(e)e(each)g(r)o(ecor)o(d)f(is)681 -2667 y(delimited)27 b(by)h(a)g(newline,)i(and)d(r)o(ecor)o(ds)f(ar)o(e) -h(br)o(oken)g(into)i(\002elds)f(with)g(other)g(delim-)681 -2767 y(iters)f(\(for)f(example,)h(the)g(colon)h(character)e(in)h -FA(/etc/passwd)p FD(\).)39 b(Scsh)27 b(has)g(pr)o(ocedur)o(es)681 -2866 y(that)i(allow)h(the)g(pr)o(ogrammer)f(to)h(easily)f(do)h(this)g -(kind)g(of)g(pr)o(ocessing.)52 b(Scsh's)30 b(\002eld)681 -2966 y(parsers)j(can)h(also)h(be)f(used)g(to)h(parse)e(other)i(kinds)g -(of)f(delimited)g(strings,)39 b(such)34 b(as)681 3066 -y(colon-separated)26 b FA($PATH)e FD(lists.)45 b(These)27 -b(r)o(outines)g(can)f(be)h(used)f(with)i(scsh's)g FA(awk)d -FD(loop)681 3165 y(constr)o(uct)f(to)g(conveniently)h(perform)e -(pattern-dir)o(ected)e(computation)j(over)g(str)o(eams)681 -3265 y(of)d(r)o(ecor)o(ds.)681 3658 y Fy(7.1)99 b(Record)25 -b(I/O)g(and)f(\002eld)h(parsing)681 3932 y FD(The)f(pr)o(ocedur)o(es)e -(in)i(this)h(section)g(ar)o(e)d(used)i(to)g(r)o(ead)f(r)o(ecor)o(ds)f -(fr)o(om)i(I/O)g(str)o(eams)f(and)681 4031 y(parse)16 -b(them)i(into)g(\002elds.)25 b(A)17 b(r)o(ecor)o(d)e(is)j(de\002ned)f -(as)g(text)g(terminated)g(by)g(some)h(delimiter)681 4131 -y(\(usually)25 b(a)f(newline\).)38 b(A)24 b(r)o(ecor)o(d)g(can)g(be)h -(split)g(into)h(\002elds)e(by)h(using)h(r)o(egular)e(expr)o(es-)681 -4230 y(sions)k(in)f(one)g(of)g(several)f(ways:)37 b(to)27 -b FC(match)e FD(\002elds,)j(to)f FC(separate)g FD(\002elds,)h(or)f(to)g -FC(terminate)681 4330 y FD(\002elds.)41 b(The)25 b(\002eld)h(parsers)f -(can)h(be)f(applied)g(to)h(arbitrary)f(strings)i(\(one)f(common)h(use) -681 4430 y(is)f(splitting)g(envir)o(onment)g(variables)f(such)g(as)h -FA($PATH)d FD(at)i(colons)i(into)f(its)g(component)681 -4529 y(elements\).)805 4699 y(The)18 b(general)g(delimited-input)g(pr)o -(ocedur)o(es)e(described)h(in)h(chapter)f(6)h(ar)o(e)e(also)i(use-)681 -4799 y(ful)36 b(for)h(r)o(eading)e(simple)i(r)o(ecor)o(ds,)i(such)e(as) -g(single)g(lines,)k(paragraphs)35 b(of)i(text,)j(or)681 -4898 y(strings)21 b(terminated)g(by)f(speci\002c)h(characters.)2053 -5147 y(1)-5 b(14)p eop -%%Page: 115 121 -115 120 bop 365 614 a FB(7.1.1)81 b(Reading)19 b(records)365 +3313 3968 V 888 4067 V 941 4038 a FA('split)p 1514 4067 +V 362 w FD(Return)i(delimiter)e(as)h(second)g(value.)p +3313 4067 V 888 4071 2428 4 v 681 4195 a(The)28 b(\002rst)g(case,)g +FA('trim)p FD(,)g(is)g(the)g(standar)o(d)e(default)h(for)g(all)h(the)g +(r)o(outines)g(described)f(in)681 4295 y(this)21 b(section.)26 +b(The)20 b(last)g(thr)o(ee)g(cases)g(allow)h(the)f(pr)o(ogrammer)g(to)g +(distinguish)i(between)681 4394 y(strings)g(that)g(ar)o(e)f(terminated) +g(by)h(a)f(delimiter)h(character)-6 b(,)20 b(and)h(strings)i(that)f(ar) +o(e)e(termi-)681 4494 y(nated)g(by)h(an)f(end-of-\002le.)681 +4650 y FA(\(read-line)39 b FC([port)20 b(handle-newline])p +FA(\))86 b Fw(\000)-14 b(!)87 b FC(string)21 b(or)g(eof-object)306 +b FD(pr)o(ocedur)o(e)888 4799 y(Reads)21 b(and)f(r)o(eturns)g(one)h +(line)g(of)f(text;)g(on)i(eof,)e(r)o(eturns)g(the)g(eof)h(object.)26 +b(A)20 b(line)h(is)888 4898 y(terminated)g(by)f(newline)i(or)f(eof.) +2051 5147 y(140)p eop +%%Page: 141 149 +141 148 bop 573 614 a FC(handle-newline)18 b FD(determines)h(what)f +FA(read-line)d FD(does)k(with)g(the)g(newline)g(or)f(EOF)573 +714 y(that)29 b(terminates)f(the)h(line;)k(it)c(takes)f(the)h(general)f +(set)h(of)g(values)f(described)g(for)573 814 y(the)21 +b(general)g FA(handle-delim)16 b FD(case)21 b(above,)f(and)h(defaults)f +(to)i FA('trim)d FD(\(discar)o(d)g(the)573 913 y(newline\).)35 +b(Using)24 b(this)g(ar)o(gument)g(allows)g(one)g(to)g(tell)g(whether)g +(or)g(not)h(the)f(last)573 1013 y(line)d(of)g(input)g(in)g(a)f(\002le)h +(is)h(newline)f(terminated.)365 1305 y FA(\(read-paragraph)38 +b FC([port)19 b(handle-delim])p FA(\))85 b Fw(\000)-14 +b(!)87 b FC(string)21 b(or)g(eof)387 b FD(pr)o(ocedur)o(e)573 +1446 y(This)19 b(pr)o(ocedur)o(e)d(skips)j(blank)g(lines,)g(then)g(r)o +(eads)e(text)h(fr)o(om)g(a)g(port)g(until)i(a)d(blank)573 +1546 y(line)24 b(or)h(eof)f(is)g(found.)36 b(A)24 b(\223blank)f +(line\224)i(is)f(a)g(\(possibly)h(empty\))f(line)g(composed)573 +1645 y(only)e(of)g(white)g(space.)27 b(The)21 b FC(handle-delim)f +FD(parameter)g(determines)i(how)g(the)g(ter)o(-)573 1745 +y(minating)33 b(blank)e(line)h(is)g(handled.)58 b(It)32 +b(is)g(described)f(above,)i(and)e(defaults)g(to)573 1845 +y FA('trim)p FD(.)23 b(The)e FA('peek)e FD(option)j(is)f(not)g +(available.)490 2012 y(The)16 b(following)i(pr)o(ocedur)o(es)d(r)o(ead) +g(in)i(strings)g(fr)o(om)f(ports)h(delimited)f(by)h(characters)365 +2112 y(belonging)35 b(to)e(a)g(speci\002c)g(set.)62 b(See)32 +b(section)i(5.3)e(for)g(information)i(on)g(character)e(set)365 +2211 y(manipulation.)365 2361 y FA(\(read-delimited)38 +b FC(char-set)20 b([port)f(handle-delim])p FA(\))86 b +Fw(\000)-15 b(!)87 b FC(string)21 b(or)g(eof)102 b FD(pr)o(ocedur)o(e) +573 2503 y(Read)46 b(until)h(we)g(encounter)f(one)h(of)g(the)f(chars)h +(in)g FC(char-set)e FD(or)i(eof.)103 b(The)573 2602 y +FC(handle-delim)19 b FD(parameter)f(determines)i(how)h(the)f +(terminating)h(character)d(is)j(han-)573 2702 y(dled.)k(It)c(is)g +(described)e(above,)h(and)h(defaults)e(to)j FA('trim)p +FD(.)573 2835 y(The)f FC(char-set)f FD(ar)o(gument)g(may)h(be)f(a)h +(charset,)f(a)g(string,)i(a)e(character)-6 b(,)19 b(or)i(a)f(charac-) +573 2935 y(ter)g(pr)o(edicate;)f(it)i(is)g(coer)o(ced)e(to)i(a)g +(charset.)365 3127 y FA(\(read-delimited!)37 b FC(char-set)15 +b(buf)i([port)e(handle-delim)f(start)h(end])p FA(\))43 +b Fw(\000)-14 b(!)44 b FC(nchars)15 b(or)h(eof)g(or)g(#f)87 +b FD(pr)o(ocedur)o(e)573 3268 y(A)20 b(side-ef)o(fecting)f(variant)h +(of)h FA(read-delimited)p FD(.)573 3402 y(The)26 b(data)f(is)h(written) +h(into)f(the)h(string)f FC(buf)h FD(at)f(the)g(indices)g(in)h(the)f +(half-open)f(in-)573 3501 y(terval)h Fn([)p FC(start)p +Fo(;)14 b FC(end)p Fn(\))p FD(;)30 b(the)d(default)f(interval)h(is)h +(the)f(whole)h(string:)39 b FC(start)34 b Fn(=)g(0)27 +b FD(and)573 3601 y FC(end)j Fn(=)f FA(\(string-length)38 +b FC(buf)q FA(\))o FD(.)f(The)25 b(values)f(of)g FC(start)g +FD(and)g FC(end)h FD(must)g(specify)f(a)573 3700 y(well-de\002ned)c +(interval)h(in)g FC(str)p FD(,)g FC(i.e.)o FD(,)g Fn(0)h +Fw(\024)h FC(start)g Fw(\024)g FC(end)g Fw(\024)f FA(\(string-length)38 +b FC(buf)q FA(\))o FD(.)573 3834 y(It)20 b(r)o(eturns)g +FC(nbytes)p FD(,)g(the)h(number)f(of)g(bytes)h(r)o(ead.)i(If)d(the)g +(buf)o(fer)f(\002lled)h(up)g(without)573 3933 y(a)31 +b(delimiter)h(character)e(being)i(found,)i FA(#f)d FD(is)h(r)o +(eturned.)57 b(If)31 b(the)h(port)g(is)g(at)f(eof)573 +4033 y(when)21 b(the)g(r)o(ead)e(starts,)i(the)f(eof)h(object)g(is)g(r) +o(eturned.)573 4166 y(If)g(an)h(integer)g(is)g(r)o(eturned)f(\()p +FC(i.e.)o FD(,)h(the)g(r)o(ead)e(is)i(successfully)g(terminated)g(by)g +(r)o(ead-)573 4266 y(ing)34 b(a)g(delimiter)f(character\),)i(then)f +(the)g FC(handle-delim)f FD(parameter)f(determines)573 +4365 y(how)23 b(the)g(terminating)g(character)e(is)i(handled.)30 +b(It)22 b(is)h(described)e(above,)h(and)g(de-)573 4465 +y(faults)e(to)h FA('trim)p FD(.)365 4657 y FA(\(\045read-delimited!)37 +b FC(char-set)15 b(buf)h(gobble?)g([port)f(start)h(end])p +FA(\))42 b Fw(\000)-14 b(!)44 b FC([char-or-eof-or-#f)13 +b(integer])87 b FD(pr)o(ocedur)o(e)573 4799 y(This)19 +b(low-level)g(delimited)g(r)o(eader)e(uses)i(an)g(alternate)f +(interface.)24 b(It)18 b(r)o(eturns)h(two)573 4898 y(values:)25 +b FC(terminator)20 b FD(and)h FC(num-r)o(ead)o FD(.)1735 +5147 y(141)p eop +%%Page: 142 150 +142 149 bop 888 614 a FB(terminator)40 b FD(A)20 b(value)h(describing)f +(why)i(the)f(r)o(ead)e(was)i(terminated:)1121 842 y(Character)e(or)i +(eof-object)166 b Fw(\))g FD(Read)20 b(terminated)g(by)h(this)h(value.) +1121 941 y FA(#f)912 b Fw(\))166 b FD(Filled)21 b(buf)o(fer)e(without)j +(\002nding)f(a)g(delimiter)-6 b(.)888 1090 y FB(num-read)40 +b FD(Number)20 b(of)h(characters)f(r)o(ead)f(into)i FC(buf)q +FD(.)888 1256 y(If)31 b(the)h(r)o(ead)e(is)h(successfully)h(terminated) +f(by)g(r)o(eading)g(a)g(delimiter)g(character)-6 b(,)888 +1356 y(then)27 b(the)g FC(gobble?)g FD(parameter)e(determines)h(what)h +(to)g(do)f(with)i(the)e(terminating)888 1456 y(character)-6 +b(.)24 b(If)19 b(tr)o(ue,)g(the)g(character)f(is)i(r)o(emoved)e(fr)o +(om)h(the)g(input)h(str)o(eam;)f(if)g(false,)888 1555 +y(the)29 b(character)f(is)h(left)f(in)i(the)e(input)i(str)o(eam)e(wher) +o(e)g(a)g(subsequent)i(r)o(ead)d(oper)o(-)888 1655 y(ation)i(will)g(r)o +(etrieve)e(it.)49 b(In)29 b(either)f(case,)h(the)g(character)e(is)i +(also)f(the)h(\002rst)g(value)888 1755 y(r)o(eturned)20 +b(by)h(the)g(pr)o(ocedur)o(e)d(call.)681 1945 y FA(\(skip-char-set)38 +b FC(skip-chars)19 b([port])p FA(\))86 b Fw(\000)-14 +b(!)87 b FC(integer)696 b FD(pr)o(ocedur)o(e)888 2087 +y(Skip)21 b(characters)e(occurring)i(in)f(the)h(set)g +FC(skip-chars)o FD(;)f(r)o(eturn)g(the)g(number)h(of)f(char)o(-)888 +2186 y(acters)d(skipped.)24 b(The)18 b FC(skip-chars)e +FD(ar)o(gument)h(may)h(be)f(a)g(charset,)h(a)f(string,)h(a)f(char)o(-) +888 2286 y(acter)-6 b(,)20 b(or)h(a)f(character)f(pr)o(edicate;)g(it)i +(is)g(coer)o(ced)e(to)i(a)g(charset.)2051 5147 y(142)p +eop +%%Page: 143 151 +143 150 bop 365 1307 a Fz(Chapter)45 b(8)365 1792 y FE(A)-14 +b(wk,)51 b(record)h(I/O,)g(and)h(\002eld)365 2041 y(parsing)365 +2567 y FD(Unix)20 b(pr)o(ograms)g(fr)o(equently)f(pr)o(ocess)h(str)o +(eams)f(of)h(r)o(ecor)o(ds,)e(wher)o(e)i(each)f(r)o(ecor)o(d)f(is)i +(de-)365 2667 y(limited)25 b(by)g(a)f(newline,)h(and)f(r)o(ecor)o(ds)f +(ar)o(e)g(br)o(oken)i(into)g(\002elds)f(with)i(other)e(delimiters)365 +2767 y(\(for)k(example,)h(the)f(colon)h(character)e(in)h +FA(/etc/passwd)p FD(\).)43 b(Scsh)28 b(has)g(pr)o(ocedur)o(es)f(that) +365 2866 y(allow)22 b(the)g(pr)o(ogrammer)e(to)i(easily)g(do)f(this)h +(kind)g(of)g(pr)o(ocessing.)27 b(Scsh's)22 b(\002eld)f(parser)o(-)365 +2966 y(s)33 b(can)f(also)g(be)g(used)g(to)h(parse)e(other)h(kinds)h(of) +f(delimited)h(strings,)i(such)e(as)f(colon-)365 3066 +y(separated)c FA($PATH)g FD(lists.)54 b(These)30 b(r)o(outines)g(can)f +(be)h(used)g(with)g(scsh's)h FA(awk)e FD(loop)h(con-)365 +3165 y(str)o(uct)e(to)h(conveniently)g(perform)e(pattern-dir)o(ected)e +(computation)k(over)e(str)o(eams)h(of)365 3265 y(r)o(ecor)o(ds.)365 +3658 y Fy(8.1)99 b(Record)25 b(I/O)g(and)g(\002eld)g(parsing)365 +3932 y FD(The)f(pr)o(ocedur)o(es)e(in)j(this)g(section)f(ar)o(e)f(used) +h(to)g(r)o(ead)e(r)o(ecor)o(ds)h(fr)o(om)g(I/O)i(str)o(eams)e(and)365 +4031 y(parse)17 b(them)h(into)g(\002elds.)24 b(A)17 b(r)o(ecor)o(d)f +(is)h(de\002ned)g(as)g(text)g(terminated)g(by)h(some)g(delimiter)365 +4131 y(\(usually)25 b(a)f(newline\).)38 b(A)25 b(r)o(ecor)o(d)e(can)i +(be)f(split)h(into)h(\002elds)f(by)g(using)h(r)o(egular)d(expr)o(es-) +365 4230 y(sions)28 b(in)f(one)h(of)e(several)g(ways:)38 +b(to)27 b FC(match)e FD(\002elds,)j(to)f FC(separate)g +FD(\002elds,)h(or)f(to)g FC(terminate)365 4330 y FD(\002elds.)41 +b(The)26 b(\002eld)g(parsers)f(can)g(be)h(applied)f(to)h(arbitrary)f +(strings)h(\(one)g(common)i(use)365 4430 y(is)e(splitting)h(envir)o +(onment)f(variables)e(such)i(as)f FA($PATH)f FD(at)h(colons)h(into)g +(its)g(component)365 4529 y(elements\).)490 4699 y(The)18 +b(general)f(delimited-input)h(pr)o(ocedur)o(es)e(described)h(in)i +(chapter)e(7)g(ar)o(e)g(also)h(use-)365 4799 y(ful)37 +b(for)f(r)o(eading)g(simple)h(r)o(ecor)o(ds,)i(such)e(as)f(single)i +(lines,)j(paragraphs)35 b(of)h(text,)k(or)365 4898 y(strings)22 +b(terminated)e(by)h(speci\002c)g(characters.)1735 5147 +y(143)p eop +%%Page: 144 152 +144 151 bop 681 614 a FB(8.1.1)81 b(Reading)19 b(records)681 821 y FA(\(record-reader)38 b FC([delims)15 b(elide-delims?)g -(handle-delim])p FA(\))42 b Fw(\000)-14 b(!)43 b FC(pr)o(ocedur)o(e)86 -b FD(pr)o(ocedur)o(e)573 946 y(Returns)32 b(a)f(pr)o(ocedur)o(e)e(that) -i(r)o(eads)f(r)o(ecor)o(ds)g(fr)o(om)h(a)f(port.)58 b(The)31 -b(pr)o(ocedur)o(e)e(is)573 1045 y(invoked)21 b(as)f(follows:)756 -1184 y FA(\()p FC(r)o(eader)43 b([port])n FA(\))h Fw(\000)-15 -b(!)44 b FC(string)21 b(or)g(eof)573 1322 y FD(A)i(r)o(ecor)o(d)f(is)i -(a)f(sequence)h(of)f(characters)g(terminated)g(by)h(one)g(of)f(the)h -(characters)573 1422 y(in)32 b FC(delims)g FD(or)f(eof.)58 -b(If)32 b FC(elide-delims?)f FD(is)h(tr)o(ue,)i(then)e(a)f(contiguous)j -(sequence)e(of)573 1522 y(delimiter)c(chars)h(ar)o(e)e(taken)h(as)h(a)f -(single)h(r)o(ecor)o(d)e(delimiter)-6 b(.)49 b(If)28 -b FC(elide-delims?)g FD(is)573 1621 y(false,)34 b(then)e(a)g(delimiter) -g(char)f(coming)j(immediately)e(after)f(a)g(delimiter)h(char)573 -1721 y(pr)o(oduces)c(an)i(empty-string)g(r)o(ecor)o(d.)50 -b(The)29 b(r)o(eader)e(consumes)k(the)f(delimiting)573 -1820 y(char\(s\))20 b(befor)o(e)f(r)o(eturning)i(fr)o(om)f(a)g(r)o -(ead.)573 1953 y(The)26 b FC(delims)g FD(set)g(defaults)f(to)i(the)f -(set)g Fw(f)p FD(newline)p Fw(g)p FD(.)41 b(It)26 b(may)g(be)g(a)f -(charset,)i(string,)573 2053 y(character)-6 b(,)49 b(or)44 -b(character)g(pr)o(edicate,)k(and)c(is)h(coer)o(ced)f(to)h(a)f -(charset.)97 b(The)573 2152 y FC(elide-delims?)20 b FD(\003ag)h -(defaults)f(to)h FA(#f)p FD(.)573 2285 y(The)f FC(handle-delim)f -FD(ar)o(gument)g(contr)o(ols)i(what)f(is)h(done)f(with)h(the)f(r)o -(ecor)o(d's)f(termi-)573 2384 y(nating)i(delimiter)-6 -b(.)805 2525 y FA('trim)185 b FD(Delimiters)19 b(ar)o(e)e(trimmed.)25 -b(\(The)18 b(default\))805 2624 y FA('split)141 b FD(Reader)36 -b(r)o(eturns)g(delimiter)g(string)h(as)f(a)1210 2724 -y(second)29 b(ar)o(gument.)49 b(If)29 b(r)o(ecor)o(d)e(is)i(termi-)1210 -2824 y(nated)k(by)h(EOF)-8 b(,)34 b(then)g(the)f(eof)h(object)g(is)1210 -2923 y(r)o(eturned)20 b(as)g(this)i(second)f(ar)o(gument.)805 -3023 y FA('concat)97 b FD(The)38 b(r)o(ecor)o(d)e(and)h(its)h -(delimiter)g(ar)o(e)e(r)o(e-)1210 3122 y(turned)21 b(as)f(a)g(single)i -(string.)573 3293 y(The)34 b(r)o(eader)e(pr)o(ocedur)o(e)g(r)o(eturned) -h(takes)g(one)i(optional)g(ar)o(gument,)h(the)e(port)573 -3392 y(fr)o(om)21 b(which)h(to)g(r)o(ead,)d(which)j(defaults)f(to)g -(the)h(curr)o(ent)e(input)i(port.)27 b(It)21 b(r)o(eturns)g(a)573 -3492 y(string)g(or)g(eof.)365 3759 y FB(7.1.2)81 b(Parsing)20 -b(\002elds)365 3966 y FA(\(field-splitter)38 b FC([r)o(egexp)19 +(handle-delim])p FA(\))41 b Fw(\000)-14 b(!)44 b FC(pr)o(ocedur)o(e)86 +b FD(pr)o(ocedur)o(e)888 946 y(Returns)32 b(a)f(pr)o(ocedur)o(e)e(that) +j(r)o(eads)d(r)o(ecor)o(ds)h(fr)o(om)h(a)g(port.)57 b(The)31 +b(pr)o(ocedur)o(e)f(is)888 1045 y(invoked)21 b(as)g(follows:)1071 +1184 y FA(\()p FC(r)o(eader)43 b([port])o FA(\))g Fw(\000)-14 +b(!)43 b FC(string)21 b(or)g(eof)888 1322 y FD(A)j(r)o(ecor)o(d)d(is)j +(a)g(sequence)f(of)h(characters)e(terminated)h(by)h(one)g(of)g(the)f +(characters)888 1422 y(in)33 b FC(delims)e FD(or)h(eof.)58 +b(If)31 b FC(elide-delims?)g FD(is)h(tr)o(ue,)j(then)d(a)f(contiguous)i +(sequence)f(of)888 1522 y(delimiter)d(chars)f(ar)o(e)f(taken)i(as)f(a)g +(single)i(r)o(ecor)o(d)d(delimiter)-6 b(.)49 b(If)28 +b FC(elide-delims?)g FD(is)888 1621 y(false,)34 b(then)f(a)e(delimiter) +h(char)g(coming)h(immediately)f(after)f(a)h(delimiter)g(char)888 +1721 y(pr)o(oduces)d(an)g(empty-string)h(r)o(ecor)o(d.)50 +b(The)30 b(r)o(eader)d(consumes)j(the)g(delimiting)888 +1820 y(char\(s\))20 b(befor)o(e)g(r)o(eturning)g(fr)o(om)h(a)f(r)o +(ead.)888 1953 y(The)26 b FC(delims)g FD(set)g(defaults)g(to)g(the)g +(set)g Fw(f)p FD(newline)q Fw(g)p FD(.)40 b(It)27 b(may)f(be)f(a)h +(charset,)h(string,)888 2053 y(character)-6 b(,)49 b(or)c(character)e +(pr)o(edicate,)48 b(and)d(is)g(coer)o(ced)e(to)i(a)f(charset.)97 +b(The)888 2152 y FC(elide-delims?)20 b FD(\003ag)h(defaults)f(to)h +FA(#f)p FD(.)888 2285 y(The)f FC(handle-delim)f FD(ar)o(gument)h(contr) +o(ols)g(what)h(is)f(done)g(with)h(the)g(r)o(ecor)o(d's)d(termi-)888 +2384 y(nating)k(delimiter)-6 b(.)1121 2525 y FA('trim)185 +b FD(Delimiters)19 b(ar)o(e)e(trimmed.)25 b(\(The)18 +b(default\))1121 2624 y FA('split)141 b FD(Reader)35 +b(r)o(eturns)h(delimiter)g(string)i(as)e(a)1526 2724 +y(second)29 b(ar)o(gument.)49 b(If)28 b(r)o(ecor)o(d)f(is)j(termi-)1526 +2824 y(nated)i(by)i(EOF)-8 b(,)34 b(then)g(the)g(eof)f(object)h(is)1526 +2923 y(r)o(eturned)19 b(as)i(this)g(second)g(ar)o(gument.)1121 +3023 y FA('concat)97 b FD(The)37 b(r)o(ecor)o(d)f(and)i(its)g +(delimiter)f(ar)o(e)g(r)o(e-)1526 3122 y(turned)20 b(as)g(a)h(single)g +(string.)888 3293 y(The)34 b(r)o(eader)e(pr)o(ocedur)o(e)g(r)o(eturned) +h(takes)h(one)g(optional)h(ar)o(gument,)i(the)d(port)888 +3392 y(fr)o(om)21 b(which)h(to)g(r)o(ead,)d(which)k(defaults)d(to)i +(the)f(curr)o(ent)g(input)g(port.)27 b(It)22 b(r)o(eturns)f(a)888 +3492 y(string)h(or)f(eof.)681 3759 y FB(8.1.2)81 b(Parsing)20 +b(\002elds)681 3966 y FA(\(field-splitter)37 b FC([\002eld)20 b(num-\002elds])p FA(\))86 b Fw(\000)-14 b(!)87 b FC(pr)o(ocedur)o(e) -460 b FD(pr)o(ocedur)o(e)365 4066 y FA(\(infix-splitter)38 -b FC([delim)17 b(num-\002elds)h(handle-delim])p FA(\))65 -b Fw(\000)-14 b(!)66 b FC(pr)o(ocedur)o(e)87 b FD(pr)o(ocedur)o(e)365 -4165 y FA(\(suffix-splitter)37 b FC([delim)16 b(num-\002elds)f -(handle-delim])p FA(\))45 b Fw(\000)-14 b(!)47 b FC(pr)o(ocedur)o(e)87 -b FD(pr)o(ocedur)o(e)365 4265 y FA(\(sloppy-suffix-sp)o(li)o(tte)o(r)37 -b FC([delim)15 b(num-\002elds)h(handle-delim])p FA(\))41 -b Fw(\000)-14 b(!)43 b FC(pr)o(ocedur)o(e)87 b FD(pr)o(ocedur)o(e)573 -4389 y(These)21 b(functions)g(r)o(eturn)f(a)h(parser)e(function)j(that) -f(can)f(be)g(used)h(as)f(follows:)756 4528 y FA(\()p -FC(parser)43 b(string)h([start])o FA(\))f Fw(\000)-14 -b(!)43 b FC(string-list)573 4699 y FD(The)27 b(r)o(eturned)f(parsers)h -(split)g(strings)h(into)h(\002elds)e(de\002ned)g(by)g(r)o(egular)f -(expr)o(es-)573 4799 y(sions.)g(Y)-8 b(ou)19 b(can)e(parse)h(by)g -(specifying)g(a)g(pattern)f(that)h FC(separates)g FD(\002elds,)h(a)e -(pattern)573 4898 y(that)k FC(terminates)f FD(\002elds,)h(or)g(a)f -(pattern)g(that)h FC(matches)f FD(\002elds:)1737 5147 -y(1)-5 b(15)p eop -%%Page: 116 122 -116 121 bop 1121 601 a FD(Pr)o(ocedur)o(e)748 b(Pattern)p -1071 634 1835 4 v 1121 704 a FA(field-splitter)509 b -FD(matches)21 b(\002elds)1121 804 y FA(infix-splitter)509 -b FD(separates)19 b(\002elds)1121 903 y FA(suffix-splitter)465 -b FD(terminates)20 b(\002elds)1121 1003 y FA(sloppy-suffix-sp)o(li)o -(tte)o(r)160 b FD(terminates)20 b(\002elds)888 1189 y(These)i(parser)e -(generators)i(ar)o(e)e(contr)o(olled)h(by)h(a)f(range)g(of)h(options,)h -(so)f(that)f(you)888 1288 y(can)31 b(pr)o(ecisely)g(specify)g(what)g -(kind)g(of)h(parsing)f(you)h(want.)57 b(However)-6 b(,)33 -b(these)888 1388 y(options)22 b(default)e(to)h(r)o(easonable)f(values)g -(for)h(general)f(use.)888 1525 y(Defaults:)1121 1605 -y FC(delim)331 b FD(=)84 b FA("[)43 b(\\t\\n]+|$")95 -b FD(\(suf)o(\002x)20 b(delimiter:)26 b(white)21 b(space)f(or)h(eos\)) -1771 1705 y FA("[)43 b(\\t\\n]+")183 b FD(\(in\002x)21 -b(delimiter:)26 b(white)21 b(space\))1121 1805 y FC(r)o(e)453 -b FD(=)84 b FA("[^)42 b(\\t\\n]+")140 b FD(\(non-white-space\))1121 -1904 y FC(num-\002elds)158 b FD(=)84 b FA(#f)534 b FD(\(as)21 -b(many)g(\002elds)f(as)h(possible\))1121 2004 y FC(handle-delim)81 -b FD(=)j FA('trim)402 b FD(\(discar)o(d)19 b(delimiter)i(chars\))888 -2102 y(.)12 b(.)g(.)g(which)33 b(means:)45 b(br)o(eak)29 -b(the)i(string)g(at)g(white)g(space,)h(discar)o(ding)e(the)g(white)888 -2202 y(space,)20 b(and)g(parse)g(as)h(many)g(\002elds)g(as)f(possible.) -888 2339 y(The)26 b(r)o(egular)e(expr)o(ession)h FC(delim)f -FD(is)i(used)f(to)h(match)f(\002eld)g(delimiters.)39 -b(It)25 b(can)g(be)888 2439 y(either)16 b(a)g(string)h(or)g(a)e -(compiled)i(r)o(egexp)e(str)o(uctur)o(e)h(\(see)f(the)i -FA(make-regexp)11 b FD(pr)o(oce-)888 2539 y(dur)o(e\).)31 -b(In)23 b(the)g(separator)e(case,)i(it)g(defaults)f(to)h(a)f(r)o -(egular)g(expr)o(ession)g(matching)888 2638 y(white)j(space;)g(in)g -(the)f(terminator)h(case,)f(it)g(defaults)g(to)g(white)h(space)f(or)g -(end-of-)888 2738 y(string.)888 2875 y(The)f(r)o(egular)f(expr)o -(ession)h FC(r)o(e)h FD(is)f(a)g(r)o(egular)f(expr)o(ession)h(used)f -(to)i(match)f(\002elds.)33 b(It)888 2975 y(defaults)20 -b(to)h(non-white-space.)888 3112 y(The)g(boolean)g FC(handle-delim)f -FD(determines)g(what)h(to)g(do)g(with)h(delimiters.)1121 -3192 y FA('trim)185 b FD(Delimiters)21 b(ar)o(e)e(thr)o(own)j(away)e -(after)f(parsing.)26 b(\(default\))1121 3292 y FA('concat)97 -b FD(Delimiters)21 b(ar)o(e)e(appended)h(to)h(the)g(\002eld)f(pr)o -(eceding)g(them.)1121 3391 y FA('split)141 b FD(Delimiters)21 -b(ar)o(e)e(r)o(eturned)h(as)g(separate)g(elements)h(in)g(the)g(\002eld) -f(list.)888 3528 y(The)31 b FC(num-\002elds)f FD(ar)o(gument)h(used)f -(to)h(cr)o(eate)f(the)g(parser)g(speci\002es)h(how)h(many)888 -3628 y(\002elds)20 b(to)h(parse.)j(If)c FA(#f)f FD(\(the)h(default\),)e -(the)i(pr)o(ocedur)o(e)e(parses)h(them)i(all.)k(If)19 -b(a)h(pos-)888 3727 y(itive)25 b(integer)g Fo(n)p FD(,)h(exactly)e -(that)h(many)g(\002elds)g(ar)o(e)e(parsed;)i(it)h(is)f(an)f(err)o(or)g -(if)h(ther)o(e)888 3827 y(ar)o(e)g(mor)o(e)h(or)g(fewer)f(than)i -Fo(n)e FD(\002elds)i(in)f(the)g(r)o(ecor)o(d.)40 b(If)26 -b FC(num-\002elds)f FD(is)i(a)e(negative)888 3927 y(integer)20 -b(or)g(zer)o(o,)f(then)i Fw(j)p Fo(n)p Fw(j)f FD(\002elds)g(ar)o(e)e -(parsed,)h(and)h(the)g(r)o(emainder)e(of)i(the)g(string)888 -4026 y(is)k(r)o(eturned)e(in)i(the)g(last)f(element)h(of)f(the)h -(\002eld)f(list;)j(it)d(is)h(an)f(err)o(or)g(if)g(fewer)g(than)888 -4126 y Fw(j)p Fo(n)p Fw(j)e FD(\002elds)g(can)f(be)h(parsed.)888 -4263 y(The)c(\002eld)f(parser)f(pr)o(oduced)g(is)i(a)f(pr)o(ocedur)o(e) -e(that)j(can)f(be)g(employed)g(as)g(follows:)1071 4412 -y FA(\()p FC(parse)43 b(string)h([start])o FA(\))f Fn(=)-14 -b Fw(\))44 b FC(string-list)888 4562 y FD(The)30 b(optional)g -FC(start)g FD(ar)o(gument)f(\(default)f(0\))h(speci\002es)h(wher)o(e)f -(in)h(the)g(string)h(to)888 4661 y(begin)21 b(the)g(parse.)k(It)c(is)g -(an)f(err)o(or)g(if)h FC(start)i Fo(>)f FA(\(string-length)38 -b FC(string)p FA(\))p FD(.)888 4799 y(The)26 b(parsers)f(r)o(eturned)g -(by)h(the)g(four)f(parser)g(generators)h(implement)g(dif)o(fer)o(ent) -888 4898 y(kinds)c(of)e(\002eld)h(parsing:)2053 5147 -y(1)-5 b(16)p eop -%%Page: 117 123 -117 122 bop 573 614 a FA(field-splitter)36 b FD(The)20 -b(r)o(egular)g(expr)o(ession)g(speci\002es)h(the)g(actual)f(\002eld.) -573 759 y FA(suffix-splitter)35 b FD(Delimiters)d(ar)o(e)f(interpr)o -(eted)f(as)h(element)h FC(terminators)p FD(.)58 b(If)756 -859 y(vertical-bar)36 b(is)i(the)g(the)g(delimiter)-6 -b(,)42 b(then)d(the)f(string)h FA("")e FD(is)h(the)g(empty)756 -958 y(r)o(ecor)o(d)24 b FA(\(\))p FD(,)k FA("foo|")c -FD(pr)o(oduces)i(a)g(one-\002eld)g(r)o(ecor)o(d)f FA(\("foo"\))p -FD(,)g(and)i FA("foo")756 1058 y FD(is)21 b(an)f(err)o(or)-6 -b(.)756 1180 y(The)20 b(syntax)h(of)g(suf)o(\002x-delimited)f(r)o(ecor) -o(ds)f(is:)961 1349 y Fo(<)p FC(r)o(ecord)p Fo(>)98 b -FD(::=)h FA("")186 b FD(\(Empty)21 b(r)o(ecor)o(d\))1431 -1448 y Fw(j)134 b Fo(<)p FC(element)p Fo(>)21 b(<)p FC(delim)p -Fo(>)e(<)p FC(r)o(ecord)p Fo(>)756 1637 y FD(It)27 b(is)i(an)e(err)o -(or)g(if)h(a)f(non-empty)i(r)o(ecor)o(d)d(does)i(not)g(end)g(with)h(a)e -(delimiter)-6 b(.)756 1736 y(T)e(o)22 b(make)g(the)g(last)g(delimiter)g -(optional,)h(make)f(sur)o(e)g(the)g(delimiter)g(r)o(egexp)756 -1836 y(matches)e(the)h(end-of-string)g(\(r)o(egexp)e -FA("$")p FD(\).)573 1981 y FA(infix-splitter)36 b FD(Delimiters)44 -b(ar)o(e)e(interpr)o(eted)g(as)h(element)g FC(separators)p -FD(.)94 b(If)756 2080 y(comma)21 b(is)g(the)g(delimiter)-6 -b(,)21 b(then)g(the)h(string)f FA("foo,")e FD(pr)o(oduces)h(a)g -(two-\002eld)756 2180 y(r)o(ecor)o(d)f FA(\("foo")41 -b(""\))p FD(.)756 2302 y(The)20 b(syntax)h(of)g(in\002x-delimited)g(r)o -(ecor)o(ds)e(is:)961 2471 y Fo(<)p FC(r)o(ecord)p Fo(>)431 -b FD(::=)99 b FA("")186 b FD(\(For)o(ced)20 b(to)h(be)f(empty)h(r)o -(ecor)o(d\))1764 2570 y Fw(j)134 b Fo(<)p FC(r)o(eal-in\002x-r)o(ecord) -p Fo(>)961 2769 y(<)p FC(r)o(eal-in\002x-r)o(ecord)p -Fo(>)97 b FD(::=)i Fo(<)p FC(element)p Fo(>)21 b(<)p -FC(delim)p Fo(>)e(<)p FC(r)o(eal-in\002x-r)o(ecord)p -Fo(>)1764 2869 y Fw(j)134 b Fo(<)p FC(element)p Fo(>)756 -3057 y FD(Note)52 b(that)g(separator)g(semantics)g(doesn't)h(r)o(eally) -e(allow)i(for)f(empty)756 3157 y(r)o(ecor)o(ds\227the)k(straightforwar) -o(d)h(grammar)g(\()p FC(i.e.)o FD(,)67 b Fo(<)p FC(r)o(eal-in\002x-r)o -(ecord)p Fo(>)p FD(\))756 3257 y(parses)34 b(an)h(empty)g(string)h(as)f -(a)g(singleton)h(list)g(whose)g(one)g(\002eld)f(is)g(the)756 -3356 y(empty)21 b(string,)h FA(\(""\))p FD(,)d(not)j(as)f(the)g(empty)h -(r)o(ecor)o(d)d FA(\(\))p FD(.)26 b(This)c(is)g(unfortunate,)756 -3456 y(since)c(it)g(means)g(that)g(in\002x)h(string)g(parsing)f -(doesn't)g(make)g FA(string-append)756 3555 y FD(and)i -FA(append)e FD(isomorphic.)27 b(For)21 b(example,)911 -3722 y FA(\(\(infix-splitter)37 b(":"\))42 b(\(string-append)37 -b FC(x)44 b FA(":")e FC(y)o FA(\)\))756 3889 y FD(doesn't)21 -b(always)f(equal)911 4034 y FA(\(append)40 b(\(\(infix-splitter)d -(":"\))42 b FC(x)p FA(\))1259 4133 y(\(\(infix-splitter)37 -b(":"\))42 b FC(y)p FA(\)\))756 4278 y FD(It)23 b(fails)g(when)h +539 b FD(pr)o(ocedur)o(e)681 4066 y FA(\(infix-splitter)37 +b FC([delim)18 b(num-\002elds)g(handle-delim])p FA(\))64 +b Fw(\000)-14 b(!)67 b FC(pr)o(ocedur)o(e)86 b FD(pr)o(ocedur)o(e)681 +4165 y FA(\(suffix-splitter)37 b FC([delim)15 b(num-\002elds)h +(handle-delim])p FA(\))45 b Fw(\000)-14 b(!)47 b FC(pr)o(ocedur)o(e)86 +b FD(pr)o(ocedur)o(e)681 4265 y FA(\(sloppy-suffix-s)o(pl)o(itt)o(er)37 +b FC([delim)15 b(num-\002elds)g(handle-delim])p FA(\))42 +b Fw(\000)-15 b(!)44 b FC(pr)o(ocedur)o(e)86 b FD(pr)o(ocedur)o(e)888 +4389 y(These)21 b(functions)h(r)o(eturn)e(a)g(parser)g(function)h(that) +g(can)f(be)h(used)f(as)h(follows:)1071 4528 y FA(\()p +FC(parser)44 b(string)f([start])o FA(\))g Fw(\000)-14 +b(!)44 b FC(string-list)888 4699 y FD(The)28 b(r)o(eturned)e(parsers)g +(split)i(strings)g(into)g(\002elds)f(de\002ned)g(by)h(r)o(egular)e +(expr)o(es-)888 4799 y(sions.)g(Y)-8 b(ou)19 b(can)f(parse)f(by)h +(specifying)g(a)g(pattern)f(that)h FC(separates)h FD(\002elds,)f(a)g +(pattern)888 4898 y(that)j FC(terminates)g FD(\002elds,)g(or)f(a)h +(pattern)f(that)h FC(matches)e FD(\002elds:)2051 5147 +y(144)p eop +%%Page: 145 153 +145 152 bop 805 601 a FD(Pr)o(ocedur)o(e)748 b(Pattern)p +756 634 1835 4 v 805 704 a FA(field-splitter)509 b FD(matches)21 +b(\002elds)805 804 y FA(infix-splitter)509 b FD(separates)20 +b(\002elds)805 903 y FA(suffix-splitter)465 b FD(terminates)21 +b(\002elds)805 1003 y FA(sloppy-suffix-spl)o(it)o(ter)159 +b FD(terminates)21 b(\002elds)573 1198 y(These)g(parser)g(generators)g +(ar)o(e)f(contr)o(olled)i(by)g(a)f(range)g(of)g(options,)i(so)f(that)g +(you)573 1298 y(can)31 b(pr)o(ecisely)f(specify)h(what)g(kind)h(of)f +(parsing)g(you)h(want.)57 b(However)-6 b(,)33 b(these)573 +1397 y(options)22 b(default)e(to)h(r)o(easonable)e(values)i(for)f +(general)g(use.)573 1537 y(Defaults:)805 1617 y FC(delim)332 +b FD(=)83 b FA(\(rx)43 b(\(|)f(\(+)h(white\))e(eos\)\))98 +b FD(\(suf)o(\002x)20 b(delimiter:)25 b(white)c(space)f(or)h(eos\))1455 +1716 y FA(\(rx)43 b(\(+)f(white\)\))446 b FD(\(in\002x)21 +b(delimiter:)k(white)c(space\))805 1816 y FC(\002eld)376 +b FD(=)83 b FA(\(rx)43 b(\(+)f(\(~)h(white\)\)\))271 +b FD(\(non-white-space\))805 1916 y FC(num-\002elds)159 +b FD(=)83 b FA(#f)971 b FD(\(as)20 b(many)h(\002elds)g(as)f(possible\)) +805 2015 y FC(handle-delim)82 b FD(=)h FA('trim)839 b +FD(\(discar)o(d)19 b(delimiter)h(chars\))573 2114 y(.)12 +b(.)g(.)g(which)32 b(means:)45 b(br)o(eak)30 b(the)h(string)g(at)f +(white)h(space,)h(discar)o(ding)e(the)h(white)573 2214 +y(space,)20 b(and)g(parse)g(as)g(many)h(\002elds)g(as)g(possible.)573 +2354 y(The)f FC(delim)f FD(parameter)f(is)i(a)g(r)o(egular)e(expr)o +(ession)i(matching)g(the)g(text)g(that)f(occurs)573 2453 +y(between)f(\002elds.)25 b(See)18 b(chapter)g(6)g(for)h(information)g +(on)h(r)o(egular)d(expr)o(essions,)i(and)573 2553 y(the)26 +b FA(rx)g FD(form)g(used)g(to)h(specify)f(them.)42 b(In)27 +b(the)f(separator)g(case,)g(it)h(defaults)e(to)i(a)573 +2653 y(pattern)20 b(matching)i(white)f(space;)f(in)i(the)f(terminator)g +(case,)f(it)h(defaults)f(to)h(white)573 2752 y(space)f(or)h +(end-of-string.)573 2892 y(The)29 b FC(\002eld)g FD(parameter)e(is)j(a) +e(r)o(egular)g(expr)o(ession)h(used)g(to)g(match)h(\002elds.)50 +b(It)29 b(de-)573 2992 y(faults)20 b(to)h(non-white-space.)573 +3132 y(The)28 b FC(delim)g FD(patterns)g(may)g(also)g(be)g(given)h(as)e +(a)h(string,)j(character)-6 b(,)28 b(or)g(char)o(-set,)573 +3232 y(which)g(ar)o(e)e(coer)o(ced)g(to)i(r)o(egular)e(expr)o(essions.) +46 b(So)27 b(the)h(following)h(expr)o(essions)573 3331 +y(ar)o(e)c(all)i(equivalent,)h(each)f(pr)o(oducing)f(a)h(function)g +(that)g(splits)h(strings)f(apart)f(at)573 3431 y(colons:)756 +3587 y FA(\(infix-splitter)37 b(\(rx)42 b(":"\)\))756 +3686 y(\(infix-splitter)37 b(":"\))756 3786 y(\(infix-splitter)g +(#\\:\))756 3886 y(\(infix-splitter)g(\(char-set)j(#\\:\)\))573 +4082 y FD(The)21 b(boolean)g FC(handle-delim)e FD(determines)i(what)g +(to)g(do)g(with)g(delimiters.)805 4161 y FA('trim)185 +b FD(Delimiters)21 b(ar)o(e)f(thr)o(own)h(away)f(after)g(parsing.)25 +b(\(default\))805 4261 y FA('concat)97 b FD(Delimiters)21 +b(ar)o(e)f(appended)f(to)i(the)g(\002eld)g(pr)o(eceding)f(them.)805 +4360 y FA('split)141 b FD(Delimiters)21 b(ar)o(e)f(r)o(eturned)f(as)i +(separate)e(elements)i(in)g(the)g(\002eld)g(list.)573 +4500 y(The)31 b FC(num-\002elds)f FD(ar)o(gument)g(used)h(to)g(cr)o +(eate)e(the)i(parser)f(speci\002es)h(how)g(many)573 4599 +y(\002elds)20 b(to)g(parse.)25 b(If)19 b FA(#f)g FD(\(the)h(default\),) +f(the)h(pr)o(ocedur)o(e)e(parses)h(them)h(all.)25 b(If)20 +b(a)f(pos-)573 4699 y(itive)25 b(integer)g Fo(n)p FD(,)g(exactly)f +(that)h(many)g(\002elds)g(ar)o(e)e(parsed;)j(it)f(is)g(an)g(err)o(or)f +(if)g(ther)o(e)573 4799 y(ar)o(e)g(mor)o(e)i(or)g(fewer)g(than)g +Fo(n)g FD(\002elds)g(in)h(the)f(r)o(ecor)o(d.)40 b(If)25 +b FC(num-\002elds)h FD(is)g(a)g(negative)573 4898 y(integer)20 +b(or)g(zer)o(o,)f(then)h Fw(j)p Fo(n)p Fw(j)g FD(\002elds)g(ar)o(e)f +(parsed,)g(and)g(the)h(r)o(emainder)f(of)h(the)g(string)1735 +5147 y(145)p eop +%%Page: 146 154 +146 153 bop 888 614 a FD(is)24 b(r)o(eturned)e(in)i(the)g(last)f +(element)h(of)f(the)h(\002eld)f(list;)j(it)d(is)h(an)f(err)o(or)g(if)g +(fewer)g(than)888 714 y Fw(j)p Fo(n)p Fw(j)e FD(\002elds)g(can)f(be)h +(parsed.)888 846 y(The)c(\002eld)f(parser)f(pr)o(oduced)g(is)i(a)f(pr)o +(ocedur)o(e)e(that)j(can)f(be)g(employed)g(as)g(follows:)1071 +984 y FA(\()p FC(parse)43 b(string)h([start])o FA(\))f +Fn(=)-14 b Fw(\))44 b FC(string-list)888 1123 y FD(The)30 +b(optional)g FC(start)g FD(ar)o(gument)f(\(default)f(0\))h(speci\002es) +h(wher)o(e)f(in)h(the)g(string)h(to)888 1223 y(begin)21 +b(the)g(parse.)k(It)c(is)g(an)f(err)o(or)g(if)h FC(start)i +Fo(>)f FA(\(string-length)38 b FC(string)p FA(\))p FD(.)888 +1354 y(The)26 b(parsers)f(r)o(eturned)g(by)h(the)g(four)f(parser)g +(generators)h(implement)g(dif)o(fer)o(ent)888 1454 y(kinds)c(of)e +(\002eld)h(parsing:)888 1618 y FA(field-splitter)36 b +FD(The)21 b(r)o(egular)e(expr)o(ession)i(speci\002es)g(the)g(actual)e +(\002eld.)888 1749 y FA(suffix-splitter)36 b FD(Delimiters)c(ar)o(e)e +(interpr)o(eted)g(as)i(element)f FC(terminators)p FD(.)58 +b(If)1071 1848 y(vertical-bar)36 b(is)i(the)h(the)f(delimiter)-6 +b(,)42 b(then)c(the)g(string)h FA("")e FD(is)i(the)f(empty)1071 +1948 y(r)o(ecor)o(d)25 b FA(\(\))p FD(,)i FA("foo|")d +FD(pr)o(oduces)i(a)g(one-\002eld)h(r)o(ecor)o(d)e FA(\("foo"\))p +FD(,)g(and)h FA("foo")1071 2048 y FD(is)21 b(an)g(err)o(or)-6 +b(.)1071 2163 y(The)21 b(syntax)g(of)f(suf)o(\002x-delimited)g(r)o +(ecor)o(ds)f(is:)1276 2303 y Fo(<)p FC(r)o(ecord)p Fo(>)98 +b FD(::=)i FA("")186 b FD(\(Empty)20 b(r)o(ecor)o(d\))1747 +2403 y Fw(j)134 b Fo(<)p FC(element)p Fo(>)20 b(<)p FC(delim)p +Fo(>)g(<)p FC(r)o(ecord)p Fo(>)1071 2556 y FD(It)28 b(is)g(an)g(err)o +(or)f(if)g(a)h(non-empty)g(r)o(ecor)o(d)e(does)i(not)h(end)f(with)g(a)g +(delimiter)-6 b(.)1071 2656 y(T)e(o)23 b(make)f(the)g(last)g(delimiter) +g(optional,)h(make)f(sur)o(e)f(the)h(delimiter)g(r)o(egexp)1071 +2755 y(matches)f(the)g(end-of-string)f(\(sr)o(e)g FA(eos)p +FD(\).)888 2886 y FA(infix-splitter)36 b FD(Delimiters)18 +b(ar)o(e)e(interpr)o(eted)f(as)i(element)h FC(separators)p +FD(.)24 b(If)17 b(com-)1071 2986 y(ma)36 b(is)h(the)f(delimiter)-6 +b(,)39 b(then)e(the)f(string)h FA("foo,")d FD(pr)o(oduces)h(a)h +(two-\002eld)1071 3085 y(r)o(ecor)o(d)19 b FA(\("foo")41 +b(""\))p FD(.)1071 3201 y(The)21 b(syntax)g(of)f(in\002x-delimited)h(r) +o(ecor)o(ds)e(is:)1276 3341 y Fo(<)p FC(r)o(ecord)p Fo(>)431 +b FD(::=)100 b FA("")186 b FD(\(For)o(ced)19 b(to)i(be)g(empty)g(r)o +(ecor)o(d\))2080 3441 y Fw(j)134 b Fo(<)p FC(r)o(eal-in\002x-r)o(ecord) +p Fo(>)1276 3640 y(<)p FC(r)o(eal-in\002x-r)o(ecord)p +Fo(>)97 b FD(::=)j Fo(<)p FC(element)p Fo(>)20 b(<)p +FC(delim)p Fo(>)f(<)p FC(r)o(eal-in\002x-r)o(ecord)p +Fo(>)2080 3739 y Fw(j)134 b Fo(<)p FC(element)p Fo(>)1071 +3893 y FD(Note)58 b(that)g(separator)f(semantics)i(doesn't)f(r)o(eally) +f(allow)i(for)e(emp-)1071 3992 y(ty)33 b(r)o(ecor)o(ds\227the)f +(straightforwar)o(d)f(grammar)i(\()p FC(i.e.)o FD(,)j +Fo(<)p FC(r)o(eal-in\002x-r)o(ecord)p Fo(>)p FD(\))1071 +4092 y(parses)17 b(an)h(empty)g(string)g(as)g(a)f(singleton)i(list)g +(whose)f(one)h(\002eld)e(is)h(the)g(emp-)1071 4192 y(ty)g(string,)g +FA(\(""\))p FD(,)e(not)j(as)e(the)g(empty)h(r)o(ecor)o(d)e +FA(\(\))p FD(.)23 b(This)18 b(is)g(unfortunate,)g(since)1071 +4291 y(it)23 b(means)g(that)g(in\002x)g(string)h(parsing)f(doesn't)g +(make)g FA(string-append)17 b FD(and)1071 4391 y FA(append)h +FD(isomorphic.)27 b(For)21 b(example,)1226 4529 y FA +(\(\(infix-splitter)37 b(":"\))42 b(\(string-append)c +FC(x)43 b FA(":")f FC(y)p FA(\)\))1071 4668 y FD(doesn't)21 +b(always)g(equal)1226 4799 y FA(\(append)41 b(\(\(infix-splitter)c +(":"\))42 b FC(x)o FA(\))1575 4898 y(\(\(infix-splitter)37 +b(":"\))42 b FC(y)o FA(\)\))2051 5147 y FD(146)p eop +%%Page: 147 155 +147 154 bop 365 535 2865 4 v 365 1403 4 868 v 519 657 +a Fk(Recor)o(d)218 b(:)23 b(suf)o(\002x)147 b Fj(:|$)20 +b Fk(suf)o(\002x)288 b(:)23 b(in\002x)418 b(non-:)24 +b(\002eld)p 470 688 2656 4 v 519 752 a Fj("")375 b(\(\))296 +b(\(\))532 b(\(\))f(\(\))519 843 y(":")336 b(\(""\))218 +b(\(""\))454 b(\("")40 b(""\))335 b(\(\))519 934 y("foo:")219 +b(\("foo"\))101 b(\("foo"\))337 b(\("foo")40 b(""\))218 +b(\("foo"\))519 1026 y(":foo")h Fh(err)o(or)226 b Fj(\("")40 +b("foo"\))219 b(\("")40 b("foo"\))218 b(\("foo"\))519 +1117 y("foo:bar")102 b Fh(err)o(or)226 b Fj(\("foo")41 +b("bar"\))101 b(\("foo")40 b("bar"\))101 b(\("foo")41 +b("bar"\))631 1379 y FD(Figur)o(e)20 b(8.1:)25 b(Using)c(dif)o(fer)o +(ent)d(grammars)j(to)g(split)g(r)o(ecor)o(ds)e(into)j(\002elds.)p +3226 1403 4 868 v 365 1406 2865 4 v 756 1664 a(It)h(fails)g(when)h FC(x)e FD(or)i FC(y)e FD(ar)o(e)g(the)h(empty)h(string.)33 -b(T)-8 b(erminator)24 b(semantics)g FC(does)756 4378 +b(T)-8 b(erminator)24 b(semantics)g FC(does)756 1764 y FD(pr)o(eserve)19 b(a)h(similar)h(isomorphism.)756 -4500 y(However)-6 b(,)32 b(separator)d(semantics)i(is)g(fr)o(equently)g -(what)f(other)h(Unix)g(soft-)756 4599 y(war)o(e)21 b(uses,)i(so)g(to)g +1884 y(However)-6 b(,)32 b(separator)d(semantics)i(is)g(fr)o(equently)g +(what)f(other)h(Unix)g(soft-)756 1984 y(war)o(e)21 b(uses,)i(so)g(to)g (parse)f(their)h(strings,)h(we)e(need)h(to)g(use)f(it.)32 -b(For)23 b(example,)756 4699 y(Unix)g FA($PATH)e FD(lists)k(have)e +b(For)23 b(example,)756 2084 y(Unix)g FA($PATH)e FD(lists)k(have)e (separator)f(semantics.)34 b(The)23 b(path)h(list)g FA("/bin:")c -FD(is)756 4799 y(br)o(oken)h(up)g(into)i FA(\("/bin")41 +FD(is)756 2183 y(br)o(oken)h(up)g(into)i FA(\("/bin")41 b(""\))p FD(,)20 b(not)i FA(\("/bin"\))p FD(.)j(Comma-separated)20 -b(lists)756 4898 y(should)h(also)g(be)f(parsed)g(this)i(way)-9 -b(.)1737 5147 y(1)k(17)p eop -%%Page: 118 124 -118 123 bop 681 535 2865 4 v 681 1403 4 868 v 835 657 -a Fk(Recor)o(d)218 b(:)22 b(suf)o(\002x)148 b Fh(:|$)19 -b Fk(suf)o(\002x)288 b(:)23 b(in\002x)419 b(non-:)23 -b(\002eld)p 785 688 2656 4 v 835 752 a Fh("")375 b(\(\))296 -b(\(\))531 b(\(\))h(\(\))835 843 y(":")336 b(\(""\))218 -b(\(""\))453 b(\("")40 b(""\))336 b(\(\))835 934 y("foo:")219 -b(\("foo"\))101 b(\("foo"\))336 b(\("foo")41 b(""\))218 -b(\("foo"\))835 1026 y(":foo")h Fi(err)o(or)226 b Fh(\("")40 -b("foo"\))218 b(\("")40 b("foo"\))219 b(\("foo"\))835 -1117 y("foo:bar")102 b Fi(err)o(or)226 b Fh(\("foo")40 -b("bar"\))101 b(\("foo")41 b("bar"\))101 b(\("foo")41 -b("bar"\))946 1379 y FD(Figur)o(e)21 b(7.1:)j(Using)d(dif)o(fer)o(ent)e -(grammars)h(to)h(split)h(r)o(ecor)o(ds)d(into)j(\002elds.)p -3542 1403 4 868 v 681 1406 2865 4 v 888 1654 a FA(sloppy-suffix)36 -b FD(The)23 b(same)f(as)g(the)g FA(suffix)e FD(case,)i(except)f(that)i -(the)f(parser)f(will)1071 1754 y(skip)26 b(an)f(initial)g(delimiter)g -(string)h(if)f(the)g(string)h(begins)g(with)g(one)f(instead)1071 -1853 y(of)33 b(parsing)g(an)f(initial)h(empty)g(\002eld.)62 -b(This)33 b(can)g(be)f(used,)j(for)e(example,)1071 1953 -y(to)27 b(\002eld-split)g(a)f(sequence)i(of)e(English)i(text)f(at)f -(white-space)h(boundaries,)1071 2053 y(wher)o(e)19 b(the)h(string)h -(may)e(begin)h(or)g(end)g(with)g(white)h(space,)e(by)h(using)g(r)o -(egex)1071 2152 y FA("[)43 b(\\t]+|$")p FD(.)24 b(\(But)d(you)g(would)h -(be)f(better)g(of)o(f)f(using)i FA(field-splitter)16 -b FD(in)1071 2252 y(this)21 b(case.\))805 2467 y(Figur)o(e)28 -b(7.1)e(shows)j(how)g(the)f(dif)o(fer)o(ent)d(parser)i(grammars)h -(split)g(apart)e(the)i(same)681 2567 y(strings.)103 b(Having)30 -b(to)f(choose)i(between)e(the)g(dif)o(fer)o(ent)e(grammars)i(r)o(equir) -o(es)g(you)h(to)681 2666 y(decide)i(what)h(you)h(want,)i(but)d(at)g -(least)g(you)h(can)e(be)h(pr)o(ecise)f(about)h(what)h(you)f(ar)o(e)681 -2766 y(parsing.)25 b(T)-8 b(ake)20 b(\002fteen)f(seconds)i(and)e(think) -i(it)f(out.)26 b(Say)19 b(what)h(you)g(mean;)g(mean)g(what)681 -2866 y(you)h(say)-9 b(.)681 3015 y FA(\(join-strings)38 -b FC(string-list)20 b([delimiter)h(grammar])p FA(\))85 -b Fw(\000)-14 b(!)87 b FC(string)282 b FD(pr)o(ocedur)o(e)888 -3155 y(This)22 b(pr)o(ocedur)o(e)d(is)i(a)g(simple)g(unparser)o(\227it) -f(pastes)h(strings)h(together)f(using)h(the)888 3255 -y(delimiter)f(string.)888 3388 y(The)40 b FC(grammar)f -FD(ar)o(gument)g(is)h(one)h(of)e(the)h(symbols)h FA(infix)d -FD(\(the)i(default\))e(or)888 3487 y FA(suffix)p FD(;)30 -b(it)f(determines)g(whether)g(the)g(delimiter)g(string)g(is)g(used)g -(as)f(a)h(separa-)888 3587 y(tor)21 b(or)g(as)g(a)f(terminator)-6 -b(.)888 3719 y(The)20 b(delimiter)f(is)h(the)g(string)g(used)g(to)g -(delimit)g(elements;)g(it)f(defaults)g(to)h(a)f(single)888 -3819 y(space)h FA(")43 b(")p FD(.)888 3952 y(Example:)1071 -4117 y FA(\(join-strings)38 b('\("foo")j("bar")g("baz"\))h(":"\))1245 -4217 y Fn(=)-14 b Fw(\))87 b FA("foo:bar:baz")681 4567 -y FB(7.1.3)81 b(Field)19 b(readers)681 4774 y FA(\(field-reader)38 +b(lists)756 2283 y(should)h(also)g(be)f(parsed)g(this)i(way)-9 +b(.)573 2425 y FA(sloppy-suffix)36 b FD(The)22 b(same)g(as)g(the)h +FA(suffix)d FD(case,)h(except)h(that)g(the)h(parser)e(will)756 +2524 y(skip)k(an)g(initial)h(delimiter)f(string)h(if)f(the)g(string)h +(begins)f(with)h(one)g(instead)756 2624 y(of)32 b(parsing)h(an)g +(initial)g(empty)g(\002eld.)61 b(This)34 b(can)e(be)h(used,)i(for)e +(example,)756 2723 y(to)27 b(\002eld-split)g(a)f(sequence)h(of)g +(English)h(text)e(at)h(white-space)f(boundaries,)756 +2823 y(wher)o(e)19 b(the)h(string)g(may)g(begin)g(or)g(end)f(with)i +(white)f(space,)f(by)h(using)h(r)o(egex)911 2965 y FA(\(rx)42 +b(\(|)h(\(+)g(white\))e(eos\)\))756 3107 y FD(\(But)20 +b(you)h(would)g(be)g(better)f(of)o(f)g(using)h FA(field-splitter)15 +b FD(in)22 b(this)f(case.\))490 3367 y(Figur)o(e)27 b(8.1)g(shows)i +(how)f(the)g(dif)o(fer)o(ent)e(parser)h(grammars)g(split)h(apart)f(the) +h(same)365 3467 y(strings.)104 b(Having)29 b(to)h(choose)g(between)f +(the)h(dif)o(fer)o(ent)d(grammars)i(r)o(equir)o(es)f(you)i(to)365 +3567 y(decide)i(what)i(you)f(want,)k(but)c(at)g(least)f(you)i(can)f(be) +g(pr)o(ecise)f(about)h(what)g(you)h(ar)o(e)365 3666 y(parsing.)26 +b(T)-8 b(ake)19 b(\002fteen)h(seconds)g(and)g(think)g(it)h(out.)k(Say) +19 b(what)h(you)h(mean;)f(mean)f(what)365 3766 y(you)j(say)-9 +b(.)365 3924 y FA(\(join-strings)39 b FC(string-list)20 +b([delimiter)g(grammar])p FA(\))86 b Fw(\000)-15 b(!)88 +b FC(string)282 b FD(pr)o(ocedur)o(e)573 4074 y(This)21 +b(pr)o(ocedur)o(e)e(is)j(a)e(simple)i(unparser)o(\227it)e(pastes)g +(strings)i(together)g(using)f(the)573 4174 y(delimiter)g(string.)573 +4316 y(The)40 b FC(grammar)e FD(ar)o(gument)i(is)g(one)g(of)g(the)g +(symbols)h FA(infix)c FD(\(the)j(default\))e(or)573 4415 +y FA(suffix)p FD(;)30 b(it)f(determines)g(whether)g(the)g(delimiter)f +(string)i(is)f(used)f(as)h(a)f(separa-)573 4515 y(tor)21 +b(or)g(as)f(a)g(terminator)-6 b(.)573 4657 y(The)19 b(delimiter)h(is)g +(the)g(string)g(used)f(to)h(delimit)g(elements;)g(it)g(defaults)f(to)h +(a)f(single)573 4756 y(space)h FA(")43 b(")p FD(.)573 +4898 y(Example:)1735 5147 y(147)p eop +%%Page: 148 156 +148 155 bop 1071 614 a FA(\(join-strings)38 b('\("foo")j("bar")g +("baz"\))h(":"\))1245 714 y Fn(=)-14 b Fw(\))87 b FA("foo:bar:baz")681 +1058 y FB(8.1.3)81 b(Field)19 b(readers)681 1263 y FA(\(field-reader)38 b FC([\002eld-parser)20 b(r)o(ec-r)o(eader])p FA(\))86 b Fw(\000)-14 b(!)87 b FC(pr)o(ocedur)o(e)418 b FD(pr)o(ocedur)o(e)888 -4898 y(This)33 b(utility)f(r)o(eturns)g(a)f(pr)o(ocedur)o(e)f(that)i(r) -o(eads)e(r)o(ecor)o(ds)g(with)j(\002eld)f(str)o(uctur)o(e)2053 -5147 y(1)-5 b(18)p eop -%%Page: 119 125 -119 124 bop 573 614 a FD(fr)o(om)27 b(a)f(port.)45 b(The)27 -b(r)o(eader)6 b('s)26 b(interface)g(is)i(designed)f(to)g(make)g(it)h -(useful)f(in)g(the)573 714 y FA(awk)19 b FD(loop)j(macr)o(o)e -(\(section)h(7.2\).)j(The)d(r)o(eader)d(is)j(used)g(as)f(follows:)756 -865 y FA(\()p FC(r)o(eader)43 b([port])n FA(\))h Fn(=)-14 -b Fw(\))86 b FC([raw-r)o(ecord)20 b(parsed-r)o(ecord])42 -b FA(or)h FC([eof)21 b(\(\)])573 1054 y FD(When)28 b(the)f(r)o(eader)e -(is)j(applied)f(to)g(an)g(input)h(port)g(\(default:)37 -b(the)28 b(curr)o(ent)e(input)573 1154 y(port\),)19 b(it)g(r)o(eads)f -(a)g(r)o(ecor)o(d)g(using)i FC(r)o(ec-r)o(eader)o FD(.)25 -b(If)19 b(this)h(r)o(ecor)o(d)d(isn't)j(the)f(eof)g(object,)g(it)573 -1254 y(is)25 b(parsed)e(with)i FC(\002eld-parser)p FD(.)37 -b(These)24 b(two)h(values\227the)f(r)o(ecor)o(d,)g(and)g(its)h(parsed) -573 1353 y(r)o(epr)o(esentation\227ar)o(e)18 b(r)o(eturned)i(as)g -(multiple)h(values)g(fr)o(om)f(the)h(r)o(eader)-6 b(.)573 -1491 y(When)21 b(called)f(at)g(eof,)h(the)f(r)o(eader)f(r)o(eturns)h -([eof-object)g FA(\(\))p FD(].)573 1629 y(Although)e(the)g(r)o(ecor)o -(d)e(r)o(eader)f(typically)j(r)o(eturns)f(a)g(string,)h(and)f(the)h -(\002eld-parser)573 1729 y(typically)k(takes)g(a)g(string)h(ar)o -(gument,)f(this)h(is)g(not)g(r)o(equir)o(ed.)29 b(The)22 -b(r)o(ecor)o(d)f(r)o(eader)573 1829 y(can)d(pr)o(oduce,)f(and)g(the)h -(\002eld-parser)f(consume,)i(values)f(of)g(any)g(type.)24 -b(However)-6 b(,)573 1928 y(the)24 b(empty)h(list)g(r)o(eturned)e(as)i -(the)f(parsed)g(value)f(on)j(eof)e(is)h(har)o(dwir)o(ed)d(into)j(the) -573 2028 y(\002eld)20 b(r)o(eader)-6 b(.)573 2166 y(For)21 -b(example,)f(if)g(port)h FA(p)f FD(is)i(open)f(on)g FA(/etc/passwd)p -FD(,)16 b(then)756 2317 y FA(\(\(field-reader)37 b(\(infix-splitter)h -(":")k(7\)\))g(p\))573 2459 y FD(r)o(eturns)20 b(two)i(values:)573 -2589 y Fh("dalbertz:mx3Uaqq0:107:22:Davi)q(d)45 b -(Albertz:/users/dalbertz:/bin/)q(csh")573 2681 y(\("dalbertz")d -("mx3Uaqq0")f("107")f("22")h("David)f(Albertz")h("/users/dalbertz")1044 -2772 y("/bin/csh"\))595 2910 y FD(The)23 b FC(\002eld-parser)f -FD(defaults)g(to)g(the)h(value)f(of)g FA(\(field-splitter\))p -FD(,)16 b(a)22 b(parser)g(that)573 3010 y(picks)f(out)g(sequences)g(of) -g(non-white-space)g(strings.)573 3148 y(The)g FC(r)o(ec-r)o(eader)f -FD(defaults)g(to)h FA(read-line)p FD(.)573 3286 y(Figur)o(e)35 -b(7.2)e(shows)k FA(field-reader)30 b FD(being)35 b(used)g(to)h(r)o(ead) -d(dif)o(fer)o(ent)g(kinds)j(of)573 3385 y(Unix)21 b(r)o(ecor)o(ds.)365 -3676 y FB(7.1.4)81 b(Forward-progress)21 b(guarantees)d(and)i -(empty-string)e(matches)365 3869 y FD(A)j(loop)g(that)g(pulls)g(text)f -(of)o(f)g(a)g(string)i(by)e(r)o(epeatedly)f(matching)i(a)g(r)o(egexp)e -(against)i(that)365 3969 y(string)28 b(can)g(conceivably)f(get)g(stuck) -h(in)g(an)f(in\002nite)i(loop)f(if)f(the)h(r)o(egexp)e(matches)h(the) -365 4068 y(empty)d(string.)36 b(For)24 b(example,)g(the)g(r)o(egexps)e -FA(^)p FD(,)i FA($)p FD(,)g FA(.*)p FD(,)g(and)f FA(foo|[^f]*)d -FD(can)k(all)f(match)365 4168 y(the)e(empty)g(string.)490 -4301 y(The)29 b(r)o(outines)h(in)g(this)g(package)e(that)i(iterate)e -(thr)o(ough)i(strings)h(with)f(r)o(egular)e(ex-)365 4400 -y(pr)o(essions)23 b(ar)o(e)f(car)o(eful)e(to)j(handle)g(this)g -(empty-string)g(case.)31 b(If)22 b(a)g(r)o(egexp)g(matches)g(the)365 -4500 y(empty)27 b(string,)h(the)f(next)f(sear)o(ch)g(starts,)h(not)h -(fr)o(om)e(the)g(end)g(of)h(the)g(match)f(\(which)h(in)365 -4599 y(the)d(empty)f(string)h(case)f(is)g(also)h(the)f -(beginning\227that's)i(the)e(pr)o(oblem\),)g(but)h(fr)o(om)e(the)365 -4699 y(next)j(character)e(over)-6 b(.)38 b(This)25 b(is)h(the)f(corr)o -(ect)e(behaviour)-6 b(.)38 b(Regexps)25 b(match)g(the)g(longest)365 -4799 y(possible)i(string)g(at)f(a)g(given)g(location,)i(so)f(if)f(the)g -(r)o(egexp)f(matched)h(the)g(empty)h(string)365 4898 -y(at)d(location)i Fo(i)p FD(,)e(then)h(it)g(is)g(guaranteed)e(it)i -(could)g(not)g(have)f(matched)g(a)g(longer)h(pattern)1737 -5147 y(1)-5 b(19)p eop -%%Page: 120 126 -120 125 bop 681 1310 2865 4 v 681 4120 4 2811 v 718 1426 -a FA(;;;)42 b(/etc/passwd)e(reader)718 1525 y(\(field-reader)e -(\(infix-splitter)g(":")k(7\)\))892 1625 y(;)i(wandy:3xuncWdpK)o(hR.)o -(:7)o(3:2)o(2:)o(Wa)o(ndy)37 b(Saetan:/usr/wand)o(y:)o(/bi)o(n/)o(cs)o -(h)718 1824 y(;;;)42 b(Two)h(ls)g(-l)f(output)f(readers)718 -1924 y(\(field-reader)d(\(infix-splitter)g("[)k(\\t]+")g(8\)\))718 -2024 y(\(field-reader)c(\(infix-splitter)g("[)k(\\t]+")g(-7\)\))892 -2123 y(;)i(-rw-r--r--)83 b(1)43 b(shivers)171 b(22880)42 -b(Sep)g(24)h(12:45)e(scsh.scm)718 2322 y(;;;)h(Internet)f(hostname)f -(reader)718 2422 y(\(field-reader)e(\(field-splitter)g("[^.]+"\)\))892 -2522 y(;)44 b(stat.sinica.edu)o(.tw)718 2721 y(;;;)e(Internet)f(IP)i -(address)d(reader)718 2821 y(\(field-reader)e(\(field-splitter)g -("[^.]+")i(4\)\))892 2920 y(;)k(18.24.0.241)718 3119 -y(;;;)e(Line)g(of)h(integers)718 3219 y(\(let)f(\(\(parser)e -(\(field-splitter)e("[+-]?[0-9]+"\)\)\))805 3319 y(\(field-reader)h(\() -p Fo(\025)f FA(\(s\))43 b(\(map)f(string->number)37 b(\(parser)k -(s\)\)\)\))892 3418 y(;)j(18)e(24)h(0)g(241)718 3618 -y(;;;)f(Same)g(as)h(above.)718 3717 y(\(let)f(\(\(reader)e -(\(field-reader)f(\(field-splitter)e("[+-]?[0-9]+"\)\)\))o(\))805 -3817 y(\()p Fo(\025)i FA(maybe-port)h(\(map)h(string->number)d(\(apply) -j(reader)g(maybe-port\)\)\)\))892 3917 y(;)j(Yale)e(beat)g(harvard)e -(26)j(to)g(7.)1305 4096 y FD(Figur)o(e)21 b(7.2:)j(Some)d(examples)f -(of)h FA(field-reader)p 3542 4120 V 681 4123 2865 4 v -2051 5147 a FD(120)p eop -%%Page: 121 127 -121 126 bop 365 614 a FD(starting)23 b(with)f(character)f -Fo(i)p FD(.)29 b(So)22 b(we)g(can)g(safely)f(begin)h(our)h(sear)o(ch)e -(for)g(the)h(next)g(match)365 714 y(at)f(char)f Fo(i)e -Fn(+)g(1)p FD(.)490 854 y(W)-5 b(ith)24 b(this)h(pr)o(ovision,)f(every) -f(iteration)h(thr)o(ough)g(the)f(loop)h(makes)g(some)g(forwar)o(d)365 -953 y(pr)o(ogr)o(ess,)c(and)g(the)h(loop)h(is)f(guaranteed)e(to)i -(terminate.)490 1093 y(This)i(has)g(the)h(ef)o(fect)d(you)i(want)g -(with)h(\002eld)f(parsing.)32 b(For)24 b(example,)e(if)h(you)h(split)f -(a)365 1193 y(string)28 b(with)f(the)g(empty)g(pattern,)h(you)f(will)g -(explode)g(the)f(string)i(into)f(its)h(individual)365 -1292 y(characters:)573 1455 y FA(\(\(suffix-splitte)o(r)37 -b(""\))43 b("foo"\))e Fn(=)-14 b Fw(\))87 b FA(\("")42 -b("f")g("o")h("o"\))365 1617 y FD(However)-6 b(,)27 b(even)e(though)i -(this)f(boundary)g(case)f(is)g(handled)h(corr)o(ectly)-9 -b(,)25 b(we)h(don't)g(r)o(ec-)365 1717 y(ommend)c(using)f(it.)26 -b(Say)20 b(what)h(you)g(mean\227just)h(use)f(a)f(\002eld)h(splitter:) -573 1879 y FA(\(\(field-splitter)37 b("."\))42 b("foo"\))f -Fn(=)-14 b Fw(\))87 b FA(\("f")42 b("o")g("o"\))365 2041 -y FD(Or)-6 b(,)21 b(mor)o(e)f(ef)o(\002ciently)-9 b(,)573 -2204 y FA(\(\()p Fo(\025)38 b FA(\(s\))43 b(\(map)e(string)h -(\(string->list)c(s\)\)\))k("foo"\))365 2494 y FB(7.1.5)81 -b(Reader)20 b(limitations)365 2697 y FD(Since)28 b(all)h(of)f(the)h(r)o -(eaders)e(in)i(this)g(package)e(r)o(equir)o(e)h(the)g(ability)h(to)g -(peek)f(ahead)f(one)365 2796 y(char)19 b(in)i(the)e(input)h(str)o(eam,) -f(they)h(cannot)g(be)g(applied)e(to)i(raw)g(integer)f(\002le)h -(descriptors,)365 2896 y(only)j(Scheme)e(input)h(ports.)29 -b(This)22 b(is)g(because)f(Unix)h(doesn't)g(support)g(peeking)g(ahead) -365 2996 y(into)g(input)f(str)o(eams.)365 3312 y Fy(7.2)99 -b(A)-7 b(wk)365 3546 y FD(Scsh)25 b(pr)o(ovides)g(a)f(loop)i(macr)o(o)e -(and)h(a)f(set)h(of)g(\002eld)g(parsers)f(that)h(can)g(be)g(used)g(to)g -(per)o(-)365 3646 y(form)34 b(text)f(pr)o(ocessing)h(very)f(similar)g -(to)h(the)g(A)-6 b(wk)33 b(pr)o(ogramming)g(language.)64 -b(The)365 3745 y(basic)30 b(functionality)h(of)f(A)-6 -b(wk)30 b(is)g(factor)o(ed)e(in)j(scsh)f(into)h(its)g(component)g -(parts.)53 b(The)365 3845 y(contr)o(ol)25 b(str)o(uctur)o(e)g(is)g(pr)o -(ovided)e(by)i(the)g FA(awk)e FD(loop)j(macr)o(o;)g(the)e(text)h(I/O)g -(and)f(parsers)365 3944 y(ar)o(e)19 b(pr)o(ovided)g(by)h(the)h -(\002eld-r)o(eader)c(subr)o(outine)k(library)f(\(section)g(7.1\).)k -(This)d(factoring)365 4044 y(allows)g(the)f(pr)o(ogrammer)f(to)h -(compose)g(the)g(basic)g(loop)g(str)o(uctur)o(e)f(with)i(any)f(parser)e -(or)365 4144 y(input)i(mechanism)g(at)f(all.)25 b(If)19 -b(the)g(parsers)g(pr)o(ovided)f(by)i(the)f(\002eld-r)o(eader)e(package) -h(ar)o(e)365 4243 y(insuf)o(\002cient,)28 b(the)f(pr)o(ogrammer)f(can)g -(write)h(a)f(custom)h(parser)e(in)j(Scheme)e(and)g(use)g(it)365 -4343 y(with)c(equal)f(ease)f(in)h(the)g(awk)f(framework.)490 -4483 y(A)-6 b(wk-in-scheme)20 b(is)i(given)f(by)f(a)h(loop)g(macr)o(o)f -(called)g FA(awk)p FD(.)k(It)d(looks)h(like)f(this:)573 -4699 y FA(\(awk)42 b Fo(<)p FC(next-r)o(ecord)p Fo(>)f(<)p -FC(r)o(ecord&\002eld-vars)p Fo(>)791 4799 y FD([)p Fo(<)p -FC(counter)p Fo(>)p FD(])h Fo(<)p FC(state-var-decls)p -Fo(>)660 4898 y(<)p FC(clause)929 4910 y Fx(1)966 4898 -y Fo(>)h FA(...\))1735 5147 y FD(121)p eop -%%Page: 122 128 -122 127 bop 805 614 a FD(The)24 b(body)f(of)g(the)h(loop)g(is)g(a)f -(series)g(of)g(clauses,)h(each)e(one)i(r)o(epr)o(esenting)f(a)f(kind)i -(of)681 714 y(condition/action)j(pair)-6 b(.)40 b(The)25 -b(loop)i(r)o(epeatedly)c(r)o(eads)h(a)i(r)o(ecor)o(d,)e(and)i(then)g -(executes)681 814 y(each)20 b(clause)g(whose)i(condition)g(is)f -(satis\002ed)g(by)f(the)h(r)o(ecor)o(d.)805 939 y(Her)o(e's)i(an)h -(example)f(that)h(r)o(eads)e(lines)j(fr)o(om)e(port)h -FA(p)g FD(and)f(prints)i(the)f(line)g(number)681 1038 -y(and)c(line)h(of)g(every)f(line)h(containing)h(the)f(string)h(\223)p -FA(Church-Rosser)p FD(\224)o(:)888 1230 y FA(\(awk)42 -b(\(read-line\))d(\(ln\))j(lineno)f(\(\))976 1329 y(\("Church-Rosser)o -(")c(\(format)k(#t)i("~d:)f(~s~\045")f(lineno)g(ln\)\)\))681 -1521 y FD(This)18 b(example)e(has)h(just)i(one)e(clause)g(in)h(the)f -(loop)h(body)-9 b(,)18 b(the)f(one)h(that)f(tests)h(for)f(matches)681 -1620 y(against)j(the)h(r)o(egular)f(expr)o(ession)g(\223)p -FA(Church-Rosser)p FD(\224.)805 1745 y(The)c Fo(<)p FC(next-r)o(ecord)p -Fo(>)e FD(form)j(is)f(an)g(expr)o(ession)g(that)g(is)g(evaluated)f -(each)g(time)h(thr)o(ough)681 1845 y(the)27 b(loop)h(to)g(pr)o(oduce)e -(a)h(r)o(ecor)o(d)f(to)h(pr)o(ocess.)45 b(This)28 b(expr)o(ession)f -(can)g(r)o(eturn)f(multiple)681 1945 y(values;)18 b(these)g(values)g -(ar)o(e)f(bound)h(to)h(the)f(variables)f(given)i(in)f(the)g -Fo(<)p FC(r)o(ecord&\002eld-vars)p Fo(>)681 2044 y FD(list)24 -b(of)g(variables.)35 b(The)24 b(\002rst)g(value)g(r)o(eturned)f(is)h -(assumed)g(to)g(be)g(the)g(r)o(ecor)o(d;)g(when)h(it)681 -2144 y(is)c(the)g(end-of-\002le)f(object,)h(the)g(loop)g(terminates.) -805 2269 y(For)d(example,)f(let's)h(suppose)g(we)f(want)h(to)f(r)o(ead) -f(items)i(fr)o(om)f FA(/etc/password)p FD(,)12 b(and)681 -2368 y(we)20 b(use)g(the)g FA(field-reader)c FD(pr)o(ocedur)o(e)i(to)i -(de\002ne)g(a)g(r)o(ecor)o(d)f(parser)g(for)h FA(/etc/passwd)681 -2468 y FD(entries:)888 2607 y FA(\(define)41 b(read-passwd)e -(\(field-reader)f(\(infix-splitter)g(":")k(7\)\)\))681 -2746 y FD(binds)22 b FA(read-passwd)c FD(to)23 b(a)f(pr)o(ocedur)o(e)e -(that)i(r)o(eads)f(in)i(a)f(line)h(of)f(text)g(when)h(it)f(is)h -(called,)681 2846 y(and)39 b(splits)i(the)f(text)f(at)h(colons.)84 -b(It)40 b(r)o(eturns)f(two)i(values:)63 b(the)40 b(entir)o(e)g(line)g -(r)o(ead,)681 2946 y(and)30 b(a)g(seven-element)g(list)h(of)g(the)g -(split-out)g(\002elds.)55 b(\(See)29 b(section)i(7.1)f(for)g(mor)o(e)g -(on)681 3045 y FA(field-reader)16 b FD(and)k FA(infix-splitter)p -FD(.\))805 3170 y(So)27 b(if)g(the)g Fo(<)p FC(next-r)o(ecord)p -Fo(>)e FD(form)i(in)g(an)g FA(awk)f FD(expr)o(ession)g(is)i -FA(\(read-passwd\))p FD(,)23 b(then)681 3270 y Fo(<)p -FC(r)o(ecord&\002eld-vars)p Fo(>)18 b FD(must)k(be)e(a)g(list)i(of)e -(two)i(variables,)d FC(e.g.)o FD(,)888 3409 y FA(\(record)41 -b(field-vec\))681 3548 y FD(since)21 b FA(read-passwd)16 -b FD(r)o(eturns)k(two)i(values.)805 3673 y(Note)27 b(that)f -FA(awk)g FD(allows)h(us)g(to)f(use)h FC(any)f FD(r)o(ecor)o(d)f(r)o -(eader)f(we)j(want)f(in)h(the)g(loop,)h(r)o(e-)681 3772 -y(turning)k(whatever)e(number)h(of)g(values)f(we)h(like.)57 -b(These)31 b(values)f(don't)i(have)e(to)h(be)681 3872 -y(strings)21 b(or)f(string)h(lists.)26 b(The)21 b(only)g(r)o(equir)o -(ement)e(is)i(that)f(the)h(r)o(ecor)o(d)d(r)o(eader)g(r)o(eturn)i(the) -681 3972 y(eof)g(object)h(as)g(its)g(\002rst)g(value)f(when)i(the)f -(loop)g(should)h(terminate.)805 4097 y(The)33 b FA(awk)f -FD(loop)i(allows)f(the)g(pr)o(ogrammer)f(to)i(have)e(loop)i(variables.) -61 b(These)32 b(ar)o(e)681 4196 y(declar)o(ed)18 b(and)j(initialised)g -(by)g(the)g Fo(<)p FC(state-var-decls)p Fo(>)d FD(form,)j(a)888 -4335 y FA(\(\()p FC(var)43 b(init-exp)o FA(\))g(\()p -FC(var)g(init-exp)o FA(\))g(...\))681 4475 y FD(list)26 -b(rather)g(like)g(the)g FA(let)f FD(form.)41 b(Whenever)25 -b(a)h(clause)f(in)i(the)f(loop)g(body)g(executes,)h(it)681 -4574 y(evaluates)19 b(to)j(as)e(many)h(values)g(as)f(ther)o(e)g(ar)o(e) -f(state)i(variables,)e(updating)i(them.)805 4699 y(The)31 -b(optional)g Fo(<)p FC(counter)p Fo(>)f FD(variable)f(is)i(an)g -(iteration)f(counter)-6 b(.)55 b(It)31 b(is)g(bound)g(to)g(0)681 -4799 y(when)21 b(the)g(loop)g(starts.)k(The)c(counter)f(is)h(incr)o -(emented)f(each)g(time)h(a)f(non-eof)h(r)o(ecor)o(d)e(is)681 -4898 y(r)o(ead.)2051 5147 y(122)p eop -%%Page: 123 129 -123 128 bop 490 614 a FD(Ther)o(e)28 b(ar)o(e)f(several)h(kinds)h(of)g -(loop)g(clause.)49 b(When)30 b(evaluating)e(the)h(body)g(of)f(the)365 -714 y(loop,)h FA(awk)c FD(evaluates)h FC(all)h FD(the)g(clauses)f -(sequentially)-9 b(.)44 b(Unlike)27 b FA(cond)p FD(,)f(it)h(does)g(not) -g(stop)365 814 y(after)20 b(the)h(\002rst)g(clause)f(is)h(satis\002ed;) -g(it)g(checks)f(them)i(all.)490 1010 y Fw(\017)41 b FA(\()p -FC(test)i(body)938 1037 y Fx(1)1019 1010 y FC(body)1177 -1037 y Fx(2)1258 1010 y FA(...\))573 1110 y FD(If)28 -b FC(test)h FD(is)g(tr)o(ue,)i(execute)d(the)h(body)g(forms.)50 -b(The)28 b(last)h(body)g(form)g(is)g(the)g(value)573 -1209 y(of)24 b(the)h(clause.)35 b(The)25 b(test)f(and)g(body)g(forms)h -(ar)o(e)e(evaluated)g(in)h(the)h(scope)f(of)g(the)573 -1309 y(r)o(ecor)o(d)19 b(and)h(state)h(variables.)573 -1440 y(The)g FC(test)f FD(form)h(can)f(be)h(one)g(of:)805 -1558 y(integer:)213 b(The)26 b(test)h(is)g(tr)o(ue)g(for)g(that)f -(iteration)h(of)g(the)g(loop.)44 b(The)1297 1658 y(\002rst)21 -b(iteration)g(is)g(#1.)805 1758 y(string:)258 b(The)23 -b(string)i(is)f(a)f(r)o(egular)g(expr)o(ession.)34 b(The)24 -b(test)g(is)g(tr)o(ue)1297 1857 y(if)c(the)h(r)o(egexp)f(matches)g(the) -h(r)o(ecor)o(d.)805 1957 y(expr)o(ession)100 b(If)38 -b(not)i(an)e(integer)h(or)g(a)f(string,)44 b(the)39 b(test)f(form)h(is) -g(a)1297 2056 y(Scheme)20 b(expr)o(ession)h(that)f(is)h(evaluated.)490 -2234 y Fw(\017)91 b FA(\(range)128 b FC(start-test)43 -b(stop-test)f(body)1851 2261 y Fx(1)1931 2234 y FA(...\))623 -2334 y(\(:range)84 b FC(start-test)43 b(stop-test)f(body)1851 -2361 y Fx(1)1931 2334 y FA(...\))623 2434 y(\(range:)84 -b FC(start-test)43 b(stop-test)f(body)1851 2461 y Fx(1)1931 -2434 y FA(...\))623 2533 y(\(:range:)e FC(start-test)j(stop-test)f -(body)1851 2560 y Fx(1)1931 2533 y FA(...\))573 2632 -y FD(These)18 b(clauses)g(become)h(activated)e(when)i -FC(start-test)e FD(is)i(tr)o(ue;)g(they)g(stay)f(active)g(on)573 -2731 y(all)i(further)h(iterations)g(until)g FC(stop-test)f -FD(is)h(tr)o(ue.)573 2862 y(So,)f(to)h(print)g(out)h(the)f(\002rst)g -(ten)f(lines)i(of)f(a)f(\002le,)g(we)h(use)g(the)g(clause:)756 -3001 y FA(\(:range:)40 b(1)j(10)g(\(display)d(record\)\))573 -3170 y FD(The)24 b(colons)i(contr)o(ol)f(whether)g(or)g(not)g(the)g -(start)f(and)g(stop)h(lines)g(ar)o(e)f(pr)o(ocessed)573 -3270 y(by)d(the)g(clause.)k(For)c(example:)805 3410 y -FA(\(range)129 b(1)43 b(5)87 b(...\))164 b FD(Lines)83 -b(2)20 b(3)h(4)805 3510 y FA(\(:range)85 b(1)43 b(5)87 -b(...\))164 b FD(Lines)21 b(1)f(2)g(3)h(4)805 3609 y -FA(\(range:)85 b(1)43 b(5)87 b(...\))164 b FD(Lines)83 -b(2)20 b(3)h(4)f(5)805 3709 y FA(\(:range:)41 b(1)i(5)87 -b(...\))164 b FD(Lines)21 b(1)f(2)g(3)h(4)f(5)573 3878 +1386 y(This)33 b(utility)f(r)o(eturns)g(a)f(pr)o(ocedur)o(e)f(that)i(r) +o(eads)e(r)o(ecor)o(ds)g(with)j(\002eld)f(str)o(uctur)o(e)888 +1485 y(fr)o(om)27 b(a)g(port.)45 b(The)27 b(r)o(eader)6 +b('s)25 b(interface)i(is)g(designed)g(to)h(make)f(it)g(useful)g(in)h +(the)888 1585 y FA(awk)20 b FD(loop)h(macr)o(o)f(\(section)h(8.2\).)j +(The)d(r)o(eader)e(is)i(used)f(as)h(follows:)1071 1724 +y FA(\()p FC(r)o(eader)43 b([port])o FA(\))g Fn(=)-14 +b Fw(\))87 b FC([raw-r)o(ecord)20 b(parsed-r)o(ecord])42 +b FA(or)h FC([eof)20 b(\(\)])888 1894 y FD(When)28 b(the)g(r)o(eader)d +(is)j(applied)e(to)i(an)f(input)h(port)f(\(default:)38 +b(the)27 b(curr)o(ent)g(input)888 1993 y(port\),)19 b(it)h(r)o(eads)d +(a)i(r)o(ecor)o(d)e(using)j FC(r)o(ec-r)o(eader)p FD(.)25 +b(If)18 b(this)i(r)o(ecor)o(d)d(isn't)j(the)f(eof)g(object,)h(it)888 +2093 y(is)25 b(parsed)e(with)j FC(\002eld-parser)p FD(.)36 +b(These)25 b(two)g(values\227the)f(r)o(ecor)o(d,)f(and)h(its)h(parsed) +888 2193 y(r)o(epr)o(esentation\227ar)o(e)18 b(r)o(eturned)i(as)g +(multiple)i(values)e(fr)o(om)g(the)h(r)o(eader)-6 b(.)888 +2324 y(When)22 b(called)d(at)i(eof,)f(the)h(r)o(eader)e(r)o(eturns)h +([eof-object)g FA(\(\))p FD(].)888 2455 y(Although)f(the)e(r)o(ecor)o +(d)f(r)o(eader)g(typically)h(r)o(eturns)g(a)g(string,)i(and)e(the)h +(\002eld-parser)888 2555 y(typically)23 b(takes)f(a)g(string)h(ar)o +(gument,)f(this)h(is)f(not)h(r)o(equir)o(ed.)29 b(The)23 +b(r)o(ecor)o(d)d(r)o(eader)888 2654 y(can)e(pr)o(oduce,)f(and)h(the)g +(\002eld-parser)e(consume,)k(values)d(of)h(any)g(type.)25 +b(However)-6 b(,)888 2754 y(the)25 b(empty)g(list)g(r)o(eturned)e(as)h +(the)h(parsed)e(value)h(on)h(eof)f(is)h(har)o(dwir)o(ed)e(into)i(the) +888 2854 y(\002eld)c(r)o(eader)-6 b(.)888 2985 y(For)21 +b(example,)f(if)h(port)g FA(p)f FD(is)h(open)g(on)g FA(/etc/passwd)p +FD(,)16 b(then)1071 3123 y FA(\(\(field-reader)38 b(\(infix-splitter)f +(":")43 b(7\)\))f(p\))888 3254 y FD(r)o(eturns)21 b(two)g(values:)888 +3376 y Fj("dalbertz:mx3Uaqq0:107:22:Da)q(vid)46 b +(Albertz:/users/dalbertz:/bin/cs)q(h")888 3468 y(\("dalbertz")c +("mx3Uaqq0")g("107")e("22")g("David)h(Albertz")g("/users/dalbertz")1359 +3559 y("/bin/csh"\))911 3690 y FD(The)22 b FC(\002eld-parser)h +FD(defaults)e(to)i(the)g(value)e(of)i FA(\(field-splitter\))o +FD(,)17 b(a)22 b(parser)f(that)888 3790 y(picks)g(out)h(sequences)f(of) +g(non-white-space)f(strings.)888 3921 y(The)h FC(r)o(ec-r)o(eader)f +FD(defaults)g(to)h FA(read-line)p FD(.)888 4052 y(Figur)o(e)i(8.2)g +(shows)i FA(field-reader)18 b FD(being)24 b(used)f(to)h(r)o(ead)e(dif)o +(fer)o(ent)f(kinds)j(of)g(U-)888 4152 y(nix)d(r)o(ecor)o(ds.)681 +4416 y FB(8.1.4)81 b(Forward-progress)20 b(guarantees)f(and)g +(empty-string)g(matches)681 4599 y FD(A)33 b(loop)h(that)f(pulls)h +(text)f(of)o(f)f(a)h(string)h(by)g(r)o(epeatedly)d(matching)j(a)f(r)o +(egexp)f(against)681 4699 y(that)d(string)g(can)g(conceivably)g(get)f +(stuck)i(in)f(an)g(in\002nite)g(loop)h(if)f(the)g(r)o(egexp)e(match-) +681 4799 y(es)e(the)h(empty)g(string.)42 b(For)26 b(example,)g(the)f +(SREs)h FA(bos)p FD(,)g FA(eos)p FD(,)f FA(\(*)43 b(any\))p +FD(,)25 b(and)g FA(\(|)43 b("foo")681 4898 y(\(*)g(\()86 +b("f"\)\)\))19 b FD(can)h(all)h(match)f(the)h(empty)g(string.)2051 +5147 y(148)p eop +%%Page: 149 157 +149 156 bop 365 1260 2865 4 v 365 4170 4 2910 v 403 1376 +a FA(;;;)42 b(/etc/passwd)d(reader)403 1476 y(\(field-reader)f +(\(infix-splitter)f(":")43 b(7\)\))577 1575 y(;)g(wandy:3xuncWdpKhR)o +(.:)o(73)o(:22)o(:W)o(and)o(y)37 b(Saetan:/usr/wandy)o(:/)o(bin)o(/c)o +(sh)403 1775 y(;;;)42 b(Two)g(ls)h(-l)g(output)e(readers)403 +1874 y(\(field-reader)d(\(infix-splitter)f(\(rx)43 b(\(+)f(white\)\))f +(8\)\))403 1974 y(\(field-reader)d(\(infix-splitter)f(\(rx)43 +b(\(+)f(white\)\))f(-7\)\))577 2073 y(;)i(-rw-r--r--)83 +b(1)43 b(shivers)172 b(22880)41 b(Sep)i(24)f(12:45)g(scsh.scm)403 +2273 y(;;;)g(Internet)e(hostname)h(reader)403 2372 y(\(field-reader)d +(\(field-splitter)f(\(rx)43 b(\(+)f(\(~)h("."\)\)\)\)\))577 +2472 y(;)g(stat.sinica.edu.t)o(w)403 2671 y(;;;)f(Internet)e(IP)j +(address)e(reader)403 2771 y(\(field-reader)d(\(field-splitter)f(\(rx) +43 b(\(+)f(\(~)h("."\)\)\))e(4\)\))577 2870 y(;)i(18.24.0.241)403 +3070 y(;;;)f(Line)g(of)h(integers)403 3169 y(\(let)f(\(\(parser)e +(\(field-splitter)d(\(rx)43 b(\(?)f(\("+-"\)\))f(\(+)i(digit\)\)\)\)\)) +490 3269 y(\(field-reader)38 b(\()p Fo(\025)h FA(\(s\))j(\(map)g +(string->number)c(\(parser)j(s\)\)\)\))577 3369 y(;)i(18)g(24)g(0)g +(241)403 3568 y(;;;)f(Same)g(as)h(above.)403 3667 y(\(let)f(\(\(reader) +e(\(field-reader)e(\(field-splitter)f(\(rx)43 b(\(?)g(\("+-"\)\))2495 +3767 y(\(+)g(digit\)\)\)\)\)\))490 3867 y(\()p Fo(\025)c +FA(maybe-port)g(\(map)j(string->number)c(\(apply)j(reader)g +(maybe-port\)\)\)\))577 3966 y(;)i(Yale)f(beat)g(harvard)f(26)h(to)h +(7.)990 4146 y FD(Figur)o(e)20 b(8.2:)k(Some)d(examples)f(of)h +FA(field-reader)p 3226 4170 V 365 4173 2865 4 v 1735 +5147 a FD(149)p eop +%%Page: 150 158 +150 157 bop 805 614 a FD(The)30 b(r)o(outines)f(in)h(this)h(package)d +(that)h(iterate)g(thr)o(ough)h(strings)g(with)h(r)o(egular)d(ex-)681 +714 y(pr)o(essions)23 b(ar)o(e)e(car)o(eful)g(to)i(handle)f(this)i +(empty-string)f(case.)30 b(If)23 b(a)f(r)o(egexp)f(matches)i(the)681 +814 y(empty)j(string,)j(the)d(next)h(sear)o(ch)e(starts,)j(not)f(fr)o +(om)f(the)h(end)f(of)g(the)h(match)g(\(which)g(in)681 +913 y(the)c(empty)h(string)g(case)e(is)i(also)f(the)h +(beginning\227that's)g(the)g(pr)o(oblem\),)f(but)g(fr)o(om)g(the)681 +1013 y(next)i(character)e(over)-6 b(.)37 b(This)26 b(is)f(the)g(corr)o +(ect)f(behaviour)-6 b(.)37 b(Regexps)25 b(match)g(the)g(longest)681 +1112 y(possible)i(string)g(at)e(a)h(given)h(location,)h(so)e(if)g(the)h +(r)o(egexp)e(matched)h(the)g(empty)g(string)681 1212 +y(at)e(location)h Fo(i)p FD(,)g(then)g(it)g(is)g(guaranteed)e(it)i +(could)f(not)h(have)f(matched)h(a)f(longer)h(pattern)681 +1312 y(starting)d(with)h(character)d Fo(i)p FD(.)29 b(So)22 +b(we)g(can)g(safely)f(begin)i(our)f(sear)o(ch)f(for)h(the)g(next)g +(match)681 1411 y(at)e(char)g Fo(i)e Fn(+)g(1)p FD(.)805 +1536 y(W)-5 b(ith)25 b(this)f(pr)o(ovision,)h(every)d(iteration)i(thr)o +(ough)g(the)g(loop)g(makes)f(some)h(forwar)o(d)681 1636 +y(pr)o(ogr)o(ess,)19 b(and)i(the)g(loop)g(is)g(guaranteed)f(to)h +(terminate.)805 1760 y(This)j(has)f(the)g(ef)o(fect)e(you)j(want)f +(with)h(\002eld)f(parsing.)32 b(For)23 b(example,)g(if)g(you)g(split)h +(a)681 1860 y(string)j(with)h(the)f(empty)g(pattern,)g(you)g(will)h +(explode)e(the)h(string)g(into)h(its)f(individual)681 +1959 y(characters:)888 2098 y FA(\(\(suffix-splitter)37 +b(\(rx\)\))k("foo"\))h Fn(=)-14 b Fw(\))86 b FA(\("")43 +b("f")f("o")g("o"\))681 2237 y FD(However)-6 b(,)26 b(even)f(though)i +(this)g(boundary)e(case)g(is)h(handled)f(corr)o(ectly)-9 +b(,)26 b(we)f(don't)h(r)o(ec-)681 2336 y(ommend)21 b(using)h(it.)k(Say) +20 b(what)h(you)g(mean\227just)g(use)g(a)f(\002eld)h(splitter:)888 +2475 y FA(\(\(field-splitter)37 b(\(rx)43 b(any\)\))e("foo"\))g +Fn(=)-14 b Fw(\))87 b FA(\("f")42 b("o")g("o"\))681 2613 +y FD(Or)-6 b(,)20 b(mor)o(e)h(ef)o(\002ciently)-9 b(,)888 +2752 y FA(\(\()p Fo(\025)39 b FA(\(s\))j(\(map)g(string)f +(\(string->list)d(s\)\)\))k("foo"\))681 3003 y FB(8.1.5)81 +b(Reader)19 b(limitations)681 3186 y FD(Since)28 b(all)g(of)h(the)f(r)o +(eaders)f(in)i(this)g(package)f(r)o(equir)o(e)f(the)i(ability)f(to)h +(peek)f(ahead)g(one)681 3286 y(char)19 b(in)h(the)g(input)g(str)o(eam,) +f(they)h(cannot)g(be)f(applied)g(to)h(raw)f(integer)h(\002le)f +(descriptors,)681 3385 y(only)j(Scheme)g(input)g(ports.)29 +b(This)22 b(is)g(because)f(Unix)g(doesn't)h(support)g(peeking)g(ahead) +681 3485 y(into)f(input)h(str)o(eams.)681 3763 y Fy(8.2)99 +b(A)-7 b(wk)681 3977 y FD(Scsh)18 b(pr)o(ovides)g(a)g(loop)h(macr)o(o)f +(and)g(a)f(set)i(of)f(\002eld)h(parsers)e(that)i(can)f(be)g(used)g(to)h +(perfor)o(-)681 4076 y(m)25 b(text)g(pr)o(ocessing)g(very)f(similar)h +(to)g(the)g(A)-6 b(wk)25 b(pr)o(ogramming)g(language.)38 +b(The)24 b(basic)681 4176 y(functionality)h(of)g(A)-6 +b(wk)24 b(is)h(factor)o(ed)e(in)j(scsh)f(into)g(its)g(component)h +(parts.)37 b(The)25 b(contr)o(ol)681 4276 y(str)o(uctur)o(e)d(is)h(pr)o +(ovided)e(by)h(the)h FA(awk)e FD(loop)i(macr)o(o;)g(the)f(text)g(I/O)h +(and)f(parsers)g(ar)o(e)f(pr)o(o-)681 4375 y(vided)e(by)h(the)h +(\002eld-r)o(eader)c(subr)o(outine)k(library)e(\(section)i(8.1\).)j +(This)c(factoring)g(allows)681 4475 y(the)j(pr)o(ogrammer)f(to)i +(compose)g(the)f(basic)g(loop)h(str)o(uctur)o(e)e(with)i(any)f(parser)f +(or)i(input)681 4574 y(mechanism)19 b(at)e(all.)25 b(If)18 +b(the)g(parsers)f(pr)o(ovided)g(by)h(the)h(\002eld-r)o(eader)c(package) +i(ar)o(e)g(insuf-)681 4674 y(\002cient,)27 b(the)f(pr)o(ogrammer)f(can) +g(write)h(a)f(custom)h(parser)f(in)h(Scheme)f(and)h(use)f(it)h(with)681 +4774 y(equal)21 b(ease)f(in)h(the)g(awk)f(framework.)805 +4898 y(A)-6 b(wk-in-scheme)21 b(is)g(given)g(by)g(a)f(loop)i(macr)o(o)e +(called)g FA(awk)p FD(.)k(It)d(looks)h(like)f(this:)2051 +5147 y(150)p eop +%%Page: 151 159 +151 158 bop 573 614 a FA(\(awk)42 b Fo(<)p FC(next-r)o(ecord)p +Fo(>)f(<)p FC(r)o(ecord&\002eld-vars)p Fo(>)791 714 y +FD([)p Fo(<)p FC(counter)p Fo(>)p FD(])h Fo(<)p FC(state-var-decls)p +Fo(>)660 814 y(<)p FC(clause)929 826 y Fx(1)966 814 y +Fo(>)h FA(...\))490 1050 y FD(The)23 b(body)h(of)f(the)g(loop)h(is)g(a) +f(series)g(of)h(clauses,)f(each)g(one)h(r)o(epr)o(esenting)e(a)h(kind)h +(of)365 1150 y(condition/action)k(pair)-6 b(.)39 b(The)26 +b(loop)g(r)o(epeatedly)e(r)o(eads)g(a)h(r)o(ecor)o(d,)g(and)g(then)h +(executes)365 1249 y(each)21 b(clause)f(whose)h(condition)h(is)g +(satis\002ed)e(by)h(the)g(r)o(ecor)o(d.)490 1382 y(Her)o(e's)i(an)h +(example)f(that)h(r)o(eads)e(lines)i(fr)o(om)g(port)g +FA(p)f FD(and)h(prints)g(the)g(line)g(number)365 1481 +y(and)d(line)g(of)f(every)h(line)g(containing)h(the)f(string)g(\223)p +FA(Church-Rosser)p FD(\224:)573 1685 y FA(\(awk)42 b(\(read-line\))d +(\(ln\))j(lineno)f(\(\))660 1785 y(\("Church-Rosser")c(\(format)k(#t)h +("~d:)g(~s~\045")g(lineno)f(ln\)\)\))365 1989 y FD(This)18 +b(example)f(has)g(just)h(one)g(clause)f(in)g(the)h(loop)g(body)-9 +b(,)17 b(the)h(one)g(that)f(tests)g(for)h(matches)365 +2088 y(against)j(the)g(r)o(egular)e(expr)o(ession)i(\223)p +FA(Church-Rosser)p FD(\224.)490 2221 y(The)16 b Fo(<)p +FC(next-r)o(ecord)p Fo(>)e FD(form)i(is)g(an)g(expr)o(ession)g(that)g +(is)h(evaluated)d(each)i(time)g(thr)o(ough)365 2320 y(the)28 +b(loop)g(to)f(pr)o(oduce)g(a)f(r)o(ecor)o(d)g(to)i(pr)o(ocess.)44 +b(This)28 b(expr)o(ession)f(can)g(r)o(eturn)g(multiple)365 +2420 y(values;)19 b(these)f(values)g(ar)o(e)e(bound)j(to)f(the)h +(variables)e(given)h(in)h(the)f Fo(<)p FC(r)o(ecord&\002eld-vars)p +Fo(>)365 2520 y FD(list)25 b(of)f(variables.)34 b(The)24 +b(\002rst)h(value)e(r)o(eturned)g(is)i(assumed)e(to)i(be)f(the)g(r)o +(ecor)o(d;)g(when)g(it)365 2619 y(is)d(the)g(end-of-\002le)f(object,)h +(the)g(loop)h(terminates.)490 2752 y(For)c(example,)f(let's)g(suppose)h +(we)g(want)f(to)h(r)o(ead)e(items)i(fr)o(om)f FA(/etc/password)p +FD(,)12 b(and)365 2851 y(we)20 b(use)h(the)f FA(field-reader)15 +b FD(pr)o(ocedur)o(e)j(to)j(de\002ne)f(a)g(r)o(ecor)o(d)e(parser)h(for) +h FA(/etc/passwd)365 2951 y FD(entries:)573 3102 y FA(\(define)41 +b(read-passwd)e(\(field-reader)f(\(infix-splitter)f(":")43 +b(7\)\)\))365 3252 y FD(binds)23 b FA(read-passwd)18 +b FD(to)k(a)g(pr)o(ocedur)o(e)f(that)h(r)o(eads)f(in)i(a)e(line)i(of)f +(text)g(when)h(it)g(is)g(called,)365 3352 y(and)40 b(splits)g(the)g +(text)g(at)f(colons.)85 b(It)40 b(r)o(eturns)f(two)h(values:)64 +b(the)40 b(entir)o(e)f(line)h(r)o(ead,)365 3451 y(and)30 +b(a)g(seven-element)h(list)g(of)g(the)f(split-out)h(\002elds.)55 +b(\(See)30 b(section)h(8.1)e(for)i(mor)o(e)f(on)365 3551 +y FA(field-reader)16 b FD(and)k FA(infix-splitter)p FD(.\))490 +3683 y(So)27 b(if)f(the)h Fo(<)p FC(next-r)o(ecord)p +Fo(>)e FD(form)i(in)h(an)f FA(awk)e FD(expr)o(ession)i(is)g +FA(\(read-passwd\))p FD(,)c(then)365 3783 y Fo(<)p FC(r)o +(ecord&\002eld-vars)p Fo(>)c FD(must)i(be)f(a)h(list)g(of)g(two)g +(variables,)f FC(e.g.)o FD(,)573 3934 y FA(\(record)41 +b(field-vec\))365 4084 y FD(since)21 b FA(read-passwd)c +FD(r)o(eturns)j(two)h(values.)490 4217 y(Note)26 b(that)h +FA(awk)e FD(allows)i(us)g(to)g(use)f FC(any)h FD(r)o(ecor)o(d)d(r)o +(eader)h(we)h(want)h(in)g(the)f(loop,)j(r)o(e-)365 4316 +y(turning)j(whatever)e(number)i(of)e(values)h(we)g(like.)56 +b(These)31 b(values)g(don't)g(have)g(to)g(be)365 4416 +y(strings)21 b(or)g(string)g(lists.)26 b(The)20 b(only)h(r)o(equir)o +(ement)f(is)h(that)f(the)g(r)o(ecor)o(d)f(r)o(eader)f(r)o(eturn)h(the) +365 4516 y(eof)i(object)g(as)f(its)i(\002rst)f(value)f(when)h(the)g +(loop)h(should)f(terminate.)490 4648 y(The)33 b FA(awk)e +FD(loop)j(allows)g(the)f(pr)o(ogrammer)f(to)h(have)g(loop)g(variables.) +61 b(These)33 b(ar)o(e)365 4748 y(declar)o(ed)19 b(and)h(initialised)h +(by)g(the)g Fo(<)p FC(state-var-decls)p Fo(>)e FD(form,)h(a)573 +4898 y FA(\(\()p FC(var)42 b(init-exp)o FA(\))h(\()p +FC(var)g(init-exp)o FA(\))g(...\))1735 5147 y FD(151)p +eop +%%Page: 152 160 +152 159 bop 681 614 a FD(list)26 b(rather)g(like)g(the)g +FA(let)f FD(form.)41 b(Whenever)25 b(a)h(clause)f(in)i(the)f(loop)g +(body)g(executes,)h(it)681 714 y(evaluates)19 b(to)j(as)e(many)h +(values)g(as)f(ther)o(e)g(ar)o(e)f(state)i(variables,)e(updating)i +(them.)805 851 y(The)31 b(optional)g Fo(<)p FC(counter)p +Fo(>)f FD(variable)f(is)i(an)g(iteration)f(counter)-6 +b(.)55 b(It)31 b(is)g(bound)g(to)g(0)681 951 y(when)21 +b(the)g(loop)g(starts.)k(The)c(counter)f(is)h(incr)o(emented)f(each)g +(time)h(a)f(non-eof)h(r)o(ecor)o(d)e(is)681 1050 y(r)o(ead.)805 +1188 y(Ther)o(e)28 b(ar)o(e)f(several)h(kinds)i(of)e(loop)i(clause.)49 +b(When)29 b(evaluating)f(the)h(body)g(of)g(the)681 1287 +y(loop,)f FA(awk)e FD(evaluates)g FC(all)g FD(the)h(clauses)g +(sequentially)-9 b(.)43 b(Unlike)27 b FA(cond)p FD(,)g(it)f(does)h(not) +h(stop)681 1387 y(after)19 b(the)i(\002rst)g(clause)g(is)g +(satis\002ed;)f(it)h(checks)g(them)g(all.)805 1620 y +Fw(\017)41 b FA(\()p FC(test)i(body)1254 1647 y Fx(1)1335 +1620 y FC(body)1493 1647 y Fx(2)1574 1620 y FA(...\))888 +1720 y FD(If)29 b FC(test)f FD(is)i(tr)o(ue,)g(execute)e(the)h(body)g +(forms.)50 b(The)29 b(last)g(body)g(form)f(is)i(the)f(value)888 +1819 y(of)c(the)f(clause.)36 b(The)24 b(test)g(and)g(body)h(forms)f(ar) +o(e)f(evaluated)g(in)i(the)f(scope)h(of)f(the)888 1919 +y(r)o(ecor)o(d)19 b(and)i(state)f(variables.)888 2060 +y(The)h FC(test)g FD(form)g(can)f(be)g(one)i(of:)1121 +2198 y FC(integer)p FD(:)317 b(The)19 b(test)g(is)g(tr)o(ue)g(for)f +(that)h(iteration)g(of)g(the)1694 2298 y(loop.)26 b(The)21 +b(\002rst)g(iteration)g(is)g(#1.)1121 2398 y FC(sr)o(e)p +FD(:)457 b(A)20 b(r)o(egular)f(expr)o(ession,)h(in)h(SRE)g(notation) +1694 2497 y(\(see)28 b(chapter)g(6\))g(can)h(be)f(used)h(as)g(a)f +(test.)1694 2597 y(The)40 b(test)h(is)g(successful)f(if)h(the)f +(pattern)1694 2697 y(matches)16 b(the)g(r)o(ecor)o(d.)22 +b(In)17 b(particular)-6 b(,)15 b(note)1694 2796 y(that)21 +b(any)f(string)i(is)f(an)g(SRE.)1121 2896 y FA(\(when)41 +b FC(expr)p FA(\))p FD(:)99 b(The)30 b(body)g(of)g(a)f +FA(when)f FD(test)i(is)g(evaluated)1694 2995 y(as)17 +b(a)g(Scheme)g(boolean)h(expr)o(ession)g(in)g(the)1694 +3095 y(inner)j(scope)g(of)g(the)f FA(awk)g FD(form.)1121 +3195 y FC(expr)o FD(:)405 b(If)37 b(the)h(form)f(is)h(none)g(of)g(the)g +(above,)j(it)1694 3294 y(is)c(tr)o(eated)e(as)h(a)h(Scheme)f(expr)o +(ession\227)1694 3394 y(in)25 b(practice,)g(the)g FA(when)f +FD(keywor)o(d)g(is)i(only)1694 3494 y(needed)33 b(in)h(cases)f(wher)o +(e)g(SRE/Scheme)1694 3593 y(expr)o(ession)20 b(ambiguity)i(might)f +(occur)-6 b(.)805 3802 y Fw(\017)91 b FA(\(range)128 +b FC(start-test)43 b(stop-test)g(body)2166 3829 y Fx(1)2247 +3802 y FA(...\))938 3901 y(\(:range)84 b FC(start-test)43 +b(stop-test)g(body)2166 3928 y Fx(1)2247 3901 y FA(...\))938 +4001 y(\(range:)84 b FC(start-test)43 b(stop-test)g(body)2166 +4028 y Fx(1)2247 4001 y FA(...\))938 4100 y(\(:range:)d +FC(start-test)j(stop-test)g(body)2166 4128 y Fx(1)2247 +4100 y FA(...\))888 4199 y FD(These)19 b(clauses)f(become)g(activated)f +(when)i FC(start-test)f FD(is)h(tr)o(ue;)g(they)f(stay)h(active)e(on) +888 4299 y(all)k(further)f(iterations)h(until)h FC(stop-test)d +FD(is)i(tr)o(ue.)888 4440 y(So,)g(to)g(print)g(out)g(the)g(\002rst)g +(ten)g(lines)g(of)g(a)f(\002le,)h(we)g(use)g(the)f(clause:)1071 +4599 y FA(\(:range:)40 b(1)j(10)g(\(display)d(record\)\))888 +4799 y FD(The)25 b(colons)h(contr)o(ol)f(whether)f(or)h(not)g(the)g +(start)f(and)h(stop)g(lines)g(ar)o(e)e(pr)o(ocessed)888 +4898 y(by)e(the)g(clause.)k(For)c(example:)2051 5147 +y(152)p eop +%%Page: 153 161 +153 160 bop 805 601 a FA(\(range)129 b(1)43 b(5)87 b(...\))164 +b FD(Lines)83 b(2)20 b(3)h(4)805 701 y FA(\(:range)85 +b(1)43 b(5)87 b(...\))164 b FD(Lines)21 b(1)f(2)g(3)h(4)805 +800 y FA(\(range:)85 b(1)43 b(5)87 b(...\))164 b FD(Lines)83 +b(2)20 b(3)h(4)f(5)805 900 y FA(\(:range:)41 b(1)i(5)87 +b(...\))164 b FD(Lines)21 b(1)f(2)g(3)h(4)f(5)573 1131 y(A)g(line)g(can)g(trigger)h(both)g(tests,)f(either)g(simultaneously)i -(starting)f(and)f(stopping)573 3977 y(an)f(active)g(r)o(egion,)h(or)g +(starting)f(and)f(stopping)573 1231 y(an)f(active)g(r)o(egion,)h(or)g (simultaneously)h(stopping)g(one)f(and)f(starting)h(a)f(new)h(one,)573 -4077 y(so)h(ranges)g(can)f(abut)g(seamlessly)-9 b(.)490 -4239 y Fw(\017)41 b FA(\(else)g FC(body)993 4266 y Fx(1)1074 -4239 y FC(body)1232 4266 y Fx(2)1313 4239 y FA(...\))573 -4338 y FD(If)22 b(no)h(other)f(clause)g(has)g(executed)f(since)i(the)f +1330 y(so)h(ranges)g(can)f(abut)g(seamlessly)-9 b(.)490 +1533 y Fw(\017)41 b FA(\(else)g FC(body)993 1560 y Fx(1)1074 +1533 y FC(body)1232 1560 y Fx(2)1313 1533 y FA(...\))573 +1632 y FD(If)22 b(no)h(other)f(clause)g(has)g(executed)f(since)i(the)f (top)h(of)f(the)g(loop,)h(or)g(since)f(the)h(last)573 -4438 y FA(else)c FD(clause,)h(this)i(clause)e(executes.)490 -4599 y Fw(\017)41 b FA(\()p FC(test)i FA(=>)g FC(exp)o -FA(\))573 4699 y FD(If)25 b(evaluating)f FA(test)g FD(pr)o(oduces)g(a)h +1732 y FA(else)c FD(clause,)h(this)i(clause)e(executes.)490 +1934 y Fw(\017)41 b FA(\()p FC(test)i FA(=>)g FC(exp)o +FA(\))573 2034 y FD(If)25 b(evaluating)f FA(test)g FD(pr)o(oduces)g(a)h (tr)o(ue)g(value,)h(apply)e FC(exp)h FD(to)h(that)f(value.)38 -b(If)25 b FC(test)573 4799 y FD(is)20 b(a)f(r)o(egular)o(-expr)o -(ession)e(string,)j(then)g FC(exp)f FD(is)h(applied)f(to)h(the)g(match) -f(data)g(str)o(uc-)573 4898 y(tur)o(e)h(r)o(eturned)f(by)i(the)g(r)o -(egexp)f(match)g(r)o(outine.)1735 5147 y(123)p eop -%%Page: 124 130 -124 129 bop 805 614 a Fw(\017)41 b FA(\(after)g FC(body)1352 -641 y Fx(1)1433 614 y FA(...\))888 714 y FD(This)23 b(clause)f -(executes)f(when)i(the)f(loop)h(encounters)g(EOF)-8 b(.)22 -b(The)g(body)g(forms)h(ex-)888 814 y(ecute)h(in)h(the)f(scope)h(of)f -(the)g(state)g(vars)g(and)g(the)g(r)o(ecor)o(d-count)f(var)-6 -b(,)24 b(if)g(ther)o(e)f(ar)o(e)888 913 y(any)-9 b(.)26 -b(The)20 b(value)g(of)h(the)g(last)g(body)g(form)g(is)g(the)g(value)f -(of)g(the)h(entir)o(e)f(awk)h(form.)888 1042 y(If)f(ther)o(e)f(is)h(no) -g FA(after)e FD(clause,)h FA(awk)f FD(r)o(eturns)i(the)g(loop's)g -(state)g(variables)e(as)i(multi-)888 1142 y(ple)h(values.)681 -1389 y FB(7.2.1)81 b(Examples)681 1572 y FD(Her)o(e)26 -b(ar)o(e)g(some)i(examples)f(of)g FA(awk)f FD(being)i(used)f(to)h(pr)o -(ocess)e(various)i(types)f(of)h(input)681 1671 y(str)o(eam.)888 -1858 y FA(\(define)41 b($)i(nth\))347 b(;)43 b(Saves)f(typing.)888 -2058 y(;;;)h(Print)e(out)i(the)f(name)g(and)g(home-directory)c(of)43 -b(everyone)d(in)j(/etc/passwd:)888 2157 y(\(let)f(\(\(read-passwd)c +b(If)25 b FC(test)573 2133 y FD(is)30 b(a)e(r)o(egular)h(expr)o +(ession,)i(then)e FC(exp)g FD(is)h(applied)e(to)i(the)f(match)h(data)e +(str)o(uctur)o(e)573 2233 y(r)o(eturned)19 b(by)i(the)g(r)o(egexp)f +(match)g(r)o(outine.)490 2435 y Fw(\017)41 b FA(\(after)g +FC(body)1036 2462 y Fx(1)1117 2435 y FA(...\))573 2535 +y FD(This)23 b(clause)e(executes)h(when)g(the)h(loop)g(encounters)f +(EOF)-8 b(.)23 b(The)f(body)g(forms)g(ex-)573 2634 y(ecute)i(in)g(the)h +(scope)f(of)g(the)h(state)f(vars)f(and)h(the)h(r)o(ecor)o(d-count)d +(var)-6 b(,)24 b(if)g(ther)o(e)g(ar)o(e)573 2734 y(any)-9 +b(.)25 b(The)c(value)f(of)h(the)g(last)f(body)h(form)g(is)g(the)g +(value)f(of)h(the)g(entir)o(e)f(awk)h(form.)573 2885 +y(If)e(ther)o(e)g(is)h(no)h FA(after)c FD(clause,)i FA(awk)g +FD(r)o(eturns)g(the)h(loop's)h(state)e(variables)g(as)g(multi-)573 +2984 y(ple)h(values.)365 3305 y FB(8.2.1)81 b(Examples)365 +3523 y FD(Her)o(e)27 b(ar)o(e)e(some)j(examples)f(of)h +FA(awk)e FD(being)h(used)g(to)h(pr)o(ocess)f(various)g(types)h(of)f +(input)365 3623 y(str)o(eam.)573 3885 y FA(\(define)41 +b($)i(nth\))347 b(;)43 b(Saves)e(typing.)573 4084 y(;;;)h(Print)g(out)g +(the)g(name)g(and)h(home-directory)37 b(of)43 b(everyone)e(in)h +(/etc/passwd:)573 4184 y(\(let)g(\(\(read-passwd)c(\(field-reader)g +(\(infix-splitter)g(":")k(7\)\)\)\))660 4283 y(\(call-with-input)o(-fi) +o(le)37 b("/etc/passwd")747 4383 y(\(lambda)k(\(port\))834 +4482 y(\(awk)h(\(read-passwd)d(port\))i(\(record)g(fields\))g(\(\))922 +4582 y(\(#t)h(\(format)f(#t)h("~a's)g(home)g(directory)e(is)i(~a~\045") +1445 4682 y(\($)g(fields)f(0\))1445 4781 y(\($)h(fields)f +(5\)\)\)\)\)\)\))1735 5147 y FD(153)p eop +%%Page: 154 162 +154 161 bop 888 614 a FA(;;;)43 b(Print)e(out)i(the)f(user-name)e(and)i +(home-directory)c(of)43 b(everyone)d(whose)888 714 y(;;;)j(name)f +(begins)f(with)h("S")888 814 y(\(let)g(\(\(read-passwd)c (\(field-reader)h(\(infix-splitter)e(":")42 b(7\)\)\)\))976 -2257 y(\(call-with-inpu)o(t-)o(fil)o(e)37 b("/etc/passwd")1063 -2357 y(\(lambda)j(\(port\))1150 2456 y(\(awk)i(\(read-passwd)c(port\))k -(\(record)f(fields\))f(\(\))1237 2556 y(\(#t)i(\(format)f(#t)i("~a's)e -(home)h(directory)e(is)j(~a~\045")1760 2655 y(\($)g(fields)e(0\))1760 -2755 y(\($)i(fields)e(5\)\)\)\)\)\)\))888 3005 y(;;;)i(Print)e(out)i -(the)f(user-name)e(and)i(home-directory)c(of)43 b(everyone)d(whose)888 -3104 y(;;;)j(name)f(begins)f(with)h("S")888 3204 y(\(let)g -(\(\(read-passwd)c(\(field-reader)h(\(infix-splitter)e(":")42 -b(7\)\)\)\))976 3303 y(\(call-with-inpu)o(t-)o(fil)o(e)37 -b("/etc/passwd")1063 3403 y(\(lambda)j(\(port\))1150 -3503 y(\(awk)i(\(read-passwd)c(port\))k(\(record)f(fields\))f(\(\))1237 -3602 y(\("^S")i(\(format)e(#t)j("~a's)f(home)f(directory)f(is)j -(~a~\045")1847 3702 y(\($)g(fields)e(0\))1847 3802 y(\($)i(fields)e -(5\)\)\)\)\)\)\))888 4051 y(;;;)i(Read)f(a)h(series)e(of)i(integers)d -(from)i(stdin.)f(This)h(expression)d(evaluates)888 4151 -y(;;;)k(to)f(the)h(number)e(of)i(positive)d(numbers)h(that)h(were)f -(read.)h(Note)g(our)888 4250 y(;;;)h("record-reader")37 -b(is)43 b(the)f(standard)e(Scheme)i(READ)f(procedure.)888 -4350 y(\(awk)h(\(read\))f(\(i\))130 b(\(\(npos)41 b(0\)\))976 -4450 y(\(\(>)h(i)h(0\))g(\(+)g(npos)e(1\)\)\))888 4699 -y(;;;)i(Filter)e(--)i(pass)e(only)h(lines)g(containing)d(my)k(name.)888 -4799 y(\(awk)f(\(read-line\))d(\(line\))i(\(\))976 4898 -y(\("Olin")f(\(display)g(line\))i(\(newline\)\)\))2051 -5147 y FD(124)p eop -%%Page: 125 131 -125 130 bop 573 614 a FA(;;;)42 b(Count)g(the)g(number)f(of)i -(non-comment)c(lines)i(of)i(code)f(in)h(my)g(Scheme)e(source.)573 -714 y(\(awk)h(\(read-line\))d(\(line\))i(\(\(nlines)f(0\)\))660 -814 y(\("^[)i(\\t]*;")f(nlines\))651 b(;)43 b(A)g(comment)e(line.)660 -913 y(\(else)303 b(\(+)43 b(nlines)e(1\)\)\))347 b(;)43 -b(Not)f(a)i(comment)c(line.)573 1196 y(;;;)i(Read)g(numbers,)e -(counting)h(the)h(evens)g(and)g(odds.)573 1295 y(\(awk)g(\(read\))f -(\(val\))g(\(\(evens)g(0\))i(\(odds)e(0\)\))660 1395 -y(\(\(>)h(val)h(0\))f(\(display)f("pos)h("\))86 b(\(values)41 -b(evens)g(odds\)\))g(;)j(Tell)d(me)i(about)660 1494 y(\(\(<)f(val)h -(0\))f(\(display)f("neg)h("\))86 b(\(values)41 b(evens)g(odds\)\))g(;)j -(sign,)d(too.)660 1594 y(\(else)259 b(\(display)41 b("zero)g("\))i -(\(values)e(evens)g(odds\)\))660 1793 y(\(\(even?)g(val\))h(\(values)e -(\(+)j(evens)f(1\))g(odds\)\))660 1893 y(\(else)347 b(\(values)40 -b(evens)303 b(\(+)43 b(odds)f(1\)\)\)\))573 2175 y(;;;)g(Determine)e -(the)i(max)h(length)e(of)i(all)f(the)g(lines)g(in)h(the)f(file.)573 -2275 y(\(awk)g(\(read-line\))d(\(line\))i(\(\(max-len)f(0\)\))660 -2374 y(\(#t)i(\(max)g(max-len)f(\(string-length)d(line\)\)\)\))573 -2657 y(;;;)k(\(This)g(could)f(also)h(be)h(done)f(with)g(REDUCE-PORT:\)) -573 2756 y(\(reduce-port)c(\(current-input-po)o(rt\))f(read-line)1139 -2856 y(\(lambda)k(\(line)h(maxlen\))e(\(max)i(\(string-length)c(line\)) -k(maxlen\)\))1139 2956 y(0\))573 3238 y(;;;)g(Print)g(every)f(line)h -(longer)f(than)h(80)h(chars.)573 3337 y(;;;)f(Prefix)f(each)h(line)g -(with)g(its)g(line)g(#.)573 3437 y(\(awk)g(\(read-line\))d(\(line\))i -(lineno)g(\(\))660 3537 y(\(\(>)h(\(string-length)c(line\))k(80\))704 -3636 y(\(format)e(#t)j("~d:)f(~s~\045")g(lineno)f(line\)\)\))573 -3919 y(;;;)h(Strip)g(blank)f(lines)h(from)g(input.)573 -4018 y(\(awk)g(\(read-line\))d(\(line\))i(\(\))660 4118 -y(\(".")h(\(display)e(line\))i(\(newline\)\)\))573 4400 -y(;;;)g(Sort)g(the)g(entries)f(in)i(/etc/passwd)c(by)k(login)e(name.) -573 4500 y(\(for-each)f(\(lambda)g(\(entry\))h(\(display)f(\(cdr)i -(entry\)\))f(\(newline\)\))432 b(;)43 b(Out)1009 4599 -y(\(sort)e(\(lambda)g(\(x)i(y\))f(\(string)h(i)h(0\))g(\(+)g(npos)e +(1\)\)\))888 2506 y(;;;)i(Filter)e(--)i(pass)e(only)h(lines)g +(containing)d(my)k(name.)888 2605 y(\(awk)f(\(read-line\))d(\(line\))i +(\(\))976 2705 y(\("Olin")f(\(display)g(line\))i(\(newline\)\)\))888 +3003 y(;;;)h(Count)e(the)i(number)e(of)h(non-comment)d(lines)j(of)h +(code)f(in)g(my)h(Scheme)e(source.)888 3102 y(\(awk)h(\(read-line\))d +(\(line\))i(\(\(nlines)g(0\)\))976 3202 y(\(\(:)h(bos)g(\(*)h(white\))e +(";"\))86 b(nlines\))389 b(;)43 b(A)g(comment)e(line.)976 +3302 y(\(else)826 b(\(+)42 b(nlines)f(1\)\)\))86 b(;)43 +b(Not)f(a)i(comment)c(line.)888 3600 y(;;;)j(Read)f(numbers,)e +(counting)g(the)j(evens)e(and)h(odds.)888 3699 y(\(awk)g(\(read\))f +(\(val\))h(\(\(evens)f(0\))h(\(odds)g(0\)\))976 3799 +y(\(\(>)g(val)g(0\))h(\(display)d("pos)i("\))87 b(\(values)40 +b(evens)i(odds\)\))f(;)i(Tell)f(me)h(about)976 3899 y(\(\(<)f(val)g +(0\))h(\(display)d("neg)i("\))87 b(\(values)40 b(evens)i(odds\)\))f(;)i +(sign,)f(too.)976 3998 y(\(else)259 b(\(display)40 b("zero)i("\))h +(\(values)d(evens)i(odds\)\))976 4197 y(\(\(even?)e(val\))i(\(values)f +(\(+)i(evens)e(1\))i(odds\)\))976 4297 y(\(else)346 b(\(values)41 +b(evens)303 b(\(+)43 b(odds)f(1\)\)\)\))888 4595 y(;;;)h(Determine)d +(the)i(max)g(length)f(of)i(all)f(the)h(lines)e(in)i(the)f(file.)888 +4695 y(\(awk)g(\(read-line\))d(\(line\))i(\(\(max-len)f(0\)\))976 +4794 y(\(#t)i(\(max)g(max-len)e(\(string-length)e(line\)\)\)\))2051 +5147 y FD(154)p eop +%%Page: 155 163 +155 162 bop 573 614 a FA(;;;)42 b(\(This)g(could)f(also)h(be)h(done)f +(with)g(PORT-FOLD:\))573 714 y(\(port-fold)d(\(current-input-po)o(rt)o +(\))f(read-line)1052 814 y(\(lambda)j(\(line)h(maxlen\))e(\(max)i +(\(string-length)c(line\))j(maxlen\)\))1052 913 y(0\))573 +1204 y(;;;)h(Print)g(every)f(line)h(longer)f(than)h(80)h(chars.)573 +1303 y(;;;)f(Prefix)f(each)h(line)g(with)g(its)g(line)g(#.)573 +1403 y(\(awk)g(\(read-line\))d(\(line\))i(lineno)g(\(\))660 +1503 y(\(\(>)h(\(string-length)c(line\))k(80\))704 1602 +y(\(format)e(#t)j("~d:)f(~s~\045")g(lineno)f(line\)\)\))573 +1893 y(;;;)h(Strip)g(blank)f(lines)h(from)g(input.)573 +1993 y(\(awk)g(\(read-line\))d(\(line\))i(\(\))660 2092 +y(\(\(~)h(white\))129 b(\(display)40 b(line\))h(\(newline\)\)\))573 +2383 y(;;;)h(Sort)g(the)g(entries)f(in)i(/etc/passwd)c(by)k(login)e +(name.)573 2482 y(\(for-each)f(\(lambda)g(\(entry\))h(\(display)f +(\(cdr)i(entry\)\))f(\(newline\)\))432 b(;)43 b(Out)1009 +2582 y(\(sort)e(\(lambda)g(\(x)i(y\))f(\(string)c Fn(0)p FD(;)28 b(a)e(right)h(shift) -g(is)573 3238 y Fo(j)h(<)22 b Fn(0)p FD(.)365 3516 y -Fy(8.2)99 b(List)26 b(procedures)365 3739 y FA(\(nth)42 -b FC(list)21 b(i)p FA(\))87 b Fw(\000)-14 b(!)87 b FC(object)1578 -b FD(pr)o(ocedur)o(e)573 3856 y(Returns)22 b(the)h Fo(i)1050 -3826 y Fx(t)p Fp(h)1140 3856 y FD(element)f(of)g FC(list)p -FD(.)29 b(The)22 b(\002rst)g(element)g(\(the)g(car\))f(is)h -FA(\(nth)42 b FC(list)i FA(0\))p FD(,)573 3956 y(the)21 -b(second)g(element)g(is)g FA(\(nth)42 b FC(list)h FA(1\))p -FD(,)20 b(and)g(so)i(on.)573 4081 y(This)e(pr)o(ocedur)o(e)f(is)h(pr)o -(ovided)f(as)h(it)g(is)g(useful)g(for)g(accessing)g(elements)h(fr)o(om) -e(the)573 4180 y(lists)i(r)o(eturned)f(by)h(the)g(\002eld-r)o(eaders)d -(\(chapter)i(7\).)365 4459 y Fy(8.3)99 b(T)-11 b(op)26 -b(level)365 4682 y FA(\(repl\))85 b Fw(\000)-14 b(!)87 -b FC(unde\002ned)1590 b FD(pr)o(ocedur)o(e)573 4799 y(This)23 -b(r)o(uns)h(a)e(Scheme)h(48)f(r)o(ead-eval-print)e(loop,)k(r)o(eading)e -(forms)h(fr)o(om)g(the)g(cur)o(-)573 4898 y(r)o(ent)d(input)h(port,)g -(and)f(writing)i(their)f(values)f(to)h(the)g(curr)o(ent)f(output)h -(port.)1735 5147 y(127)p eop -%%Page: 128 134 -128 133 bop 888 614 a FD(If)25 b(you)h(wish)f(to)h(try)f(something)i -(danger)o(ous,)e(and)f(want)h(to)h(be)f(able)f(to)h(r)o(ecover)888 -714 y(your)c(shell)h(state,)e(you)h(can)g(fork)f(of)o(f)g(a)g(subshell) -i(with)g(the)e(following)j(form:)1071 853 y FA(\(run)42 -b(\(begin)f(\(repl\)\)\))888 991 y FD(.)12 b(.)g(.)g(or)-6 -b(,)21 b(r)o(ephrased)e(for)i(the)g(pr)o(oceduralists:)1071 -1130 y FA(\(wait)42 b(\(fork)f(repl\)\))2051 5147 y FD(128)p -eop -%%Page: 129 135 -129 134 bop 365 1266 a Fz(Chapter)45 b(9)365 1709 y FE(Running)53 -b(scsh)365 2194 y FD(Scsh)23 b(is)g(curr)o(ently)f(implemented)h(on)h -(top)f(of)g(Scheme)f(48,)g(a)g(fr)o(eely-available)e(Scheme)365 -2293 y(implementation)i(written)f(by)f(Jonathan)g(Rees)h(and)f(Richar)o -(d)g(Kelsey)-9 b(.)25 b(Scheme)20 b(48)f(uses)365 2393 -y(a)33 b(byte-code)g(interpr)o(eter)f(for)h(good)h(code)g(density)-9 -b(,)36 b(portability)e(and)f(medium)h(ef)o(\002-)365 -2493 y(ciency)-9 b(.)26 b(It)20 b(is)i(R4RS.)e(It)h(also)g(has)g(a)f -(module)h(system)h(designed)e(by)h(Jonathan)g(Rees.)490 -2621 y(Scsh's)k(design)h(is)g(not)f(Scheme)g(48)g(speci\002c,)h -(although)g(the)f(curr)o(ent)g(implementa-)365 2720 y(tion)k(is)e -(necessarily)g(so.)46 b(Scsh)27 b(is)h(intended)f(to)h(be)f -(implementable)h(in)f(other)h(Scheme)365 2820 y(implementations.)37 -b(The)24 b(Scheme)g(48)f(virtual)h(machine)g(that)g(scsh)h(uses)g(is)f -(a)g(specially)365 2920 y(modi\002ed)k(version;)i(standar)o(d)c(Scheme) -g(48)g(virtual)h(machines)h(cannot)f(be)g(used)g(with)365 -3019 y(the)21 b(scsh)h(heap)e(image.)490 3147 y(Ther)o(e)37 -b(ar)o(e)f(several)h(dif)o(fer)o(ent)f(ways)i(to)h(invoke)f(scsh.)78 -b(Y)-8 b(ou)39 b(can)e(r)o(un)i(it)f(as)g(an)365 3247 -y(interactive)30 b(Scheme)g(system,)k(with)d(a)f(standar)o(d)f(r)o -(ead-eval-print)e(interaction)k(loop.)365 3347 y(Scsh)38 -b(can)f(also)h(be)f(invoked)h(as)f(the)g(interpr)o(eter)g(for)g(a)g -(shell)h(script)f(by)h(putting)g(a)365 3446 y(\223)p -FA(#!/usr/local/bin)o(/s)o(csh)f(-s)p FD(\224)19 b(line)i(at)g(the)g -(top)g(of)f(the)h(shell)h(script.)490 3575 y(Descending)h(a)g(level,)f -(it)i(is)f(also)g(possible)g(to)h(invoke)f(the)g(underlying)h(virtual)e -(ma-)365 3674 y(chine)k(byte-code)f(interpr)o(eter)g(dir)o(ectly)g(on)h -(dumped)f(heap)h(images.)40 b(Scsh)26 b(pr)o(ograms)365 -3774 y(can)i(be)f(pr)o(e-compiled)f(to)i(byte-codes)f(and)g(dumped)g -(as)g(raw)-8 b(,)29 b(binary)f(heap)f(images.)365 3873 -y(W)-6 b(riting)28 b(heap)e(images)h(strips)g(out)h(unused)f(portions)h -(of)f(the)g(scsh)g(r)o(untime)h(\(such)f(as)365 3973 -y(the)19 b(compiler)-6 b(,)20 b(the)f(debugger)-6 b(,)18 -b(and)g(other)i(complex)f(subsystems\),)h(r)o(educing)e(memory)365 -4073 y(demands)25 b(and)g(saving)h(loading)g(and)f(compilation)i -(times.)40 b(The)25 b(heap)g(image)h(format)365 4172 -y(allows)j(for)f(an)h(initial)g FA(#!/usr/local/li)o(b/s)o(cs)o(h/s)o -(cs)o(hvm)22 b FD(trigger)28 b(on)h(the)f(\002rst)h(line)365 -4272 y(of)23 b(the)f(image,)h(making)g(heap)f(images)g(dir)o(ectly)g -(executable)f(as)h(another)h(kind)g(of)f(shell)365 4372 -y(script.)490 4500 y(Finally)-9 b(,)24 b(scsh's)h(static)e(linker)h -(system)h(allows)f(dumped)f(heap)g(images)h(to)g(be)f(com-)365 -4599 y(piled)c(to)h(a)f(raw)g(Unix)g(a.out\(5\))e(format,)i(which)i -(can)e(be)g(linked)g(into)h(the)g(text)f(section)h(of)365 -4699 y(the)h(vm)g(binary)-9 b(.)26 b(This)21 b(pr)o(oduces)f(a)h(tr)o -(ue)g(Unix)g(executable)e(binary)i(\002le.)26 b(Since)21 -b(the)g(byte)365 4799 y(codes)i(comprising)h(the)e(pr)o(ogram)g(ar)o(e) -g(in)h(the)f(\002le's)h(text)g(section,)g(they)g(ar)o(e)e(not)j(traced) -365 4898 y(or)f(copied)g(by)f(the)h(garbage)f(collector)-6 -b(,)23 b(do)g(not)g(occupy)g(space)f(in)h(the)g(vm's)h(heap,)e(and)1735 -5147 y(129)p eop -%%Page: 130 136 -130 135 bop 681 614 a FD(do)16 b(not)g(need)g(to)g(be)g(loaded)f(and)h -(linked)g(at)f(startup)h(time.)24 b(This)17 b(r)o(educes)d(the)i(pr)o -(ogram's)681 714 y(startup)k(time,)h(memory)g(r)o(equir)o(ements,)f -(and)h(paging)g(over)o(head.)805 854 y(This)h(chapter)e(will)h(cover)f -(these)h(various)g(ways)g(of)g(invoking)h(scsh)f(pr)o(ograms.)681 -1169 y Fy(9.1)99 b(Scsh)25 b(command-line)f(switches)681 -1403 y FD(When)f(the)g(scsh)g(top-level)f(starts)h(up,)g(it)g(scans)f -(the)h(command)g(line)g(for)g(switches)g(that)681 1503 -y(contr)o(ol)i(its)h(behaviour)-6 b(.)38 b(These)25 b(ar)o(guments)g -(ar)o(e)e(r)o(emoved)i(fr)o(om)f(the)h(command)h(line;)681 -1602 y(the)35 b(r)o(emaining)f(ar)o(guments)h(can)f(be)h(accessed)e(as) -i(the)f(value)g(of)h(the)g(scsh)g(variable)681 1702 y -FA(command-line-arg)o(um)o(ent)o(s)p FD(.)681 1992 y -FB(9.1.1)81 b(Scripts)19 b(and)h(programs)681 2194 y -FD(The)d(scsh)h(command-line)g(switches)g(pr)o(ovide)e(sophisticated)i -(support)f(for)g(the)h(authors)681 2294 y(of)28 b(shell)i(scripts)f -(and)f(pr)o(ograms;)k(they)d(also)g(allow)g(the)g(pr)o(ogrammer)f(to)h -(write)g(pr)o(o-)681 2393 y(grams)21 b(that)f(use)h(the)g(Scheme)f(48)g -(module)h(system.)805 2533 y(Ther)o(e)34 b(is)h(a)f(dif)o(fer)o(ence)e -(between)i(a)h FC(script)p FD(,)i(which)e(performs)g(its)g(action)g -FC(as)f(it)h(is)681 2633 y(loaded)p FD(,)d(and)f(a)g -FC(pr)o(ogram)p FD(,)h(which)g(is)g(loaded/linked,)h(and)e(then)g -(performs)g(its)h(action)681 2732 y(by)24 b(having)h(contr)o(ol)g -(transferr)o(ed)e(to)i(an)f(entry)h(point)h(\()p FC(e.g.)n -FD(,)g(the)f FA(main\(\))d FD(function)j(in)g(C)681 2832 -y(pr)o(ograms\))20 b(that)g(was)h(de\002ned)f(by)h(the)g(load/link)h -(operation.)805 2971 y(A)g FC(script)p FD(,)f(by)g(the)h(above)f -(de\002nition,)i(cannot)f(be)f(compiled)h(by)g(the)g(simple)g(mecha-) -681 3071 y(nism)i(of)g(loading)f(it)h(into)g(a)f(scsh)h(pr)o(ocess)f -(and)g(dumping)h(out)g(a)f(heap)f(image\227it)i(exe-)681 -3171 y(cutes)c(as)h(it)g(loads.)k(It)c(does)g(not)g(have)g(a)f -(top-level)g FA(main\(\))p FD(-type)e(entry)j(point.)805 -3310 y(It)g(is)g(mor)o(e)f(\003exible)h(and)f(useful)g(to)h(implement)h -(a)e(system)h(as)f(a)h(pr)o(ogram)e(than)i(as)g(a)681 -3410 y(script.)29 b(Pr)o(ograms)21 b(can)h(be)g(compiled)g -(straightforwar)o(dly;)f(they)h(can)g(also)g(export)g(pr)o(o-)681 -3509 y(cedural)g(interfaces)g(for)h(use)g(by)g(other)g(Scheme)g -(packages.)32 b(However)-6 b(,)23 b(scsh)h(supports)681 -3609 y(both)d(the)g(script)g(and)f(the)h(pr)o(ogram)f(style)h(of)g(pr)o -(ogramming.)681 3899 y FB(9.1.2)81 b(Inserting)19 b(interpreter)g -(triggers)h(into)g(scsh)g(programs)681 4101 y FD(When)g(Unix)f(tries)h -(to)g(execute)e(an)i(executable)e(\002le)i(whose)g(\002rst)g(16)f(bits) -h(ar)o(e)e(the)i(charac-)681 4201 y(ter)d(pair)f(\223)p -FA(#!)p FD(\224,)g(it)i(tr)o(eats)e(the)i(\002le)f(not)h(as)f -(machine-code)g(to)h(be)f(dir)o(ectly)f(executed)g(by)i(the)681 -4301 y(native)26 b(pr)o(ocessor)-6 b(,)28 b(but)f(as)g(sour)o(ce)f -(code)h(to)g(be)g(executed)f(by)h(some)g(interpr)o(eter)-6 -b(.)43 b(The)681 4400 y(interpr)o(eter)22 b(to)h(use)h(is)f -(speci\002ed)g(immediately)h(after)e(the)h(\223)p FA(#!)p -FD(\224)f(sequence)h(on)h(the)g(\002rst)681 4500 y(line)k(of)g(the)h -(sour)o(ce)e(\002le)h(\(along)h(with)f(one)h(optional)g(initial)f(ar)o -(gument\).)47 b(The)28 b(kernel)681 4599 y(r)o(eads)20 -b(in)i(the)f(name)h(of)f(the)h(interpr)o(eter)-6 b(,)20 -b(and)h(executes)g(that)g(instead.)28 b(The)21 b(interpr)o(eter)681 -4699 y(is)e(passed)g(the)h(sour)o(ce)e(\002lename)i(as)f(its)g(\002rst) -h(ar)o(gument,)f(with)h(the)f(original)h(ar)o(guments)681 -4799 y(following.)29 b(Consult)22 b(the)g(Unix)g(man)f(page)g(for)g -(the)h FA(exec)e FD(system)i(call)f(for)g(mor)o(e)h(infor)o(-)681 -4898 y(mation.)2051 5147 y(130)p eop -%%Page: 131 137 -131 136 bop 490 614 a FD(Scsh)29 b(allows)h(Scheme)f(pr)o(ograms)g(to)g -(have)g(these)g(triggers)h(placed)e(on)i(their)f(\002rst)365 -714 y(line.)49 b(Scsh)28 b(tr)o(eats)g(the)g(character)f(sequence)h -(\223)p FA(#!)p FD(\224)f(as)h(a)g(block-comment)h(sequence,)3196 -684 y Fs(1)365 814 y FD(and)41 b(skips)h(all)g(following)h(characters)d -(until)i(it)g(r)o(eads)e(the)h(comment-terminating)365 -913 y(sequence)34 b(newline/exclamation-point/sharp-sign/newline)i(\()p -FC(i.e.)p FD(,)g(the)d(sequence)365 1013 y(\223)p FA(!#)p -FD(\224)19 b(occurring)i(on)h(its)f(own)h(line\).)490 -1142 y(In)f(this)g(way)-9 b(,)21 b(the)f(pr)o(ogrammer)g(can)h(arrange) -e(for)i(an)g(initial)573 1341 y FA(#!/usr/local/bin)o(/s)o(csh)37 -b(-s)573 1441 y(!#)365 1639 y FD(header)31 b(appearing)f(in)i(a)f -(Scheme)g(pr)o(ogram)g(to)h(be)f(ignor)o(ed)g(when)h(the)f(pr)o(ogram)g -(is)365 1739 y(loaded)20 b(into)i(scsh.)365 2002 y FB(9.1.3)81 -b(Module)20 b(system)365 2191 y FD(Scsh)e(uses)f(the)h(Scheme)f(48)f -(module)i(system,)g(which)h(de\002nes)e FC(packages)p -FD(,)g FC(structur)o(es)p FD(,)h(and)365 2291 y FC(interfaces)p -FD(.)365 2490 y FB(Package)40 b FD(A)25 b(package)f(is)i(an)f(envir)o -(onment\227that)h(is,)h(a)e(set)g(of)h(variable/value)e(bind-)573 -2589 y(ings.)h(Y)-8 b(ou)17 b(can)f(evaluate)f(Scheme)h(forms)h(inside) -f(a)g(package,)g(or)h(load)f(a)f(\002le)i(into)g(a)573 -2689 y(package.)23 b(Packages)17 b(export)h(sets)g(of)g(bindings;)h -(these)f(sets)g(ar)o(e)e(called)h FC(structur)o(es)p -FD(.)365 2861 y FB(Structure)40 b FD(A)20 b(str)o(uctur)o(e)g(is)h(a)f -(named)g(view)g(on)h(a)f(package\227a)f(set)i(of)f(bindings.)26 -b(Other)573 2961 y(packages)15 b(can)h FC(open)g FD(the)g(str)o(uctur)o -(e,)g(importing)h(its)g(bindings)g(into)g(their)f(envir)o(on-)573 -3061 y(ment.)28 b(Packages)21 b(can)g(pr)o(ovide)f(mor)o(e)i(than)f -(one)h(str)o(uctur)o(e,)f(r)o(evealing)g(dif)o(fer)o(ent)573 -3160 y(portions)h(of)e(the)h(package's)f(envir)o(onment.)365 -3332 y FB(Interface)40 b FD(An)29 b(interface)e(is)i(the)f -(\223type\224)g(of)g(a)g(str)o(uctur)o(e.)48 b(An)28 -b(interface)g(is)h(the)f(set)h(of)573 3432 y(names)g(exported)g(by)g(a) -f(str)o(uctur)o(e.)51 b(These)29 b(names)g(can)g(also)g(be)g(marked)g -(with)573 3532 y(other)21 b(static)h(information)g(\()p -FC(e.g.)o FD(,)f(advisory)g(type)h(declarations,)e(or)i(syntax)f(infor) -o(-)573 3631 y(mation\).)365 3830 y(Mor)o(e)d(information)i(on)g(the)f -(the)g(Scheme)g(48)f(module)h(system)h(can)f(be)g(found)g(in)g(the)g -(\002le)365 3930 y FA(module.ps)e FD(in)22 b(the)e FA(doc)g -FD(dir)o(ectory)g(of)h(the)g(Scheme)f(48)g(and)g(scsh)h(r)o(eleases.) -490 4059 y(Pr)o(ogramming)33 b(Scheme)g(with)g(a)g(module)g(system)g -(is)g(dif)o(fer)o(ent)e(fr)o(om)i(pr)o(ogram-)365 4159 -y(ming)20 b(in)e(older)g(Scheme)g(implementations,)i(and)e(the)h -(associated)e(development)h(pr)o(ob-)365 4258 y(lems)36 -b(ar)o(e)d(consequently)j(dif)o(fer)o(ent.)66 b(In)35 -b(Schemes)g(that)g(lack)f(modular)h(abstraction)365 4358 -y(mechanisms,)26 b(everything)f(is)f(accessible;)h(the)f(major)h(pr)o -(oblem)f(is)g(pr)o(eventing)g(name-)365 4458 y(space)e(con\003icts.)32 -b(In)22 b(Scheme)h(48,)e(name-space)g(con\003icts)j(vanish;)g(the)e -(major)h(pr)o(oblem)365 4557 y(is)29 b(that)g(not)g(all)g(bindings)h -(ar)o(e)d(accessible)h(fr)o(om)g(every)h(place.)48 b(It)29 -b(takes)f(a)g(little)i(extra)365 4657 y(work)22 b(to)f(specify)f(what)h -(packages)f(export)g(which)i(values.)p 365 4740 1146 -4 v 456 4796 a Fr(1)485 4819 y Fv(Why)17 b(a)f(block-comment)h(instead) -f(of)h(an)g(end-of-line)f(delimited)g(comment?)k(See)d(the)e(section)j -(on)e(meta-)365 4898 y(ar)o(gs.)1735 5147 y FD(131)p -eop -%%Page: 132 138 -132 137 bop 805 614 a FD(It)20 b(may)g(take)f(you)h(a)f(little)h(while) -g(to)g(get)g(used)f(to)h(the)g(new)g(style)g(of)f(pr)o(ogram)g(devel-) -681 714 y(opment.)26 b(Although)21 b(scsh)h(can)e(be)g(used)g(without)i -(r)o(eferring)e(to)h(the)f(module)h(system)g(at)681 814 -y(all,)k(we)f(r)o(ecommend)g(taking)h(the)g(time)g(to)g(learn)f(and)g -(use)g(it.)37 b(The)24 b(ef)o(fort)g(will)h(pay)f(of)o(f)681 -913 y(in)d(the)g(constr)o(uction)h(of)f(modular)-6 b(,)20 -b(factorable)g(pr)o(ograms.)681 1384 y FB(Module)f(warning)681 -1680 y FD(Pr)o(ogrammers)34 b(who)i(open)g(both)g(the)f -FA(scheme)d FD(and)j FA(scsh)f FD(str)o(uctur)o(es)g(in)i(their)f(own) -681 1780 y(packages)20 b(should)h(make)g(sur)o(e)f(to)h(always)f(put)h -(the)g FA(scsh)e FD(r)o(efer)o(ence)f(\002rst.)731 2192 -y(Do)j(this:)1184 b(Not)21 b(this:)814 2279 y FA(\(define-structu)o(re) -37 b(web-server)901 2344 y(\(open)k(scsh)1162 2413 y(scheme)1162 -2464 y(net-hax)1162 2524 y(.)1162 2557 y(.)1162 2590 -y(.\))901 2655 y(\(file)g(web\)\))2283 2279 y(\(define-structur)o(e)d -(web-server)2370 2344 y(\(open)k(scheme)2632 2413 y(scsh)2632 -2464 y(net-hax)2632 2524 y(.)2632 2557 y(.)2632 2590 -y(.)o(\))2370 2655 y(\(file)g(web\)\))731 2755 y FD(Open)21 -b FA(scsh)e FD(befor)o(e)g FA(scheme)p FD(.)515 b(Not)21 -b FA(scsh)e FD(after)h FA(scheme)p FD(.)681 3088 y(Or)o(dering)j(the)h -(two)h(packages)d(like)j(this)f(is)g(necessary)g(because)f(scsh)h -(overrides)f(some)681 3187 y(of)c(the)g(standar)o(d)f(R4RS)h(Scheme)g -(de\002nitions)h(exported)f(by)g(the)g FA(scheme)e FD(package)h(with) -681 3287 y(its)30 b(own)h(de\002nitions.)53 b(For)30 -b(example,)h(scsh's)g(versions)f(of)g(the)g(R4RS)g(I/O)g(functions)681 -3387 y(such)25 b(as)f FA(display)d FD(and)j FA(write)e -FD(take)i(integer)g(\002le)h(descriptors)f(as)g(ar)o(guments,)h(as)f -(well)681 3486 y(as)i(Scheme)h(ports.)44 b(If)26 b(you)h(open)h(the)f -FA(scheme)d FD(str)o(uctur)o(e)i(befor)o(e)g(the)h FA(scsh)e -FD(str)o(uctur)o(e,)681 3586 y(you'll)c(get)g(the)g(standar)o(d)e -(Scheme)i(48)e(de\002nitions,)j(which)g(is)f(not)g(what)g(you)h(want.) -681 4057 y FB(9.1.4)81 b(Switches)681 4353 y FD(The)21 -b(scsh)g(top-level)f(takes)h(command-line)g(switches)g(in)h(the)f -(following)h(format:)888 4626 y FA(scsh)42 b([)p FC(meta-ar)o(g)n -FA(])h([)p FC(switch)1797 4638 y Fp(i)1868 4626 y FA(...])f([)p -FC(end-option)g(ar)o(g)2642 4653 y Fx(1)2723 4626 y FA(...)g -FC(ar)o(g)3007 4653 y Fp(n)3052 4626 y FA(])681 4898 -y FD(wher)o(e)2051 5147 y(132)p eop -%%Page: 133 139 -133 138 bop 623 692 a FC(meta-ar)o(g:)159 b FA(\\)20 -b FC(script-\002le-name)623 892 y(switch:)240 b FA(-e)20 -b FC(entry-point)404 b FD(Specify)20 b(top-level)h(entry-point.)1103 -991 y FA(-o)f FC(structur)o(e)479 b FD(Open)21 b(str)o(uctur)o(e)f(in)i -(curr)o(ent)e(package.)1103 1091 y FA(-m)g FC(structur)o(e)479 -b FD(Switch)21 b(to)g(package.)1103 1191 y FA(-n)f FC(new-package)361 -b FD(Switch)21 b(to)g(new)g(package.)1103 1390 y FA(-lm)e -FC(module-\002le-name)165 b FD(Load)20 b(module)h(into)h(con\002g)g -(package.)1103 1489 y FA(-l)e FC(\002le-name)481 b FD(Load)20 -b(\002le)h(into)h(curr)o(ent)e(package.)1103 1589 y FA(-dm)764 -b FD(Do)22 b(script)e(module.)1103 1689 y FA(-ds)764 -b FD(Do)22 b(script.)623 1888 y FC(end-option:)98 b FA(-s)20 -b FC(script)1103 1988 y FA(-sfd)f FC(num)1103 2087 y -FA(-c)h FC(exp)1103 2187 y FA(--)365 2354 y FD(These)29 -b(command-line)h(switches)f(essentially)h(pr)o(ovide)e(a)g(little)i -(linker)f(language)g(for)365 2453 y(linking)35 b(a)d(shell)i(script)f -(or)g(a)g(pr)o(ogram)f(together)h(with)h(Scheme)f(48)f(modules.)63 -b(The)365 2553 y(command-line)23 b(pr)o(ocessor)g(serially)f(opens)h -(str)o(uctur)o(es)g(and)f(loads)g(code)h(into)g(a)f(given)365 -2653 y(package.)30 b(Switches)23 b(that)f(side-ef)o(fect)f(a)h(package) -f(operate)h(on)h(a)f(particular)f(\223curr)o(ent\224)365 -2752 y(package;)29 b(ther)o(e)d(ar)o(e)g(switches)i(to)f(change)g(this) -h(package.)43 b(\(These)27 b(switches)g(pr)o(ovide)365 -2852 y(functionality)38 b(equivalent)e(to)h(the)g(interactive)f -FA(,open)e(,load)g(,in)i FD(and)g FA(,new)e FD(com-)365 -2951 y(mands.\))57 b(Except)30 b(wher)o(e)h(indicated,)i(switches)f -(specify)f(actions)h(that)f(ar)o(e)f(executed)365 3051 -y(in)25 b(a)f(left-to-right)h(or)o(der)-6 b(.)36 b(The)24 -b(initial)h(curr)o(ent)f(package)f(is)i(the)g(user)g(package,)f(which) -365 3151 y(is)29 b(completely)g(empty)g(and)f(opens)h(\(imports)g(the)f -(bindings)i(of\))e(the)g(R4RS)h(and)f(scsh)365 3250 y(str)o(uctur)o -(es.)490 3393 y(If)i(the)g(Scheme)g(pr)o(ocess)g(is)g(started)g(up)g -(in)g(an)h(interactive)e(mode,)k(then)d(the)h(cur)o(-)365 -3493 y(r)o(ent)21 b(package)g(in)h(for)o(ce)f(at)g(the)h(end)f(of)h -(switch)g(scanning)h(is)f(the)g(one)g(inside)g(which)g(the)365 -3593 y(interactive)e(r)o(ead-eval-print)e(loop)k(is)f(started.)490 -3736 y(The)f(command-line)h(switch)g(pr)o(ocessor)f(works)h(in)g(two)g -(passes:)k(it)20 b(\002rst)h(parses)e(the)365 3836 y(switches,)26 -b(building)f(a)f(list)h(of)f(actions)h(to)g(perform,)f(then)h(the)g -(actions)g(ar)o(e)e(performed)365 3935 y(serially)-9 -b(.)48 b(The)29 b(switch)g(list)g(is)g(terminated)f(by)g(one)h(of)g -(the)f FC(end-option)f FD(switches.)50 b(The)365 4035 -y FC(ar)o(g)474 4062 y Fp(i)520 4035 y FD(ar)o(guments)17 -b(occurring)h(after)f(an)h(end-option)g(switch)h(ar)o(e)d(passed)h(to)h -(the)g(scsh)g(pr)o(o-)365 4134 y(gram)j(as)g(the)g(value)g(of)g -FA(command-line-arg)o(um)o(ent)o(s)15 b FD(and)20 b(the)i(tail)f(of)g -(the)g(list)h(r)o(eturned)365 4234 y(by)i FA(\(command-line\))p -FD(.)j(That)c(is,)g(an)g FC(end-option)f FD(switch)i(separates)e -(switches)i(that)f(con-)365 4334 y(tr)o(ol)30 b(the)h(scsh)g -(\223machine\224)f(fr)o(om)f(the)i(actual)e(ar)o(guments)h(being)h -(passed)f(to)g(the)h(scsh)365 4433 y(pr)o(ogram)20 b(that)h(r)o(uns)h -(on)f(that)g(machine.)490 4577 y(The)g(following)h(switches)f(and)g -(end)f(options)i(ar)o(e)e(de\002ned:)490 4799 y Fw(\017)41 -b FA(-o)i FC(struct)573 4898 y FD(Open)21 b(the)g(str)o(uctur)o(e)f(in) -h(the)g(curr)o(ent)f(package.)1735 5147 y(133)p eop -%%Page: 134 140 -134 139 bop 805 614 a Fw(\017)41 b FA(-n)i FC(package)888 -714 y FD(Make)20 b(and)h(enter)g(a)g(new)g(package.)26 -b(The)21 b(package)f(has)h(an)g(associated)g(str)o(uctur)o(e)888 -814 y(named)f FC(package)f FD(with)j(an)e(empty)g(export)g(list.)26 -b(If)20 b FC(package)f FD(is)i(the)f(string)i(\223)p -FA(#f)p FD(\224,)c(the)888 913 y(new)j(package)f(is)h(anonmyous,)h -(with)g(no)f(associated)f(named)h(str)o(uctur)o(e.)888 -1044 y(The)k(new)h(package)e(initially)i(opens)f(no)h(other)f(str)o -(uctur)o(es,)h(not)g(even)f(the)g(R4RS)888 1143 y(bindings.)h(Y)-8 -b(ou)18 b(must)g(follow)g(a)f(\223)p FA(-n)42 b(foo)p -FD(\224)15 b(switch)j(with)g(\223)p FA(-o)43 b(scheme)p -FD(\224)14 b(to)k(access)888 1243 y(the)j(standar)o(d)e(identi\002ers)i -(such)g(as)g FA(car)e FD(and)i FA(define)p FD(.)805 1404 -y Fw(\017)41 b FA(-m)i FC(struct)888 1503 y FD(Change)27 -b(the)g(curr)o(ent)f(package)f(to)i(the)g(package)f(underlying)h(str)o -(uctur)o(e)f FC(struct)p FD(.)888 1603 y(\(The)21 b FA(-m)f -FD(stands)g(for)h(\223module.\224\))805 1764 y Fw(\017)41 -b FA(-lm)i FC(module-\002le-name)888 1864 y FD(Load)21 -b(the)g(speci\002ed)g(\002le)h(into)g(scsh's)g(con\002g)g(package)e -(\227)i(the)f(\002le)h(must)f(contain)888 1963 y(sour)o(ce)d(written)g -(in)h(the)f(Scheme)g(48)f(module)i(language)e(\(\223load)g -(module\224\).)24 b(Does)888 2063 y(not)e(alter)e(the)h(curr)o(ent)f -(package.)805 2224 y Fw(\017)41 b FA(-l)i FC(\002le-name)888 -2323 y FD(Load)20 b(the)h(speci\002ed)g(\002le)g(into)g(the)g(curr)o -(ent)f(package.)805 2484 y Fw(\017)41 b FA(-c)i FC(exp)888 -2584 y FD(Evaluate)28 b(expr)o(ession)h FC(exp)f FD(in)i(the)f(curr)o -(ent)g(package)f(and)g(exit.)51 b(This)29 b(is)h(called)888 -2684 y FA(-c)c FD(after)f(a)g(common)j(shell)f(convention)g(\(see)f(sh) -g(and)g(csh\).)42 b(The)26 b(expr)o(ession)g(is)888 2783 -y(evaluated)f(in)i(the)f(the)h(curr)o(ent)f(package)f(\(and)g(hence)i -(is)f(af)o(fected)e(by)j FA(-m)p FD('s)e(and)888 2883 -y FA(-n)p FD('s.\))888 3013 y(When)d(the)f(scsh)g(top-level)g(constr)o -(ucts)h(the)f(scsh)h(command-line)f(in)h(this)g(case,)e(it)888 -3113 y(takes)j FA("scsh")e FD(to)j(be)f(the)g(pr)o(ogram)g(name.)32 -b(This)24 b(switch)g(terminates)g(ar)o(gument)888 3212 -y(scanning;)e(following)g(ar)o(gs)e(become)h(the)f(tail)h(of)g(the)g -(command-line)g(list.)805 3373 y Fw(\017)41 b FA(-e)i -FC(entry-point)888 3473 y FD(Specify)28 b(an)g(entry)g(point)h(for)f(a) -g(pr)o(ogram.)47 b(The)28 b FC(entry-point)f FD(is)h(a)g(variable)f -(that)888 3573 y(is)i(taken)g(fr)o(om)f(the)h(curr)o(ent)f(package)f -(in)i(for)o(ce)f(at)g(the)h(end)f(of)h(switch)g(evalua-)888 -3672 y(tion.)44 b(The)26 b(entry)g(point)i(does)e(not)h(have)f(to)h(be) -f(exported)f(by)i(the)f(package)g(in)h(a)888 3772 y(str)o(uctur)o(e;)19 -b(it)f(can)g(be)g(internal)g(to)g(the)g(package.)24 b(The)18 -b(top)g(level)g(passes)g(contr)o(ol)h(to)888 3871 y(the)k(entry)g -(point)h(by)f(applying)g(it)g(to)g(the)g(command-line)g(list)h(\(so)e -(pr)o(ograms)h(ex-)888 3971 y(ecuting)d(in)g(private)e(packages)g(can)h -(r)o(efer)o(ence)e(their)i(command-line)g(ar)o(guments)888 -4071 y(without)26 b(opening)f(the)f FA(scsh)f FD(package)g(to)i(access) -e(the)i FA(\(command-line\))18 b FD(pr)o(oce-)888 4170 -y(dur)o(e\).)24 b(Note)19 b(that,)g(like)h(the)f(list)h(r)o(eturned)d -(by)j(the)f FA(\(command-line\))13 b FD(pr)o(ocedur)o(e,)888 -4270 y(the)21 b(list)f(passed)g(to)g(the)h(entry)f(point)h(includes)f -(the)h(name)f(of)g(the)g(pr)o(ogram)g(being)888 4370 -y(executed)28 b(\(as)g(the)h(\002rst)h(element)f(of)g(the)g(list\),)i -(not)e(just)h(the)f(ar)o(guments)g(to)g(the)888 4469 -y(pr)o(ogram.)888 4599 y(A)21 b FA(-e)g FD(switch)h(can)f(occur)g -(anywher)o(e)g(in)g(the)h(switch)g(list,)g(but)f(it)h(is)f(the)h -FC(last)f FD(action)888 4699 y(performed)k(by)h(switch)g(scanning)g(if) -g(it)g(occurs.)40 b(\(W)-8 b(e)25 b(violate)g(or)o(dering)h(her)o(e)e -(as)888 4799 y(the)31 b(shell-script)f FA(#!)g FD(mechanism)h(pr)o -(events)e(you)i(fr)o(om)f(putting)h(the)f FC(-e)g FD(switch)888 -4898 y(last,)21 b(wher)o(e)f(it)h(belongs.\))2051 5147 -y(134)p eop -%%Page: 135 141 -135 140 bop 490 614 a Fw(\017)41 b FA(-s)i FC(script)573 -714 y FD(Specify)28 b(a)h(\002le)h(to)g(load.)51 b(A)29 -b FA(-ds)f FD(\(do-script\))h(or)g FA(-dm)g FD(\(do-module\))f(switch)j -(oc-)573 814 y(curring)26 b(earlier)e(in)j(the)e(switch)i(list)f(gives) -g(the)g(place)f(wher)o(e)g(the)h(script)g(should)573 -913 y(be)h(loaded.)46 b(If)27 b(ther)o(e)g(is)i(no)f -FA(-ds)e FD(or)i FA(-dm)f FD(switch,)j(then)e(the)g(script)g(is)g -(loaded)f(at)573 1013 y(the)d(end)f(of)h(switch)g(scanning,)h(into)f -(the)g(module)g(that)g(is)g(curr)o(ent)e(at)h(the)h(end)g(of)573 -1112 y(switch)d(scanning.)573 1243 y(W)-8 b(e)16 b(use)h(the)f -FA(-ds)g FD(switch)h(to)g(violate)f(left-to-right)g(switch)h(execution) -g(or)o(der)e(as)h(the)573 1343 y FA(-s)g FD(switch)j(is)e -FC(r)o(equir)o(ed)h FD(to)g(be)f(last)g(\(because)g(of)g(the)g -FA(#!)g FD(machinery\),)h(independent)573 1443 y(of)j(when/wher)o(e)g -(in)g(the)g(switch-pr)o(ocessing)g(or)o(der)f(it)h(should)g(be)g -(loaded.)573 1574 y(When)29 b(the)f(scsh)h(top-level)f(constr)o(ucts)h -(the)f(scsh)h(command-line)g(in)f(this)h(case,)573 1673 -y(it)j(takes)g FC(script)f FD(to)i(be)e(the)h(pr)o(ogram)g(name.)59 -b(This)32 b(switch)h(terminates)f(switch)573 1773 y(parsing;)19 -b(following)h(ar)o(gs)e(ar)o(e)f(ignor)o(ed)i(by)f(the)h -(switch-scanner)g(and)f(ar)o(e)f(passed)573 1872 y(thr)o(ough)k(to)g -(the)g(pr)o(ogram)f(as)h(the)g(tail)f(of)h(the)g(command-line)g(list.) -490 2035 y Fw(\017)41 b FA(-sfd)h FC(num)573 2134 y FD(Loads)36 -b(the)g(script)h(fr)o(om)f(\002le)g(descriptor)g FC(num)p -FD(.)72 b(This)37 b(switch)g(is)g(like)g(the)f FA(-s)573 -2234 y FD(switch,)24 b(except)f(that)g(the)g(script)h(is)f(loaded)g(fr) -o(om)g(one)g(of)h(the)f(pr)o(ocess')g(open)g(in-)573 -2333 y(put)18 b(\002le)f(descriptors.)25 b(For)18 b(example,)f(to)h -(have)f(the)h(script)g(loaded)f(fr)o(om)g(standar)o(d)573 -2433 y(input,)k(specify)f FA(-sfd)42 b(0)p FD(.)490 2595 -y Fw(\017)f FA(--)573 2695 y FD(T)-8 b(erminate)39 b(ar)o(gument)f -(scanning)i(and)e(start)h(up)g(scsh)g(in)g(interactive)g(mode.)573 -2794 y(If)c(the)h(ar)o(gument)g(list)g(just)h(r)o(uns)g(out,)i(without) -f(either)d(a)h(terminating)g FA(-s)f FD(or)573 2894 y -FA(--)j FD(ar)o(g,)43 b(then)d(scsh)f(also)h(starts)f(up)g(in)h -(interactive)e(mode,)44 b(with)c(an)f(empty)573 2994 -y FA(command-line-arg)o(um)o(ent)o(s)28 b FD(list)35 -b(\(for)f(example,)j(simply)e(entering)f FA(scsh)f FD(at)h(a)573 -3093 y(shell)21 b(pr)o(ompt)g(with)g(no)h(ar)o(gs)e(at)g(all\).)573 -3224 y(When)29 b(the)f(scsh)h(top-level)f(constr)o(ucts)h(the)f(scsh)h -(command-line)g(in)f(this)h(case,)573 3324 y(it)e(takes)f -FA("scsh")e FD(to)j(be)f(the)g(pr)o(ogram)g(name.)43 -b(This)27 b(switch)g(terminates)g(switch)573 3423 y(parsing;)19 -b(following)h(ar)o(gs)e(ar)o(e)f(ignor)o(ed)i(by)f(the)h -(switch-scanner)g(and)f(ar)o(e)f(passed)573 3523 y(thr)o(ough)k(to)g -(the)g(pr)o(ogram)f(as)h(the)g(tail)f(of)h(the)g(command-line)g(list.) -490 3685 y Fw(\017)41 b FA(-ds)573 3785 y FD(Specify)27 -b(when)i(to)g(load)f(the)h(script)f(\(\223do-script\224\).)47 -b(If)28 b(this)h(switch)g(occurs,)h(the)573 3884 y(switch)23 -b(list)f FC(must)g FD(be)g(terminated)f(by)h(a)g FA(-s)42 -b FC(script)22 b FD(switch.)30 b(The)22 b(script)g(is)g(loaded)573 -3984 y(into)f(the)g(package)f(that)h(is)g(curr)o(ent)f(at)g(the)h -FA(-ds)f FD(switch.)490 4146 y Fw(\017)41 b FA(-dm)573 -4246 y FD(As)18 b(above,)g(but)h(the)f(curr)o(ent)g(module)h(is)f -(ignor)o(ed.)25 b(The)18 b(script)h(is)f(loaded)g(into)h(the)573 -4345 y FA(config)14 b FD(package)h(\(\223do-module\224\),)g(and)h -(hence)h(must)g(be)f(written)h(in)f(the)h(Scheme)573 -4445 y(48)31 b(module)h(language.)59 b(This)33 b(switch)g(doesn't)g(af) -o(fect)d(the)i(curr)o(ent)f(module\227)573 4545 y(after)26 -b(executing)h(this)h(switch,)i(the)d(curr)o(ent)g(module)h(is)f(the)h -(same)f(as)g(as)g(it)h(was)573 4644 y(befor)o(e.)573 -4775 y(This)16 b(switch)h(is)g(pr)o(ovided)e(to)h(make)g(it)g(easy)g -(to)g(write)g(shell)h(scripts)f(in)h(the)f(Scheme)573 -4875 y(48)k(module)h(language.)1735 5147 y(135)p eop -%%Page: 136 142 -136 141 bop 681 614 a FB(9.1.5)81 b(The)20 b(meta)f(argument)681 -809 y FD(The)32 b(scsh)i(switch)f(parser)f(takes)g(a)g(special)g -(command-line)h(switch,)j(a)d(single)g(back-)681 908 -y(slash)20 b(called)e(the)i(\223meta-ar)o(gument,\224)d(which)k(is)f -(useful)f(for)g(shell)h(scripts.)26 b(If)19 b(the)h(initial)681 -1008 y(command-line)j(ar)o(gument)g(is)h(a)f(\223)p FA(\\)p -FD(\224)e(ar)o(gument,)j(followed)f(by)g(a)g(\002lename)h(ar)o(gument) -681 1108 y FC(fname)p FD(,)e(scsh)h(will)h(open)e(the)h(\002le)g -FC(fname)f FD(and)g(r)o(ead)f(mor)o(e)h(ar)o(guments)g(fr)o(om)g(the)h -(second)681 1207 y(line)29 b(of)g(this)h(\002le.)51 b(This)29 -b(list)h(of)f(ar)o(guments)g(will)h(then)f(r)o(eplace)f(the)h(\223)p -FA(\\)p FD(\224)f(ar)o(gument\227)681 1307 y FC(i.e.)p -FD(,)21 b(the)g(new)h(ar)o(guments)f(ar)o(e)f(inserted)h(in)h(fr)o(ont) -f(of)g FC(fname)p FD(,)g(and)g(the)g(ar)o(gument)g(parser)681 -1407 y(r)o(esumes)27 b(ar)o(gument)g(scanning.)48 b(This)28 -b(is)g(used)g(to)g(over)o(come)f(a)g(limitation)i(of)f(the)g -FA(#!)681 1506 y FD(featur)o(e:)23 b(the)c FA(#!)g FD(line)h(can)f -(only)i(specify)e(a)g(single)h(ar)o(gument)f(after)f(the)i(interpr)o -(eter)-6 b(.)24 b(For)681 1606 y(example,)i(we)h(might)g(hope)g(the)f -(following)i(scsh)f(script,)g FA(ekko)p FD(,)f(would)h(implement)g(a) -681 1705 y(simple-minded)21 b(version)g(of)g(the)g(Unix)f -FA(echo)f FD(pr)o(ogram:)888 1911 y FA(#!/usr/local/bin/)o(sc)o(sh)37 -b(-e)43 b(main)f(-s)888 2011 y(!#)888 2110 y(\(define)f(\(main)h -(args\))976 2210 y(\(map)f(\()p Fo(\025)e FA(\(arg\))j(\(display)e -(arg\))i(\(display)e(")j("\)\))1193 2310 y(\(cdr)f(args\)\))976 -2409 y(\(newline\)\))681 2615 y FD(The)21 b(idea)e(would)j(be)e(that)h -(the)g(command)888 2767 y FA(ekko)42 b(Hi)h(there.)681 -2919 y FD(would)21 b(by)g(expanded)e(by)i(the)g FA(exec\(2\))d -FD(kernel)i(call)h(into)888 3125 y FA(/usr/local/bin/sc)o(sh)37 -b(-e)43 b(main)f(-s)h(ekko)e(Hi)i(there.)681 3331 y FD(In)17 -b(theory)-9 b(,)18 b(this)f(would)h(cause)e(scsh)i(to)f(start)f(up,)i -(load)e(in)i(\002le)f FA(ekko)p FD(,)f(call)g(the)h(entry)g(point)681 -3430 y(on)k(the)g(command-line)g(list)888 3583 y FA(\(main)42 -b('\("ekko")e("Hi")i("there."\)\))681 3735 y FD(and)20 -b(exit.)805 3868 y(Unfortunately)-9 b(,)34 b(the)e(Unix)g -FA(exec\(2\))d FD(syscall's)j(support)g(for)g(scripts)g(is)g(not)g -(very)681 3968 y(general)c(or)g(well-designed.)49 b(It)29 -b(will)g(not)g(handle)f(multiple)h(ar)o(guments;)j(the)d -FA(#!)f FD(line)681 4068 y(is)g(usually)g(r)o(equir)o(ed)e(to)i -(contain)g(no)g(mor)o(e)g(than)f(32)g(characters;)i(it)f(is)g(not)g(r)o -(ecursive.)681 4167 y(If)c(these)g(r)o(estrictions)h(ar)o(e)e -(violated,)h(most)i(Unix)e(systems)h(will)g(not)g(pr)o(ovide)f -(accurate)681 4267 y(err)o(or)19 b(r)o(eporting,)i(but)f(either)h(fail) -f(silently)-9 b(,)21 b(or)g(simply)g(incorr)o(ectly)g(implement)g(the)g -(de-)681 4366 y(sir)o(ed)f(functionality)-9 b(.)26 b(These)20 -b(ar)o(e)g(the)h(facts)f(of)g(Unix)h(life.)805 4500 y(In)k(the)g -FA(ekko)f FD(example)g(above,)h(our)g FA(#!)f FD(trigger)h(line)g(has)g -(thr)o(ee)f(ar)o(guments)g(\(\223)p FA(-e)p FD(\224,)681 -4599 y(\223)p FA(main)p FD(\224,)j(and)g(\223)p FA(-s)p -FD(\224\),)h(so)g(it)h(will)g(not)f(work.)48 b(The)28 -b(meta-ar)o(gument)f(is)i(how)f(we)h(work)681 4699 y(ar)o(ound)18 -b(this)h(pr)o(oblem.)25 b(W)-8 b(e)19 b(must)g(instead)f(invoke)i(the)f -(scsh)g(interpr)o(eter)e(with)j(the)f(sin-)681 4799 y(gle)j -FA(\\)g FD(ar)o(gument,)g(and)g(put)g(the)g(r)o(est)g(of)g(the)h(ar)o -(guments)f(on)h(line)f(two)h(of)g(the)f(pr)o(ogram.)681 -4898 y(Her)o(e's)e(the)h(corr)o(ect)e(pr)o(ogram:)2051 -5147 y(136)p eop -%%Page: 137 143 -137 142 bop 573 614 a FA(#!/usr/local/bin)o(/s)o(csh)37 -b(\\)573 714 y(-e)43 b(main)f(-s)573 814 y(!#)573 913 -y(\(define)f(\(main)g(args\))660 1013 y(\(map)h(\()p -Fo(\025)d FA(\(arg\))i(\(display)g(arg\))g(\(display)g(")i("\)\))878 -1112 y(\(cdr)f(args\)\))660 1212 y(\(newline\)\))365 -1429 y FD(Now)-8 b(,)22 b(the)f(invocation)g(starts)g(as)573 -1591 y FA(ekko)42 b(Hi)h(there.)365 1754 y FD(and)21 -b(is)g(expanded)e(by)i(exec\(2\))e(into)573 1970 y FA(/usr/local/bin/s) -o(cs)o(h)38 b(\\)43 b(ekko)f(Hi)g(there.)365 2187 y FD(When)17 -b(scsh)h(starts)e(up,)h(it)g(expands)f(the)h(\223)p FA(\\)p -FD(\224)e(ar)o(gument)h(into)i(the)f(ar)o(guments)f(r)o(ead)f(fr)o(om) -365 2286 y(line)21 b(two)h(of)f FA(ekko)p FD(,)d(pr)o(oducing)j(this)g -(ar)o(gument)g(list:)573 2503 y FA(-e)43 b(main)f(-s)g(ekko)p -573 2516 654 4 v 42 w(Hi)h(there.)922 2603 y Fw(")573 -2702 y FD(Expanded)19 b(fr)o(om)43 b FA(\\)g(ekko)365 -2919 y FD(W)-5 b(ith)22 b(this)g(ar)o(gument)e(list,)h(pr)o(ocessing)g -(pr)o(oceeds)e(as)i(we)g(intended.)365 3209 y FB(Secondary)f(argument)f -(syntax)365 3412 y FD(Scsh)h(uses)g(a)f(very)g(simple)h(grammar)f(to)h -(encode)g(the)f(extra)g(ar)o(guments)g(on)i(the)e(second)365 -3512 y(line)k(of)g(the)g(scsh)g(script.)31 b(The)22 b(only)i(special)e -(characters)f(ar)o(e)g(space,)h(tab,)g(newline,)i(and)365 -3611 y(backslash.)490 3828 y Fw(\017)41 b FD(Each)e(space)g(character)f -(terminates)h(an)h(ar)o(gument.)81 b(This)41 b(means)e(that)h(two)573 -3928 y(spaces)20 b(in)h(a)g(r)o(ow)f(intr)o(oduce)h(an)f(empty-string)h -(ar)o(gument.)490 4114 y Fw(\017)41 b FD(The)18 b(tab)g(character)f(is) -i(not)g(permitted)f(\(unless)g(you)h(quote)g(it)g(with)g(the)g -(backslash)573 4214 y(character)26 b(described)g(below\).)46 -b(This)28 b(is)g(to)g(pr)o(event)f(the)h(insidious)g(bug)g(wher)o(e)573 -4313 y(you)19 b(believe)g(you)h(have)e(six)h(space)g(characters,)e(but) -j(you)f(r)o(eally)f(have)h(a)f(tab)h(char)o(-)573 4413 -y(acter)-6 b(,)19 b(and)i FC(vice-versa)p FD(.)490 4599 -y Fw(\017)41 b FD(The)25 b(newline)g(character)f(terminates)g(an)h(ar)o -(gument,)g(like)g(the)g(space)f(character)-6 b(,)573 -4699 y(and)26 b(also)h(terminates)g(the)g(ar)o(gument)f(sequence.)44 -b(This)27 b(means)g(that)g(an)f(empty)573 4799 y(line)j(parses)e(to)i -(the)g(singleton)h(list)f(whose)g(one)g(element)f(is)h(the)g(empty)f -(string:)573 4898 y FA(\(""\))p FD(.)c(The)c(grammar)h(doesn't)g(admit) -f(the)h(empty)g(list.)1735 5147 y(137)p eop -%%Page: 138 144 -138 143 bop 805 614 a Fw(\017)41 b FD(The)35 b(backslash)g(character)e -(is)i(the)g(escape)f(character)-6 b(.)66 b(It)35 b(escapes)f -(backslash,)888 714 y(space,)d(tab,)h(and)d(newline,)j(turning)f(of)o -(f)e(their)h(special)f(functions,)k(and)c(allow-)888 -814 y(ing)k(them)f(to)g(be)f(included)h(in)g(ar)o(guments.)58 -b(The)33 b(A)t Fv(N)t(S)t(I)h FD(C)e(escape)f(sequences)888 -913 y(\()p FA(\\b)p FD(,)36 b FA(\\n)p FD(,)g FA(\\r)d -FD(and)g FA(\\t)p FD(\))g(ar)o(e)f(also)i(supported;)40 -b(these)34 b(also)g(pr)o(oduce)f(ar)o(gument-)888 1013 -y(constituents\227)p FA(\\n)28 b FD(doesn't)f(act)g(like)g(a)f -(terminating)i(newline.)45 b(The)26 b(escape)g(se-)888 -1112 y(quence)31 b FA(\\)p FC(nnn)g FD(for)f FC(exactly)g -FD(thr)o(ee)f(octal)i(digits)g(r)o(eads)e(as)h(the)h(character)e(whose) -890 1212 y(A)t Fv(S)t(C)t(I)t(I)21 b FD(code)d(is)h FC(nnn)p -FD(.)25 b(It)18 b(is)h(an)f(err)o(or)f(if)h(backslash)g(is)h(followed)f -(by)h(just)f(one)h(or)f(two)888 1312 y(octal)26 b(digits:)36 -b FA(\\3Q)25 b FD(is)h(an)f(err)o(or)-6 b(.)40 b(Octal)26 -b(escapes)f(ar)o(e)f(always)i(constituent)h(chars.)888 -1411 y(Backslash)f(followed)g(by)f(other)h(chars)g(is)g(not)g(allowed)g -(\(so)g(we)f(can)h(extend)f(the)888 1511 y(escape-code)19 -b(space)h(later)g(if)h(we)g(like\).)805 1722 y(Y)-8 b(ou)21 -b(have)e(to)g(constr)o(uct)h(these)g(line-two)g(ar)o(gument)f(lines)h -(car)o(efully)-9 b(.)23 b(In)d(particular)-6 b(,)681 -1822 y(bewar)o(e)22 b(of)h(trailing)h(spaces)e(at)h(the)h(end)f(of)g -(the)h(line\227they'll)g(give)g(you)f(extra)g(trailing)681 -1921 y(empty-string)e(ar)o(guments.)k(Her)o(e's)20 b(an)h(example:)888 -2079 y FA(#!/bin/interprete)o(r)37 b(\\)888 2178 y(foo)43 -b(bar)86 b(quux\\)41 b(yow)681 2336 y FD(would)21 b(pr)o(oduce)f(the)h -(ar)o(guments)888 2493 y FA(\("foo")41 b("bar")h("")h("quux)e(yow"\)) -681 2775 y FB(9.1.6)81 b(Examples)805 2974 y Fw(\017)41 -b FA(scsh)h(-dm)h(-m)f(myprog)f(-e)i(top)g(-s)f(myprog.scm)888 -3074 y FD(Load)19 b FA(myprog.scm)c FD(into)20 b(the)f -FA(config)e FD(package,)h(then)i(shift)f(to)h(the)f FA(myprog)e -FD(pack-)888 3173 y(age)26 b(and)f(call)g FA(\(top)42 -b('\("myprog.scm"\)\))p FD(,)20 b(then)27 b(exit.)40 -b(This)26 b(sort)g(of)g(invocation)888 3273 y(is)21 b(typically)g(used) -g(in)g FA(#!)f FD(script)h(lines)g(\(see)f(below\).)805 -3455 y Fw(\017)41 b FA(scsh)h(-c)h('\(display)d("Hello,)h(world."\)') -888 3555 y FD(A)21 b(simple)g(pr)o(ogram.)805 3737 y -Fw(\017)41 b FA(scsh)h(-o)h(bigscheme)888 3837 y FD(Start)53 -b(up)g(interactively)f(in)i(the)f(user)g(package)f(after)g(opening)j -(str)o(uctur)o(e)888 3936 y FA(bigscheme)p FD(.)805 4118 -y Fw(\017)41 b FA(scsh)h(-o)h(bigscheme)d(--)j(Three)e(args)h(passed) -888 4218 y FD(Start)24 b(up)g(interactively)g(in)h(the)g(user)f -(package)f(after)g(opening)i FA(bigscheme)p FD(.)33 b(The)888 -4318 y FA(command-line-args)e FD(variable)36 b(in)i(the)g(scsh)g -(package)f(is)h(bound)g(to)g(the)f(list)888 4417 y FA(\("Three")k -("args")g("passed"\))p FD(,)g(and)f(the)g FA(\(command-line\))35 -b FD(pr)o(ocedur)o(e)j(r)o(e-)888 4517 y(turns)22 b(the)e(list)i -FA(\("scsh")40 b("Three")h("args")g("passed"\))p FD(.)805 -4699 y Fw(\017)g FD(Pr)o(ogram)21 b FA(ekko)888 4799 -y FD(This)g(shell)g(script,)f(called)f FA(ekko)p FD(,)g(implements)i(a) -e(version)i(of)f(the)g(Unix)g FA(echo)f FD(pr)o(o-)888 -4898 y(gram:)2051 5147 y(138)p eop -%%Page: 139 145 -139 144 bop 756 614 a FA(#!/usr/local/bi)o(n/)o(scs)o(h)37 -b(-s)756 714 y(!#)756 814 y(\(for-each)i(\()p Fo(\025)g -FA(\(arg\))j(\(display)e(arg\))i(\(display)e(")j("\)\))1191 -913 y(command-line-args)o(\))573 1207 y FD(Note)21 b(this)h(short)g(pr) -o(ogram)e(is)i(an)f(example)f(of)h(a)g FC(script)p FD(\227it)g -(executes)g(as)f(it)i(loads.)573 1307 y(The)f(Unix)f(r)o(ule)h(for)g -(executing)f FA(#!)g FD(shell)i(scripts)f(causes)756 -1520 y FA(ekko)41 b(Hello,)h(world.)573 1732 y FD(to)21 -b(expand)f(as)756 1945 y FA(/usr/local/bin/)o(sc)o(sh)37 -b(-s)43 b(ekko)f(Hello,)f(world.)490 2223 y Fw(\017)g -FD(Pr)o(ogram)20 b FA(ekko)573 2322 y FD(This)29 b(is)h(the)f(same)f -(pr)o(ogram,)i FC(not)f FD(as)f(a)h(script.)50 b(W)-6 -b(riting)29 b(it)g(this)h(way)f(makes)f(it)573 2422 y(possible)20 -b(to)h(compile)f(the)g(pr)o(ogram)g(\(and)f(then,)h(for)g(instance,)g -(dump)g(it)g(out)g(as)g(a)573 2522 y(heap)g(image\).)756 -2751 y FA(#!/usr/local/bi)o(n/)o(scs)o(h)37 b(\\)756 -2850 y(-e)42 b(top)h(-s)756 2950 y(!#)756 3050 y(\(define)d(\(top)i -(args\))843 3149 y(\(for-each)e(\()p Fo(\025)e FA(\(arg\))k(\(display)e -(arg\))i(\(display)e(")j("\)\))1279 3249 y(\(cdr)e(args\)\)\))573 -3478 y FD(The)28 b FA(exec\(2\))c FD(expansion)k(of)g(the)g -FA(#!)f FD(line)h(together)g(with)g(the)g(scsh)g(expansion)573 -3578 y(of)33 b(the)h(\223)p FA(\\)43 b(ekko)p FD(\224)31 -b(meta-ar)o(gument)i(\(see)g(section)h(9.1.5\))d(gives)j(the)g -(following)573 3678 y(command-line)21 b(expansion:)756 -3907 y FA(ekko)41 b(Hello,)h(world.)930 4006 y Fn(=)-14 -b Fw(\))87 b FA(/usr/local/bin/s)o(cs)o(h)37 b(\\)44 -b(ekko)390 b(Hello,)41 b(world.)930 4106 y Fn(=)-14 b -Fw(\))87 b FA(/usr/local/bin/s)o(cs)o(h)37 b(-e)43 b(top)g(-s)f(ekko)g -(Hello,)f(world.)490 4400 y Fw(\017)g FD(Pr)o(ogram)20 -b FA(sort)573 4500 y FD(This)d(is)f(a)g(pr)o(ogram)f(to)i(r)o(eplace)e -(the)h(Unix)g FA(sort)f FD(utility\227sorting)j(lines)e(r)o(ead)f(fr)o -(om)573 4599 y(stdin,)28 b(and)d(printing)i(the)g(r)o(esults)f(on)h -(stdout.)42 b(Note)26 b(that)g(the)h(sour)o(ce)f(code)f(de-)573 -4699 y(\002nes)g(a)f(general)g(sorting)h(package,)f(which)i(is)e -(useful)h(\(1\))e(as)h(a)g(Scheme)g(module)573 4799 y(exporting)f(sort) -g(pr)o(ocedur)o(es)e(to)i(other)h(Scheme)e(code,)h(and)f(\(2\))g(as)g -(a)h(standalone)573 4898 y(pr)o(ogram)d(invoked)h(fr)o(om)f(the)h -FA(top)f FD(pr)o(ocedur)o(e.)1735 5147 y(139)p eop -%%Page: 140 146 -140 145 bop 1071 614 a FA(#!/usr/local/bin)o(/sc)o(sh)37 -b(\\)1071 714 y(-dm)42 b(-m)h(sort-toplevel)38 b(-e)43 -b(top)f(-s)1071 814 y(!#)1071 1013 y(;;;)g(This)g(is)h(a)g(sorting)e -(module.)g(TOP)h(procedure)e(exports)1071 1112 y(;;;)i(the)h -(functionality)38 b(as)43 b(a)g(Unix)f(program)e(akin)i(to)h -(sort\(1\).)1071 1212 y(\(define-structur)o(es)37 b(\(\(sort-struct)h -(\(export)j(sort-list)2858 1312 y(sort-vector!\)\))1943 -1411 y(\(sort-toplevel)d(\(export)i(top\)\)\))1158 1511 -y(\(open)i(scheme\))1158 1710 y(\(begin)f(\(define)g(\(sort-list)e -(elts)j(<=\))h(...\))1463 1810 y(\(define)e(\(sort-vec!)e(vec)k(<=\))86 -b(...\))1463 2009 y(;;)43 b(Parse)f(the)g(command)f(line)h(and)1463 -2109 y(;;)h(sort)f(stdin)f(to)i(stdout.)1463 2208 y(\(define)e(\(top)h -(args\))1594 2308 y(...\)\)\))888 2491 y FD(The)18 b(expansion)h(below) -g(shows)g(how)g(the)f(command-line)h(scanner)f(\(1\))f(loads)h(the)888 -2583 y(con\002g)i(\002le)g FA(sort)d FD(\(written)i(in)h(the)f(Scheme)g -(48)f(module)i(language\),)e(\(2\))g(switches)888 2674 -y(to)33 b(the)f(package)f(underlying)i(the)f FA(sort-toplevel)27 -b FD(str)o(uctur)o(e,)34 b(\(3\))d(calls)h FA(\(top)888 -2765 y('\("sort")41 b("foo")g("bar"\)\))18 b FD(in)j(the)g(package,)f -(and)g(\002nally)h(\(4\))f(exits.)888 2997 y Fh(sort)40 -b(foo)g(bar)888 3089 y Fb(=)-13 b Fa(\))79 b Fh(/usr/local/bin/scsh)43 -b(\\)d(sort)1177 b(foo)40 b(bar)888 3180 y Fb(=)-13 b -Fa(\))79 b Fh(/usr/local/bin/scsh)43 b(-dm)d(-m)g(sort-toplevel)i(-e)e -(top)f(-s)h(sort)g(foo)g(bar)888 3352 y FD(An)21 b(alternate)f(method)h -(would)g(have)g(used)f(a)1071 3513 y FA(-n)43 b(#f)g(-o)f -(sort-toplevel)888 3674 y FD(sequence)21 b(of)g(switches)h(to)f -(specify)f(a)g(top-level)h(package.)805 3869 y(Note)d(that)g(the)g -(sort)g(example)g(can)f(be)h(compiled)g(into)g(a)g(Unix)g(pr)o(ogram)f -(by)h(loading)681 3969 y(the)25 b(\002le)g(into)h(an)f(scsh)g(pr)o -(ocess,)g(and)g(dumping)g(a)g(heap)f(with)i(top-level)f -FA(top)p FD(.)37 b(Even)24 b(if)681 4068 y(we)18 b(don't)h(want)g(to)g -(export)f(the)h(sort's)g(functionality)h(as)e(a)g(subr)o(outine)h -(library)-9 b(,)18 b(it)g(is)h(still)681 4168 y(useful)f(to)h(write)f -(the)g(sort)h(pr)o(ogram)e(with)i(the)g(module)f(language.)25 -b(The)18 b(command)h(line)681 4267 y(design)k(allows)g(us)g(to)g(r)o -(un)g(this)g(pr)o(ogram)f(as)h(either)f(an)g(interpr)o(eted)g(script)g -(\(given)h(the)681 4367 y FA(#!)d FD(ar)o(gs)g(in)h(the)g(header\))e -(or)i(as)f(a)h(compiled)g(heap)f(image.)681 4616 y FB(9.1.7)81 -b(Process)20 b(exit)f(values)681 4799 y FD(Scsh)i(ignor)o(es)h(the)g -(value)f(pr)o(oduced)f(by)i(its)g(top-level)g(computation)g(when)g -(determin-)681 4898 y(ing)g(its)g(exit)f(status)h(code.)27 -b(If)21 b(the)h(top-level)f(computation)h(completed)g(with)g(no)g(err)o -(ors,)2051 5147 y(140)p eop -%%Page: 141 147 -141 146 bop 365 614 a FD(scsh)21 b(dies)e(with)i(exit)f(code)f(0.)25 -b(For)20 b(example,)f(a)g(scsh)i(pr)o(ocess)e(whose)i(top-level)e(is)h -(spec-)365 714 y(i\002ed)h(by)f(a)g FA(-c)43 b FC(exp)20 -b FD(or)g(a)g FA(-e)43 b FC(entry)20 b FD(entry)h(point)g(ignor)o(es)g -(the)f(value)g(pr)o(oduced)f(by)i(eval-)365 814 y(uating)f -FC(exp)f FD(and)g(calling)g FC(entry)p FD(,)h(r)o(espectively)-9 -b(.)24 b(If)19 b(these)g(computations)i(terminate)e(with)365 -913 y(no)j(err)o(ors,)d(the)i(scsh)h(pr)o(ocess)e(exits)h(with)g(an)g -(exit)f(code)h(of)g(0.)490 1061 y(T)-8 b(o)21 b(r)o(eturn)f(a)g -(speci\002c)h(exit)g(status,)f(use)h(the)g FA(exit)e -FD(pr)o(ocedur)o(e)g(explicitly)-9 b(,)20 b FC(e.g.)p -FD(,)573 1160 y FA(scsh)42 b(-c)h(\\)660 1260 y("\(exit)e -(\(status:exit-val)c(\(run)42 b(\(|)h(\(fmt\))e(\(mail)h -(shivers\)\)\)\)\)")365 1596 y Fy(9.2)99 b(The)25 b(scsh)h(virtual)f -(machine)365 1840 y FD(T)-8 b(o)31 b(r)o(un)f(the)g(Scheme)f(48)g -(implementation)i(of)f(scsh,)j(you)d(r)o(un)g(a)g(specially)f -(modi\002ed)365 1940 y(copy)e(of)g(the)g(Scheme)f(48)g(virtual)g -(machine)h(with)h(a)e(scsh)h(heap)g(image.)43 b(The)27 -b(scsh)g(bi-)365 2039 y(nary)22 b(is)h(actually)f(nothing)i(but)e(a)g -(small)h(cover)f(pr)o(ogram)f(that)i(invokes)g(the)f(byte-code)365 -2139 y(interpr)o(eter)28 b(on)j(the)e(scsh)h(heap)f(image)h(for)f(you.) -52 b(This)30 b(allows)h(you)f(to)g(simply)g(start)365 -2238 y(up)23 b(an)g(interactive)g(scsh)h(fr)o(om)e(a)h(command)g(line,) -h(as)f(well)h(as)e(write)i(shell)f(scripts)h(that)365 -2338 y(begin)d(with)h(the)f(simple)g(trigger)573 2512 -y FA(#!/usr/local/bin)o(/s)o(csh)37 b(-s)490 2734 y FD(Y)-8 -b(ou)26 b(can)f(also)h(dir)o(ectly)e(execute)h(the)g(virtual)g -(machine,)h(which)h(takes)e(its)g(own)i(set)365 2834 -y(of)21 b(command-line)h(switches..)27 b(For)21 b(example,)f(this)i -(command)f(starts)g(the)g(vm)h(up)f(with)365 2934 y(a)g(1Mwor)o(d)e -(heap)h(\(split)h(into)h(two)f(semispaces\):)573 3108 -y FA(scshvm)41 b(-o)i(scshvm)e(-h)i(1000000)d(-i)j(scsh.image)c(arg1)j -(arg2)g(...)365 3282 y FD(The)34 b(vm)f(peels)g(of)o(f)g(initial)h(vm)f -(ar)o(guments)g(up)h(to)f(the)h FA(-i)e FD(heap)h(image)g(ar)o(gument,) -365 3382 y(which)46 b(terminates)g(vm)f(ar)o(gument)g(parsing.)99 -b(The)45 b(r)o(est)f(of)i(the)f(ar)o(guments)g(ar)o(e)365 -3481 y(passed)d(of)o(f)g(to)h(the)f(scsh)h(top-level.)91 -b(Scsh's)43 b(top-level)f(r)o(emoves)g(scsh)h(switches,)365 -3581 y(as)k(discussed)h(in)f(the)h(pr)o(evious)f(section;)61 -b(the)47 b(r)o(est)g(show)h(up)f(as)g(the)h(value)f(of)365 -3681 y FA(command-line-argu)o(me)o(nts)o FD(.)490 3828 -y(Dir)o(ectly)25 b(executing)g(the)g(vm)h(can)e(be)h(useful)g(to)h -(specify)f(non-standar)o(d)f(switches,)365 3928 y(or)g(invoke)g(the)g -(virtual)f(machine)g(on)h(special)f(heap)g(images,)h(which)h(can)e -(contain)h(pr)o(e-)365 4027 y(compiled)d(scsh)h(pr)o(ograms)e(with)h -(their)g(own)h(top-level)e(pr)o(ocedur)o(es.)365 4337 -y FB(9.2.1)81 b(VM)21 b(arguments)365 4550 y FD(The)g(vm)g(takes)f(ar)o -(guments)h(in)g(the)g(following)h(form:)573 4724 y FA(scshvm)41 -b([)p FC(meta-ar)o(g)n FA(])i([)p FC(vm-options)1729 -4694 y Fx(+)1784 4724 y FA(])g([)p FC(end-option)f(scheme-ar)o(gs)o -FA(])365 4898 y FD(wher)o(e)1735 5147 y(141)p eop -%%Page: 142 148 -142 147 bop 938 601 a FC(meta-ar)o(g:)159 b FA(\\)43 -b FC(\002lename)938 800 y(vm-option)n FD(:)113 b FA(-h)43 -b FC(heap-size-in-words)1418 900 y FA(-s)g FC(stack-size-in-words)1418 -1000 y FA(-o)g FC(object-\002le-name)938 1199 y(end-option:)98 -b FA(-i)43 b FC(image-\002le-name)1418 1298 y FA(--)805 -1471 y FD(The)36 b(vm's)g(meta-switch)f(\223)p FA(\\)43 -b FC(\002lename)p FD(\224)35 b(is)h(handled)f(the)h(same)f(as)g(scsh's) -i(meta-)681 1571 y(switch,)21 b(and)f(serves)h(the)g(same)f(purpose.) -681 1832 y FB(VM)g(options)681 2020 y FD(The)f FA(-o)42 -b FC(object-\002le-name)19 b FD(switch)h(tells)f(the)g(vm)g(wher)o(e)g -(to)g(\002nd)g(r)o(elocation)g(information)681 2120 y(for)27 -b(its)i(for)o(eign-function)f(calls.)47 b(Scsh)28 b(will)g(use)g(a)g -(pr)o(e-compiled)e(default)h(if)h(it)g(is)g(not)681 2220 -y(speci\002ed.)c(Scsh)19 b FC(must)g FD(have)f(this)i(information)g(to) -f(r)o(un,)h(since)f(scsh's)h(syscall)f(interfaces)681 -2319 y(ar)o(e)g(done)i(with)h(for)o(eign-function)e(calls.)805 -2448 y(The)i FA(-h)g FD(and)f FA(-s)h FD(options)h(tell)g(the)f(vm)g -(how)h(much)g(space)e(to)i(allocate)e(for)h(the)h(heap)681 -2547 y(and)i(stack.)39 b(The)25 b(heap)g(size)f(value)h(is)h(the)f -(total)h(number)f(of)g(wor)o(ds)g(allocated)g(for)g(the)681 -2647 y(heap;)30 b(this)f(space)e(is)h(then)g(split)g(into)g(two)h -(semi-spaces)e(for)g(Scheme)h(48's)f(stop-and-)681 2747 -y(copy)21 b(collector)-6 b(.)681 3008 y FB(End)20 b(options)681 -3196 y FD(End)31 b(options)h(terminate)f(ar)o(gument)g(parsing.)57 -b(The)31 b FA(-i)f FD(switch)i(is)g(followed)g(by)f(the)681 -3295 y(name)23 b(of)h(a)f(heap)g(image)h(for)f(the)h(vm)g(to)g -(execute.)33 b(The)23 b FC(image-\002le-name)g FD(string)h(is)g(also) -681 3395 y(taken)d(to)i(be)e(the)h(name)g(of)g(the)g(pr)o(ogram)f -(being)h(executed)f(by)h(the)g(VM;)f(this)i(name)f(be-)681 -3495 y(comes)e(the)h(head)e(of)h(the)g(ar)o(gument)g(list)g(passed)g -(to)g(the)g(heap)g(image's)g(top-level)g(entry)681 3594 -y(point.)25 b(The)17 b(tail)g(of)g(the)g(ar)o(gument)g(list)g(is)h -(constr)o(ucted)f(fr)o(om)g(all)g(following)i(ar)o(guments.)805 -3723 y(The)k FA(--)f FD(switch)h(terminates)g(ar)o(gument)f(parsing)h -(without)h(giving)g(a)e(speci\002c)h(heap)681 3822 y(image;)k(the)e(vm) -h(will)g(start)f(up)g(using)h(a)f(default)f(heap)h(\(whose)g(location)h -(is)g(compiled)681 3922 y(into)g(the)f(vm\).)38 b(All)25 -b(the)h(following)g(ar)o(guments)f(comprise)g(the)h(tail)f(of)g(the)g -(list)h(passed)681 4022 y(of)o(f)20 b(to)h(the)g(heap)f(image's)h -(top-level)f(pr)o(ocedur)o(e.)805 4150 y(Notice)g(that)g(you)g(ar)o(e)f -(not)h(allowed)g(to)g(pass)f(ar)o(guments)h(to)g(the)g(heap)f(image's)h -(top-)681 4250 y(level)g(pr)o(ocedur)o(e)f(\()p FC(e.g.)o -FD(,)i(scsh\))g(without)h(delimiting)f(them)g(with)h -FA(-i)e FD(or)h FA(--)f FD(\003ags.)681 4511 y FB(9.2.2)81 -b(Inserting)19 b(interpreter)g(triggers)h(into)g(heap)g(images)681 -4699 y FD(Scheme)i(48's)g(heap)g(image)h(format)f(allows)h(for)g(an)f -(informational)h(header:)29 b(when)23 b(the)681 4799 -y(vm)18 b(loads)g(in)h(a)f(heap)g(image,)g(it)g(ignor)o(es)h(all)f -(data)f(occurring)h(befor)o(e)f(the)i(\002rst)f(contr)o(ol-L)681 -4898 y(character)23 b(\()r(A)t Fv(S)t(C)t(I)t(I)k FD(12\).)35 -b(This)26 b(means)e(that)h(you)g(can)f(insert)h(a)f(\223)p -FA(#!)p FD(\224)f(trigger)h(line)h(into)h(a)2051 5147 -y(142)p eop -%%Page: 143 149 -143 148 bop 365 614 a FD(heap)16 b(image,)h(making)g(it)f(a)g(form)g -(of)g(executable)f(\223shell)h(script.\224)24 b(Since)16 -b(the)g(vm)h(r)o(equir)o(es)365 714 y(multiple)23 b(ar)o(guments)e(to)h -(be)g(given)g(on)g(the)g(command)g(line,)h(you)f(must)g(use)g(the)g -(meta-)365 814 y(switch.)27 b(Her)o(e's)20 b(an)g(example)g(heap-image) -g(header:)573 1009 y FA(#!/usr/local/lib)o(/s)o(csh)o(/s)o(csh)o(vm)37 -b(\\)573 1109 y(-o)43 b(/usr/local/lib/)o(scs)o(h/)o(scs)o(hv)o(m)37 -b(-i)573 1209 y(...)42 b FC(Y)-9 b(our)21 b(heap)f(image)g(goes)h(her)o -(e)44 b FA(...)365 1535 y FB(9.2.3)81 b(Inserting)20 -b(a)g(double-level)e(trigger)i(into)g(Scheme)f(programs)365 -1722 y FD(If)j(you'r)o(e)f(a)g(ner)o(d,)g(you)h(may)g(enjoy)h(doing)f -(a)f(double-level)h(machine)g(shift)g(in)g(the)g(trig-)365 -1822 y(ger)f(line)g(of)g(your)g(Scheme)f(pr)o(ograms)g(with)i(the)f -(following)h(magic:)573 2009 y Fh(#!/usr/local/lib/scsh/scshvm)45 -b(\\)573 2101 y(-o)40 b(/usr/local/lib/scsh/scshvm)45 -b(-i)39 b(/usr/local/lib/scsh/scsh.ima)q(ge)45 b(-s)573 -2192 y(!#)573 2283 y(...)40 b Fi(Y)-8 b(our)18 b(Scheme)h(pr)o(ogram)h -(goes)f(her)o(e)39 b Fh(...)365 2636 y Fy(9.3)99 b(Compiling)26 -b(scsh)f(programs)365 2854 y FD(Scsh)30 b(allows)h(you)f(to)g(cr)o -(eate)e(a)i(heap)f(image)h(with)g(your)h(own)f(top-level)g(pr)o(ocedur) -o(e.)365 2954 y(Adding)21 b(the)g(pair)f(of)g(lines)573 -3150 y FA(#!/usr/local/lib)o(/s)o(csh)o(/s)o(csh)o(vm)37 -b(\\)573 3249 y(-o)43 b(/usr/local/lib/)o(scs)o(h/)o(scs)o(hv)o(m)37 -b(-i)365 3445 y FD(to)21 b(the)g(top)g(of)g(the)g(heap)f(image)h(will)g -(turn)g(it)g(into)h(an)f(executable)e(Unix)i(\002le.)490 -3572 y(Y)-8 b(ou)22 b(can)e(cr)o(eate)f(heap)h(images)h(with)h(the)f -(following)h(two)f(pr)o(ocedur)o(es.)365 3724 y FA(\(dump-scsh-progra)o -(m)37 b FC(main)21 b(fname)p FA(\))87 b Fw(\000)-15 b(!)88 -b FC(unde\002ned)585 b FD(pr)o(ocedur)o(e)573 3867 y(This)28 -b(pr)o(ocedur)o(e)e(writes)i(out)g(a)f(scsh)i(heap)e(image.)46 -b(When)28 b(the)g(heap)g(image)f(is)573 3967 y(executed)f(by)i(the)g -(Scheme)f(48)g(vm,)i(it)f(will)g(call)g(the)g FC(main)f -FD(pr)o(ocedur)o(e,)g(passing)573 4066 y(it)d(the)h(vm's)g(ar)o(gument) -f(list.)37 b(When)24 b FA(main)f FD(r)o(eturns)h(an)g(integer)g(value)g -Fo(i)p FD(,)h(the)f(vm)573 4166 y(exits)16 b(with)i(exit)e(status)g -Fo(i)p FD(.)24 b(The)16 b(Scheme)g(vm)h(will)g(parse)f(command-line)h -(switches)573 4265 y(as)30 b(described)f(in)i(section)g(9.2.1;)i(r)o -(emaining)e(ar)o(guments)f(form)g(the)h(tail)f(of)g(the)573 -4365 y(command-line)19 b(list)g(that)g(is)f(passed)g(to)h -FA(main)p FD(.)k(\(The)c(head)f(of)g(the)h(list)g(is)g(the)g(name)573 -4465 y(of)h(the)g(pr)o(ogram)f(being)h(executed)f(by)h(the)g(vm.\))25 -b(Further)20 b(ar)o(gument)f(parsing)h(\(as)573 4564 -y(described)g(for)g(scsh)h(in)h(section)f(9.1.4\))e(is)i(not)g -(performed.)573 4699 y(The)33 b(heap)g(image)h(cr)o(eated)d(by)i -FA(dump-scsh-program)27 b FD(has)33 b(unused)h(code)f(and)573 -4799 y(data)26 b(pr)o(uned)g(out,)j(so)e(small)h(pr)o(ograms)e(compile) -h(to)h(much)f(smaller)g(heap)f(im-)573 4898 y(ages.)1735 -5147 y(143)p eop -%%Page: 144 150 -144 149 bop 681 614 a FA(\(dump-scsh)39 b FC(fname)p -FA(\))87 b Fw(\000)-14 b(!)87 b FC(unde\002ned)1125 b -FD(pr)o(ocedur)o(e)888 754 y(This)20 b(pr)o(ocedur)o(e)e(writes)i(out)g -(a)f(heap)g(image)g(with)i(the)f(standar)o(d)d(scsh)k(top-level.)888 -853 y(When)32 b(the)f(image)g(is)g(r)o(esumed)f(by)h(the)g(vm,)j(it)d -(will)h(parse)e(and)g(execute)g(scsh)888 953 y(command-line)22 -b(switches)f(as)g(described)e(in)i(section)h(9.1.4.)888 -1085 y(Y)-8 b(ou)31 b(can)f(use)g(this)g(pr)o(ocedur)o(e)e(to)i(write)g -(out)g(custom)h(scsh)f(heap)f(images)h(that)888 1184 -y(have)21 b(speci\002c)f(packages)g(pr)o(eloaded)f(and)h(start)h(up)f -(in)i(speci\002c)e(packages.)805 1350 y(Unfortunately)-9 -b(,)18 b(Scheme)f(48)f(does)h(not)h(support)g(separate)e(compilation)i -(of)f(Scheme)681 1449 y(\002les)25 b(or)f(Scheme)g(modules.)37 -b(The)25 b(only)g(way)f(to)h(compile)g(is)g(to)g(load)f(sour)o(ce)g -(and)g(then)681 1549 y(dump)30 b(out)h(a)f(heap)g(image.)54 -b(One)31 b(occasionally)g(hears)f(r)o(umours)h(that)g(this)g(is)g -(being)681 1648 y(addr)o(essed)18 b(by)j(the)g(Scheme)g(48)e -(development)i(team.)681 1925 y Fy(9.4)99 b(Statically)26 -b(linking)f(heap)g(images)681 2139 y FD(The)32 b(static)g(heap)g -(linker)h(converts)f(a)g(Scheme)g(48)f(bytecode)h(image)g(contained)h -(in)g(a)681 2239 y(.image)25 b(\002le)h(to)h(a)e(C)h(r)o(epr)o -(esentation.)40 b(This)26 b(C)g(code)g(is)g(then)h(compiled)f(and)f -(linked)i(in)681 2338 y(with)j(a)f(virtual)g(machine,)i(pr)o(oducing)f -(a)e(single)j(executable.)50 b(Some)29 b(of)g(the)h(bene\002ts)681 -2438 y(ar)o(e:)805 2625 y Fw(\017)41 b FD(Instantaneous)22 -b(start-up)e(time.)805 2789 y Fw(\017)41 b FD(Impr)o(oved)16 -b(paging;)h(scsh)g(images)f(can)g(be)f(shar)o(ed)g(between)h(dif)o(fer) -o(ent)e(pr)o(ocesses.)805 2953 y Fw(\017)41 b FD(V)-8 -b(astly)21 b(r)o(educed)d(GC)j(copying\227the)g(whole)g(initial)g -(image)f(is)h(moved)f(out)h(of)f(the)888 3053 y(heap,)g(and)h(neither)g -(traced)e(nor)i(copied.)805 3217 y Fw(\017)41 b FD(Result)22 -b(pr)o(ogram)e(no)h(longer)h(depends)e(on)h(the)g(\002lesystem)h(for)e -(its)h(initial)h(image.)805 3404 y(The)f(static)g(heap)f(linker)h -(takes)f(ar)o(guments)h(in)g(the)g(following)h(form:)888 -3543 y FA(scsh-hlink)40 b FC(image)j(executable)h FA([)p -FC(option)e FA(...])681 3682 y FD(It)20 b(r)o(eads)f(in)h(the)h(heap)e -(image)h FC(image)p FD(,)g(translates)f(it)i(into)g(C)f(code,)f -(compiles)i(the)g(C)f(code,)681 3781 y(and)c(links)i(it)f(against)f -(the)h(scsh)g(vm,)h(pr)o(oducing)e(the)h(standalone)g(binary)f(\002le)h -FC(executable)p FD(.)805 3897 y(Each)27 b(C)g(\002le)g(r)o(epr)o -(esents)e(part)i(of)g(the)g(heap)f(image)h(as)g(a)f(constant)i(C)f -FA(long)e FD(vector)681 3989 y(that)20 b(looks)i(something)h(like)e -(this:)681 4168 y Fh(const)79 b(long)41 b(p116[]={0x882,0x24,0x19,)1465 -4259 y(0x882,\(long\)\(&p19[785]\)+7,\(l)q(ong\))q(\(&p1)q(19[12)q -(5]\)+)q(7,)1465 4350 y(0x882,\(long\)\(&p119[128]\)+7,\()q(long)q -(\)\(&p)q(119[1)q(31]\))q(+7,)1465 4442 y -(0x882,\(long\)\(&p102[348]\)+7,\()q(long)q(\)\(&p)q(3[114)q(]\)+7)q(,) -1465 4533 y(0xfc2,0x2030200,0x7100209,0x)q(1091)q(002,)q(0x1c0)q(75a,) -1465 4624 y(0x882,\(long\)\(&p29[1562]\)+7,\()q(long)q(\)\(&p)q(119[1)q -(37]\))q(+7,)1465 4716 y(0x882,\(long\)\(&p78[692]\)+7,\(l)q(ong\))q -(\(&p1)q(19[14)q(0]\)+)q(7,)1622 4807 y(.)1622 4898 y(.)2051 -5147 y FD(144)p eop -%%Page: 145 151 -145 150 bop 1307 614 a Fh(.)1150 706 y(};)490 893 y FD(T)-7 -b(ranslating)21 b(to)g(a)g(C)g(declaration)f(gives)h(us)g(fr)o(eedom)f -(fr)o(om)h(the)g(various)g(object-\002le)365 992 y(formats.)669 -962 y Fs(2)732 992 y FD(Note)h(that)g(the)g(const)h(declaration)e -(allows)i(the)f(compiler)g(to)h(put)f(this)h(array)365 -1092 y(in)e(the)f(text)f(pages)h(of)g(the)g(executable.)k(The)19 -b(heap)h(is)g(split)g(into)h(parts)f(because)f(many)h(C)365 -1192 y(compilers)i(cannot)f(handle)f(multi-megabyte)h(initialised)g -(vector)g(declarations.)490 1316 y(The)g(allowed)f(options)i(to)f(the)g -(heap)g(linker)g(ar)o(e:)490 1503 y Fw(\017)41 b FA(--temp)g -FC(dir)573 1603 y FD(The)27 b(temporary)f(dir)o(ectory)g(to)i(hold)f -(.c)g(and)f(.o)h(\002les.)44 b(The)27 b(default)f(is)h(typically)573 -1702 y(con\002gur)o(ed)h(to)h(be)f FA(/usr/tmp)p FD(,)f(and)h(can)g(be) -g(overridden)g(by)g(the)h(envir)o(onment)573 1802 y(variable)19 -b FA(TMPDIR)p FD(.)f(Example:)756 1941 y FA(--temp)41 -b(/tmp)490 2111 y Fw(\017)g FA(--cc)h FC(command)573 -2211 y FD(The)25 b(command)g(to)h(r)o(un)g(the)f(C)g(compiler)-6 -b(.)38 b(The)25 b(default)g(can)f(be)h(overridden)f(by)573 -2311 y(the)d(envir)o(onment)g(variable)f FA(CC)p FD(.)f(Example:)756 -2449 y FA(--cc)41 b("gcc)h(-g)h(-O")490 2620 y Fw(\017)e -FA(--ld)h FC(command)573 2720 y FD(The)33 b(ar)o(guments)g(to)g(r)o(un) -h(the)g(C)f(compiler)g(as)g(a)g(linker)-6 b(.)63 b(The)33 -b(default)f(can)h(be)573 2819 y(overridden)20 b(by)h(the)g(envir)o -(onment)g(variable)e FA(LDFLAGS)p FD(.)f(Example:)756 -2958 y FA(--ld)41 b("-Wl,-E")490 3129 y Fw(\017)g FA(--libs)g -FC(libs)573 3228 y FD(The)25 b(libraries)f(needed)g(to)h(link)h(the)e -(VM)h(and)f(heap.)37 b(The)25 b(default)f(can)g(be)h(over)o(-)573 -3328 y(ridden)20 b(by)h(the)g(envir)o(onment)g(variable)f -FA(LIBS)p FD(.)e(Example:)756 3466 y FA(--libs)41 b("-ldld)g(-lld)h -(-lm")490 3653 y FD(Be)20 b(warned)g(that)h(the)g(curr)o(ent)f(heap)g -(linker)h(has)g(many)g(shortcomings.)490 3840 y Fw(\017)41 -b FD(It)30 b(is)g(extr)o(emely)e(slow)-8 b(.)54 b(Really)-9 -b(,)32 b(r)o(eally)c(slow)-8 b(.)54 b(T)-7 b(ranslating)29 -b(the)h(standar)o(d)e(scsh)573 3940 y(heap)42 b(image)h(into)g(a)f -(standalone)h(binary)f(takes)h(well)g(over)f(an)h(hour)g(on)g(a)573 -4040 y(40Mb/133Mhz)26 b(Pentium)31 b(system.)54 b(A)30 -b(memory-starved)f(486)f(could)i(take)g(all)573 4139 -y(night.)490 4303 y Fw(\017)41 b FD(It)c(cannot)g(be)f(applied)g(to)i -(itself.)73 b(The)37 b(curr)o(ent)f(implementation)i(works)f(by)573 -4403 y(r)o(eplacing)i(some)i(of)f(the)g(heap-dumping)g(code.)83 -b(This)40 b(means)h(you)f(cannot)573 4503 y(load)j(the)g(heap-linker)g -(code)g(into)h(a)f(scsh)g(system)h(and)f(subsequently)i(use)573 -4602 y FA(dump-scsh-progra)o(m)15 b FD(to)21 b(cr)o(eate)e(a)h -(heap-linker)g(heap)h(image.)490 4766 y Fw(\017)41 b -FD(The)21 b(interface)e(leaves)h(a)h(lot)g(to)g(be)f(desir)o(ed.)p -365 4819 1146 4 v 456 4875 a Fr(2)485 4898 y Fv(This)c(idea)h(is)g(due) -f(to)h(Jonathan)f(Rees.)1735 5147 y FD(145)p eop -%%Page: 146 152 -146 151 bop 988 614 a FB(\226)41 b FD(It)19 b(r)o(equir)o(es)f(the)h -(heap)g(image)g(to)g(be)g(r)o(efer)o(enced)d(by)j(a)f(\002le-name;)i -(the)f(linker)1071 714 y(will)i(not)h(allow)f(you)g(to)h(feed)d(it)i -(the)g(input)g(heap)g(image)f(on)i(a)e(port.)988 848 -y FB(\226)41 b FD(The)21 b(heap-image)f(is)h(linked)g(against)f(the)h -(vm)g(contained)g(in)1226 948 y FA(/usr/local/lib/sc)o(sh)o(/li)o(bs)o -(cs)o(hvm)o(.a)1071 1048 y FD(This)g(is)g(wir)o(ed)f(in)i(at)e(the)h -(time)g(scsh)g(is)g(installed)g(on)h(your)f(system.)988 -1182 y FB(\226)41 b FD(Ther)o(e)20 b(is)h(no)g(Scheme)g(pr)o(ocedural)e -(interface.)805 1351 y Fw(\017)41 b FD(The)28 b(pr)o(ogram)f(pr)o -(oduced)f(uses)h(the)h(default)e(VM)h(ar)o(gv)g(parser)f -FA(process_args)888 1451 y FD(fr)o(om)36 b(the)g(scsh)h(sour)o(ce)f -(\002le)g FA(main.c)e FD(to)i(pr)o(ocess)g(the)g(command)h(line)f -(befor)o(e)888 1550 y(handing)25 b(it)g(of)o(f)e(to)i(the)f(heap)g -(image's)g(top-level)g(pr)o(ocedur)o(e.)34 b(This)25 -b(is)g(not)g(what)888 1650 y(you)d(want)f(for)f(many)h(pr)o(ograms.)888 -1784 y(The)28 b(system)g(needs)f(to)g(be)g(changed)g(to)h(allow)g -(users)f(to)h(override)e(this)i(default)888 1884 y(with)22 -b(their)f(own)g(VM)g(ar)o(gument)f(parsers.)805 2053 -y Fw(\017)41 b FD(A)28 b(possible)i(pr)o(oblem)e(is)h(the)f(Unix)h -(limits)h(on)f(the)f(number)h(of)g(command)g(line)888 -2152 y(ar)o(guments.)58 b(The)32 b(heap-linker)f(calls)g(the)h(C)f -(linker)h(with)h(a)e(lar)o(ge)f(number)i(of)888 2252 -y(object)19 b(\002les.)25 b(Its)19 b(conceivable)f(that)g(on)h(some)g -(Unix)f(systems)i(this)f(could)f(fail)g(now)888 2352 -y(or)32 b(if)g(scsh)h(gr)o(ows)f(in)g(the)g(futur)o(e.)58 -b(The)32 b(solution)h(could)f(be)g(to)g(cr)o(eate)f(library)888 -2451 y(ar)o(chives)26 b(of)h(a)f(few)g(dozen)h(\002les)g(and)f(then)h -(link)h(the)f(r)o(esult)f(few)g(dozen)h(library)888 2551 -y(ar)o(chives)20 b(to)h(make)g(the)g(executable.)805 -2746 y(In)f(spite)g(of)g(these)g(many)g(shortcomings,)i(we)e(ar)o(e)e -(pr)o(oviding)i(the)g(static)f(linker)h(as)g(it)681 2845 -y(stands)h(in)g(this)g(r)o(elease)f(so)h(that)g(people)f(may)h(get)g -(some)g(experience)f(with)h(it.)805 2972 y(Her)o(e)f(is)h(an)g(example) -f(of)g(how)i(one)f(might)h(use)f(the)g(heap)f(linker:)1237 -3167 y FA(scsh-hlink)39 b(scsh.image)h(fastscsh)805 3389 -y FD(W)-8 b(e'd)21 b(love)g(it)g(if)f(someone)i(would)g(dive)e(into)h -(the)g(sour)o(ce)g(and)f(impr)o(ove)g(it.)681 3672 y -Fy(9.5)99 b(Standard)24 b(\002le)h(locations)681 3889 -y FD(Because)20 b(the)h(scshvm)h(binary)f(is)h(intended)f(to)g(be)g -(used)g(for)g(writing)h(shell)g(scripts,)f(it)h(is)681 -3989 y(important)i(that)f(the)h(binary)f(be)g(installed)h(in)g(a)f -(standar)o(d)e(place,)i(so)h(that)g(shell)g(scripts)681 -4088 y(can)g(dependably)f(r)o(efer)g(to)i(it.)37 b(The)25 -b(standar)o(d)e(dir)o(ectory)g(for)i(the)f(scsh)i(tr)o(ee)d(should)i -(be)681 4188 y FA(/usr/local/lib/s)o(cs)o(h/)p FD(.)19 -b(Whenever)h(possible,)i(the)e(vm)h(should)h(be)e(located)h(in)888 -4330 y FA(/usr/local/lib/sc)o(sh)o(/sc)o(sh)o(vm)681 -4472 y FD(and)f(a)g(scsh)i(heap)e(image)h(should)g(be)g(located)f(in) -888 4614 y FA(/usr/local/lib/sc)o(sh)o(/sc)o(sh)o(.im)o(ag)o(e)681 -4756 y FD(The)h(top-level)f(scsh)h(pr)o(ogram)f(should)i(be)e(located)h -(in)888 4898 y FA(/usr/local/lib/sc)o(sh)o(/sc)o(sh)2051 -5147 y FD(146)p eop -%%Page: 147 153 -147 152 bop 365 614 a FD(with)22 b(a)e(symbolic)i(link)f(to)h(it)f(fr)o -(om)573 753 y FA(/usr/local/bin/s)o(cs)o(h)490 916 y -FD(The)30 b(Scheme)g(48)f(image)h(format)f(allows)i(heap)e(images)i(to) -f(have)g FA(#!)f FD(triggers,)j(so)365 1016 y FA(scsh.image)17 -b FD(should)k(have)g(a)f FA(#!)g FD(trigger)h(of)f(the)h(following)h -(form:)573 1207 y FA(#!/usr/local/lib)o(/s)o(csh)o(/s)o(csh)o(vm)37 -b(\\)573 1307 y(-o)43 b(/usr/local/lib/)o(scs)o(h/)o(scs)o(hv)o(m)37 -b(-i)573 1406 y(...)42 b FC(heap)20 b(image)g(goes)h(her)o(e)43 -b FA(...)1735 5147 y FD(147)p eop -%%Page: 148 154 -148 153 bop 681 1283 a Fz(Chapter)44 b(10)681 1744 y -FE(Changes)52 b(from)g(previous)681 1993 y(releases)681 -2488 y Fy(10.1)99 b(Changes)25 b(from)f(the)h(previous)g(release)681 -2729 y FD(This)30 b(section)h(details)f(changes)g(that)g(have)g(been)f -(made)h(in)g(scsh)h(since)f(the)g(pr)o(evious)681 2829 -y(r)o(elease.)805 2975 y(Scsh)f(is)g(now)h(much)f(mor)o(e)g(r)o(obust.) -49 b(All)29 b(known)h(bugs)f(have)f(been)h(\002xed.)49 -b(Ther)o(e)681 3074 y(have)20 b(been)h(many)g(impr)o(ovements)g(and)f -(extensions)i(made.)j(These)c(new)g(featur)o(es)e(and)681 -3174 y(changes)31 b(ar)o(e)e(listed)i(below)-8 b(,)33 -b(in)e(no)h(particular)d(or)o(der;)34 b(the)d(r)o(elevant)f(sections)h -(of)g(the)681 3273 y(manual)20 b(give)h(the)g(full)g(details.)805 -3419 y(Scsh)29 b(now)g(supports)g(complete)h(P)t Fv(O)t(S)t(I)t(X)r -FD(,)i(including)d(signal)g(handlers.)48 b(Early)28 b(au-)681 -3519 y(tor)o(eaping)f(of)i(child)f(pr)o(ocesses)g(is)g(now)h(handled)f -(by)h(a)e FA(SIGCHLD)f FD(signal)i(handler)-6 b(,)30 -b(so)681 3618 y(childr)o(en)20 b(ar)o(e)f(r)o(eaped)g(as)i(early)f(as)g -(possible)i(with)f(no)h(user)e(intervention)i(r)o(equir)o(ed.)805 -3764 y(A)g(functional)h(static)f(heap)f(linker)i(is)f(included)g(in)h -(this)f(r)o(elease.)29 b(It)22 b(is)g(ugly)-9 b(,)23 -b(limited)681 3864 y(in)g(functionality)-9 b(,)24 b(and)e(extr)o(emely) -g(slow)-8 b(,)24 b(but)f(it)g(works.)32 b(It)22 b(can)h(be)f(used)h(to) -g(build)f(scsh)681 3963 y(binaries)e(that)h(start)f(up)h(instantly)-9 -b(.)805 4109 y(The)22 b(r)o(egular)e(expr)o(ession)h(system)i(has)e -(been)h(sped)f(up.)28 b(Regular)o(-expr)o(ession)20 b(com-)681 -4209 y(pilation)g(is)f(now)h(pr)o(ovided,)e(and)h(the)g -FA(awk)f FD(macr)o(o)h(has)g(been)g(r)o(ewritten)f(to)i(pr)o(e-compile) -681 4308 y(r)o(egexps)c(used)h(in)h(r)o(ules)g(outside)g(the)g(loop.)25 -b(It)17 b(is)h(still,)h(however)-6 b(,)18 b(slower)g(than)g(it)f -(should)681 4408 y(be.)805 4553 y(Execing)31 b(pr)o(ograms)g(should)h -(be)f(faster)f(in)h(this)h(r)o(elease,)g(since)g(we)f(now)h(use)f(the) -681 4653 y FA(CLOEXEC)18 b FD(status)i(bit)h(to)h(get)e(automatic)h -(closing)h(of)f(unr)o(evealed)e(port)h(\002le)h(descriptors.)805 -4799 y(scm's)33 b(\003oating)g(point)f(support)g(was)g(inadvertently)g -(omitted)g(fr)o(om)g(the)g(last)f(r)o(e-)681 4898 y(lease.)25 -b(It)20 b(has)h(been)g(r)o(einstated.)2051 5147 y(148)p -eop -%%Page: 149 155 -149 154 bop 490 614 a FD(Ther)o(e)19 b(is)i(now)g(a)f(new)h -(command-line)g(switch,)g FA(-sfd)42 b FC(num)p FD(,)20 -b(which)h(causes)f(scsh)h(to)365 714 y(r)o(ead)e(its)j(script)e(fr)o -(om)h(\002le)g(descriptor)f FC(num)p FD(.)365 990 y Fy(10.2)99 -b(Changes)25 b(from)f(the)h(penultimate)f(release)365 -1204 y FD(This)d(section)f(details)g(changes)g(that)f(have)h(been)f -(made)h(in)g(scsh)g(since)g(the)g(penultimate)365 1304 -y(r)o(elease.)490 1429 y(Scsh)29 b(is)g(now)g(much)h(mor)o(e)e(r)o -(obust.)50 b(All)28 b(known)i(bugs)g(have)e(been)g(\002xed.)50 -b(Ther)o(e)365 1528 y(have)34 b(been)g(many)h(impr)o(ovements)f(and)g -(extensions)h(made.)66 b(W)-8 b(e)34 b(have)g(also)g(made)365 -1628 y(made)20 b(some)i(incompatible)f(changes.)490 1752 -y(The)32 b(sections)h(below)g(brie\003y)f(describe)g(these)g(new)g -(featur)o(es)f(and)h(changes;)37 b(the)365 1852 y(r)o(elevant)20 -b(sections)i(of)e(the)h(manual)g(give)g(the)f(full)h(details.)365 -2102 y FB(10.2.1)81 b(New)20 b(features)365 2285 y FD(This)i(r)o -(elease)d(incorporates)i(several)e(new)j(featur)o(es)d(into)i(scsh.)490 -2487 y Fw(\017)41 b FD(Contr)o(ol)21 b(of)g(buf)o(fer)o(ed)d(I/O)573 -2586 y(Scsh)24 b(now)i(allows)f(you)g(to)g(contr)o(ol)g(the)g(buf)o -(fering)f(policy)h(used)f(for)h(doing)g(I/O)573 2686 -y(on)c(a)g(Scheme)f(port.)490 2850 y Fw(\017)41 b FD(Her)o(e-strings) -573 2949 y(Scsh)26 b(now)h(has)e(a)h(new)g(lexical)g(featur)o(e,)f -FA(#<<)p FD(,)g(that)h(pr)o(ovides)f(the)h(ability)h(to)f(en-)573 -3049 y(ter)j(long,)k(multi-line)e(string)f(constants)h(in)f(scsh)h(pr)o -(ograms.)52 b(Such)29 b(a)h(string)g(is)573 3149 y(called)21 -b(a)g(\223her)o(e)g(string,\224)h(by)g(analogy)g(to)g(the)g(common)i -(shell)e(\223her)o(e)f(document\224)573 3248 y FA(<<)f -FD(r)o(edir)o(ection.)490 3412 y Fw(\017)41 b FD(Delimited)21 -b(r)o(eaders)e(and)h(r)o(ead-line)573 3512 y(Scsh)31 -b(now)h(has)g(a)e(powerful)i(set)f(of)g(delimited)g(r)o(eaders.)56 -b(These)31 b(can)g(be)g(used)573 3611 y(to)23 b(r)o(ead)e(input)i -(delimited)g(by)g(a)f(newline)h(character)f(\()p FA(read-line)p -FD(\),)c(a)k(blank)h(line)573 3711 y(\()p FA(read-paragraph)p -FD(\))o(,)c(or)25 b(the)f(occurr)o(ence)f(of)i(any)f(character)f(in)h -(an)h(arbitrary)e(set)573 3810 y(\()p FA(read-delimited)p -FD(\))o(.)573 3942 y(While)k(these)f(pr)o(ocedur)o(es)f(can)h(be)g -(applied)g(to)h(any)f(Scheme)h(input)g(port,)g(ther)o(e)573 -4042 y(is)37 b(native-code)e(support)i(for)f(performing)h(delimited)f -(r)o(eads)f(on)i(Unix)f(input)573 4141 y(sour)o(ces,)i(so)d(doing)h -(block)f(input)g(with)h(these)f(pr)o(ocedur)o(es)e(should)i(be)g(much) -573 4241 y(faster)20 b(than)h(the)f(equivalent)h(character)o -(-at-a-time)c(Scheme)k(code.)490 4405 y Fw(\017)41 b -FD(New)21 b(system)g(calls)573 4504 y(W)-5 b(ith)32 b(the)g(sole)g -(exception)f(of)g(signal)h(handlers,)i(scsh)e(now)g(has)g(all)f(of)i(P) -t Fv(O)t(S)t(I)t(X)r FD(.)573 4604 y(This)21 b(r)o(elease)e(intr)o -(oduces)672 4768 y FB(\226)42 b FA(select)p FD(,)672 -4898 y FB(\226)g FD(full)20 b(terminal)h(device)f(contr)o(ol,)1735 -5147 y(149)p eop -%%Page: 150 156 -150 155 bop 988 614 a FB(\226)41 b FD(support)21 b(for)g -(pseudo-terminal)f(\223pty\224)g(devices,)988 748 y FB(\226)41 -b FD(\002le)21 b(locking,)988 882 y FB(\226)41 b FD(pr)o(ocess)20 -b(timing,)988 1016 y FB(\226)41 b FA(set-file-times)p -FD(,)988 1150 y FB(\226)g FA(seek)19 b FD(and)h FA(tell)p -FD(.)888 1318 y(Note)d(that)g(having)g FA(select)p FD(,)e -(pseudo-terminals,)i(and)g(tty)g(device)f(contr)o(ol)h(means)888 -1417 y(that)24 b(it)g(is)f(now)i(possible)f(to)g(implement)g(inter)o -(esting)g(network)g(pr)o(otocols,)h(such)888 1517 y(as)c(telnet)g -(servers)f(and)g(clients,)h(dir)o(ectly)f(in)h(Scheme.)805 -1685 y Fw(\017)41 b FD(New)21 b(command-line)g(switches)888 -1785 y(Ther)o(e)32 b(is)i(a)e(new)i(set)f(of)g(command-line)g(switches) -h(that)f(make)g(it)g(possible)h(to)888 1884 y(write)27 -b(shell)g(scripts)f(using)h(the)g(Scheme)e(48)h(module)g(system.)43 -b(Scripts)26 b(can)g(use)888 1984 y(the)k(new)g(command-line)f -(switches)h(to)g(open)g(dependent)f(modules)g(and)g(load)888 -2084 y(dependent)16 b(sour)o(ce)g(code.)24 b(Scripts)16 -b(can)g(also)g(be)g(written)h(in)g(the)g(Scheme)f(48)f(mod-)888 -2183 y(ule)k(language,)f(which)i(allows)f(you)g(to)g(use)g(it)g(both)g -(as)f(a)h(standalone)f(shell)h(script,)888 2283 y(and)i(as)g(a)g(code)f -(module)i(that)f(can)g(be)g(loaded)f(and)h(used)g(by)g(other)g(Scheme)g -(pr)o(o-)888 2383 y(grams.)805 2551 y Fw(\017)41 b FD(Static)20 -b(heap)h(linking)888 2650 y(Ther)o(e)c(is)h(a)g(new)g(facility)f(that)h -(allows)g(you)h(to)f(compile)g(a)f(heap)h(image)f(to)i(a)e -FA(.o)g FD(\002le)888 2750 y(that)26 b(can)g(be)g(linked)g(with)h(the)g -(scsh)f(virtual)g(machine.)42 b(This)26 b(pr)o(oduces)g(a)f(stan-)888 -2849 y(dalone)34 b(executable)e(binary)-9 b(,)37 b(makes)d(startup)f -(time)h(near)o(-instantaneous,)i(and)888 2949 y(gr)o(eatly)19 -b(impr)o(oves)h(memory)g(performance\227the)f(initial)h(heap)f(image)h -(is)g(placed)888 3049 y(in)k(the)g(pr)o(ocess')g(text)f(pages,)h(wher)o -(e)f(it)h(is)g(shar)o(ed)e(by)i(dif)o(fer)o(ent)e(scsh)i(pr)o(ocesses,) -888 3148 y(and)d(does)f(not)i(occupy)f(space)f(in)h(the)g(r)o(un-time)g -(heap.)1071 3325 y Fl(Oops:)79 b Fk(The)26 b(static)h(heap)f(linker)e -(was)j(not)f(documented)g(and)g(installed)f(in)1071 3417 -y(time)19 b(for)e(this)i(r)o(elease.)681 3672 y FB(10.2.2)80 -b(Incompatible)18 b(improvements)681 3856 y FD(Some)30 -b(featur)o(es)e(of)j(scsh)f(have)g(been)g(impr)o(oved)f(in)i(ways)f -(that)g(ar)o(e)f(not)i(backwar)o(ds-)681 3956 y(compatible)19 -b(with)h(pr)o(evious)f(r)o(eleases.)24 b(These)19 b(changes)h(should)g -(not)g(af)o(fect)d(most)k(code;)681 4056 y(however)-6 -b(,)20 b(please)g(note)i(the)e(changes)h(and)g(modify)g(your)g(code)f -(accor)o(dingly)-9 b(.)805 4266 y Fw(\017)41 b FD(New)21 -b(pr)o(ocess-object)f(data-type)g(r)o(eturned)f(by)i -FA(fork)888 4366 y FD(Pr)o(evious)h(r)o(eleases)e(wer)o(e)g(pr)o(one)h -(to)h(\002ll)g(up)f(the)h(kernel's)f(pr)o(ocess)g(table)g(if)g(a)g(pr)o -(o-)888 4466 y(gram)26 b(forked)f(lar)o(ge)f(numbers)i(of)g(pr)o -(ocesses)f(and)g(subsequently)i(failed)e(to)h(use)888 -4565 y FA(wait)16 b FD(to)h(r)o(eclaim)g(the)g(entries)g(in)h(the)f -(kernel's)g(pr)o(ocess)g(table.)24 b(\(This)17 b(is)h(a)e(pr)o(oblem) -888 4665 y(in)22 b(standar)o(d)d(C)h(envir)o(onments,)i(as)e(well.\)) -888 4799 y(Scsh)27 b(0.4)f(intr)o(oduces)h(a)g(new)g(mechanism)h(for)f -(automatically)g(managing)g(sub-)888 4898 y(pr)o(ocesses.)36 -b(Pr)o(ocesses)24 b(ar)o(e)e(no)j(longer)g(r)o(epr)o(esented)d(by)i(an) -g(integer)h(pr)o(ocess)e(id,)2051 5147 y(150)p eop -%%Page: 151 157 -151 156 bop 573 614 a FD(which)30 b(is)g(impossible)h(to)f -(garbage-collect,)g(but)f(by)h(an)f(abstract)g(pr)o(ocess)g(data)573 -714 y(type)d(that)g(encapsulates)f(the)h(pr)o(ocess)g(id.)41 -b(All)26 b(pr)o(ocesses)g(ar)o(e)f(r)o(epr)o(esented)f(us-)573 -814 y(ing)30 b(the)g(new)g(data)f(str)o(uctur)o(es;)k(see)d(the)g(r)o -(elevant)e(section)j(of)e(the)h(manual)g(for)573 913 -y(further)20 b(details.)490 1099 y Fw(\017)41 b FD(Better)20 -b(stdio/curr)o(ent-port)g(synchr)o(onisation)573 1199 -y(The)i FA(\(begin)41 b(...\))21 b FD(pr)o(ocess)h(form)g(now)h(does)f -(a)g FA(stdio->stdports)16 b FD(call)22 b(befor)o(e)573 -1298 y(executing)i(its)g(body)-9 b(.)34 b(This)25 b(means)f(that)g(the) -f(Scheme)h(code)f(in)i(the)f(body)g(\223sees\224)573 -1398 y(any)h(external)f(r)o(edir)o(ections.)38 b(For)26 -b(example,)f(it)g(means)h(that)f(if)g(a)g FA(begin)e -FD(form)i(in)573 1498 y(the)i(middle)f(of)h(a)f(pipeline)h(performs)f -(I/O)h(on)g(the)g(curr)o(ent)f(input)h(and)f(output)573 -1597 y(ports,)17 b(it)g(will)g(be)g(communicating)h(with)f(its)g(upstr) -o(eam)e(and)i(downstr)o(eam)f(pipes.)573 1697 y FC(E.g.)o -FD(,)j(this)g(code)g(works)h(as)f(intended)f(without)j(the)e(need)f -(for)h(explicit)g(synchr)o(oni-)573 1797 y(sation:)573 -2016 y FA(\(run)42 b(\(|)h(\(gunzip\))922 2115 y(;;)f(Kill)g(line)g(1)h -(and)g(insert)e(doubled-sided)922 2215 y(;;)h(code)g(at)h(head)f(of)h -(Postscript.)922 2315 y(\(begin)e(\(read-line\))e(;)k(Eat)f(first)g -(line.)1227 2414 y(\(display)e("\045!PS-Adobe-2.0\\)o(\\n)o("\))1227 -2514 y(\(display)g("statusdict)f(/setduplexmode)f(known)j("\))1227 -2614 y(\(display)f("{statusdict)f(begin)i(true)h("\))1227 -2713 y(\(display)e("setduplexmode)e(end})k(if\\n"\))1227 -2813 y(\(exec-epf)e(\(cat\)\)\))922 2912 y(\(lpr\)\))791 -3012 y(\(<)j(paper.ps\)\))573 3231 y FD(Arranging)34 -b(for)g(the)h FA(begin)d FD(pr)o(ocess)i(form)h(to)f(synchr)o(onise)i -(the)e(curr)o(ent)g(I/O)573 3331 y(ports)29 b(with)i(stdio)e(means)h -(that)f(all)g(pr)o(ocess)g(forms)h(now)g(see)f(their)g(epf)5 -b('s)29 b(r)o(edi-)573 3430 y(r)o(ections.)490 3616 y -Fw(\017)41 b FA(file-match)16 b FD(mor)o(e)21 b(r)o(obust)573 -3716 y(The)f FA(file-match)d FD(pr)o(ocedur)o(e)h(now)j(catches)f(any)h -(err)o(or)e(condition)j(signalled)e(by)573 3816 y(a)i(match)g(pr)o -(ocedur)o(e,)e(and)i(tr)o(eats)f(it)h(as)g(if)g(the)h(pr)o(ocedur)o(e)d -(had)i(simply)h(r)o(eturned)573 3915 y FA(#f)p FD(,)h -FC(i.e.)p FD(,)g(match)g(failur)o(e.)35 b(This)24 b(means)g -FA(file-match)c FD(no)25 b(longer)g(gets)f(blown)h(out)573 -4015 y(of)18 b(the)h(water)e(by)i(trying)g(to)f(apply)g(a)g(function)h -(like)g FA(file-directory?)12 b FD(to)19 b(a)e(dan-)573 -4115 y(gling)22 b(symlink,)g(and)e(other)h(r)o(elated)e(OS)i(err)o -(ors.)490 4301 y Fw(\017)41 b FD(Standar)o(d)18 b(input)k(now)f(unbuf)o -(fer)o(ed)573 4400 y(Scsh's)d(startup)g(code)f(now)i(makes)f(the)g -(initial)g(curr)o(ent)f(input)i(port)f(\(corr)o(espond-)573 -4500 y(ing)24 b(to)h(\002le)f(descriptor)f(0\))g(unbuf)o(fer)o(ed.)33 -b(This)24 b(keeps)g(the)g(shell)h(fr)o(om)e(\223stealing\224)573 -4599 y(input)e(meant)g(for)g(subpr)o(ocesses.)26 b(However)-6 -b(,)20 b(it)h(does)g(slow)h(down)g(character)o(-at-)573 -4699 y(a-time)i(input)h(pr)o(ocessing.)36 b(If)24 b(you)h(ar)o(e)e -(writing)i(a)f(pr)o(ogram)g(that)g(is)h(tolerant)g(of)573 -4799 y(buf)o(fer)o(ed)18 b(input,)j(and)g(wish)h(the)f(ef)o(\002ciency) -f(gains,)h(you)h(can)e(r)o(eset)g(the)i(buf)o(fering)573 -4898 y(policy)f(yourself.)1735 5147 y(151)p eop -%%Page: 152 158 -152 157 bop 805 614 a Fw(\017)41 b FD(\223writeable\224)19 -b(now)j(spelled)f(\223writable\224)888 714 y(W)-8 b(e)27 -b(inconsistently)i(spelled)d FA(file-writable?)21 b FD(and)26 -b FA(file-not-writable)o(?)21 b FD(in)888 814 y(the)k(manual)g(and)f -(the)h(implementation.)39 b(W)-8 b(e)25 b(have)f(now)i(standar)o(dised) -c(on)k(the)888 913 y(common)f(spelling)f(\223writable\224)e(in)i(both.) -33 b(The)23 b(older)g(bindings)h(still)g(exist)g(in)f(r)o(e-)888 -1013 y(lease)d(0.4,)g(but)h(will)g(go)g(away)f(in)i(futur)o(e)d(r)o -(eleases.)805 1190 y Fw(\017)41 b FA(char-set-member?)14 -b FD(r)o(eplaced)888 1290 y(W)-8 b(e)21 b(have)g(de-r)o(eleased)d(the)j -FA(char-set-member?)14 b FD(pr)o(ocedur)o(e.)24 b(The)c(scsh)i(0.3)d -(ver)o(-)888 1390 y(sion)j(of)f(this)g(pr)o(ocedur)o(e)e(took)j(ar)o -(guments)e(in)h(the)g(following)i(or)o(der:)1071 1541 -y FA(\(char-set-member)o(?)38 b FC(char)43 b(char-set)o -FA(\))888 1693 y FD(This)18 b(ar)o(gument)f(or)o(der)f(is)h(in)h(accor) -o(dance)d(with)j(standar)o(d)d(mathematical)i(useage)888 -1793 y(\()p FC(i.e.)p FD(,)30 b Fo(x)39 b Fw(2)f Fo(S)5 -b FD(\),)30 b(and)f(also)g(consistent)h(with)f(the)g(R4RS)g -FA(member)p FD(,)f FA(memq)f FD(and)i FA(memv)888 1892 -y FD(pr)o(ocedur)o(es.)60 b(It)32 b(is,)k(however)-6 -b(,)36 b(exactly)c(opposite)h(fr)o(om)f(the)h(ar)o(gument)f(or)o(der) -888 1992 y(used)24 b(by)g(the)g FA(char-set-member?)17 -b FD(in)25 b(MIT)e(Scheme's)h(character)o(-set)d(library)-9 -b(.)34 b(If)888 2092 y(we)27 b(left)g(things)h(as)f(they)h(wer)o(e,)f -(we)g(risked)g(pr)o(oblems)g(with)h(code)f(ported)f(over)888 -2191 y(fr)o(om)k(MIT)g(Scheme.)54 b(On)31 b(the)g(other)f(hand,)j -(changing)e(to)g(conformance)f(with)888 2291 y(MIT)e(Scheme)f(meant)h -(inconsistency)i(with)e(common)i(mathematical)d(notation)888 -2391 y(and)g(other)g(long-standing)h(Scheme)e(pr)o(ocedur)o(es.)42 -b(Either)27 b(way)g(was)f(bound)i(to)888 2490 y(intr)o(oduce)21 -b(confusion.)888 2629 y(W)-8 b(e've)35 b(taken)f(the)h(appr)o(oach)e -(of)h(simply)h(r)o(emoving)g(the)g FA(char-set-member)o(?)888 -2728 y FD(pr)o(ocedur)o(e)19 b(altogether)-6 b(,)20 b(and)h(r)o -(eplacing)f(it)h(with)g(a)f(new)h(pr)o(ocedur)o(e:)1071 -2880 y FA(\(char-set-contai)o(ns?)37 b FC(cset)43 b(char)p -FA(\))888 3032 y FD(Note)21 b(that)g(the)g(ar)o(gument)f(or)o(der)g(is) -h(consistent)h(with)f(the)g(name.)805 3209 y Fw(\017)41 -b FA(file-attributes)15 b FD(now)22 b FA(file-info)888 -3309 y FD(In)17 b(keeping)g(with)g(the)g(general)f(convention)i(in)f -(scsh)g(of)g(naming)g(pr)o(ocedur)o(es)e(that)888 3409 -y(r)o(etrieve)33 b(information)j(about)e(system)h(r)o(esour)o(ces)e -FA(...-info)e FD(\()p FC(e.g.)o FD(,)38 b FA(tty-info)p -FD(,)888 3508 y FA(user-info)p FD(,)16 b FA(group-info)p -FD(\),)g(the)k FA(file-attributes)13 b FD(pr)o(ocedur)o(e)18 -b(is)j(now)f(named)888 3608 y FA(file-info)p FD(.)888 -3747 y(W)-8 b(e)17 b(continue)h(to)g(export)e(a)h FA(file-attributes)10 -b FD(binding)18 b(for)f(the)g(curr)o(ent)f(r)o(elease,)888 -3846 y(but)21 b(it)g(will)h(go)f(away)f(in)h(futur)o(e)f(r)o(eleases.) -805 4024 y Fw(\017)41 b FD(Renaming)22 b(of)f(I/O)g(synchr)o(onisation) -h(pr)o(ocedur)o(es)888 4123 y(The)108 b FA(\(stdio->stdport)o(s)38 -b FC(thunk)o FA(\))107 b FD(pr)o(ocedur)o(e)e(has)i(been)g(r)o(enamed) -888 4223 y FA(with-stdio-ports*)o FD(;)35 b(ther)o(e)f(is)h(now)g(a)f -(corr)o(esponding)h FA(with-stdio-port)o(s)888 4322 y -FD(special)54 b(form.)126 b(The)55 b FA(stdio->stdports)48 -b FD(pr)o(ocedur)o(e)k(is)j(now)g(a)f(nullary)888 4422 -y(pr)o(ocedur)o(e)19 b(that)i(side-ef)o(fects)e(the)h(curr)o(ent)g(set) -h(of)g(curr)o(ent)f(I/O)h(port)g(bindings.)805 4599 y -Fw(\017)41 b FD(New)21 b(meta-ar)o(g)e(line-two)j(syntax)888 -4699 y(Scsh)g(now)h(uses)e(a)h(simpli\002ed)g(grammar)f(for)h -(describing)f(command-line)h(ar)o(gu-)888 4799 y(ments)29 -b(r)o(ead)e(by)h(the)g(\223meta-ar)o(g\224)e(switch)j(fr)o(om)f(line)g -(two)h(of)f(a)g(shell)h(script.)47 b(If)888 4898 y(you)26 -b(wer)o(e)f(using)h(this)g(featur)o(e)e(in)h(pr)o(evious)g(r)o -(eleases,)g(the)h(thr)o(ee)f(incompatible)2051 5147 y(152)p -eop -%%Page: 153 159 -153 158 bop 573 614 a FD(changes)19 b(of)f(which)i(to)f(be)g(awar)o(e)e -(ar)o(e:)23 b(\(1\))17 b(tab)h(is)i(no)f(longer)g(allowed)g(as)f(an)h -(ar)o(gu-)573 714 y(ment)k(delimiter)-6 b(,)23 b(\(2\))f(a)h(r)o(un)g -(of)g(space)g(characters)e(is)j(not)g(equivalent)f(to)g(a)g(single)573 -814 y(space,)d(\(3\))f(empty)i(ar)o(guments)g(ar)o(e)e(written)i(a)f -(dif)o(fer)o(ent)f(way)-9 b(.)365 1065 y FB(10.2.3)81 -b(Backwards-compatible)17 b(improvements)365 1248 y FD(Some)k(existing) -h(featur)o(es)e(in)h(scsh)h(have)e(been)h(impr)o(oved)g(in)g(ways)h -(that)f(will)g(not)h(ef)o(fect)365 1347 y(existing)g(code.)490 -1555 y Fw(\017)41 b FD(Impr)o(oved)20 b(err)o(or)g(r)o(eporting)573 -1654 y(Exception)c(handlers)g(that)g(print)h(out)g(err)o(or)e(messages) -h(and)g(warnings)h(now)g(print)573 1754 y(their)32 b(messages)g(on)g -(the)g(err)o(or)f(output)h(port,)i(instead)e(of)f(the)h(curr)o(ent)f -(output)573 1854 y(port.)25 b(Pr)o(evious)20 b(r)o(eleases)e(used)h -(the)h(curr)o(ent)f(output)h(port,)g(a)f(pr)o(oblem)g(inherited)573 -1953 y(fr)o(om)h(Scheme)h(48.)573 2086 y(Pr)o(evious)d(scsh)h(r)o -(eleases)e(\003ushed)j(the)e(Scheme)g(48)g(debugging)h(tables)f(when)h -(cr)o(e-)573 2186 y(ating)27 b(the)h(standar)o(d)d(scsh)j(heap)f -(image.)44 b(This)28 b(trimmed)f(the)h(size)f(of)g(the)g(heap)573 -2285 y(image,)22 b(but)h(made)e(err)o(or)h(messages)g(much)h(less)g -(compr)o(ehensible.)30 b(W)-8 b(e)23 b(now)g(r)o(e-)573 -2385 y(tain)c(the)g(debugging)g(tables.)24 b(This)c(bloats)f(the)g -(heap)f(image)h(up)g(by)f(about)h(600kb.)573 2485 y(And)h(worth)i(it,)e -(too.)573 2617 y(\(W)-8 b(e)26 b(also)h(have)f(some)h(new)g(techniques) -h(for)e(eliminating)i(the)e(r)o(un-time)i(mem-)573 2717 -y(ory)23 b(penalty)f(imposed)h(by)f(these)h(lar)o(ge)e(heap)h(images.) -31 b(Scsh's)23 b(new)g(static-heap)573 2817 y(technology)34 -b(allows)e(for)h(this)g(data)e(to)h(be)g(linked)h(into)g(the)f(text)g -(pages)g(of)g(the)573 2916 y(vm's)26 b(binary)-9 b(,)26 -b(wher)o(e)f(it)h(will)g(not)g(be)g(touched)f(by)h(the)g(GC)g(or)f -(otherwise)i(af)o(fect)573 3016 y(the)21 b(memory)g(system)h(until)f -(it)g(is)g(r)o(efer)o(enced.\))573 3149 y(Finally)-9 -b(,)26 b(scsh)f(now)h(generates)e(mor)o(e)g(informative)h(err)o(or)f -(messages)h(for)f(syscall)573 3248 y(err)o(ors.)k(For)22 -b(example,)f(a)h(\002le-open)g(err)o(or)f(pr)o(eviously)h(told)g(you)g -(what)g(the)h(err)o(or)573 3348 y(was)28 b(\()p FC(e.g.)o -FD(,)i(\223Permission)f(denied,\224)g(or)g(\223No)f(such)g(\002le)h(or) -f(dir)o(ectory\224\),)h(but)f(not)573 3448 y(which)22 -b(\002le)e(you)i(had)e(tried)g(to)h(open.)26 b(W)-8 b(e've)21 -b(impr)o(oved)f(this.)490 3614 y Fw(\017)41 b FD(Closing)22 -b(a)e(port)h(twice)g(allowed)573 3713 y(Scsh)k(used)g(to)h(generate)e -(an)h(err)o(or)f(if)h(you)h(attempted)f(to)g(close)h(a)e(port)i(that)f -(had)573 3813 y(alr)o(eady)20 b(been)i(closed.)29 b(This)23 -b(is)f(now)h(allowed.)29 b(The)22 b(close)g(pr)o(ocedur)o(e)f(r)o -(eturns)g(a)573 3913 y(boolean)g(to)g(indicate)f(whether)h(the)g(port)g -(had)f(alr)o(eady)f(been)i(closed)g(or)g(not.)490 4079 -y Fw(\017)41 b FD(Better)20 b(time)h(pr)o(ecision)573 -4178 y(The)33 b FA(time+ticks)d FD(pr)o(ocedur)o(e)h(now)k(r)o(eturns)e -(sub-second)h(pr)o(ecision)f(on)h(OS's)573 4278 y(that)21 -b(support)g(it.)490 4444 y Fw(\017)41 b FD(Nicer)20 b(print-methods)i -(for)e(basic)g(data-types)573 4544 y(Scsh's)e(standar)o(d)f(r)o(ecor)o -(d)f(types)j(now)g(print)f(mor)o(e)g(informatively)-9 -b(.)25 b(For)19 b(example,)573 4643 y(a)j(pr)o(ocess)h(object)g -(includes)g(the)g(pr)o(ocess)f(id)h(in)g(its)g(printed)g(r)o(epr)o -(esentation:)28 b(the)573 4743 y(pr)o(ocess)20 b(object)h(for)g(pr)o -(ocess)f(id)h(2653)e(prints)i(as)f FA(#{proc)41 b(2653})p -FD(.)1735 5147 y(153)p eop -%%Page: 154 160 -154 159 bop 681 1262 a Fz(Chapter)44 b(1)-6 b(1)681 1702 -y FE(T)-23 b(odo)681 2159 y FD(Ther)o(e)34 b(ar)o(e)g(always)h(many)-9 -b(,)39 b(many)c(impr)o(ovements)h(and)f(extensions)h(that)f(could)g(be) -681 2258 y(made)30 b(to)h(scsh.)55 b(W)-8 b(e)31 b(invite)g(inter)o -(ested)e(hackers)h(to)h(do)g(any)f(of)h(them,)i(and)d(send)h(us)681 -2358 y(the)22 b(code;)f(we'll)h(put)g(you)g(on)g(the)g(team.)27 -b(V)-5 b(isit)23 b(the)f(Scheme)f(Under)o(gr)o(ound)f(W)-8 -b(eb)22 b(page)681 2457 y(for)e(mor)o(e)h(information)g(on)h(good)f -(hacks)g(at)888 2557 y FA(http://www.ai.mit)o(.e)o(du/)o(pr)o(oje)o(ct) -o(s/s)o(u/)681 2657 y FD(Scsh)g(is)g(a)g(tool)h(that)f(lets)g(you)g -(write)g(fun)g(pr)o(ograms)g(that)g(do)g(r)o(eal)f(things)i(in)f(an)g -(elegant)681 2756 y(language;)f(go)h(wild.)805 2959 y -Fw(\017)41 b FD(Thr)o(eads.)805 3123 y Fw(\017)g FD(An)21 -b(X)g(gui)g(interface.)k(\(Needs)19 b(thr)o(eads.\))805 -3287 y Fw(\017)41 b FD(A)21 b(better)f(C)g(function/data-str)o(uctur)o -(e)g(interface.)25 b(This)c(is)g(not)g(easy)-9 b(.)805 -3451 y Fw(\017)41 b FD(Mor)o(e)20 b(network)h(pr)o(otocols.)26 -b(T)-8 b(elnet)21 b(and)g(ftp)f(would)h(be)g(the)g(most)g(important.) -805 3615 y Fw(\017)41 b FD(An)21 b(ILU)f(interface.)805 -3779 y Fw(\017)41 b FD(An)21 b(RPC)g(system,)g(with)h(\223tail-r)o -(ecursion.\224)805 3943 y Fw(\017)41 b FD(Interfaces)22 -b(to)h(r)o(elational)e(db's.)31 b(This)23 b(would)g(be)g(quite)g -(useful)f(for)g(W)-8 b(eb)23 b(servers.)888 4043 y(An)c(s-expr)o -(ession)g(embedding)f(of)h(SQL)g(would)g(be)f(a)h(key)g(design)g -(component)h(of)888 4142 y(such)i(a)e(system,)h(along)g(the)g(lines)h -(of)e(scsh's)i(pr)o(ocess)e(notation)i(or)f FA(awk)e -FD(notation.)805 4307 y Fw(\017)41 b FD(Port)22 b(Edwin,)f(and)g(emacs) -f(text)h(editor)g(written)h(in)f(MIT)g(Scheme,)f(to)i(scsh.)27 -b(Com-)888 4406 y(bine)21 b(it)g(with)h(scsh's)f(OS)g(interfaces)f(to)h -(make)f(a)h(visual)f(shell.)805 4570 y Fw(\017)41 b FD(An)21 -b FA(expect)d FD(knock-of)o(f.)805 4734 y Fw(\017)41 -b FD(A)21 b FA(make)e FD(r)o(eplacement,)g(using)j(scsh's)f(pr)o(ocess) -g(notation)g(in)h(the)f(build)f(r)o(ules.)805 4898 y -Fw(\017)41 b FD(Manual)20 b(hacking.)2051 5147 y(154)p -eop -%%Page: 155 161 -155 160 bop 672 614 a FB(\226)42 b FD(The)17 b(L)933 -597 y Fs(A)966 614 y FD(T)1003 634 y(E)1043 614 y(X)h(hackery)f(needs)g -(yet)h(another)f(serious)h(pass.)25 b(Most)17 b(importantly)-9 -b(,)756 714 y(long)21 b(pr)o(ocedur)o(e)e(\223declarations\224)g(need)h -(to)i(be)e(br)o(oken)h(acr)o(oss)f(two)h(lines.)672 847 -y FB(\226)42 b FD(Soup)24 b(up)g(the)h(markup)f(pr)o(ocessor)-6 -b(,)25 b(and)f(r)o(edo)f(manual)h(in)h(markup.)36 b(Gen-)756 -946 y(erate)19 b(L)978 929 y Fs(A)1011 946 y FD(T)1048 -966 y(E)1088 946 y(X,)i(HTML,)e(and)i(info)g(versions.)26 -b(Alternatively)-9 b(,)20 b(persuade)f(some)756 1046 -y(kind)i(soul)g(to)g(hand-port)g(manual)f(to)h(HTML)f(or)h(info.)490 -1212 y Fw(\017)41 b FD(Job)20 b(contr)o(ol,)h(after)f -FA(jcontrol.scm)490 1378 y Fw(\017)41 b FD(Better)20 -b(static)g(heap)h(linker)-6 b(.)490 1544 y Fw(\017)41 -b FD(Gnu)21 b(r)o(eadline)f(lib.)1735 5147 y(155)p eop -%%Page: 156 162 -156 161 bop 681 1095 a FE(Index)681 1513 y FA(\045read-delimited!)o -FD(,)15 b(1)-5 b(12)681 1616 y(*temp-\002le-template*,)20 -b(49)681 1718 y FA(->uid)p FD(,)e(61)681 1821 y FA(->username)p -FD(,)e(61)681 1924 y FA(\045exec)p FD(,)i(52)681 2026 -y FA(\045exit)p FD(,)g(52)681 2129 y FA(\045fork)p FD(,)g(53)681 -2231 y FA(\045fork/pipe)p FD(,)e(53)681 2334 y FA(\045fork/pipe+)p -FD(,)g(54)681 2436 y(&,)k(13)681 2539 y FA(&)p FD(,)g(13)681 -2642 y FA(&&)p FD(,)f(20)681 2744 y FA(interrupt/alarm)p -FD(,)14 b(64)681 2847 y FA(interrupt/alrm)p FD(,)g(64)681 -2949 y FA(interrupt/chld)p FD(,)g(64)681 3052 y FA(interrupt/cont)p -FD(,)g(64)681 3154 y FA(interrupt/hup)p FD(,)h(64)681 -3257 y FA(interrupt/info)p FD(,)f(64)681 3360 y FA(interrupt/int)p -FD(,)h(64)681 3462 y FA(interrupt/io)p FD(,)g(64)681 -3565 y FA(interrupt/keyboa)o(rd)o FD(,)g(64)681 3667 -y FA(interrupt/memory)o(-s)o(hor)o(ta)o(ge)o FD(,)g(64)681 -3770 y FA(interrupt/poll)p FD(,)f(64)681 3873 y FA(interrupt/prof)p -FD(,)g(64)681 3975 y FA(interrupt/pwr)p FD(,)h(64)681 -4078 y FA(interrupt/quit)p FD(,)f(64)681 4180 y FA(interrupt/term)p -FD(,)g(64)681 4283 y FA(interrupt/tstp)p FD(,)g(64)681 -4385 y FA(interrupt/urg)p FD(,)h(64)681 4488 y FA(interrupt/usr1)p -FD(,)f(64)681 4591 y FA(interrupt/usr2)p FD(,)g(64)681 -4693 y FA(interrupt/vtalrm)o FD(,)h(64)681 4796 y FA(interrupt/winch)p -FD(,)f(64)681 4898 y FA(interrupt/xcpu)p FD(,)g(64)2258 -1513 y FA(interrupt/xfsz)p FD(,)h(64)2258 1616 y FA(signal/abrt)p -FD(,)h(65)2258 1718 y FA(signal/alrm)p FD(,)g(64)2258 -1821 y FA(signal/bus)p FD(,)h(65)2258 1924 y FA(signal/chld)p -FD(,)f(64)2258 2026 y FA(signal/cont)p FD(,)g(64)2258 -2129 y FA(signal/emt)p FD(,)h(65)2258 2231 y FA(signal/fpe)p -FD(,)g(65)2258 2334 y FA(signal/hup)p FD(,)g(64)2258 -2436 y FA(signal/ill)p FD(,)g(65)2258 2539 y FA(signal/info)p -FD(,)f(64)2258 2642 y FA(signal/int)p FD(,)h(64)2258 -2744 y FA(signal/iot)p FD(,)g(65)2258 2847 y FA(signal/io)p -FD(,)g(64)2258 2949 y FA(signal/kill)p FD(,)f(65)2258 -3052 y FA(signal/pipe)p FD(,)g(65)2258 3154 y FA(signal/poll)p -FD(,)g(64)2258 3257 y FA(signal/prof)p FD(,)g(64)2258 -3360 y FA(signal/pwr)p FD(,)h(64)2258 3462 y FA(signal/quit)p -FD(,)f(64)2258 3565 y FA(signal/segv)p FD(,)g(65)2258 -3667 y FA(signal/stop)p FD(,)g(65)2258 3770 y FA(signal/sys)p -FD(,)h(65)2258 3873 y FA(signal/term)p FD(,)f(64)2258 -3975 y FA(signal/trap)p FD(,)g(65)2258 4078 y FA(signal/tstp)p -FD(,)g(64)2258 4180 y FA(signal/ttin)p FD(,)g(65)2258 -4283 y FA(signal/ttou)p FD(,)g(65)2258 4385 y FA(signal/urg)p -FD(,)h(64)2258 4488 y FA(signal/usr1)p FD(,)f(64)2258 -4591 y FA(signal/usr2)p FD(,)g(64)2258 4693 y FA(signal/vtalrm)p -FD(,)f(64)2258 4796 y FA(signal/winch)p FD(,)h(64)2258 -4898 y FA(signal/xcpu)p FD(,)g(64)2051 5147 y(156)p eop -%%Page: 157 163 -157 162 bop 365 614 a FA(signal/xfsz)p FD(,)16 b(64)365 -807 y FA(accept-connection)o FD(,)f(93)365 907 y FA(add-after)p -FD(,)i(75)365 1007 y FA(add-before)p FD(,)g(75)365 1107 -y FA(alist->env)p FD(,)g(74)365 1208 y FA(alist-compress)p -FD(,)e(74)365 1308 y FA(alist-delete)p FD(,)h(74)365 -1408 y FA(alist-update)p FD(,)g(74)365 1508 y FA(arg)p -FD(,)k(62)365 1608 y FA(arg*)p FD(,)f(62)365 1709 y FA(argv)p -FD(,)g(62)365 1809 y FA(arithmetic-shift)p FD(,)14 b(127)365 -1909 y FA(ascii->char)p FD(,)i(108)365 2009 y FA(ascii-range->char)o -(-s)o(et)p FD(,)e(109)365 2109 y FA(autoreap-policy)p -FD(,)h(56)365 2210 y(awk,)21 b(121)365 2402 y FA(become-session-le)o -(ad)o(er)p FD(,)14 b(81)365 2502 y FA(bind-listen-accep)o(t-)o(loo)o(p) -p FD(,)g(90)365 2602 y FA(bind-socket)p FD(,)i(93)365 -2703 y FA(bitwise-and)p FD(,)g(127)365 2803 y FA(bitwise-ior)p -FD(,)g(127)365 2903 y FA(bitwise-not)p FD(,)g(127)365 -3003 y FA(bitwise-xor)p FD(,)g(127)365 3196 y FA(call-terminally)p -FD(,)f(52)365 3296 y FA(call-with-string-)o(ou)o(tpu)o(t-)o(por)o(t)p -FD(,)697 3396 y(26)365 3496 y FA(call/fdes)p FD(,)i(30)365 -3596 y FA(char->ascii)p FD(,)f(108)365 3696 y FA(char-alphabetic?)p -FD(,)e(1)-5 b(10)365 3796 y FA(char-alphanumeric)o(?)p -FD(,)14 b(1)-5 b(10)365 3896 y FA(char-filter)p FD(,)16 -b(20)365 3997 y FA(char-graphic?)p FD(,)f(1)-5 b(10)365 -4097 y FA(char-lower-case?)p FD(,)14 b(1)-5 b(10)365 -4197 y FA(char-numeric?)82 b FD(,)21 b(1)-5 b(10)365 -4297 y FA(char-set)p FD(,)17 b(108)365 4397 y FA(char-set-contains)o(?) -p FD(,)d(109)365 4498 y FA(char-set-differen)o(ce)o FD(,)h(109)365 -4598 y FA(char-set-intersec)o(ti)o(on)p FD(,)f(109)365 -4698 y FA(char-set-invert)p FD(,)h(109)365 4798 y FA(char-set-members)p -FD(,)f(109)365 4898 y FA(char-set-union)p FD(,)h(109)1943 -614 y(char)o(-set:alphabetic,)j(109)1943 714 y(char)o -(-set:alphanumeric,)g(109)1943 814 y(char)o(-set:graphic,)g(109)1943 -914 y(char)o(-set:lower)o(-case,)f(109)1943 1014 y(char)o -(-set:not-whitespace,)i(109)1943 1114 y(char)o(-set:numeric,)g(109)1943 -1214 y(char)o(-set:upper)o(-case,)e(109)1943 1314 y(char)o -(-set:whitespace,)h(109)1943 1414 y FA(char-set?)p FD(,)f(108)1943 -1514 y FA(char-upper-case?)o FD(,)e(1)-5 b(10)1943 1613 -y FA(char-whitespace?)o FD(,)15 b(1)-5 b(10)1943 1713 -y FA(chars->char-set)p FD(,)14 b(108)1943 1813 y FA(chdir)p -FD(,)k(59)1943 1913 y FA(close)p FD(,)g(25)1943 2013 -y FA(close-after)p FD(,)e(24)1943 2113 y FA(close-socket)p -FD(,)f(90)1943 2213 y FA(command-line)p FD(,)g(61)1943 -2313 y(command-line-ar)o(guments,)20 b(61)1943 2413 y -FA(connect-socket)p FD(,)14 b(93)1943 2513 y FA(control-tty-file)o(-n)o -(am)o(e)p FD(,)h(82)1943 2613 y FA(copy-tty-info)p FD(,)g(79)1943 -2712 y FA(cpu-ticks/sec)p FD(,)g(60)1943 2812 y FA(create-directory)o -FD(,)g(40)1943 2912 y FA(create-fifo)p FD(,)h(40)1943 -3012 y FA(create-hard-link)o FD(,)f(40)1943 3112 y FA(create-socket)p -FD(,)g(90)1943 3212 y FA(create-socket-pa)o(ir)o FD(,)g(90)1943 -3312 y FA(create-symlink)p FD(,)f(40)1943 3412 y FA(create-temp-file)o -FD(,)h(48)1943 3512 y FA(cwd)p FD(,)k(59)1943 3699 y(date,)g(68)1943 -3799 y FA(date)p FD(,)g(70)1943 3899 y FA(date->string)p -FD(,)c(71)1943 3999 y FA(define-record)p FD(,)g(7)1943 -4099 y FA(delete-directory)o FD(,)g(40)1943 4199 y FA(delete-file)p -FD(,)h(40)1943 4299 y FA(delete-filesys-o)o(bj)o(ec)o(t)p -FD(,)f(40)1943 4399 y FA(directory-as-fil)o(e-)o(na)o(me)p -FD(,)f(104)1943 4499 y FA(directory-files)p FD(,)g(44)1943 -4599 y FA(disable-tty-char)o FD(,)h(78)1943 4698 y FA(drain-tty)p -FD(,)i(80)1943 4798 y FA(dump-scsh)p FD(,)g(144)1943 -4898 y FA(dump-scsh-progra)o(m)p FD(,)d(143)1735 5147 -y(157)p eop -%%Page: 158 164 -158 163 bop 681 614 a FA(dup)p FD(,)19 b(31)681 714 y -FA(dup->fdes)p FD(,)e(31)681 815 y FA(dup->inport)p FD(,)f(31)681 -915 y FA(dup->outport)p FD(,)f(31)681 1105 y FA(enabled-interrup)o(ts)o -FD(,)g(66)681 1205 y FA(env->alist)p FD(,)h(73)681 1305 -y FA(errno-error)p FD(,)g(21)681 1405 y FA(error-output-por)o(t)p -FD(,)e(24)681 1505 y FA(exec)p FD(,)19 b(51)681 1605 -y(exec-epf,)f(13)681 1706 y FA(exec-epf)p FD(,)f(13)681 -1806 y FA(exec-path)p FD(,)g(51)681 1906 y(exec-path-list,)i(76)681 -2006 y FA(exec-path-search)o FD(,)c(52)681 2106 y FA(exec-path/env)p -FD(,)g(51)681 2206 y FA(exec/env)p FD(,)i(51)681 2306 -y FA(exit)p FD(,)i(52)681 2406 y FA(expand-file-name)o -FD(,)c(107)681 2597 y FA(fdes->inport)p FD(,)g(30)681 -2697 y FA(fdes->outport)p FD(,)g(30)681 2797 y FA(fdes-flags)p -FD(,)h(32)681 2897 y FA(fdes-status)p FD(,)g(33)681 2997 -y FA(field-reader)p FD(,)f(1)-5 b(18)681 3097 y FA(field-splitter)p -FD(,)14 b(1)-5 b(15)681 3197 y FA(file-directory?)p FD(,)14 -b(43)681 3297 y FA(file-executable?)o FD(,)h(44)681 3397 -y FA(file-exists?)p FD(,)g(44)681 3497 y FA(file-fifo?)p -FD(,)h(43)681 3597 y FA(file-group)p FD(,)g(42)681 3697 -y FA(file-info)p FD(,)h(41)681 3797 y(\002le-info:atime,)j(42)681 -3898 y(\002le-info:ctime,)g(42)681 3998 y(\002le-info:device,)f(42)681 -4098 y(\002le-info:gid,)h(42)681 4198 y(\002le-info:inode,)h(42)681 -4298 y(\002le-info:mode,)f(42)681 4398 y(\002le-info:mtime,)h(42)681 -4498 y(\002le-info:nlinks,)h(42)681 4598 y(\002le-info:size,)e(42)681 -4698 y(\002le-info:type,)g(42)681 4798 y(\002le-info:uid,)g(42)681 -4898 y FA(file-inode)p FD(,)c(42)2258 614 y FA(file-last-access)p -FD(,)e(42)2258 714 y FA(file-last-mod)p FD(,)h(42)2258 -814 y FA(file-last-status-)o(ch)o(ang)o(e)p FD(,)f(42)2258 -914 y FA(file-match)p FD(,)j(46)2258 1014 y FA(file-mode)p -FD(,)g(42)2258 1114 y FA(file-name-absolut)o(e?)o FD(,)e(104)2258 -1214 y FA(file-name-as-dire)o(ct)o(ory)o FD(,)g(104)2258 -1314 y FA(file-name-directo)o(ry)o FD(,)g(104)2258 1414 -y FA(file-name-directo)o(ry)o(?)p FD(,)f(103)2258 1514 -y FA(file-name-extensi)o(on)o FD(,)h(106)2258 1613 y -FA(file-name-non-dir)o(ec)o(tor)o(y?)o FD(,)g(103)2258 -1713 y FA(file-name-nondire)o(ct)o(ory)o FD(,)g(105)2258 -1813 y FA(file-name-sans-ex)o(te)o(nsi)o(on)o FD(,)g(106)2258 -1913 y FA(file-nlinks)p FD(,)h(42)2258 2013 y FA(file-not-executab)o -(le)o(?)p FD(,)e(43)2258 2113 y FA(file-not-exists?)p -FD(,)g(44)2258 2213 y FA(file-not-readable)o(?)p FD(,)g(43)2258 -2313 y FA(file-not-writable)o(?)p FD(,)g(43)2258 2413 -y FA(file-owner)p FD(,)j(42)2258 2513 y FA(file-readable?)p -FD(,)e(44)2258 2613 y FA(file-regular?)p FD(,)g(43)2258 -2712 y FA(file-size)p FD(,)i(42)2258 2812 y FA(file-socket?)p -FD(,)f(43)2258 2912 y FA(file-special?)p FD(,)f(43)2258 -3012 y FA(file-symlink?)p FD(,)g(43)2258 3112 y FA(file-type)p -FD(,)i(42)2258 3212 y FA(file-writable?)p FD(,)e(44)2258 -3312 y FA(fill-in-date!)p FD(,)g(71)2258 3412 y FA(flush-all-ports)p -FD(,)g(37)2258 3512 y FA(flush-tty/both)p FD(,)g(80)2258 -3612 y FA(flush-tty/input)p FD(,)g(80)2258 3712 y FA(flush-tty/output)p -FD(,)f(80)2258 3811 y FA(force-output)p FD(,)i(37)2258 -3911 y FA(fork)p FD(,)j(53)2258 4011 y FA(fork-pty-session)p -FD(,)14 b(82)2258 4111 y FA(fork/pipe)p FD(,)j(53)2258 -4211 y FA(fork/pipe+)p FD(,)g(54)2258 4311 y FA(format-date)p -FD(,)f(71)2258 4499 y FA(get-lock-region)p FD(,)f(39)2258 -4599 y FA(getenv)p FD(,)j(73)2258 4698 y FA(glob)p FD(,)h(45)2258 -4798 y FA(glob-quote)p FD(,)e(46)2258 4898 y(gr)o(oup-info,)k(61)2051 +2781 y(\(awk)f(\(read\))f(\(line)h(fields\))f(\(\(ans)g('\(\)\)\))1445 +2881 y(\(#t)h(\(cons)f(\(cons)h(\($)h(fields)e(0\))i(line\))e +(ans\)\)\)\)\)\))573 3171 y(;;;)h(Prefix)f(line)h(numbers)f(to)i(the)f +(input)g(stream.)573 3271 y(\(awk)g(\(read-line\))d(\(line\))i(lineno)g +(\(\))660 3371 y(\(#t)h(\(format)f(#t)i("~d:\\t~a~\045")c(lineno)i +(line\)\)\))365 3731 y Fy(8.3)99 b(Backwards)25 b(compatibility)365 +3945 y FD(Pr)o(evious)d(scsh)g(r)o(eleases)e(pr)o(ovided)h(an)g +FA(awk)g FD(form)h(with)g(a)f(dif)o(fer)o(ent)f(syntax,)i(designed)365 +4045 y(ar)o(ound)32 b(r)o(egular)f(expr)o(essions)h(written)g(in)h +(Posix)g(notation)g(as)f(strings,)k(rather)31 b(than)365 +4144 y(SREs.)490 4269 y(This)23 b(form)g(is)h(still)g(available)d(in)j +(a)e(separate)g(module)h(for)g(old)g(code.)32 b(It'll)23 +b(be)g(docu-)365 4369 y(mented)e(in)g(the)g(next)g(r)o(elease)e(of)i +(this)g(manual.)26 b(Dig)21 b(ar)o(ound)f(in)h(the)g(sour)o(ces)g(for)f +(it.)1735 5147 y(155)p eop +%%Page: 156 164 +156 163 bop 681 1262 a Fz(Chapter)44 b(9)681 1702 y FE(Miscellaneous)51 +b(routines)681 2175 y Fy(9.1)99 b(Integer)24 b(bitwise)i(ops)681 +2398 y FA(\(arithmetic-shif)o(t)37 b FC(i)21 b(j)p FA(\))87 +b Fw(\000)-14 b(!)87 b FC(integer)1051 b FD(pr)o(ocedur)o(e)681 +2498 y FA(\(bitwise-and)38 b FC(i)21 b(j)p FA(\))87 b +Fw(\000)-14 b(!)87 b FC(integer)1269 b FD(pr)o(ocedur)o(e)681 +2598 y FA(\(bitwise-ior)38 b FC(i)21 b(j)p FA(\))87 b +Fw(\000)-14 b(!)87 b FC(integer)1269 b FD(pr)o(ocedur)o(e)681 +2697 y FA(\(bitwise-not)38 b FC(i)p FA(\))87 b Fw(\000)-14 +b(!)87 b FC(integer)1313 b FD(pr)o(ocedur)o(e)681 2797 +y FA(\(bitwise-xor)38 b FC(i)21 b(j)p FA(\))87 b Fw(\000)-14 +b(!)87 b FC(integer)1269 b FD(pr)o(ocedur)o(e)888 2913 +y(These)53 b(operations)g(operate)f(on)i(integers)f(r)o(epr)o(esenting) +f(semi-in\002nite)i(bit)888 3013 y(strings,)22 b(using)f(a)g +(2's-complement)g(encoding.)888 3138 y FA(arithmetic-shift)f +FD(shifts)27 b FC(i)g FD(by)f FC(j)h FD(bits.)43 b(A)26 +b(left)g(shift)h(is)g Fo(j)39 b(>)33 b Fn(0)p FD(;)c(a)d(right)h(shift) +g(is)888 3238 y Fo(j)h(<)23 b Fn(0)p FD(.)681 3516 y +Fy(9.2)99 b(List)25 b(procedures)681 3739 y FA(\(nth)42 +b FC(list)21 b(i)p FA(\))86 b Fw(\000)-14 b(!)87 b FC(object)1578 +b FD(pr)o(ocedur)o(e)888 3856 y(Returns)23 b(the)f Fo(i)1365 +3826 y Fx(t)p Fp(h)1455 3856 y FD(element)h(of)e FC(list)q +FD(.)29 b(The)21 b(\002rst)i(element)f(\(the)f(car\))g(is)h +FA(\(nth)42 b FC(list)i FA(0\))p FD(,)888 3956 y(the)21 +b(second)g(element)g(is)g FA(\(nth)42 b FC(list)i FA(1\))p +FD(,)20 b(and)g(so)h(on.)888 4081 y(This)g(pr)o(ocedur)o(e)d(is)i(pr)o +(ovided)f(as)h(it)g(is)h(useful)f(for)g(accessing)g(elements)g(fr)o(om) +g(the)888 4180 y(lists)i(r)o(eturned)d(by)i(the)g(\002eld-r)o(eaders)e +(\(chapter)g(8\).)681 4459 y Fy(9.3)99 b(T)-11 b(op)26 +b(level)681 4682 y FA(\(repl\))84 b Fw(\000)-14 b(!)87 +b FC(unde\002ned)1590 b FD(pr)o(ocedur)o(e)888 4799 y(This)24 +b(r)o(uns)f(a)g(Scheme)f(48)g(r)o(ead-eval-print)f(loop,)i(r)o(eading)f +(forms)i(fr)o(om)e(the)h(cur)o(-)888 4898 y(r)o(ent)e(input)g(port,)f +(and)h(writing)g(their)g(values)g(to)g(the)g(curr)o(ent)f(output)h +(port.)2051 5147 y(156)p eop +%%Page: 157 165 +157 164 bop 573 614 a FD(If)24 b(you)i(wish)g(to)f(try)g(something)i +(danger)o(ous,)e(and)g(want)g(to)g(be)g(able)f(to)i(r)o(ecover)573 +714 y(your)21 b(shell)g(state,)f(you)i(can)e(fork)h(of)o(f)f(a)g +(subshell)i(with)f(the)g(following)h(form:)756 853 y +FA(\(run)41 b(\(begin)h(\(repl\)\)\))573 991 y FD(.)12 +b(.)g(.)g(or)-6 b(,)21 b(r)o(ephrased)e(for)i(the)f(pr)o(oceduralists:) +756 1130 y FA(\(wait)41 b(\(fork)h(repl\)\))1735 5147 +y FD(157)p eop +%%Page: 158 166 +158 165 bop 681 1266 a Fz(Chapter)44 b(10)681 1709 y +FE(Running)52 b(scsh)681 2194 y FD(Scsh)22 b(is)i(curr)o(ently)e +(implemented)h(on)g(top)g(of)g(Scheme)f(48,)g(a)h(fr)o(eely-available)c +(Scheme)681 2293 y(implementation)i(written)g(by)f(Jonathan)h(Rees)f +(and)g(Richar)o(d)g(Kelsey)-9 b(.)25 b(Scheme)20 b(48)g(uses)681 +2393 y(a)e(byte-code)g(interpr)o(eter)g(for)g(good)i(code)e(density)-9 +b(,)19 b(portability)h(and)e(medium)h(ef)o(\002cien-)681 +2493 y(cy)-9 b(.)25 b(It)c(is)g(R4RS.)g(It)f(also)h(has)g(a)f(module)h +(system)h(designed)e(by)h(Jonathan)g(Rees.)805 2621 y(Scsh's)26 +b(design)f(is)h(not)g(Scheme)f(48)f(speci\002c,)i(although)g(the)g +(curr)o(ent)e(implementa-)681 2720 y(tion)k(is)g(necessarily)f(so.)46 +b(Scsh)27 b(is)h(intended)f(to)h(be)f(implementable)g(in)h(other)f +(Scheme)681 2820 y(implementations.)37 b(The)24 b(Scheme)g(48)f +(virtual)h(machine)g(that)g(scsh)h(uses)f(is)h(a)e(specially)681 +2920 y(modi\002ed)k(version;)k(standar)o(d)25 b(Scheme)i(48)f(virtual)h +(machines)g(cannot)h(be)e(used)h(with)681 3019 y(the)21 +b(scsh)g(heap)f(image.)805 3147 y(Ther)o(e)37 b(ar)o(e)g(several)g(dif) +o(fer)o(ent)f(ways)i(to)g(invoke)h(scsh.)77 b(Y)-8 b(ou)39 +b(can)f(r)o(un)g(it)h(as)e(an)681 3247 y(interactive)30 +b(Scheme)g(system,)j(with)e(a)f(standar)o(d)f(r)o(ead-eval-print)f +(interaction)j(loop.)681 3347 y(Scsh)37 b(can)g(also)h(be)f(invoked)h +(as)f(the)h(interpr)o(eter)e(for)h(a)g(shell)h(script)g(by)f(putting)i +(a)681 3446 y(\223)p FA(#!/usr/local/b)o(in/)o(sc)o(sh)e(-s)p +FD(\224)20 b(line)h(at)f(the)h(top)g(of)g(the)g(shell)g(script.)805 +3575 y(Descending)j(a)e(level,)h(it)g(is)g(also)g(possible)h(to)f +(invoke)h(the)f(underlying)g(virtual)g(ma-)681 3674 y(chine)j +(byte-code)f(interpr)o(eter)f(dir)o(ectly)h(on)i(dumped)e(heap)g +(images.)41 b(Scsh)26 b(pr)o(ograms)681 3774 y(can)h(be)g(pr)o +(e-compiled)g(to)h(byte-codes)e(and)i(dumped)f(as)g(raw)-8 +b(,)29 b(binary)e(heap)g(images.)681 3873 y(W)-6 b(riting)27 +b(heap)g(images)g(strips)g(out)g(unused)g(portions)h(of)f(the)g(scsh)h +(r)o(untime)f(\(such)g(as)681 3973 y(the)19 b(compiler)-6 +b(,)19 b(the)g(debugger)-6 b(,)18 b(and)h(other)g(complex)g +(subsystems\),)h(r)o(educing)e(memory)681 4073 y(demands)25 +b(and)g(saving)h(loading)g(and)f(compilation)h(times.)40 +b(The)26 b(heap)f(image)g(format)681 4172 y(allows)k(for)f(an)g +(initial)h FA(#!/usr/local/lib/)o(sc)o(sh)o(/sc)o(sh)o(vm)22 +b FD(trigger)28 b(on)h(the)g(\002rst)g(line)681 4272 +y(of)22 b(the)h(image,)f(making)h(heap)f(images)h(dir)o(ectly)e +(executable)h(as)g(another)g(kind)h(of)f(shell)681 4372 +y(script.)805 4500 y(Finally)-9 b(,)25 b(scsh's)f(static)g(linker)g +(system)g(allows)g(dumped)g(heap)f(images)h(to)g(be)f(com-)681 +4599 y(piled)c(to)g(a)g(raw)g(Unix)g(a.out\(5\))f(format,)h(which)h +(can)f(be)g(linked)h(into)g(the)f(text)g(section)h(of)681 +4699 y(the)h(vm)g(binary)-9 b(.)25 b(This)d(pr)o(oduces)e(a)g(tr)o(ue)h +(Unix)g(executable)f(binary)g(\002le.)27 b(Since)20 b(the)h(byte)681 +4799 y(codes)h(comprising)i(the)f(pr)o(ogram)f(ar)o(e)f(in)i(the)g +(\002le's)g(text)f(section,)i(they)f(ar)o(e)e(not)i(traced)681 +4898 y(or)g(copied)f(by)h(the)g(garbage)e(collector)-6 +b(,)24 b(do)e(not)i(occupy)f(space)f(in)h(the)g(vm's)g(heap,)f(and)2051 5147 y(158)p eop -%%Page: 159 165 -159 164 bop 365 614 a FA(group-info)p FD(,)17 b(61)365 -714 y(gr)o(oup-info:gid,)j(61)365 814 y(gr)o(oup-info:members,)g(61)365 -913 y(gr)o(oup-info:name,)g(61)365 1096 y FA(home-dir)p -FD(,)d(107)365 1196 y(home-dir)o(ectory)-9 b(,)20 b(76)365 -1295 y FA(home-file)p FD(,)d(107)365 1395 y FA(host-info)p -FD(,)g(96)365 1577 y FA(index)p FD(,)i(101)365 1677 y -FA(infix-splitter)p FD(,)c(1)-5 b(15)365 1777 y FA(internet-address-)o -(>s)o(ock)o(et)o(-ad)o(dr)o(es)o(s)p FD(,)697 1876 y(92)365 -1976 y FA(interrupt-handler)o FD(,)15 b(67)365 2076 y -FA(interrupt-set)p FD(,)g(66)365 2175 y FA(itimer)p FD(,)j(63)365 -2358 y FA(join-strings)p FD(,)e(1)-5 b(18)365 2540 y -FA(listen-socket)p FD(,)15 b(93)365 2640 y FA(lock-region)p -FD(,)h(39)365 2740 y FA(lock-region/no-bl)o(oc)o(k)p -FD(,)f(39)365 2839 y(lock-r)o(egion:end,)21 b(38)365 -2939 y(lock-r)o(egion:exclusive?,)f(38)365 3039 y(lock-r)o(egion:len,)h -(38)365 3138 y(lock-r)o(egion:pr)o(oc,)f(38)365 3238 -y(lock-r)o(egion:start,)g(38)365 3337 y(lock-r)o(egion:whence,)h(38)365 -3437 y(lock-r)o(egion?,)g(38)365 3620 y FA(make-date)p -FD(,)c(69)365 3719 y FA(make-lock-region)p FD(,)d(39)365 -3819 y FA(make-pty-generato)o(r)p FD(,)g(83)365 3919 -y FA(make-regexp)p FD(,)i(99)365 4018 y FA(make-string-input)o(-p)o -(ort)o FD(,)f(26)365 4118 y FA(make-string-outpu)o(t-)o(por)o(t)p -FD(,)f(26)365 4218 y FA(make-tty-info)p FD(,)h(79)365 -4317 y FA(match:end)p FD(,)i(99)365 4417 y FA(match:start)p -FD(,)f(99)365 4516 y FA(match:substring)p FD(,)f(99)365 -4616 y FA(move->fdes)p FD(,)i(30)365 4799 y FA(network-info)p -FD(,)f(96)365 4898 y FA(nice)p FD(,)j(60)1943 614 y FA(nth)p -FD(,)g(127)1943 807 y FA(open-control-tty)o FD(,)c(81)1943 -907 y FA(open-fdes)p FD(,)i(32)1943 1007 y FA(open-file)p -FD(,)g(32)1943 1107 y FA(open-input-file)p FD(,)d(32)1943 -1208 y FA(open-output-file)o FD(,)h(32)1943 1308 y FA(open-pty)p -FD(,)i(82)1943 1500 y FA(parent-pid)p FD(,)f(60)1943 -1600 y FA(parse-file-name)p FD(,)e(106)1943 1700 y FA(path-list->file-) -o(na)o(me)o FD(,)h(105)1943 1801 y FA(pause-until-inte)o(rr)o(up)o(t)p -FD(,)g(63)1943 1901 y FA(pid)p FD(,)k(60)1943 2001 y -FA(pid->proc)p FD(,)e(55)1943 2101 y FA(pipe)p FD(,)i(33)1943 -2201 y FA(port->fdes)p FD(,)d(30)1943 2302 y FA(port->list)p -FD(,)g(15)1943 2402 y FA(port->sexp-list)p FD(,)e(15)1943 -2502 y FA(port->string)p FD(,)h(15)1943 2602 y FA(port->string-lis)o(t) -p FD(,)f(15)1943 2702 y FA(port-revealed)p FD(,)h(30)1943 -2802 y FA(predicate->char-)o(se)o(t)p FD(,)f(108)1943 -2903 y FA(priority)p FD(,)j(60)1943 3003 y(pr)o(oc,)j(55)1943 -3103 y(pr)o(oc:pid,)f(55)1943 3203 y(pr)o(oc?,)g(55)1943 -3303 y FA(process-group)p FD(,)c(60)1943 3404 y FA(process-times)p -FD(,)g(60)1943 3504 y FA(protocol-info)p FD(,)g(96)1943 -3604 y FA(pty-name->tty-na)o(me)o FD(,)g(82)1943 3796 -y FA(read-delimited)p FD(,)f(1)-5 b(12)1943 3896 y FA(read-delimited!)p -FD(,)14 b(1)-5 b(12)1943 3997 y FA(read-line)p FD(,)17 -b(1)-5 b(1)g(1)1943 4097 y FA(read-paragraph)p FD(,)14 -b(1)-5 b(12)1943 4197 y FA(read-string)p FD(,)16 b(33)1943 -4297 y FA(read-string!)p FD(,)f(33)1943 4397 y FA(read-string!/par)o -(ti)o(al)o FD(,)g(34)1943 4498 y FA(read-string/part)o(ia)o(l)p -FD(,)f(34)1943 4598 y FA(read-symlink)p FD(,)h(40)1943 -4698 y FA(reap-zombies)p FD(,)g(56)1943 4798 y FA(receive-message)p -FD(,)f(94)1943 4898 y FA(receive-message!)o FD(,)h(94)1735 -5147 y(159)p eop -%%Page: 160 166 -160 165 bop 681 614 a FA(receive-message!)o(/p)o(art)o(ia)o(l)p -FD(,)14 b(94)681 714 y FA(receive-message/)o(pa)o(rti)o(al)o -FD(,)h(94)681 814 y FA(record-reader)p FD(,)g(1)-5 b(15)681 -914 y FA(reduce-port)p FD(,)16 b(16)681 1014 y FA(regexp-exec)p -FD(,)g(99)681 1114 y FA(regexp-match?)p FD(,)f(98)681 -1214 y FA(regexp-quote)p FD(,)g(99)681 1314 y FA(regexp-substitut)o(e)p -FD(,)f(100)681 1414 y FA(regexp-substitut)o(e/)o(glo)o(ba)o(l)p -FD(,)g(100)681 1514 y FA(regexp?)p FD(,)j(99)681 1613 -y FA(release-port-han)o(dl)o(e)p FD(,)d(30)681 1713 y -FA(rename-file)p FD(,)i(40)681 1813 y FA(repl)p FD(,)j(127)681 -1913 y FA(replace-extensio)o(n)p FD(,)14 b(107)681 2013 -y FA(resolve-file-nam)o(e)p FD(,)g(107)681 2113 y FA(rindex)p -FD(,)k(101)681 2213 y(r)o(un,)j(13)681 2313 y FA(run)p -FD(,)e(13)681 2413 y FA(run/collecting)p FD(,)14 b(17)681 -2513 y FA(run/collecting*)p FD(,)g(17)681 2613 y FA(run/file)p -FD(,)j(14)681 2712 y FA(run/file*)p FD(,)g(15)681 2812 -y FA(run/port)p FD(,)g(14)681 2912 y FA(run/port*)p FD(,)g(15)681 -3012 y FA(run/port+proc)p FD(,)e(17)681 3112 y FA(run/port+proc*)p -FD(,)f(17)681 3212 y FA(run/sexp)p FD(,)j(14)681 3312 -y FA(run/sexp*)p FD(,)g(15)681 3412 y FA(run/sexps)p -FD(,)g(14)681 3512 y FA(run/sexps*)p FD(,)f(15)681 3612 -y FA(run/string)p FD(,)g(14)681 3712 y FA(run/string*)p -FD(,)g(15)681 3811 y FA(run/strings)p FD(,)g(14)681 3911 -y FA(run/strings*)p FD(,)f(15)681 4099 y FA(seek)p FD(,)k(31)681 -4199 y FA(select)41 b FD(,)20 b(34)681 4299 y FA(send-message)p -FD(,)15 b(94)681 4399 y FA(send-message/par)o(ti)o(al)p -FD(,)f(94)681 4499 y FA(send-tty-break)p FD(,)g(80)681 -4599 y FA(service-info)p FD(,)h(96)681 4698 y FA(set-enabled-inte)o(rr) -o(upt)o(s)p FD(,)f(66)681 4798 y FA(set-fdes-flags)p -FD(,)g(32)681 4898 y FA(set-fdes-status)p FD(,)g(33)2258 -614 y FA(set-file-group)p FD(,)h(41)2258 714 y FA(set-file-mode)p -FD(,)g(41)2258 814 y FA(set-file-owner)p FD(,)g(41)2258 -913 y FA(set-file-times)p FD(,)g(41)2258 1013 y FA(set-gid)p -FD(,)j(60)2258 1112 y FA(set-interrupt-han)o(dl)o(er)p -FD(,)c(66)2258 1212 y FA(set-port-bufferin)o(g)p FD(,)g(37)2258 -1312 y FA(set-priority)p FD(,)i(60)2258 1411 y FA(set-process-group)o -FD(,)f(60)2258 1511 y FA(set-socket-option)o FD(,)g(95)2258 -1611 y FA(set-tty-info/drai)o(n)p FD(,)f(80)2258 1710 -y FA(set-tty-info/flus)o(h)p FD(,)g(80)2258 1810 y FA(set-tty-info/now) -p FD(,)g(80)2258 1910 y FA(set-tty-process-g)o(ro)o(up)p -FD(,)g(82)2258 2009 y FA(set-uid)p FD(,)k(60)2258 2109 -y FA(set-umask)p FD(,)f(59)2258 2208 y FA(setenv)p FD(,)h(73)2258 -2308 y FA(shutdown-socket)p FD(,)d(94)2258 2408 y FA(signal->interrupt) -o FD(,)g(66)2258 2507 y FA(signal-process)p FD(,)g(63)2258 -2607 y FA(signal-process-gr)o(ou)o(p)p FD(,)f(63)2258 -2707 y FA(simplify-file-nam)o(e)p FD(,)g(107)2258 2806 -y FA(skip-char-set)p FD(,)h(1)-5 b(13)2258 2906 y FA(sleep)p -FD(,)19 b(63)2258 3005 y FA(sleep-until)p FD(,)d(63)2258 -3105 y FA(sloppy-suffix-spl)o(it)o(ter)o FD(,)f(1)-5 -b(15)2258 3205 y FA(socket-address->i)o(nt)o(ern)o(et)o(-a)o(ddr)o(es)o -(s)p FD(,)2590 3304 y(92)2258 3404 y FA(socket-address->u)o(ni)o(x-a)o -(dd)o(re)o(ss)p FD(,)2590 3504 y(92)2258 3603 y FA(socket-connect)p -FD(,)15 b(89)2258 3703 y FA(socket-local-addr)o(es)o(s)p -FD(,)f(93)2258 3802 y FA(socket-option)p FD(,)h(95)2258 -3902 y FA(socket-remote-add)o(re)o(ss)p FD(,)f(93)2258 -4002 y FA(split-file-name)p FD(,)h(105)2258 4101 y FA(start-tty-input)p -FD(,)g(81)2258 4201 y FA(start-tty-output)p FD(,)f(80)2258 -4301 y FA(status:exit-val)p FD(,)h(58)2258 4400 y FA(status:stop-sig)p -FD(,)g(59)2258 4500 y FA(status:term-sig)p FD(,)g(59)2258 -4599 y FA(stdio->stdports)p FD(,)g(25)2258 4699 y FA(stdports->stdio)p -FD(,)g(25)2258 4799 y FA(stop-tty-input)p FD(,)g(81)2258 -4898 y FA(stop-tty-output)p FD(,)g(80)2051 5147 y(160)p +%%Page: 159 167 +159 166 bop 365 614 a FD(do)16 b(not)h(need)f(to)g(be)g(loaded)f(and)g +(linked)h(at)g(startup)g(time.)24 b(This)16 b(r)o(educes)f(the)h(pr)o +(ogram's)365 714 y(startup)21 b(time,)f(memory)i(r)o(equir)o(ements,)e +(and)g(paging)h(over)o(head.)490 854 y(This)g(chapter)f(will)i(cover)e +(these)h(various)g(ways)f(of)h(invoking)h(scsh)g(pr)o(ograms.)365 +1169 y Fy(10.1)99 b(Scsh)25 b(command-line)g(switches)365 +1403 y FD(When)e(the)g(scsh)g(top-level)g(starts)f(up,)h(it)g(scans)g +(the)g(command)g(line)g(for)f(switches)i(that)365 1503 +y(contr)o(ol)i(its)f(behaviour)-6 b(.)38 b(These)25 b(ar)o(guments)g +(ar)o(e)f(r)o(emoved)g(fr)o(om)h(the)g(command)g(line;)365 +1602 y(the)35 b(r)o(emaining)g(ar)o(guments)f(can)h(be)f(accessed)g(as) +g(the)h(value)f(of)h(the)g(scsh)g(variable)365 1702 y +FA(command-line-argu)o(me)o(nts)o FD(.)365 1992 y FB(10.1.1)81 +b(Scripts)19 b(and)h(programs)365 2194 y FD(The)e(scsh)f(command-line)h +(switches)g(pr)o(ovide)f(sophisticated)g(support)h(for)f(the)g(authors) +365 2294 y(of)29 b(shell)g(scripts)g(and)g(pr)o(ograms;)j(they)d(also)g +(allow)g(the)g(pr)o(ogrammer)e(to)j(write)e(pr)o(o-)365 +2393 y(grams)21 b(that)g(use)g(the)f(Scheme)h(48)f(module)h(system.)490 +2533 y(Ther)o(e)e(is)i(a)f(dif)o(fer)o(ence)e(between)j(a)f +FC(script)p FD(,)g(which)h(performs)f(its)h(action)g +FC(as)f(it)h(is)g(load-)365 2633 y(ed)p FD(,)35 b(and)d(a)g +FC(pr)o(ogram)p FD(,)h(which)h(is)e(loaded/linked,)j(and)d(then)h +(performs)f(its)h(action)f(by)365 2732 y(having)21 b(contr)o(ol)f +(transferr)o(ed)e(to)i(an)g(entry)g(point)g(\()p FC(e.g.)o +FD(,)g(the)g FA(main\(\))e FD(function)i(in)h(C)e(pr)o(o-)365 +2832 y(grams\))i(that)f(was)h(de\002ned)f(by)h(the)g(load/link)h +(operation.)490 2971 y(A)f FC(script)p FD(,)g(by)h(the)g(above)f +(de\002nition,)h(cannot)g(be)g(compiled)g(by)f(the)h(simple)g(mecha-) +365 3071 y(nism)j(of)e(loading)h(it)f(into)i(a)e(scsh)h(pr)o(ocess)e +(and)h(dumping)h(out)g(a)f(heap)g(image\227it)h(exe-)365 +3171 y(cutes)d(as)f(it)h(loads.)26 b(It)21 b(does)f(not)i(have)e(a)g +(top-level)h FA(main\(\))p FD(-type)d(entry)j(point.)490 +3310 y(It)f(is)h(mor)o(e)g(\003exible)f(and)g(useful)h(to)g(implement)g +(a)f(system)i(as)e(a)g(pr)o(ogram)g(than)h(as)f(a)365 +3410 y(script.)29 b(Pr)o(ograms)22 b(can)g(be)f(compiled)h +(straightforwar)o(dly;)g(they)g(can)g(also)g(export)f(pr)o(o-)365 +3509 y(cedural)h(interfaces)g(for)h(use)g(by)h(other)f(Scheme)g +(packages.)31 b(However)-6 b(,)23 b(scsh)h(supports)365 +3609 y(both)e(the)f(script)f(and)h(the)g(pr)o(ogram)f(style)h(of)f(pr)o +(ogramming.)365 3899 y FB(10.1.2)81 b(Inserting)19 b(interpreter)g +(triggers)h(into)g(scsh)g(programs)365 4101 y FD(When)g(Unix)g(tries)f +(to)h(execute)f(an)g(executable)g(\002le)g(whose)i(\002rst)f(16)e(bits) +i(ar)o(e)e(the)i(charac-)365 4201 y(ter)d(pair)g(\223)p +FA(#!)p FD(\224,)f(it)h(tr)o(eats)g(the)g(\002le)h(not)g(as)f +(machine-code)g(to)g(be)g(dir)o(ectly)g(executed)f(by)h(the)365 +4301 y(native)27 b(pr)o(ocessor)-6 b(,)28 b(but)f(as)f(sour)o(ce)h +(code)g(to)g(be)g(executed)e(by)i(some)h(interpr)o(eter)-6 +b(.)43 b(The)365 4400 y(interpr)o(eter)22 b(to)i(use)f(is)h +(speci\002ed)f(immediately)g(after)f(the)i(\223)p FA(#!)p +FD(\224)d(sequence)j(on)g(the)f(\002rst)365 4500 y(line)29 +b(of)f(the)g(sour)o(ce)g(\002le)g(\(along)g(with)h(one)f(optional)h +(initial)g(ar)o(gument\).)47 b(The)28 b(kernel)365 4599 +y(r)o(eads)20 b(in)i(the)g(name)f(of)h(the)g(interpr)o(eter)-6 +b(,)20 b(and)h(executes)f(that)i(instead.)27 b(The)22 +b(interpr)o(eter)365 4699 y(is)e(passed)f(the)g(sour)o(ce)g(\002lename) +g(as)g(its)h(\002rst)g(ar)o(gument,)e(with)j(the)e(original)h(ar)o +(guments)365 4799 y(following.)30 b(Consult)22 b(the)g(Unix)f(man)h +(page)f(for)g(the)g FA(exec)f FD(system)i(call)g(for)f(mor)o(e)g(infor) +o(-)365 4898 y(mation.)1735 5147 y(159)p eop +%%Page: 160 168 +160 167 bop 805 614 a FD(Scsh)30 b(allows)f(Scheme)g(pr)o(ograms)g(to)h +(have)f(these)g(triggers)g(placed)f(on)i(their)g(\002rst)681 +714 y(line.)48 b(Scsh)29 b(tr)o(eats)e(the)i(character)d(sequence)j +(\223)p FA(#!)p FD(\224)e(as)h(a)f(block-comment)j(sequence,)3512 +684 y Fs(1)681 814 y FD(and)41 b(skips)h(all)f(following)i(characters)d +(until)j(it)e(r)o(eads)f(the)i(comment-terminating)681 +913 y(sequence)33 b(newline/exclamation-point/sharp-sign/newline)k(\()p +FC(i.e.)o FD(,)f(the)e(sequence)681 1013 y(\223)p FA(!#)p +FD(\224)19 b(occurring)i(on)g(its)g(own)h(line\).)805 +1144 y(In)f(this)h(way)-9 b(,)20 b(the)h(pr)o(ogrammer)f(can)g(arrange) +g(for)g(an)h(initial)888 1345 y FA(#!/usr/local/bin/)o(sc)o(sh)37 +b(-s)888 1444 y(!#)681 1645 y FD(header)30 b(appearing)h(in)g(a)g +(Scheme)g(pr)o(ogram)g(to)h(be)f(ignor)o(ed)g(when)h(the)g(pr)o(ogram)f +(is)681 1745 y(loaded)20 b(into)h(scsh.)681 2012 y FB(10.1.3)80 +b(Module)20 b(system)681 2203 y FD(Scsh)d(uses)h(the)f(Scheme)g(48)g +(module)g(system,)i(which)f(de\002nes)g FC(packages)p +FD(,)e FC(structur)o(es)p FD(,)i(and)681 2303 y FC(interfaces)p +FD(.)681 2504 y FB(Package)39 b FD(A)25 b(package)g(is)g(an)h(envir)o +(onment\227that)g(is,)h(a)d(set)i(of)f(variable/value)f(bind-)888 +2603 y(ings.)h(Y)-8 b(ou)18 b(can)e(evaluate)f(Scheme)h(forms)g(inside) +h(a)f(package,)g(or)g(load)g(a)g(\002le)g(into)i(a)888 +2703 y(package.)24 b(Packages)17 b(export)g(sets)h(of)g(bindings;)i +(these)e(sets)g(ar)o(e)e(called)h FC(structur)o(es)p +FD(.)681 2877 y FB(Structure)40 b FD(A)20 b(str)o(uctur)o(e)g(is)g(a)g +(named)g(view)h(on)g(a)f(package\227a)f(set)h(of)h(bindings.)26 +b(Other)888 2977 y(packages)15 b(can)h FC(open)g FD(the)g(str)o(uctur)o +(e,)h(importing)g(its)f(bindings)h(into)g(their)f(envir)o(on-)888 +3076 y(ment.)28 b(Packages)21 b(can)g(pr)o(ovide)g(mor)o(e)g(than)h +(one)g(str)o(uctur)o(e,)f(r)o(evealing)f(dif)o(fer)o(ent)888 +3176 y(portions)i(of)f(the)g(package's)f(envir)o(onment.)681 +3350 y FB(Interface)40 b FD(An)28 b(interface)g(is)g(the)h +(\223type\224)e(of)i(a)f(str)o(uctur)o(e.)48 b(An)28 +b(interface)f(is)i(the)g(set)f(of)888 3450 y(names)i(exported)e(by)h(a) +g(str)o(uctur)o(e.)50 b(These)29 b(names)h(can)f(also)g(be)g(marked)f +(with)888 3549 y(other)22 b(static)f(information)h(\()p +FC(e.g.)o FD(,)g(advisory)f(type)g(declarations,)g(or)g(syntax)h(infor) +o(-)888 3649 y(mation\).)681 3850 y(Mor)o(e)c(information)i(on)f(the)h +(the)f(Scheme)f(48)g(module)i(system)g(can)e(be)h(found)g(in)h(the)f +(\002le)681 3950 y FA(module.ps)e FD(in)k(the)g FA(doc)e +FD(dir)o(ectory)h(of)h(the)g(Scheme)f(48)g(and)g(scsh)i(r)o(eleases.) +805 4081 y(Pr)o(ogramming)34 b(Scheme)e(with)i(a)e(module)h(system)h +(is)f(dif)o(fer)o(ent)e(fr)o(om)h(pr)o(ogram-)681 4180 +y(ming)19 b(in)g(older)f(Scheme)g(implementations,)i(and)e(the)g +(associated)g(development)g(pr)o(ob-)681 4280 y(lems)35 +b(ar)o(e)e(consequently)k(dif)o(fer)o(ent.)65 b(In)36 +b(Schemes)e(that)h(lack)g(modular)f(abstraction)681 4379 +y(mechanisms,)25 b(everything)g(is)g(accessible;)g(the)f(major)g(pr)o +(oblem)g(is)h(pr)o(eventing)e(name-)681 4479 y(space)e(con\003icts.)32 +b(In)23 b(Scheme)f(48,)g(name-space)f(con\003icts)j(vanish;)f(the)g +(major)f(pr)o(oblem)681 4579 y(is)29 b(that)g(not)g(all)g(bindings)g +(ar)o(e)e(accessible)i(fr)o(om)f(every)g(place.)49 b(It)28 +b(takes)h(a)f(little)h(extra)681 4678 y(work)21 b(to)g(specify)g(what)g +(packages)e(export)i(which)g(values.)p 681 4740 1146 +4 v 771 4796 a Fr(1)800 4819 y Fv(Why)c(a)g(block-comment)g(instead)f +(of)h(an)f(end-of-line)h(delimited)f(comment?)k(See)c(the)g(section)h +(on)g(meta-)681 4898 y(ar)o(gs.)2051 5147 y FD(160)p eop -%%Page: 161 167 -161 166 bop 365 614 a FA(string->char-set)p FD(,)14 b(108)365 -714 y FA(string-filter)p FD(,)h(20)365 814 y FA(string-match)p -FD(,)h(98)365 914 y FA(string-output-por)o(t-)o(out)o(pu)o(t)p -FD(,)e(26)365 1014 y FA(substitute-env-va)o(rs)o FD(,)h(102)365 -1114 y FA(suffix-splitter)p FD(,)g(1)-5 b(15)365 1214 -y FA(suspend)p FD(,)18 b(53)365 1314 y FA(sync-file)p -FD(,)f(41)365 1414 y FA(sync-file-system)p FD(,)d(41)365 -1514 y FA(system-name)p FD(,)i(63)365 1701 y FA(tell)p -FD(,)j(31)365 1801 y FA(temp-file-channel)o FD(,)c(50)365 -1901 y FA(temp-file-iterate)o FD(,)g(49)365 2001 y FA(ticks/sec)p -FD(,)i(69)365 2101 y(time,)k(68)365 2201 y FA(time)p -FD(,)e(70)365 2301 y FA(time+ticks)p FD(,)e(69)365 2401 -y FA(truncate-file)p FD(,)e(41)365 2500 y FA(tty-file-name)p -FD(,)g(77)365 2600 y FA(tty-info)p FD(,)i(80)365 2700 -y(tty-info)k(r)o(ecor)o(d)e(type,)i(77)365 2800 y FA(tty-info:control-) -o(ch)o(ars)o FD(,)15 b(77)365 2900 y FA(tty-info:control-)o(fl)o(ags)o -FD(,)g(77)365 3000 y FA(tty-info:input-fl)o(ag)o(s)p -FD(,)g(77)365 3100 y FA(tty-info:input-sp)o(ee)o(d)p -FD(,)g(77)365 3200 y FA(tty-info:local-fl)o(ag)o(s)p -FD(,)g(77)365 3300 y FA(tty-info:min)p FD(,)h(77)365 -3400 y FA(tty-info:output-f)o(la)o(gs)p FD(,)e(77)365 -3500 y FA(tty-info:output-s)o(pe)o(ed)p FD(,)g(77)365 -3599 y FA(tty-info:time)p FD(,)h(77)365 3699 y FA(tty-info?)p -FD(,)i(77)365 3799 y FA(tty-name->pty-nam)o(e)p FD(,)d(82)365 -3899 y FA(tty-process-group)o FD(,)h(82)365 3999 y FA(tty?)p -FD(,)k(77)365 4099 y FA(ttyc/2-stop-bits)p FD(,)14 b(87)365 -4199 y FA(ttyc/carrier-flow)o(-c)o(tl)p FD(,)g(87)365 -4299 y FA(ttyc/char-size)p FD(,)h(87)365 4399 y FA(ttyc/char-size5)p -FD(,)g(87)365 4499 y FA(ttyc/char-size6)p FD(,)g(87)365 -4599 y FA(ttyc/char-size7)p FD(,)g(87)365 4698 y FA(ttyc/char-size8)p -FD(,)g(87)365 4798 y FA(ttyc/CTS-output-f)o(lo)o(w-c)o(tl)o -FD(,)g(87)365 4898 y FA(ttyc/enable-parit)o(y)p FD(,)f(87)1943 -614 y FA(ttyc/enable-read)o FD(,)h(87)1943 714 y FA(ttyc/hup-on-clos)o -(e)p FD(,)f(87)1943 814 y FA(ttyc/ignore-flag)o(s)p FD(,)g(87)1943 -913 y FA(ttyc/no-modem-sy)o(nc)o FD(,)h(87)1943 1013 -y FA(ttyc/odd-parity)p FD(,)f(87)1943 1112 y FA(ttyc/RTS-input-f)o(lo)o -(w-)o(ctl)o FD(,)h(87)1943 1212 y FA(ttychar/delayed-)o(su)o(sp)o(end)o -FD(,)g(84)1943 1312 y FA(ttychar/delete-c)o(ha)o(r)p -FD(,)f(84)1943 1411 y FA(ttychar/delete-l)o(in)o(e)p -FD(,)g(84)1943 1511 y FA(ttychar/delete-w)o(or)o(d)p -FD(,)g(84)1943 1611 y FA(ttychar/discard)p FD(,)g(84)1943 -1710 y FA(ttychar/eof)p FD(,)i(84)1943 1810 y FA(ttychar/eol)p -FD(,)g(84)1943 1910 y FA(ttychar/eol2)p FD(,)f(84)1943 -2009 y FA(ttychar/interrup)o(t)p FD(,)f(84)1943 2109 -y FA(ttychar/literal-)o(ne)o(xt)o FD(,)h(84)1943 2208 -y FA(ttychar/quit)p FD(,)g(84)1943 2308 y FA(ttychar/reprint)p -FD(,)f(84)1943 2408 y FA(ttychar/start)p FD(,)h(84)1943 -2507 y FA(ttychar/status)p FD(,)f(84)1943 2607 y FA(ttychar/stop)p -FD(,)h(84)1943 2707 y FA(ttychar/suspend)p FD(,)f(84)1943 -2806 y FA(ttyin/7bits)p FD(,)i(85)1943 2906 y FA(ttyin/beep-on-ov)o(er) -o(fl)o(ow)p FD(,)e(85)1943 3005 y FA(ttyin/check-pari)o(ty)o -FD(,)h(85)1943 3105 y FA(ttyin/cr->nl)p FD(,)g(85)1943 -3205 y FA(ttyin/ignore-bad)o(-p)o(ar)o(ity)o(-c)o(har)o(s)p -FD(,)2275 3304 y(85)1943 3404 y FA(ttyin/ignore-bre)o(ak)o -FD(,)g(85)1943 3504 y FA(ttyin/ignore-cr)p FD(,)f(85)1943 -3603 y FA(ttyin/input-flow)o(-c)o(tl)o FD(,)h(85)1943 -3703 y FA(ttyin/interrupt-)o(on)o(-b)o(rea)o(k)p FD(,)f(85)1943 -3802 y FA(ttyin/lowercase)p FD(,)g(85)1943 3902 y FA(ttyin/mark-parit)o -(y-)o(er)o(ror)o(s)p FD(,)g(85)1943 4002 y FA(ttyin/nl->cr)p -FD(,)h(85)1943 4101 y FA(ttyin/output-flo)o(w-)o(ct)o(l)p -FD(,)g(85)1943 4201 y FA(ttyin/xon-any)p FD(,)g(85)1943 -4301 y FA(ttyl/alt-delete-)o(wo)o(rd)o FD(,)g(88)1943 -4400 y FA(ttyl/canonical)p FD(,)f(88)1943 4500 y FA(ttyl/case-map)p -FD(,)h(88)1943 4599 y FA(ttyl/echo)p FD(,)i(88)1943 4699 -y FA(ttyl/echo-ctl)p FD(,)e(88)1943 4799 y FA(ttyl/echo-delete)o(-l)o -(in)o(e)p FD(,)g(88)1943 4898 y FA(ttyl/echo-nl)p FD(,)g(88)1735 -5147 y(161)p eop -%%Page: 162 168 -162 167 bop 681 614 a FA(ttyl/enable-sign)o(al)o(s)p -FD(,)14 b(88)681 716 y FA(ttyl/extended)p FD(,)h(88)681 -818 y FA(ttyl/flush-outpu)o(t)p FD(,)f(88)681 920 y FA -(ttyl/hardcopy-de)o(le)o(te)p FD(,)g(88)681 1022 y FA(ttyl/no-flush-on) -o(-i)o(nte)o(rr)o(up)o(t)p FD(,)h(88)681 1124 y FA(ttyl/no-kernel-s)o -(ta)o(tus)o FD(,)g(88)681 1226 y FA(ttyl/reprint-unr)o(ea)o(d-c)o(ha)o -(rs)o FD(,)g(88)681 1328 y FA(ttyl/ttou-signal)o FD(,)g(88)681 -1430 y FA(ttyl/visual-dele)o(te)o FD(,)g(88)681 1532 -y FA(ttyl/visual-dele)o(te)o(-li)o(ne)o FD(,)g(88)681 -1634 y FA(ttyout/all-delay)o FD(,)g(86)681 1736 y FA(ttyout/bs-delay)p -FD(,)f(86)681 1838 y FA(ttyout/bs-delay0)o FD(,)h(86)681 -1940 y FA(ttyout/bs-delay1)o FD(,)g(86)681 2042 y FA(ttyout/cr->nl)p -FD(,)g(85)681 2144 y FA(ttyout/cr-delay)p FD(,)f(86)681 -2246 y FA(ttyout/cr-delay0)o FD(,)h(86)681 2348 y FA(ttyout/cr-delay1)o -FD(,)g(86)681 2450 y FA(ttyout/cr-delay2)o FD(,)g(86)681 -2552 y FA(ttyout/cr-delay3)o FD(,)g(86)681 2654 y FA(ttyout/delay-w/f)o -(il)o(l-c)o(ha)o(r)p FD(,)f(85)681 2756 y FA(ttyout/discard-e)o(ot)o -FD(,)h(85)681 2858 y FA(ttyout/enable)p FD(,)g(85)681 -2960 y FA(ttyout/expand-ta)o(bs)o FD(,)g(85)681 3062 -y FA(ttyout/ff-delay)p FD(,)f(86)681 3164 y FA(ttyout/ff-delay0)o -FD(,)h(86)681 3266 y FA(ttyout/ff-delay1)o FD(,)g(86)681 -3368 y FA(ttyout/fill-w/de)o(l)p FD(,)f(85)681 3470 y -FA(ttyout/nl->crnl)p FD(,)g(85)681 3572 y FA(ttyout/nl-delay)p -FD(,)g(86)681 3674 y FA(ttyout/nl-delay0)o FD(,)h(86)681 -3776 y FA(ttyout/nl-delay1)o FD(,)g(86)681 3878 y FA(ttyout/nl-does-c)o -(r)p FD(,)f(85)681 3980 y FA(ttyout/no-col0-c)o(r)p FD(,)g(85)681 -4082 y FA(ttyout/tab-delay)o FD(,)h(86)681 4184 y FA(ttyout/tab-delay)o -(0)p FD(,)f(86)681 4286 y FA(ttyout/tab-delay)o(1)p FD(,)g(86)681 -4388 y FA(ttyout/tab-delay)o(2)p FD(,)g(86)681 4490 y -FA(ttyout/tab-delay)o(x)p FD(,)g(86)681 4592 y FA(ttyout/uppercase)o -FD(,)h(85)681 4694 y FA(ttyout/vtab-dela)o(y)p FD(,)f(86)681 -4796 y FA(ttyout/vtab-dela)o(y0)o FD(,)h(86)681 4898 -y FA(ttyout/vtab-dela)o(y1)o FD(,)g(86)2258 614 y FA(umask)p -FD(,)k(59)2258 714 y FA(unix-address->soc)o(ke)o(t-a)o(dd)o(re)o(ss)p -FD(,)2590 814 y(92)2258 914 y FA(unlock-region)p FD(,)c(39)2258 -1014 y FA(user-effective-gi)o(d)p FD(,)f(60)2258 1114 -y FA(user-effective-ui)o(d)p FD(,)g(60)2258 1214 y FA(user-gid)p -FD(,)j(60)2258 1313 y(user)o(-info,)j(61)2258 1413 y -FA(user-info)p FD(,)d(61)2258 1513 y(user)o(-info:gid,)j(61)2258 -1613 y(user)o(-info:home-dir)-6 b(,)20 b(61)2258 1713 -y(user)o(-info:name,)g(61)2258 1813 y(user)o(-info:shell,)g(61)2258 -1913 y(user)o(-info:uid,)g(61)2258 2013 y FA(user-login-name)p -FD(,)15 b(60)2258 2113 y FA(user-supplementar)o(y-)o(gid)o(s)p -FD(,)f(60)2258 2213 y FA(user-uid)p FD(,)j(60)2258 2400 -y FA(wait)p FD(,)i(57)2258 2500 y FA(wait-any)p FD(,)e(57)2258 -2600 y FA(wait-process-grou)o(p)p FD(,)d(58)2258 2700 +%%Page: 161 169 +161 168 bop 490 614 a FD(It)19 b(may)h(take)f(you)h(a)f(little)h(while) +h(to)f(get)f(used)h(to)g(the)f(new)h(style)g(of)g(pr)o(ogram)f(devel-) +365 714 y(opment.)26 b(Although)c(scsh)f(can)f(be)h(used)f(without)i(r) +o(eferring)d(to)i(the)g(module)g(system)g(at)365 814 +y(all,)k(we)g(r)o(ecommend)f(taking)h(the)f(time)h(to)g(learn)f(and)g +(use)h(it.)37 b(The)24 b(ef)o(fort)f(will)i(pay)f(of)o(f)365 +913 y(in)e(the)e(constr)o(uction)j(of)e(modular)-6 b(,)20 +b(factorable)f(pr)o(ograms.)365 1384 y FB(Module)h(warning)365 +1680 y FD(Pr)o(ogrammers)35 b(who)h(open)f(both)h(the)f +FA(scheme)e FD(and)i FA(scsh)e FD(str)o(uctur)o(es)i(in)g(their)h(own) +365 1780 y(packages)20 b(should)i(make)e(sur)o(e)g(to)h(always)g(put)g +(the)g FA(scsh)e FD(r)o(efer)o(ence)f(\002rst.)415 2192 +y(Do)j(this:)1185 b(Not)21 b(this:)498 2279 y FA(\(define-structure)37 +b(web-server)585 2344 y(\(open)42 b(scsh)847 2413 y(scheme)847 +2464 y(net-hax)847 2524 y(.)847 2557 y(.)847 2590 y(.)o(\))585 +2655 y(\(file)g(web\)\))1968 2279 y(\(define-structu)o(re)37 +b(web-server)2055 2344 y(\(open)k(scheme)2316 2413 y(scsh)2316 +2464 y(net-hax)2316 2524 y(.)2316 2557 y(.)2316 2590 +y(.\))2055 2655 y(\(file)g(web\)\))415 2755 y FD(Open)21 +b FA(scsh)e FD(befor)o(e)h FA(scheme)p FD(.)515 b(Not)21 +b FA(scsh)e FD(after)g FA(scheme)p FD(.)365 3088 y(Or)o(dering)24 +b(the)g(two)g(packages)f(like)h(this)h(is)f(necessary)f(because)g(scsh) +i(overrides)e(some)365 3187 y(of)c(the)h(standar)o(d)d(R4RS)j(Scheme)e +(de\002nitions)j(exported)d(by)i(the)f FA(scheme)e FD(package)h(with) +365 3287 y(its)30 b(own)h(de\002nitions.)54 b(For)30 +b(example,)h(scsh's)g(versions)f(of)g(the)g(R4RS)f(I/O)i(functions)365 +3387 y(such)25 b(as)f FA(display)e FD(and)h FA(write)g +FD(take)h(integer)g(\002le)g(descriptors)g(as)h(ar)o(guments,)f(as)g +(well)365 3486 y(as)j(Scheme)f(ports.)44 b(If)27 b(you)g(open)g(the)g +FA(scheme)d FD(str)o(uctur)o(e)j(befor)o(e)e(the)i FA(scsh)e +FD(str)o(uctur)o(e,)365 3586 y(you'll)d(get)f(the)g(standar)o(d)e +(Scheme)h(48)g(de\002nitions,)i(which)f(is)g(not)h(what)f(you)g(want.) +365 4057 y FB(10.1.4)81 b(Switches)365 4353 y FD(The)21 +b(scsh)g(top-level)g(takes)f(command-line)h(switches)h(in)f(the)g +(following)h(format:)573 4626 y FA(scsh)42 b([)p FC(meta-ar)o(g)n +FA(])h([)p FC(switch)1482 4638 y Fp(i)1553 4626 y FA(...])f([)p +FC(end-option)g(ar)o(g)2327 4653 y Fx(1)2408 4626 y FA(...)g +FC(ar)o(g)2691 4653 y Fp(n)2736 4626 y FA(])365 4898 +y FD(wher)o(e)1735 5147 y(161)p eop +%%Page: 162 170 +162 169 bop 938 692 a FC(meta-ar)o(g:)159 b FA(\\)21 +b FC(script-\002le-name)938 892 y(switch:)240 b FA(-e)20 +b FC(entry-point)405 b FD(Specify)20 b(top-level)g(entry-point.)1418 +991 y FA(-o)g FC(structur)o(e)480 b FD(Open)21 b(str)o(uctur)o(e)f(in)h +(curr)o(ent)f(package.)1418 1091 y FA(-m)g FC(structur)o(e)480 +b FD(Switch)21 b(to)g(package.)1418 1191 y FA(-n)f FC(new-package)362 +b FD(Switch)21 b(to)g(new)g(package.)1418 1390 y FA(-lm)f +FC(module-\002le-name)165 b FD(Load)20 b(module)h(into)h(con\002g)f +(package.)1418 1489 y FA(-l)f FC(\002le-name)482 b FD(Load)20 +b(\002le)h(into)g(curr)o(ent)f(package.)1418 1589 y FA(-dm)765 +b FD(Do)21 b(script)g(module.)1418 1689 y FA(-ds)765 +b FD(Do)21 b(script.)938 1888 y FC(end-option:)98 b FA(-s)20 +b FC(script)1418 1988 y FA(-sfd)f FC(num)1418 2087 y +FA(-c)h FC(exp)1418 2187 y FA(--)681 2354 y FD(These)29 +b(command-line)g(switches)h(essentially)f(pr)o(ovide)f(a)h(little)g +(linker)h(language)e(for)681 2453 y(linking)34 b(a)f(shell)g(script)g +(or)h(a)e(pr)o(ogram)g(together)i(with)g(Scheme)e(48)g(modules.)63 +b(The)681 2553 y(command-line)23 b(pr)o(ocessor)f(serially)h(opens)g +(str)o(uctur)o(es)f(and)g(loads)h(code)f(into)i(a)e(given)681 +2653 y(package.)40 b(Switches)26 b(that)g(side-ef)o(fect)e(a)h(package) +g(operate)g(on)i(a)e(particular)g(\223curr)o(en-)681 +2752 y(t\224)k(package;)k(ther)o(e)c(ar)o(e)g(switches)h(to)h(change)e +(this)i(package.)52 b(\(These)29 b(switches)i(pr)o(o-)681 +2852 y(vide)18 b(functionality)h(equivalent)g(to)g(the)f(interactive)g +FA(,open)e(,load)h(,in)g FD(and)h FA(,new)f FD(com-)681 +2951 y(mands.\))56 b(Except)31 b(wher)o(e)g(indicated,)h(switches)h +(specify)d(actions)i(that)f(ar)o(e)f(executed)681 3051 +y(in)25 b(a)f(left-to-right)g(or)o(der)-6 b(.)36 b(The)25 +b(initial)g(curr)o(ent)e(package)h(is)h(the)g(user)f(package,)g(which) +681 3151 y(is)29 b(completely)g(empty)f(and)g(opens)h(\(imports)g(the)g +(bindings)g(of\))f(the)h(R4RS)f(and)g(scsh)681 3250 y(str)o(uctur)o +(es.)805 3393 y(If)21 b(the)g(Scheme)g(pr)o(ocess)g(is)g(started)f(up)h +(in)h(an)f(interactive)f(mode,)h(then)h(the)f(curr)o(en-)681 +3493 y(t)29 b(package)g(in)h(for)o(ce)f(at)g(the)h(end)f(of)h(switch)g +(scanning)h(is)f(the)f(one)h(inside)g(which)h(the)681 +3593 y(interactive)20 b(r)o(ead-eval-print)e(loop)j(is)g(started.)805 +3736 y(The)g(command-line)f(switch)h(pr)o(ocessor)f(works)h(in)g(two)g +(passes:)k(it)c(\002rst)f(parses)g(the)681 3836 y(switches,)26 +b(building)f(a)f(list)g(of)h(actions)g(to)f(perform,)h(then)g(the)f +(actions)h(ar)o(e)e(performed)681 3935 y(serially)-9 +b(.)48 b(The)28 b(switch)i(list)f(is)f(terminated)g(by)h(one)g(of)f +(the)h FC(end-option)e FD(switches.)49 b(The)681 4035 +y FC(ar)o(g)790 4062 y Fp(i)835 4035 y FD(ar)o(guments)18 +b(occurring)g(after)e(an)i(end-option)g(switch)h(ar)o(e)d(passed)h(to)i +(the)f(scsh)g(pr)o(o-)681 4134 y(gram)j(as)f(the)i(value)e(of)h +FA(command-line-argu)o(me)o(nts)14 b FD(and)21 b(the)g(tail)g(of)g(the) +h(list)f(r)o(eturned)681 4234 y(by)i FA(\(command-line\))p +FD(.)k(That)c(is,)h(an)f FC(end-option)f FD(switch)i(separates)e +(switches)i(that)f(con-)681 4334 y(tr)o(ol)30 b(the)g(scsh)h +(\223machine\224)f(fr)o(om)g(the)g(actual)g(ar)o(guments)g(being)h +(passed)e(to)i(the)f(scsh)681 4433 y(pr)o(ogram)20 b(that)h(r)o(uns)g +(on)g(that)g(machine.)805 4577 y(The)g(following)h(switches)g(and)e +(end)h(options)h(ar)o(e)d(de\002ned:)805 4799 y Fw(\017)41 +b FA(-o)i FC(struct)888 4898 y FD(Open)21 b(the)g(str)o(uctur)o(e)f(in) +i(the)f(curr)o(ent)f(package.)2051 5147 y(162)p eop +%%Page: 163 171 +163 170 bop 490 614 a Fw(\017)41 b FA(-n)i FC(package)573 +714 y FD(Make)20 b(and)h(enter)g(a)f(new)i(package.)j(The)c(package)f +(has)i(an)f(associated)f(str)o(uctur)o(e)573 814 y(named)g +FC(package)f FD(with)i(an)f(empty)h(export)f(list.)26 +b(If)20 b FC(package)f FD(is)h(the)h(string)g(\223)p +FA(#f)p FD(\224,)d(the)573 913 y(new)j(package)f(is)h(anonmyous,)h +(with)f(no)h(associated)e(named)g(str)o(uctur)o(e.)573 +1044 y(The)25 b(new)g(package)f(initially)i(opens)g(no)g(other)f(str)o +(uctur)o(es,)h(not)f(even)g(the)h(R4RS)573 1143 y(bindings.)f(Y)-8 +b(ou)18 b(must)g(follow)g(a)f(\223)p FA(-n)42 b(foo)p +FD(\224)16 b(switch)i(with)g(\223)p FA(-o)42 b(scheme)p +FD(\224)15 b(to)i(access)573 1243 y(the)k(standar)o(d)e(identi\002ers)i +(such)g(as)f FA(car)g FD(and)g FA(define)p FD(.)490 1404 +y Fw(\017)41 b FA(-m)i FC(struct)573 1503 y FD(Change)27 +b(the)f(curr)o(ent)g(package)g(to)h(the)g(package)e(underlying)j(str)o +(uctur)o(e)e FC(struct)p FD(.)573 1603 y(\(The)20 b FA(-m)g +FD(stands)h(for)f(\223module.\224\))490 1764 y Fw(\017)41 +b FA(-lm)h FC(module-\002le-name)573 1864 y FD(Load)20 +b(the)i(speci\002ed)f(\002le)g(into)h(scsh's)h(con\002g)f(package)e +(\227)h(the)h(\002le)f(must)h(contain)573 1963 y(sour)o(ce)17 +b(written)i(in)g(the)f(Scheme)g(48)f(module)h(language)g(\(\223load)f +(module\224\).)24 b(Does)573 2063 y(not)d(alter)f(the)h(curr)o(ent)f +(package.)490 2224 y Fw(\017)41 b FA(-l)i FC(\002le-name)573 +2323 y FD(Load)20 b(the)h(speci\002ed)f(\002le)h(into)h(the)f(curr)o +(ent)f(package.)490 2484 y Fw(\017)41 b FA(-c)i FC(exp)573 +2584 y FD(Evaluate)28 b(expr)o(ession)h FC(exp)f FD(in)i(the)f(curr)o +(ent)f(package)g(and)h(exit.)50 b(This)30 b(is)f(called)573 +2684 y FA(-c)c FD(after)g(a)h(common)h(shell)g(convention)h(\(see)d(sh) +i(and)e(csh\).)42 b(The)26 b(expr)o(ession)g(is)573 2783 +y(evaluated)f(in)i(the)f(the)h(curr)o(ent)e(package)g(\(and)h(hence)g +(is)h(af)o(fected)d(by)i FA(-m)p FD('s)g(and)573 2883 +y FA(-n)p FD('s.\))573 3013 y(When)21 b(the)g(scsh)h(top-level)f +(constr)o(ucts)h(the)f(scsh)h(command-line)f(in)g(this)h(case,)e(it)573 +3113 y(takes)j FA("scsh")e FD(to)i(be)g(the)h(pr)o(ogram)e(name.)33 +b(This)24 b(switch)g(terminates)f(ar)o(gument)573 3212 +y(scanning;)e(following)h(ar)o(gs)e(become)h(the)g(tail)g(of)f(the)h +(command-line)g(list.)490 3373 y Fw(\017)41 b FA(-e)i +FC(entry-point)573 3473 y FD(Specify)27 b(an)h(entry)g(point)h(for)f(a) +g(pr)o(ogram.)47 b(The)28 b FC(entry-point)f FD(is)i(a)f(variable)f +(that)573 3573 y(is)i(taken)f(fr)o(om)h(the)f(curr)o(ent)g(package)g +(in)h(for)o(ce)e(at)i(the)f(end)h(of)f(switch)i(evalua-)573 +3672 y(tion.)43 b(The)26 b(entry)h(point)g(does)g(not)g(have)f(to)g(be) +g(exported)g(by)g(the)h(package)e(in)i(a)573 3772 y(str)o(uctur)o(e;)18 +b(it)g(can)g(be)g(internal)g(to)h(the)f(package.)23 b(The)c(top)f +(level)g(passes)g(contr)o(ol)g(to)573 3871 y(the)23 b(entry)g(point)g +(by)g(applying)g(it)g(to)g(the)g(command-line)h(list)f(\(so)g(pr)o +(ograms)f(ex-)573 3971 y(ecuting)d(in)h(private)e(packages)h(can)f(r)o +(efer)o(ence)f(their)i(command-line)h(ar)o(guments)573 +4071 y(without)25 b(opening)h(the)e FA(scsh)f FD(package)g(to)h(access) +g(the)g FA(\(command-line\))19 b FD(pr)o(oce-)573 4170 +y(dur)o(e\).)k(Note)d(that,)f(like)g(the)g(list)h(r)o(eturned)e(by)h +(the)g FA(\(command-line\))14 b FD(pr)o(ocedur)o(e,)573 +4270 y(the)20 b(list)h(passed)e(to)i(the)f(entry)h(point)f(includes)h +(the)f(name)g(of)g(the)h(pr)o(ogram)e(being)573 4370 +y(executed)28 b(\(as)g(the)h(\002rst)g(element)g(of)g(the)g(list\),)i +(not)f(just)f(the)g(ar)o(guments)g(to)g(the)573 4469 +y(pr)o(ogram.)573 4599 y(A)21 b FA(-e)f FD(switch)i(can)f(occur)g +(anywher)o(e)g(in)h(the)f(switch)h(list,)g(but)g(it)f(is)h(the)f +FC(last)g FD(action)573 4699 y(performed)j(by)i(switch)h(scanning)f(if) +f(it)h(occurs.)40 b(\(W)-8 b(e)26 b(violate)f(or)o(dering)g(her)o(e)g +(as)573 4799 y(the)30 b(shell-script)h FA(#!)e FD(mechanism)i(pr)o +(events)f(you)g(fr)o(om)g(putting)h(the)g FC(-e)f FD(switch)573 +4898 y(last,)20 b(wher)o(e)g(it)h(belongs.\))1735 5147 +y(163)p eop +%%Page: 164 172 +164 171 bop 805 614 a Fw(\017)41 b FA(-s)i FC(script)888 +714 y FD(Specify)29 b(a)g(\002le)g(to)h(load.)52 b(A)29 +b FA(-ds)f FD(\(do-script\))g(or)i FA(-dm)e FD(\(do-module\))h(switch)h +(oc-)888 814 y(curring)c(earlier)f(in)h(the)g(switch)h(list)f(gives)g +(the)g(place)f(wher)o(e)g(the)h(script)f(should)888 913 +y(be)j(loaded.)46 b(If)27 b(ther)o(e)g(is)h(no)g FA(-ds)f +FD(or)h FA(-dm)e FD(switch,)k(then)f(the)f(script)f(is)h(loaded)f(at) +888 1013 y(the)d(end)f(of)h(switch)g(scanning,)h(into)g(the)f(module)g +(that)f(is)h(curr)o(ent)f(at)g(the)h(end)f(of)888 1112 +y(switch)f(scanning.)888 1243 y(W)-8 b(e)17 b(use)f(the)h +FA(-ds)e FD(switch)i(to)g(violate)f(left-to-right)h(switch)g(execution) +f(or)o(der)g(as)g(the)888 1343 y FA(-s)h FD(switch)h(is)g +FC(r)o(equir)o(ed)g FD(to)f(be)h(last)f(\(because)f(of)h(the)h +FA(#!)f FD(machinery\),)g(independent)888 1443 y(of)k(when/wher)o(e)g +(in)g(the)g(switch-pr)o(ocessing)h(or)o(der)d(it)i(should)h(be)e +(loaded.)888 1574 y(When)29 b(the)f(scsh)h(top-level)f(constr)o(ucts)h +(the)g(scsh)g(command-line)f(in)h(this)g(case,)888 1673 +y(it)k(takes)e FC(script)h FD(to)g(be)g(the)g(pr)o(ogram)f(name.)59 +b(This)33 b(switch)f(terminates)g(switch)888 1773 y(parsing;)19 +b(following)i(ar)o(gs)c(ar)o(e)h(ignor)o(ed)g(by)h(the)f +(switch-scanner)h(and)g(ar)o(e)e(passed)888 1872 y(thr)o(ough)22 +b(to)f(the)g(pr)o(ogram)f(as)g(the)h(tail)g(of)f(the)h(command-line)h +(list.)805 2035 y Fw(\017)41 b FA(-sfd)h FC(num)888 2134 +y FD(Loads)36 b(the)h(script)f(fr)o(om)g(\002le)h(descriptor)f +FC(num)o FD(.)73 b(This)37 b(switch)g(is)g(like)f(the)h +FA(-s)888 2234 y FD(switch,)25 b(except)d(that)i(the)f(script)g(is)h +(loaded)e(fr)o(om)h(one)h(of)f(the)g(pr)o(ocess')g(open)h(in-)888 +2333 y(put)18 b(\002le)g(descriptors.)24 b(For)18 b(example,)g(to)g +(have)f(the)h(script)f(loaded)g(fr)o(om)h(standar)o(d)888 +2433 y(input,)j(specify)g FA(-sfd)42 b(0)p FD(.)805 2595 +y Fw(\017)f FA(--)888 2695 y FD(T)-8 b(erminate)39 b(ar)o(gument)g +(scanning)g(and)g(start)f(up)h(scsh)h(in)f(interactive)f(mode.)888 +2794 y(If)e(the)g(ar)o(gument)f(list)i(just)f(r)o(uns)h(out,)j(without) +d(either)f(a)f(terminating)i FA(-s)e FD(or)888 2894 y +FA(--)k FD(ar)o(g,)j(then)e(scsh)g(also)f(starts)g(up)h(in)f +(interactive)g(mode,)44 b(with)c(an)f(empty)888 2994 +y FA(command-line-argu)o(me)o(nts)28 b FD(list)35 b(\(for)e(example,)k +(simply)e(entering)g FA(scsh)e FD(at)h(a)888 3093 y(shell)22 +b(pr)o(ompt)e(with)i(no)f(ar)o(gs)f(at)g(all\).)888 3224 +y(When)29 b(the)f(scsh)h(top-level)f(constr)o(ucts)h(the)g(scsh)g +(command-line)f(in)h(this)g(case,)888 3324 y(it)e(takes)f +FA("scsh")e FD(to)j(be)f(the)h(pr)o(ogram)f(name.)42 +b(This)27 b(switch)h(terminates)e(switch)888 3423 y(parsing;)19 +b(following)i(ar)o(gs)c(ar)o(e)h(ignor)o(ed)g(by)h(the)f +(switch-scanner)h(and)g(ar)o(e)e(passed)888 3523 y(thr)o(ough)22 +b(to)f(the)g(pr)o(ogram)f(as)g(the)h(tail)g(of)f(the)h(command-line)h +(list.)805 3685 y Fw(\017)41 b FA(-ds)888 3785 y FD(Specify)28 +b(when)h(to)g(load)f(the)g(script)h(\(\223do-script\224\).)46 +b(If)28 b(this)h(switch)h(occurs,)g(the)888 3884 y(switch)23 +b(list)g FC(must)e FD(be)h(terminated)g(by)g(a)f FA(-s)43 +b FC(script)21 b FD(switch.)31 b(The)22 b(script)f(is)i(loaded)888 +3984 y(into)f(the)f(package)e(that)i(is)g(curr)o(ent)f(at)h(the)f +FA(-ds)g FD(switch.)805 4146 y Fw(\017)41 b FA(-dm)888 +4246 y FD(As)19 b(above,)f(but)g(the)h(curr)o(ent)e(module)i(is)g +(ignor)o(ed.)24 b(The)19 b(script)f(is)h(loaded)f(into)h(the)888 +4345 y FA(config)14 b FD(package)h(\(\223do-module\224\),)h(and)g +(hence)g(must)h(be)f(written)h(in)g(the)f(Scheme)888 +4445 y(48)31 b(module)i(language.)59 b(This)33 b(switch)g(doesn't)f(af) +o(fect)e(the)i(curr)o(ent)g(module\227)888 4545 y(after)26 +b(executing)i(this)g(switch,)h(the)f(curr)o(ent)e(module)i(is)g(the)f +(same)g(as)g(as)h(it)f(was)888 4644 y(befor)o(e.)888 +4775 y(This)17 b(switch)g(is)f(pr)o(ovided)f(to)i(make)e(it)i(easy)e +(to)i(write)f(shell)g(scripts)h(in)f(the)g(Scheme)888 +4875 y(48)k(module)h(language.)2051 5147 y(164)p eop +%%Page: 165 173 +165 172 bop 365 614 a FB(10.1.5)81 b(The)20 b(meta)f(argument)365 +809 y FD(The)33 b(scsh)g(switch)h(parser)d(takes)h(a)h(special)f +(command-line)h(switch,)j(a)c(single)h(back-)365 908 +y(slash)20 b(called)f(the)h(\223meta-ar)o(gument,\224)d(which)j(is)g +(useful)g(for)f(shell)h(scripts.)25 b(If)19 b(the)h(initial)365 +1008 y(command-line)k(ar)o(gument)f(is)g(a)g(\223)p FA(\\)p +FD(\224)f(ar)o(gument,)h(followed)h(by)f(a)g(\002lename)g(ar)o(gument) +365 1108 y FC(fname)p FD(,)g(scsh)g(will)g(open)g(the)g(\002le)f +FC(fname)h FD(and)f(r)o(ead)e(mor)o(e)j(ar)o(guments)f(fr)o(om)g(the)g +(second)365 1207 y(line)30 b(of)f(this)h(\002le.)50 b(This)30 +b(list)g(of)f(ar)o(guments)f(will)i(then)g(r)o(eplace)d(the)i(\223)p +FA(\\)p FD(\224)f(ar)o(gument\227)365 1307 y FC(i.e.)p +FD(,)21 b(the)h(new)f(ar)o(guments)g(ar)o(e)f(inserted)h(in)h(fr)o(ont) +f(of)g FC(fname)p FD(,)h(and)e(the)i(ar)o(gument)f(parser)365 +1407 y(r)o(esumes)28 b(ar)o(gument)f(scanning.)47 b(This)28 +b(is)h(used)e(to)h(over)o(come)g(a)f(limitation)i(of)e(the)h +FA(#!)365 1506 y FD(featur)o(e:)23 b(the)d FA(#!)f FD(line)h(can)f +(only)h(specify)f(a)g(single)i(ar)o(gument)e(after)f(the)i(interpr)o +(eter)-6 b(.)23 b(For)365 1606 y(example,)k(we)f(might)i(hope)e(the)g +(following)i(scsh)f(script,)g FA(ekko)p FD(,)f(would)h(implement)g(a) +365 1705 y(simple-minded)21 b(version)g(of)g(the)g(Unix)g +FA(echo)e FD(pr)o(ogram:)573 1911 y FA(#!/usr/local/bin)o(/s)o(csh)37 +b(-e)43 b(main)e(-s)573 2011 y(!#)573 2110 y(\(define)g(\(main)g +(args\))660 2210 y(\(map)h(\()p Fo(\025)d FA(\(arg\))i(\(display)g +(arg\))g(\(display)g(")i("\)\))878 2310 y(\(cdr)f(args\)\))660 +2409 y(\(newline\)\))365 2615 y FD(The)21 b(idea)f(would)h(be)g(that)f +(the)h(command)573 2767 y FA(ekko)42 b(Hi)h(there.)365 +2919 y FD(would)22 b(by)e(expanded)g(by)h(the)f FA(exec\(2\))e +FD(kernel)j(call)f(into)573 3125 y FA(/usr/local/bin/s)o(cs)o(h)38 +b(-e)k(main)g(-s)h(ekko)f(Hi)h(there.)365 3331 y FD(In)18 +b(theory)-9 b(,)17 b(this)h(would)f(cause)g(scsh)g(to)g(start)g(up,)g +(load)g(in)g(\002le)g FA(ekko)p FD(,)f(call)h(the)g(entry)g(point)365 +3430 y(on)22 b(the)f(command-line)g(list)573 3583 y FA(\(main)41 +b('\("ekko")g("Hi")h("there."\)\))365 3735 y FD(and)21 +b(exit.)490 3868 y(Unfortunately)-9 b(,)34 b(the)e(Unix)f +FA(exec\(2\))e FD(syscall's)k(support)f(for)f(scripts)h(is)g(not)h +(very)365 3968 y(general)28 b(or)h(well-designed.)49 +b(It)28 b(will)h(not)h(handle)e(multiple)h(ar)o(guments;)j(the)c +FA(#!)g FD(line)365 4068 y(is)g(usually)g(r)o(equir)o(ed)e(to)i +(contain)g(no)h(mor)o(e)e(than)h(32)e(characters;)k(it)e(is)g(not)g(r)o +(ecursive.)365 4167 y(If)c(these)h(r)o(estrictions)f(ar)o(e)f +(violated,)i(most)g(Unix)f(systems)i(will)f(not)g(pr)o(ovide)e +(accurate)365 4267 y(err)o(or)d(r)o(eporting,)g(but)h(either)f(fail)g +(silently)-9 b(,)22 b(or)e(simply)i(incorr)o(ectly)e(implement)i(the)e +(de-)365 4366 y(sir)o(ed)g(functionality)-9 b(.)26 b(These)21 +b(ar)o(e)e(the)i(facts)f(of)h(Unix)g(life.)490 4500 y(In)k(the)g +FA(ekko)e FD(example)h(above,)h(our)g FA(#!)f FD(trigger)h(line)g(has)g +(thr)o(ee)f(ar)o(guments)h(\(\223)p FA(-e)p FD(\224,)365 +4599 y(\223)p FA(main)p FD(\224,)i(and)h(\223)p FA(-s)p +FD(\224\),)f(so)i(it)f(will)h(not)g(work.)48 b(The)28 +b(meta-ar)o(gument)f(is)h(how)h(we)f(work)365 4699 y(ar)o(ound)18 +b(this)i(pr)o(oblem.)k(W)-8 b(e)19 b(must)g(instead)g(invoke)g(the)g +(scsh)g(interpr)o(eter)f(with)h(the)g(sin-)365 4799 y(gle)k +FA(\\)f FD(ar)o(gument,)f(and)h(put)h(the)f(r)o(est)g(of)g(the)g(ar)o +(guments)g(on)h(line)g(two)g(of)f(the)h(pr)o(ogram.)365 +4898 y(Her)o(e's)d(the)h(corr)o(ect)f(pr)o(ogram:)1735 +5147 y(165)p eop +%%Page: 166 174 +166 173 bop 888 614 a FA(#!/usr/local/bin/)o(sc)o(sh)37 +b(\\)888 714 y(-e)43 b(main)f(-s)888 814 y(!#)888 913 +y(\(define)f(\(main)h(args\))976 1013 y(\(map)f(\()p +Fo(\025)e FA(\(arg\))j(\(display)e(arg\))i(\(display)e(")j("\)\))1193 +1112 y(\(cdr)f(args\)\))976 1212 y(\(newline\)\))681 +1429 y FD(Now)-8 b(,)21 b(the)g(invocation)h(starts)e(as)888 +1591 y FA(ekko)42 b(Hi)h(there.)681 1754 y FD(and)20 +b(is)h(expanded)f(by)g(exec\(2\))f(into)888 1970 y FA +(/usr/local/bin/sc)o(sh)37 b(\\)43 b(ekko)f(Hi)h(there.)681 +2187 y FD(When)17 b(scsh)g(starts)g(up,)g(it)g(expands)f(the)g(\223)p +FA(\\)p FD(\224)g(ar)o(gument)g(into)h(the)g(ar)o(guments)f(r)o(ead)f +(fr)o(om)681 2286 y(line)21 b(two)g(of)g FA(ekko)p FD(,)e(pr)o(oducing) +h(this)i(ar)o(gument)e(list:)888 2503 y FA(-e)43 b(main)f(-s)h(ekko)p +888 2516 654 4 v 42 w(Hi)f(there.)1237 2603 y Fw(")888 +2702 y FD(Expanded)20 b(fr)o(om)43 b FA(\\)g(ekko)681 +2919 y FD(W)-5 b(ith)22 b(this)f(ar)o(gument)f(list,)h(pr)o(ocessing)g +(pr)o(oceeds)f(as)g(we)h(intended.)681 3209 y FB(Secondary)e(argument)g +(syntax)681 3412 y FD(Scsh)g(uses)h(a)f(very)h(simple)g(grammar)f(to)h +(encode)f(the)h(extra)e(ar)o(guments)i(on)g(the)g(second)681 +3512 y(line)j(of)f(the)h(scsh)g(script.)31 b(The)23 b(only)g(special)f +(characters)g(ar)o(e)f(space,)h(tab,)g(newline,)h(and)681 +3611 y(backslash.)805 3828 y Fw(\017)41 b FD(Each)31 +b(space)f(character)g(terminates)h(an)g(ar)o(gument.)56 +b(This)31 b(means)g(that)g(two)h(s-)888 3928 y(paces)20 +b(in)i(a)e(r)o(ow)g(intr)o(oduce)h(an)f(empty-string)i(ar)o(gument.)805 +4114 y Fw(\017)41 b FD(The)19 b(tab)f(character)e(is)j(not)g(permitted) +f(\(unless)h(you)g(quote)g(it)g(with)g(the)f(backslash)888 +4214 y(character)26 b(described)h(below\).)46 b(This)28 +b(is)g(to)g(pr)o(event)e(the)i(insidious)h(bug)f(wher)o(e)888 +4313 y(you)20 b(believe)e(you)i(have)f(six)g(space)f(characters,)g(but) +h(you)h(r)o(eally)e(have)g(a)h(tab)f(char)o(-)888 4413 +y(acter)-6 b(,)20 b(and)g FC(vice-versa)p FD(.)805 4599 +y Fw(\017)41 b FD(The)25 b(newline)h(character)d(terminates)i(an)g(ar)o +(gument,)g(like)g(the)g(space)f(character)-6 b(,)888 +4699 y(and)27 b(also)g(terminates)f(the)h(ar)o(gument)g(sequence.)43 +b(This)28 b(means)f(that)f(an)h(empty)888 4799 y(line)i(parses)f(to)h +(the)f(singleton)i(list)f(whose)g(one)g(element)g(is)f(the)h(empty)g +(string:)888 4898 y FA(\(""\))p FD(.)24 b(The)d(grammar)f(doesn't)h +(admit)g(the)g(empty)g(list.)2051 5147 y(166)p eop +%%Page: 167 175 +167 174 bop 490 614 a Fw(\017)41 b FD(The)26 b(backslash)h(character)e +(is)i(the)g(escape)e(character)-6 b(.)42 b(It)26 b(escapes)g +(backslash,)i(s-)573 714 y(pace,)35 b(tab,)g(and)d(newline,)37 +b(turning)d(of)o(f)e(their)h(special)f(functions,)37 +b(and)c(allow-)573 814 y(ing)f(them)g(to)g(be)g(included)f(in)h(ar)o +(guments.)58 b(The)34 b(A)t Fv(N)t(S)t(I)g FD(C)d(escape)g(sequences) +573 913 y(\()p FA(\\b)p FD(,)36 b FA(\\n)p FD(,)g FA(\\r)c +FD(and)i FA(\\t)p FD(\))e(ar)o(e)h(also)h(supported;)40 +b(these)34 b(also)g(pr)o(oduce)e(ar)o(gument-)573 1013 +y(constituents\227)p FA(\\n)27 b FD(doesn't)h(act)e(like)h(a)g +(terminating)g(newline.)45 b(The)27 b(escape)f(se-)573 +1112 y(quence)31 b FA(\\)p FC(nnn)f FD(for)h FC(exactly)e +FD(thr)o(ee)h(octal)g(digits)h(r)o(eads)f(as)g(the)h(character)e(whose) +575 1212 y(A)t Fv(S)t(C)t(I)t(I)21 b FD(code)d(is)g FC(nnn)p +FD(.)26 b(It)18 b(is)g(an)g(err)o(or)g(if)g(backslash)g(is)g(followed)h +(by)f(just)h(one)g(or)f(two)573 1312 y(octal)26 b(digits:)36 +b FA(\\3Q)24 b FD(is)i(an)g(err)o(or)-6 b(.)39 b(Octal)26 +b(escapes)f(ar)o(e)g(always)g(constituent)i(chars.)573 +1411 y(Backslash)e(followed)h(by)g(other)g(chars)f(is)h(not)h(allowed)e +(\(so)h(we)g(can)f(extend)g(the)573 1511 y(escape-code)19 +b(space)h(later)g(if)h(we)f(like\).)490 1722 y(Y)-8 b(ou)20 +b(have)f(to)h(constr)o(uct)g(these)f(line-two)h(ar)o(gument)f(lines)h +(car)o(efully)-9 b(.)24 b(In)19 b(particular)-6 b(,)365 +1822 y(bewar)o(e)22 b(of)h(trailing)h(spaces)f(at)g(the)g(end)g(of)h +(the)f(line\227they'll)i(give)e(you)h(extra)e(trailing)365 +1921 y(empty-string)g(ar)o(guments.)j(Her)o(e's)20 b(an)g(example:)573 +2079 y FA(#!/bin/interpret)o(er)37 b(\\)573 2178 y(foo)42 +b(bar)86 b(quux\\)42 b(yow)365 2336 y FD(would)22 b(pr)o(oduce)d(the)i +(ar)o(guments)573 2493 y FA(\("foo")41 b("bar")g("")i("quux)f(yow"\)) +365 2775 y FB(10.1.6)81 b(Examples)490 2974 y Fw(\017)41 +b FA(scsh)h(-dm)g(-m)h(myprog)e(-e)i(top)f(-s)h(myprog.scm)573 +3074 y FD(Load)18 b FA(myprog.scm)d FD(into)20 b(the)g +FA(config)c FD(package,)j(then)g(shift)h(to)f(the)h FA(myprog)c +FD(pack-)573 3173 y(age)25 b(and)g(call)h FA(\(top)42 +b('\("myprog.scm"\)\))o FD(,)21 b(then)26 b(exit.)40 +b(This)27 b(sort)f(of)g(invocation)573 3273 y(is)21 b(typically)g(used) +f(in)i FA(#!)e FD(script)g(lines)i(\(see)e(below\).)490 +3455 y Fw(\017)41 b FA(scsh)h(-c)h('\(display)c("Hello,)i(world."\)') +573 3555 y FD(A)20 b(simple)h(pr)o(ogram.)490 3737 y +Fw(\017)41 b FA(scsh)h(-o)h(bigscheme)573 3837 y FD(Start)52 +b(up)h(interactively)g(in)h(the)f(user)g(package)f(after)g(opening)i +(str)o(uctur)o(e)573 3936 y FA(bigscheme)p FD(.)490 4118 +y Fw(\017)41 b FA(scsh)h(-o)h(bigscheme)c(--)k(Three)f(args)g(passed) +573 4218 y FD(Start)23 b(up)i(interactively)f(in)g(the)h(user)f +(package)f(after)h(opening)h FA(bigscheme)p FD(.)33 b(The)573 +4318 y FA(command-line-arg)o(s)e FD(variable)37 b(in)h(the)g(scsh)g +(package)e(is)i(bound)g(to)g(the)g(list)573 4417 y FA(\("Three")i +("args")h("passed"\))p FD(,)h(and)d(the)i FA(\(command-line\))34 +b FD(pr)o(ocedur)o(e)39 b(r)o(e-)573 4517 y(turns)21 +b(the)g(list)g FA(\("scsh")41 b("Three")g("args")g("passed"\))p +FD(.)490 4699 y Fw(\017)g FD(Pr)o(ogram)20 b FA(ekko)573 +4799 y FD(This)h(shell)f(script,)g(called)g FA(ekko)p +FD(,)e(implements)j(a)f(version)g(of)h(the)f(Unix)g FA(echo)e +FD(pr)o(o-)573 4898 y(gram:)1735 5147 y(167)p eop +%%Page: 168 176 +168 175 bop 1071 614 a FA(#!/usr/local/bin)o(/sc)o(sh)37 +b(-s)1071 714 y(!#)1071 814 y(\(for-each)j(\()p Fo(\025)f +FA(\(arg\))i(\(display)f(arg\))i(\(display)f(")i("\)\))1507 +913 y(command-line-arg)o(s\))888 1207 y FD(Note)22 b(this)g(short)f(pr) +o(ogram)g(is)g(an)g(example)g(of)g(a)g FC(script)p FD(\227it)g +(executes)f(as)h(it)g(loads.)888 1307 y(The)g(Unix)g(r)o(ule)g(for)f +(executing)h FA(#!)f FD(shell)h(scripts)g(causes)1071 +1520 y FA(ekko)42 b(Hello,)f(world.)888 1732 y FD(to)21 +b(expand)f(as)1071 1945 y FA(/usr/local/bin/s)o(csh)37 +b(-s)42 b(ekko)g(Hello,)g(world.)805 2223 y Fw(\017)f +FD(Pr)o(ogram)21 b FA(ekko)888 2322 y FD(This)30 b(is)f(the)g(same)g +(pr)o(ogram,)h FC(not)e FD(as)h(a)f(script.)50 b(W)-6 +b(riting)29 b(it)h(this)f(way)g(makes)g(it)888 2422 y(possible)21 +b(to)f(compile)h(the)f(pr)o(ogram)f(\(and)g(then,)i(for)e(instance,)h +(dump)g(it)g(out)h(as)f(a)888 2522 y(heap)h(image\).)1071 +2751 y FA(#!/usr/local/bin)o(/sc)o(sh)37 b(\\)1071 2850 +y(-e)43 b(top)f(-s)1071 2950 y(!#)1071 3050 y(\(define)f(\(top)h +(args\))1158 3149 y(\(for-each)e(\()p Fo(\025)f FA(\(arg\))i(\(display) +g(arg\))h(\(display)e(")j("\)\))1594 3249 y(\(cdr)f(args\)\)\))888 +3478 y FD(The)28 b FA(exec\(2\))d FD(expansion)j(of)f(the)h +FA(#!)f FD(line)h(together)g(with)h(the)e(scsh)i(expansion)888 +3578 y(of)g(the)g(\223)p FA(\\)43 b(ekko)p FD(\224)27 +b(meta-ar)o(gument)h(\(see)g(section)i(10.1.5\))c(gives)j(the)h +(following)888 3678 y(command-line)22 b(expansion:)1071 +3907 y FA(ekko)42 b(Hello,)f(world.)1245 4006 y Fn(=)-14 +b Fw(\))87 b FA(/usr/local/bin/sc)o(sh)37 b(\\)43 b(ekko)391 +b(Hello,)41 b(world.)1245 4106 y Fn(=)-14 b Fw(\))87 +b FA(/usr/local/bin/sc)o(sh)37 b(-e)43 b(top)f(-s)h(ekko)f(Hello,)f +(world.)805 4400 y Fw(\017)g FD(Pr)o(ogram)21 b FA(sort)888 +4500 y FD(This)c(is)g(a)e(pr)o(ogram)h(to)h(r)o(eplace)d(the)i(Unix)g +FA(sort)f FD(utility\227sorting)j(lines)f(r)o(ead)d(fr)o(om)888 +4599 y(stdin,)28 b(and)e(printing)h(the)f(r)o(esults)g(on)h(stdout.)42 +b(Note)27 b(that)f(the)g(sour)o(ce)g(code)g(de-)888 4699 +y(\002nes)f(a)f(general)g(sorting)i(package,)e(which)h(is)g(useful)f +(\(1\))f(as)i(a)f(Scheme)g(module)888 4799 y(exporting)f(sort)h(pr)o +(ocedur)o(es)d(to)i(other)g(Scheme)f(code,)h(and)g(\(2\))e(as)i(a)f +(standalone)888 4898 y(pr)o(ogram)e(invoked)i(fr)o(om)e(the)h +FA(top)e FD(pr)o(ocedur)o(e.)2051 5147 y(168)p eop +%%Page: 169 177 +169 176 bop 756 614 a FA(#!/usr/local/bi)o(n/)o(scs)o(h)37 +b(\\)756 714 y(-dm)42 b(-m)h(sort-toplevel)38 b(-e)43 +b(top)f(-s)756 814 y(!#)756 1013 y(;;;)g(This)g(is)h(a)g(sorting)d +(module.)h(TOP)h(procedure)e(exports)756 1112 y(;;;)i(the)g +(functionality)c(as)43 b(a)g(Unix)f(program)f(akin)h(to)h(sort\(1\).) +756 1212 y(\(define-structu)o(re)o(s)38 b(\(\(sort-struct)g(\(export)j +(sort-list)2543 1312 y(sort-vector!\)\))1627 1411 y(\(sort-toplevel)d +(\(export)j(top\)\)\))843 1511 y(\(open)g(scheme\))843 +1710 y(\(begin)g(\(define)f(\(sort-list)g(elts)i(<=\))g(...\))1148 +1810 y(\(define)e(\(sort-vec!)g(vec)i(<=\))86 b(...\))1148 +2009 y(;;)43 b(Parse)e(the)h(command)f(line)h(and)1148 +2109 y(;;)h(sort)e(stdin)h(to)h(stdout.)1148 2208 y(\(define)d(\(top)i +(args\))1279 2308 y(...\)\)\))573 2491 y FD(The)18 b(expansion)g(below) +h(shows)h(how)f(the)f(command-line)g(scanner)g(\(1\))f(loads)h(the)573 +2583 y(con\002g)i(\002le)f FA(sort)f FD(\(written)h(in)h(the)f(Scheme)g +(48)f(module)h(language\),)g(\(2\))f(switches)573 2674 +y(to)32 b(the)h(package)e(underlying)h(the)g FA(sort-toplevel)27 +b FD(str)o(uctur)o(e,)34 b(\(3\))d(calls)h FA(\(top)573 +2765 y('\("sort")40 b("foo")i("bar"\)\))18 b FD(in)j(the)g(package,)e +(and)h(\002nally)i(\(4\))d(exits.)573 2997 y Fj(sort)40 +b(foo)g(bar)573 3089 y Fb(=)-13 b Fa(\))78 b Fj(/usr/local/bin/scsh)44 +b(\\)39 b(sort)1178 b(foo)40 b(bar)573 3180 y Fb(=)-13 +b Fa(\))78 b Fj(/usr/local/bin/scsh)44 b(-dm)39 b(-m)h(sort-toplevel)i +(-e)e(top)g(-s)g(sort)g(foo)g(bar)573 3352 y FD(An)21 +b(alternate)e(method)i(would)h(have)e(used)h(a)756 3513 +y FA(-n)42 b(#f)h(-o)g(sort-toplevel)573 3674 y FD(sequence)21 +b(of)g(switches)g(to)g(specify)g(a)f(top-level)g(package.)490 +3869 y(Note)e(that)g(the)g(sort)g(example)f(can)h(be)f(compiled)h(into) +h(a)e(Unix)h(pr)o(ogram)f(by)h(loading)365 3969 y(the)25 +b(\002le)g(into)h(an)f(scsh)h(pr)o(ocess,)f(and)f(dumping)i(a)e(heap)h +(with)h(top-level)e FA(top)p FD(.)37 b(Even)25 b(if)365 +4068 y(we)19 b(don't)g(want)g(to)g(export)f(the)g(sort's)i +(functionality)f(as)f(a)g(subr)o(outine)h(library)-9 +b(,)18 b(it)h(is)g(still)365 4168 y(useful)f(to)h(write)f(the)h(sort)f +(pr)o(ogram)g(with)h(the)f(module)h(language.)24 b(The)19 +b(command)f(line)365 4267 y(design)23 b(allows)g(us)g(to)g(r)o(un)g +(this)h(pr)o(ogram)e(as)g(either)h(an)f(interpr)o(eted)f(script)i +(\(given)f(the)365 4367 y FA(#!)e FD(ar)o(gs)g(in)h(the)g(header\))f +(or)g(as)h(a)f(compiled)h(heap)f(image.)365 4616 y FB(10.1.7)81 +b(Process)20 b(exit)f(values)365 4799 y FD(Scsh)j(ignor)o(es)g(the)g +(value)f(pr)o(oduced)f(by)i(its)g(top-level)f(computation)i(when)f +(determin-)365 4898 y(ing)g(its)g(exit)g(status)f(code.)28 +b(If)21 b(the)g(top-level)g(computation)i(completed)e(with)h(no)h(err)o +(ors,)1735 5147 y(169)p eop +%%Page: 170 178 +170 177 bop 681 614 a FD(scsh)20 b(dies)g(with)g(exit)g(code)g(0.)k +(For)c(example,)f(a)h(scsh)g(pr)o(ocess)f(whose)i(top-level)f(is)g +(spec-)681 714 y(i\002ed)g(by)h(a)f FA(-c)42 b FC(exp)20 +b FD(or)h(a)f FA(-e)42 b FC(entry)21 b FD(entry)f(point)h(ignor)o(es)g +(the)g(value)e(pr)o(oduced)h(by)g(eval-)681 814 y(uating)f +FC(exp)g FD(and)g(calling)h FC(entry)p FD(,)f(r)o(espectively)-9 +b(.)24 b(If)19 b(these)h(computations)g(terminate)f(with)681 +913 y(no)i(err)o(ors,)f(the)h(scsh)g(pr)o(ocess)f(exits)h(with)h(an)e +(exit)h(code)f(of)h(0.)805 1061 y(T)-8 b(o)22 b(r)o(eturn)e(a)g +(speci\002c)h(exit)f(status,)h(use)g(the)g FA(exit)e +FD(pr)o(ocedur)o(e)f(explicitly)-9 b(,)21 b FC(e.g.)o +FD(,)888 1160 y FA(scsh)42 b(-c)h(\\)976 1260 y("\(exit)e +(\(status:exit-va)o(l)d(\(run)k(\(|)g(\(fmt\))g(\(mail)f +(shivers\)\)\)\)\)")681 1596 y Fy(10.2)99 b(The)25 b(scsh)g(virtual)h +(machine)681 1840 y FD(T)-8 b(o)30 b(r)o(un)h(the)f(Scheme)f(48)g +(implementation)i(of)f(scsh,)i(you)e(r)o(un)h(a)e(specially)h +(modi\002ed)681 1940 y(copy)d(of)f(the)h(Scheme)g(48)e(virtual)i +(machine)g(with)g(a)f(scsh)i(heap)e(image.)43 b(The)27 +b(scsh)g(bi-)681 2039 y(nary)22 b(is)h(actually)e(nothing)j(but)f(a)f +(small)g(cover)g(pr)o(ogram)g(that)g(invokes)h(the)g(byte-code)681 +2139 y(interpr)o(eter)28 b(on)i(the)g(scsh)g(heap)f(image)g(for)h(you.) +52 b(This)30 b(allows)g(you)g(to)g(simply)g(start)681 +2238 y(up)23 b(an)g(interactive)f(scsh)i(fr)o(om)f(a)f(command)i(line,) +g(as)f(well)g(as)g(write)g(shell)h(scripts)f(that)681 +2338 y(begin)e(with)g(the)g(simple)h(trigger)888 2512 +y FA(#!/usr/local/bin/)o(sc)o(sh)37 b(-s)805 2734 y FD(Y)-8 +b(ou)27 b(can)e(also)g(dir)o(ectly)g(execute)f(the)i(virtual)f +(machine,)h(which)g(takes)f(its)h(own)g(set)681 2834 +y(of)21 b(command-line)g(switches..)27 b(For)22 b(example,)e(this)h +(command)h(starts)f(the)g(vm)g(up)g(with)681 2934 y(a)f(1Mwor)o(d)f +(heap)i(\(split)g(into)g(two)h(semispaces\):)888 3108 +y FA(scshvm)41 b(-o)i(scshvm)e(-h)i(1000000)e(-i)i(scsh.image)c(arg1)j +(arg2)g(...)681 3282 y FD(The)47 b(vm)h(peels)f(of)o(f)f(initial)i(vm)f +(ar)o(guments)g(up)h(to)f(the)h FA(-i)e FD(heap)h(image)g(ar)o(gu-)681 +3382 y(ment,)41 b(which)d(terminates)e(vm)h(ar)o(gument)g(parsing.)74 +b(The)36 b(r)o(est)h(of)f(the)h(ar)o(guments)681 3481 +y(ar)o(e)d(passed)h(of)o(f)g(to)h(the)g(scsh)h(top-level.)70 +b(Scsh's)36 b(top-level)g(r)o(emoves)f(scsh)i(switch-)681 +3581 y(es,)k(as)c(discussed)g(in)g(the)h(pr)o(evious)e(section;)46 +b(the)37 b(r)o(est)g(show)h(up)f(as)g(the)h(value)e(of)681 +3681 y FA(command-line-arg)o(um)o(ent)o(s)p FD(.)805 +3828 y(Dir)o(ectly)25 b(executing)g(the)h(vm)f(can)g(be)g(useful)g(to)g +(specify)g(non-standar)o(d)f(switches,)681 3928 y(or)f(invoke)h(the)g +(virtual)f(machine)h(on)g(special)f(heap)g(images,)h(which)g(can)f +(contain)h(pr)o(e-)681 4027 y(compiled)d(scsh)g(pr)o(ograms)f(with)i +(their)f(own)g(top-level)g(pr)o(ocedur)o(es.)681 4337 +y FB(10.2.1)80 b(VM)21 b(arguments)681 4550 y FD(The)g(vm)f(takes)h(ar) +o(guments)f(in)i(the)f(following)h(form:)888 4724 y FA(scshvm)41 +b([)p FC(meta-ar)o(g)n FA(])i([)p FC(vm-options)2044 +4694 y Fx(+)2099 4724 y FA(])g([)p FC(end-option)f(scheme-ar)o(gs)o +FA(])681 4898 y FD(wher)o(e)2051 5147 y(170)p eop +%%Page: 171 179 +171 178 bop 623 601 a FC(meta-ar)o(g:)159 b FA(\\)43 +b FC(\002lename)623 800 y(vm-option)n FD(:)113 b FA(-h)43 +b FC(heap-size-in-words)1103 900 y FA(-s)g FC(stack-size-in-words)1103 +1000 y FA(-o)g FC(object-\002le-name)623 1199 y(end-option:)98 +b FA(-i)43 b FC(image-\002le-name)1103 1298 y FA(--)490 +1471 y FD(The)35 b(vm's)h(meta-switch)g(\223)p FA(\\)43 +b FC(\002lename)p FD(\224)35 b(is)h(handled)f(the)g(same)h(as)f(scsh's) +h(meta-)365 1571 y(switch,)22 b(and)e(serves)g(the)h(same)g(purpose.) +365 1832 y FB(VM)g(options)365 2020 y FD(The)e FA(-o)43 +b FC(object-\002le-name)18 b FD(switch)i(tells)g(the)f(vm)g(wher)o(e)f +(to)i(\002nd)f(r)o(elocation)g(information)365 2120 y(for)28 +b(its)g(for)o(eign-function)g(calls.)47 b(Scsh)28 b(will)h(use)f(a)f +(pr)o(e-compiled)g(default)g(if)g(it)i(is)f(not)365 2220 +y(speci\002ed.)d(Scsh)19 b FC(must)f FD(have)h(this)g(information)h(to) +g(r)o(un,)f(since)g(scsh's)h(syscall)f(interfaces)365 +2319 y(ar)o(e)h(done)h(with)g(for)o(eign-function)g(calls.)490 +2448 y(The)h FA(-h)f FD(and)h FA(-s)f FD(options)j(tell)e(the)g(vm)h +(how)g(much)f(space)g(to)g(allocate)g(for)g(the)g(heap)365 +2547 y(and)j(stack.)39 b(The)25 b(heap)g(size)g(value)g(is)g(the)h +(total)f(number)h(of)f(wor)o(ds)g(allocated)f(for)h(the)365 +2647 y(heap;)31 b(this)d(space)f(is)h(then)g(split)g(into)h(two)f +(semi-spaces)f(for)h(Scheme)f(48's)g(stop-and-)365 2747 +y(copy)21 b(collector)-6 b(.)365 3008 y FB(End)20 b(options)365 +3196 y FD(End)31 b(options)i(terminate)e(ar)o(gument)f(parsing.)57 +b(The)32 b FA(-i)e FD(switch)i(is)g(followed)f(by)g(the)365 +3295 y(name)24 b(of)f(a)g(heap)h(image)f(for)g(the)h(vm)g(to)g +(execute.)33 b(The)24 b FC(image-\002le-name)e FD(string)i(is)g(also) +365 3395 y(taken)e(to)g(be)g(the)g(name)g(of)g(the)g(pr)o(ogram)f +(being)h(executed)f(by)h(the)g(VM;)f(this)h(name)g(be-)365 +3495 y(comes)f(the)f(head)f(of)h(the)h(ar)o(gument)e(list)i(passed)e +(to)i(the)f(heap)f(image's)i(top-level)e(entry)365 3594 +y(point.)25 b(The)17 b(tail)g(of)g(the)h(ar)o(gument)e(list)i(is)f +(constr)o(ucted)h(fr)o(om)f(all)g(following)h(ar)o(guments.)490 +3723 y(The)23 b FA(--)e FD(switch)j(terminates)f(ar)o(gument)f(parsing) +h(without)h(giving)f(a)f(speci\002c)h(heap)365 3822 y(image;)k(the)f +(vm)f(will)h(start)f(up)g(using)h(a)f(default)f(heap)h(\(whose)h +(location)g(is)f(compiled)365 3922 y(into)h(the)g(vm\).)38 +b(All)25 b(the)g(following)i(ar)o(guments)e(comprise)g(the)g(tail)g(of) +g(the)h(list)f(passed)365 4022 y(of)o(f)20 b(to)h(the)g(heap)f(image's) +h(top-level)g(pr)o(ocedur)o(e.)490 4150 y(Notice)f(that)f(you)i(ar)o(e) +d(not)j(allowed)e(to)h(pass)g(ar)o(guments)f(to)i(the)e(heap)h(image's) +g(top-)365 4250 y(level)h(pr)o(ocedur)o(e)e(\()p FC(e.g.)o +FD(,)h(scsh\))h(without)h(delimiting)g(them)f(with)h +FA(-i)d FD(or)i FA(--)f FD(\003ags.)365 4511 y FB(10.2.2)81 +b(Inserting)19 b(interpreter)g(triggers)h(into)g(heap)g(images)365 +4699 y FD(Scheme)j(48's)f(heap)g(image)g(format)h(allows)g(for)f(an)h +(informational)g(header:)28 b(when)23 b(the)365 4799 +y(vm)c(loads)f(in)h(a)e(heap)h(image,)g(it)h(ignor)o(es)f(all)g(data)f +(occurring)i(befor)o(e)e(the)h(\002rst)h(contr)o(ol-L)365 +4898 y(character)k(\()r(A)t Fv(S)t(C)t(I)t(I)k FD(12\).)36 +b(This)25 b(means)g(that)f(you)h(can)g(insert)f(a)h(\223)p +FA(#!)p FD(\224)d(trigger)j(line)g(into)g(a)1735 5147 +y(171)p eop +%%Page: 172 180 +172 179 bop 681 614 a FD(heap)15 b(image,)i(making)g(it)f(a)g(form)g +(of)h(executable)e(\223shell)h(script.\224)23 b(Since)16 +b(the)h(vm)f(r)o(equir)o(es)681 714 y(multiple)22 b(ar)o(guments)g(to)g +(be)f(given)h(on)h(the)f(command)g(line,)g(you)h(must)f(use)g(the)g +(meta-)681 814 y(switch.)k(Her)o(e's)20 b(an)h(example)f(heap-image)f +(header:)888 995 y FA(#!/usr/local/lib/)o(sc)o(sh/)o(sc)o(shv)o(m)37 +b(\\)888 1094 y(-o)43 b(/usr/local/lib/s)o(csh)o(/s)o(csh)o(vm)37 +b(-i)888 1194 y(...)43 b FC(Y)-9 b(our)21 b(heap)f(image)g(goes)h(her)o +(e)43 b FA(...)681 1499 y FB(10.2.3)80 b(Inserting)20 +b(a)g(double-level)e(trigger)i(into)g(Scheme)f(programs)681 +1682 y FD(If)i(you'r)o(e)h(a)f(ner)o(d,)g(you)h(may)g(enjoy)g(doing)h +(a)e(double-level)g(machine)h(shift)g(in)g(the)g(trig-)681 +1782 y(ger)e(line)h(of)g(your)g(Scheme)g(pr)o(ograms)f(with)h(the)g +(following)i(magic:)888 1955 y Fj(#!/usr/local/lib/scsh/scshvm)46 +b(\\)888 2046 y(-o)40 b(/usr/local/lib/scsh/scshvm)45 +b(-i)40 b(/usr/local/lib/scsh/scsh.image)46 b(-s)888 +2137 y(!#)888 2229 y(...)40 b Fh(Y)-8 b(our)18 b(Scheme)i(pr)o(ogram)f +(goes)h(her)o(e)39 b Fj(...)681 2561 y Fy(10.3)99 b(Compiling)25 +b(scsh)h(programs)681 2775 y FD(Scsh)k(allows)g(you)g(to)h(cr)o(eate)d +(a)h(heap)g(image)h(with)h(your)f(own)h(top-level)e(pr)o(ocedur)o(e.) +681 2874 y(Adding)20 b(the)h(pair)f(of)h(lines)888 3055 +y FA(#!/usr/local/lib/)o(sc)o(sh/)o(sc)o(shv)o(m)37 b(\\)888 +3155 y(-o)43 b(/usr/local/lib/s)o(csh)o(/s)o(csh)o(vm)37 +b(-i)681 3336 y FD(to)21 b(the)g(top)g(of)g(the)g(heap)f(image)g(will)i +(turn)f(it)g(into)g(an)g(executable)f(Unix)g(\002le.)805 +3461 y(Y)-8 b(ou)22 b(can)f(cr)o(eate)e(heap)h(images)h(with)g(the)g +(following)h(two)g(pr)o(ocedur)o(es.)681 3605 y FA(\(dump-scsh-progr)o +(am)37 b FC(main)20 b(fname)p FA(\))87 b Fw(\000)-14 +b(!)87 b FC(unde\002ned)585 b FD(pr)o(ocedur)o(e)888 +3741 y(This)29 b(pr)o(ocedur)o(e)c(writes)j(out)h(a)e(scsh)h(heap)f +(image.)47 b(When)28 b(the)g(heap)f(image)h(is)888 3841 +y(executed)f(by)h(the)f(Scheme)h(48)e(vm,)k(it)e(will)g(call)f(the)h +FC(main)f FD(pr)o(ocedur)o(e,)h(passing)888 3941 y(it)d(the)f(vm's)h +(ar)o(gument)f(list.)37 b(When)25 b FA(main)d FD(r)o(eturns)i(an)h +(integer)f(value)g Fo(i)p FD(,)g(the)h(vm)888 4040 y(exits)17 +b(with)g(exit)f(status)h Fo(i)p FD(.)23 b(The)17 b(Scheme)f(vm)h(will)g +(parse)e(command-line)i(switches)888 4140 y(as)27 b(described)f(in)h +(section)g(10.2.1;)g(r)o(emaining)g(ar)o(guments)g(form)g(the)f(tail)h +(of)g(the)888 4240 y(command-line)19 b(list)g(that)g(is)g(passed)f(to)h +FA(main)p FD(.)k(\(The)18 b(head)g(of)h(the)f(list)h(is)g(the)g(name) +888 4339 y(of)h(the)g(pr)o(ogram)f(being)i(executed)d(by)i(the)g(vm.\)) +26 b(Further)19 b(ar)o(gument)h(parsing)g(\(as)888 4439 +y(described)g(for)h(scsh)g(in)g(section)h(10.1.4\))c(is)j(not)g +(performed.)888 4569 y(The)d(heap)g(image)g(cr)o(eated)e(by)i +FA(dump-scsh-program)11 b FD(has)18 b(unused)h(code)e(and)h(da-)888 +4669 y(ta)j(pr)o(uned)f(out,)h(so)h(small)f(pr)o(ograms)f(compile)h(to) +g(much)h(smaller)e(heap)h(images.)681 4852 y FA(\(dump-scsh)39 +b FC(fname)p FA(\))87 b Fw(\000)-14 b(!)87 b FC(unde\002ned)1125 +b FD(pr)o(ocedur)o(e)2051 5147 y(172)p eop +%%Page: 173 181 +173 180 bop 573 614 a FD(This)20 b(pr)o(ocedur)o(e)e(writes)h(out)h(a)f +(heap)h(image)f(with)h(the)g(standar)o(d)e(scsh)i(top-level.)573 +714 y(When)31 b(the)g(image)g(is)h(r)o(esumed)e(by)h(the)g(vm,)i(it)f +(will)f(parse)f(and)h(execute)f(scsh)573 814 y(command-line)21 +b(switches)h(as)e(described)g(in)h(section)g(10.1.4.)573 +943 y(Y)-8 b(ou)31 b(can)e(use)h(this)h(pr)o(ocedur)o(e)c(to)j(write)g +(out)h(custom)f(scsh)g(heap)g(images)g(that)573 1043 +y(have)20 b(speci\002c)h(packages)f(pr)o(eloaded)f(and)h(start)g(up)h +(in)g(speci\002c)g(packages.)490 1206 y(Unfortunately)-9 +b(,)17 b(Scheme)g(48)f(does)i(not)g(support)f(separate)f(compilation)j +(of)e(Scheme)365 1306 y(\002les)25 b(or)g(Scheme)f(modules.)37 +b(The)24 b(only)h(way)g(to)g(compile)f(is)h(to)g(load)f(sour)o(ce)g +(and)g(then)365 1405 y(dump)31 b(out)g(a)f(heap)f(image.)55 +b(One)31 b(occasionally)g(hears)f(r)o(umours)h(that)f(this)h(is)g +(being)365 1505 y(addr)o(essed)19 b(by)i(the)g(Scheme)f(48)g +(development)h(team.)365 1780 y Fy(10.4)99 b(Statically)26 +b(linking)g(heap)e(images)365 1994 y FD(The)33 b(static)f(heap)g +(linker)g(converts)h(a)f(Scheme)f(48)h(bytecode)g(image)g(contained)g +(in)h(a)365 2093 y(.image)26 b(\002le)g(to)g(a)g(C)g(r)o(epr)o +(esentation.)39 b(This)27 b(C)f(code)f(is)i(then)f(compiled)g(and)g +(linked)g(in)365 2193 y(with)k(a)f(virtual)g(machine,)j(pr)o(oducing)d +(a)g(single)h(executable.)50 b(Some)29 b(of)h(the)f(bene\002ts)365 +2293 y(ar)o(e:)490 2471 y Fw(\017)41 b FD(Instantaneous)21 +b(start-up)f(time.)490 2632 y Fw(\017)41 b FD(Impr)o(oved)15 +b(paging;)j(scsh)e(images)g(can)g(be)g(shar)o(ed)f(between)g(dif)o(fer) +o(ent)f(pr)o(ocesses.)490 2792 y Fw(\017)41 b FD(V)-8 +b(astly)20 b(r)o(educed)f(GC)h(copying\227the)i(whole)f(initial)f +(image)h(is)f(moved)h(out)f(of)g(the)573 2891 y(heap,)g(and)g(neither)h +(traced)f(nor)h(copied.)490 3051 y Fw(\017)41 b FD(Result)21 +b(pr)o(ogram)f(no)i(longer)f(depends)f(on)i(the)f(\002lesystem)g(for)g +(its)g(initial)g(image.)490 3230 y(The)g(static)f(heap)g(linker)i +(takes)e(ar)o(guments)g(in)i(the)f(following)h(form:)573 +3369 y FA(scsh-hlink)39 b FC(image)k(executable)h FA([)p +FC(option)e FA(...])365 3507 y FD(It)20 b(r)o(eads)f(in)i(the)f(heap)g +(image)g FC(image)o FD(,)g(translates)g(it)g(into)h(C)f(code,)g +(compiles)h(the)f(C)g(code,)365 3607 y(and)d(links)g(it)g(against)g +(the)f(scsh)i(vm,)f(pr)o(oducing)g(the)g(standalone)f(binary)h(\002le)f +FC(executable)q FD(.)490 3723 y(Each)26 b(C)h(\002le)g(r)o(epr)o +(esents)f(part)g(of)h(the)g(heap)g(image)g(as)f(a)h(constant)h(C)e +FA(long)g FD(vector)365 3814 y(that)21 b(looks)h(something)g(like)f +(this:)365 3985 y Fj(const)80 b(long)40 b(p116[]={0x882,0x24,0x19,)1150 +4076 y(0x882,\(long\)\(&p19[785]\)+7,\(lon)q(g\)\(&)q(p119[)q(125])q +(\)+7,)1150 4168 y(0x882,\(long\)\(&p119[128]\)+7,\(lo)q(ng\)\()q +(&p119)q([131)q(]\)+7)q(,)1150 4259 y +(0x882,\(long\)\(&p102[348]\)+7,\(lo)q(ng\)\()q(&p3[1)q(14]\))q(+7,) +1150 4350 y(0xfc2,0x2030200,0x7100209,0x10)q(9100)q(2,0x1)q(c075)q(a,) +1150 4442 y(0x882,\(long\)\(&p29[1562]\)+7,\(lo)q(ng\)\()q(&p119)q +([137)q(]\)+7)q(,)1150 4533 y(0x882,\(long\)\(&p78[692]\)+7,\(lon)q +(g\)\(&)q(p119[)q(140])q(\)+7,)1307 4624 y(.)1307 4716 +y(.)1307 4807 y(.)1150 4898 y(};)1735 5147 y FD(173)p +eop +%%Page: 174 182 +174 181 bop 805 614 a FD(T)-7 b(ranslating)21 b(to)h(a)e(C)h +(declaration)f(gives)i(us)f(fr)o(eedom)f(fr)o(om)h(the)g(various)g +(object-\002le)681 714 y(formats.)985 684 y Fs(2)1047 +714 y FD(Note)h(that)g(the)h(const)f(declaration)g(allows)g(the)h +(compiler)f(to)g(put)g(this)h(array)681 814 y(in)d(the)g(text)g(pages)f +(of)h(the)g(executable.)k(The)c(heap)f(is)i(split)f(into)h(parts)e +(because)g(many)h(C)681 913 y(compilers)h(cannot)g(handle)g +(multi-megabyte)g(initialised)g(vector)f(declarations.)805 +1042 y(The)h(allowed)g(options)h(to)f(the)g(heap)f(linker)h(ar)o(e:)805 +1239 y Fw(\017)41 b FA(--temp)g FC(dir)888 1339 y FD(The)27 +b(temporary)g(dir)o(ectory)f(to)h(hold)h(.c)e(and)h(.o)g(\002les.)44 +b(The)27 b(default)f(is)h(typically)888 1438 y(con\002gur)o(ed)i(to)f +(be)h FA(/usr/tmp)p FD(,)d(and)i(can)g(be)h(overridden)e(by)i(the)f +(envir)o(onment)888 1538 y(variable)20 b FA(TMPDIR)p +FD(.)e(Example:)1071 1682 y FA(--temp)41 b(/tmp)805 1863 +y Fw(\017)g FA(--cc)h FC(command)888 1962 y FD(The)25 +b(command)h(to)f(r)o(un)h(the)f(C)g(compiler)-6 b(.)39 +b(The)25 b(default)f(can)h(be)g(overridden)f(by)888 2062 +y(the)d(envir)o(onment)h(variable)d FA(CC)p FD(.)h(Example:)1071 +2207 y FA(--cc)42 b("gcc)g(-g)h(-O")805 2387 y Fw(\017)e +FA(--ld)h FC(command)888 2487 y FD(The)34 b(ar)o(guments)e(to)i(r)o(un) +g(the)f(C)g(compiler)h(as)e(a)h(linker)-6 b(.)63 b(The)33 +b(default)f(can)h(be)888 2586 y(overridden)20 b(by)h(the)g(envir)o +(onment)g(variable)f FA(LDFLAGS)p FD(.)e(Example:)1071 +2731 y FA(--ld)42 b("-Wl,-E")805 2911 y Fw(\017)f FA(--libs)g +FC(libs)888 3011 y FD(The)25 b(libraries)f(needed)g(to)h(link)h(the)f +(VM)f(and)h(heap.)37 b(The)24 b(default)g(can)h(be)f(over)o(-)888 +3110 y(ridden)d(by)f(the)h(envir)o(onment)h(variable)d +FA(LIBS)p FD(.)g(Example:)1071 3255 y FA(--libs)41 b("-ldld)g(-lld)h +(-lm")805 3452 y FD(Be)21 b(warned)f(that)g(the)h(curr)o(ent)f(heap)g +(linker)i(has)e(many)h(shortcomings.)805 3650 y Fw(\017)41 +b FD(It)30 b(is)g(extr)o(emely)f(slow)-8 b(.)53 b(Really)-9 +b(,)32 b(r)o(eally)d(slow)-8 b(.)53 b(T)-7 b(ranslating)30 +b(the)f(standar)o(d)f(scsh)888 3749 y(heap)d(image)f(into)i(a)e +(standalone)h(binary)g(takes)f(well)h(over)g(an)g(hour)g(on)h(a)e(40M-) +888 3849 y(b/133Mhz)19 b(Pentium)j(system.)k(A)20 b(memory-starved)g +(486)g(could)h(take)f(all)g(night.)805 4020 y Fw(\017)41 +b FD(It)c(cannot)g(be)g(applied)f(to)h(itself.)74 b(The)37 +b(curr)o(ent)e(implementation)j(works)g(by)888 4120 y(r)o(eplacing)i +(some)g(of)g(the)g(heap-dumping)g(code.)83 b(This)41 +b(means)f(you)h(cannot)888 4219 y(load)i(the)h(heap-linker)e(code)h +(into)h(a)f(scsh)h(system)g(and)f(subsequently)h(use)888 +4319 y FA(dump-scsh-program)14 b FD(to)21 b(cr)o(eate)e(a)h +(heap-linker)h(heap)f(image.)805 4490 y Fw(\017)41 b +FD(The)21 b(interface)f(leaves)g(a)g(lot)h(to)g(be)g(desir)o(ed.)988 +4661 y FB(\226)41 b FD(It)19 b(r)o(equir)o(es)f(the)h(heap)g(image)g +(to)g(be)g(r)o(efer)o(enced)d(by)j(a)f(\002le-name;)i(the)f(linker)1071 +4761 y(will)i(not)h(allow)f(you)g(to)h(feed)d(it)i(the)g(input)g(heap)g +(image)f(on)i(a)e(port.)p 681 4819 1146 4 v 771 4875 +a Fr(2)800 4898 y Fv(This)d(idea)f(is)h(due)f(to)h(Jonathan)f(Rees.) +2051 5147 y FD(174)p eop +%%Page: 175 183 +175 182 bop 672 614 a FB(\226)42 b FD(The)20 b(heap-image)g(is)h +(linked)g(against)g(the)g(vm)g(contained)g(in)911 714 +y FA(/usr/local/lib/s)o(cs)o(h/)o(lib)o(sc)o(shv)o(m.)o(a)756 +814 y FD(This)g(is)g(wir)o(ed)f(in)h(at)f(the)h(time)g(scsh)h(is)f +(installed)g(on)g(your)g(system.)672 947 y FB(\226)42 +b FD(Ther)o(e)19 b(is)i(no)h(Scheme)e(pr)o(ocedural)f(interface.)490 +1113 y Fw(\017)41 b FD(The)27 b(pr)o(ogram)g(pr)o(oduced)f(uses)i(the)f +(default)g(VM)g(ar)o(gv)f(parser)h FA(process_args)573 +1213 y FD(fr)o(om)36 b(the)g(scsh)h(sour)o(ce)e(\002le)i +FA(main.c)c FD(to)k(pr)o(ocess)e(the)i(command)f(line)h(befor)o(e)573 +1312 y(handing)25 b(it)f(of)o(f)g(to)g(the)h(heap)e(image's)i +(top-level)f(pr)o(ocedur)o(e.)34 b(This)25 b(is)f(not)h(what)573 +1412 y(you)c(want)g(for)g(many)g(pr)o(ograms.)573 1545 +y(The)27 b(system)h(needs)f(to)h(be)f(changed)g(to)g(allow)h(users)f +(to)h(override)f(this)h(default)573 1645 y(with)21 b(their)g(own)h(VM)e +(ar)o(gument)g(parsers.)490 1811 y Fw(\017)41 b FD(A)28 +b(possible)h(pr)o(oblem)f(is)h(the)g(Unix)f(limits)i(on)f(the)g(number) +g(of)f(command)h(line)573 1911 y(ar)o(guments.)58 b(The)31 +b(heap-linker)g(calls)h(the)f(C)h(linker)g(with)g(a)f(lar)o(ge)g +(number)h(of)573 2010 y(object)19 b(\002les.)25 b(Its)18 +b(conceivable)g(that)h(on)g(some)g(Unix)f(systems)h(this)g(could)g +(fail)f(now)573 2110 y(or)32 b(if)g(scsh)g(gr)o(ows)g(in)h(the)f(futur) +o(e.)58 b(The)31 b(solution)j(could)e(be)g(to)g(cr)o(eate)e(library)573 +2210 y(ar)o(chives)c(of)g(a)g(few)h(dozen)f(\002les)h(and)g(then)g +(link)g(the)g(r)o(esult)f(few)h(dozen)f(library)573 2309 +y(ar)o(chives)20 b(to)h(make)f(the)h(executable.)490 +2501 y(In)f(spite)g(of)g(these)f(many)h(shortcomings,)i(we)e(ar)o(e)e +(pr)o(oviding)i(the)g(static)g(linker)g(as)f(it)365 2600 +y(stands)i(in)g(this)h(r)o(elease)d(so)i(that)g(people)g(may)f(get)h +(some)g(experience)f(with)i(it.)490 2725 y(Her)o(e)d(is)j(an)e(example) +g(of)h(how)h(one)f(might)h(use)e(the)h(heap)f(linker:)922 +2917 y FA(scsh-hlink)39 b(scsh.image)g(fastscsh)490 3133 +y FD(W)-8 b(e'd)21 b(love)f(it)h(if)g(someone)h(would)f(dive)f(into)i +(the)f(sour)o(ce)f(and)g(impr)o(ove)h(it.)365 3412 y +Fy(10.5)99 b(Standard)24 b(\002le)h(locations)365 3626 +y FD(Because)20 b(the)i(scshvm)g(binary)f(is)g(intended)g(to)h(be)f +(used)g(for)g(writing)h(shell)g(scripts,)f(it)g(is)365 +3726 y(important)j(that)g(the)f(binary)h(be)f(installed)g(in)h(a)f +(standar)o(d)f(place,)h(so)h(that)f(shell)h(scripts)365 +3825 y(can)h(dependably)e(r)o(efer)g(to)i(it.)37 b(The)24 +b(standar)o(d)f(dir)o(ectory)h(for)g(the)h(scsh)g(tr)o(ee)f(should)h +(be)365 3925 y FA(/usr/local/lib/sc)o(sh)o(/)p FD(.)20 +b(Whenever)g(possible,)h(the)g(vm)g(should)g(be)g(located)f(in)573 +4064 y FA(/usr/local/lib/s)o(cs)o(h/s)o(cs)o(hvm)365 +4203 y FD(and)h(a)f(scsh)h(heap)f(image)h(should)h(be)e(located)g(in) +573 4342 y FA(/usr/local/lib/s)o(cs)o(h/s)o(cs)o(h.i)o(ma)o(ge)365 +4481 y FD(The)h(top-level)f(scsh)i(pr)o(ogram)e(should)h(be)g(located)f +(in)573 4620 y FA(/usr/local/lib/s)o(cs)o(h/s)o(cs)o(h)365 +4759 y FD(with)i(a)e(symbolic)i(link)f(to)h(it)f(fr)o(om)573 +4898 y FA(/usr/local/bin/s)o(cs)o(h)1735 5147 y FD(175)p +eop +%%Page: 176 184 +176 183 bop 805 614 a FD(The)30 b(Scheme)g(48)f(image)h(format)g +(allows)g(heap)g(images)g(to)h(have)e FA(#!)g FD(triggers,)k(so)681 +714 y FA(scsh.image)16 b FD(should)22 b(have)e(a)g FA(#!)g +FD(trigger)h(of)g(the)g(following)h(form:)888 905 y FA +(#!/usr/local/lib/)o(sc)o(sh/)o(sc)o(shv)o(m)37 b(\\)888 +1005 y(-o)43 b(/usr/local/lib/s)o(csh)o(/s)o(csh)o(vm)37 +b(-i)888 1104 y(...)43 b FC(heap)20 b(image)g(goes)g(her)o(e)44 +b FA(...)2051 5147 y FD(176)p eop +%%Page: 177 185 +177 184 bop 365 1283 a Fz(Chapter)45 b(1)-6 b(1)365 1744 +y FE(Changes)53 b(from)e(previous)365 1993 y(releases)365 +2488 y Fy(1)l(1.1)100 b(Changes)24 b(from)h(the)g(previous)g(release) +365 2729 y FD(This)31 b(section)g(details)e(changes)h(that)g(have)g +(been)g(made)f(in)i(scsh)f(since)h(the)f(pr)o(evious)365 +2829 y(r)o(elease.)490 2975 y(Scsh)f(is)g(now)g(much)h(mor)o(e)e(r)o +(obust.)50 b(All)28 b(known)i(bugs)g(have)e(been)g(\002xed.)50 +b(Ther)o(e)365 3074 y(have)21 b(been)f(many)h(impr)o(ovements)h(and)e +(extensions)i(made.)j(These)c(new)g(featur)o(es)e(and)365 +3174 y(changes)31 b(ar)o(e)e(listed)i(below)-8 b(,)34 +b(in)d(no)g(particular)f(or)o(der;)k(the)d(r)o(elevant)e(sections)j(of) +e(the)365 3273 y(manual)21 b(give)g(the)g(full)f(details.)490 +3419 y(Scsh)28 b(now)h(supports)g(complete)i(P)t Fv(O)t(S)t(I)t(X)r +FD(,)g(including)f(signal)e(handlers.)49 b(Early)27 b(au-)365 +3519 y(tor)o(eaping)h(of)g(child)h(pr)o(ocesses)e(is)i(now)g(handled)f +(by)g(a)g FA(SIGCHLD)d FD(signal)k(handler)-6 b(,)29 +b(so)365 3618 y(childr)o(en)21 b(ar)o(e)e(r)o(eaped)g(as)h(early)g(as)h +(possible)g(with)h(no)f(user)g(intervention)g(r)o(equir)o(ed.)490 +3764 y(A)h(functional)g(static)g(heap)g(linker)g(is)h(included)f(in)g +(this)h(r)o(elease.)28 b(It)22 b(is)h(ugly)-9 b(,)22 +b(limited)365 3864 y(in)h(functionality)-9 b(,)24 b(and)e(extr)o(emely) +g(slow)-8 b(,)24 b(but)f(it)g(works.)32 b(It)23 b(can)f(be)h(used)f(to) +h(build)g(scsh)365 3963 y(binaries)e(that)g(start)f(up)h(instantly)-9 +b(.)490 4109 y(The)21 b(r)o(egular)g(expr)o(ession)g(system)h(has)g +(been)f(sped)g(up.)28 b(Regular)o(-expr)o(ession)20 b(com-)365 +4209 y(pilation)g(is)g(now)g(pr)o(ovided,)e(and)g(the)i +FA(awk)e FD(macr)o(o)g(has)h(been)g(r)o(ewritten)g(to)g(pr)o(e-compile) +365 4308 y(r)o(egexps)e(used)g(in)h(r)o(ules)g(outside)g(the)f(loop.)25 +b(It)18 b(is)g(still,)g(however)-6 b(,)18 b(slower)g(than)g(it)g +(should)365 4408 y(be.)490 4553 y(Execing)31 b(pr)o(ograms)f(should)i +(be)f(faster)f(in)i(this)g(r)o(elease,)g(since)f(we)g(now)h(use)f(the) +365 4653 y FA(CLOEXEC)18 b FD(status)j(bit)g(to)g(get)g(automatic)f +(closing)i(of)f(unr)o(evealed)e(port)i(\002le)g(descriptors.)490 +4799 y(scm's)32 b(\003oating)h(point)g(support)f(was)g(inadvertently)f +(omitted)i(fr)o(om)e(the)h(last)g(r)o(e-)365 4898 y(lease.)25 +b(It)c(has)g(been)f(r)o(einstated.)1735 5147 y(177)p +eop +%%Page: 178 186 +178 185 bop 805 614 a FD(Ther)o(e)20 b(is)h(now)g(a)f(new)g +(command-line)h(switch,)g FA(-sfd)42 b FC(num)p FD(,)20 +b(which)i(causes)e(scsh)h(to)681 714 y(r)o(ead)e(its)i(script)g(fr)o +(om)f(\002le)h(descriptor)f FC(num)p FD(.)681 990 y Fy(1)l(1.2)99 +b(Changes)25 b(from)f(the)h(penultimate)f(release)681 +1204 y FD(This)c(section)h(details)e(changes)h(that)g(have)f(been)h +(made)f(in)h(scsh)h(since)f(the)g(penultimate)681 1304 +y(r)o(elease.)805 1429 y(Scsh)29 b(is)g(now)h(much)f(mor)o(e)g(r)o +(obust.)49 b(All)29 b(known)h(bugs)f(have)f(been)h(\002xed.)49 +b(Ther)o(e)681 1528 y(have)34 b(been)g(many)g(impr)o(ovements)h(and)f +(extensions)h(made.)65 b(W)-8 b(e)34 b(have)g(also)h(made)681 +1628 y(made)20 b(some)h(incompatible)g(changes.)805 1752 +y(The)32 b(sections)i(below)e(brie\003y)h(describe)e(these)h(new)h +(featur)o(es)d(and)i(changes;)38 b(the)681 1852 y(r)o(elevant)19 +b(sections)j(of)f(the)g(manual)f(give)h(the)g(full)g(details.)681 +2102 y FB(1)m(1.2.1)80 b(New)21 b(features)681 2285 y +FD(This)g(r)o(elease)e(incorporates)i(several)f(new)h(featur)o(es)e +(into)j(scsh.)805 2487 y Fw(\017)41 b FD(Contr)o(ol)21 +b(of)g(buf)o(fer)o(ed)d(I/O)888 2586 y(Scsh)25 b(now)g(allows)h(you)f +(to)g(contr)o(ol)g(the)g(buf)o(fering)e(policy)i(used)g(for)f(doing)h +(I/O)888 2686 y(on)d(a)e(Scheme)g(port.)805 2850 y Fw(\017)41 +b FD(Her)o(e-strings)888 2949 y(Scsh)26 b(now)h(has)f(a)f(new)i +(lexical)e(featur)o(e,)g FA(#<<)p FD(,)h(that)g(pr)o(ovides)f(the)h +(ability)g(to)g(en-)888 3049 y(ter)k(long,)j(multi-line)d(string)h +(constants)f(in)h(scsh)f(pr)o(ograms.)52 b(Such)30 b(a)f(string)i(is) +888 3149 y(called)21 b(a)h(\223her)o(e)e(string,\224)i(by)g(analogy)g +(to)h(the)f(common)h(shell)g(\223her)o(e)d(document\224)888 +3248 y FA(<<)g FD(r)o(edir)o(ection.)805 3412 y Fw(\017)41 +b FD(Delimited)21 b(r)o(eaders)e(and)i(r)o(ead-line)888 +3512 y(Scsh)32 b(now)g(has)f(a)g(powerful)g(set)g(of)h(delimited)f(r)o +(eaders.)55 b(These)31 b(can)g(be)g(used)888 3611 y(to)23 +b(r)o(ead)f(input)h(delimited)f(by)h(a)f(newline)i(character)d(\()p +FA(read-line)p FD(\),)e(a)j(blank)h(line)888 3711 y(\()p +FA(read-paragraph)p FD(\),)c(or)24 b(the)h(occurr)o(ence)e(of)h(any)g +(character)f(in)i(an)f(arbitrary)f(set)888 3810 y(\()p +FA(read-delimited)p FD(\).)888 3942 y(While)k(these)g(pr)o(ocedur)o(es) +e(can)h(be)g(applied)g(to)g(any)h(Scheme)f(input)h(port,)h(ther)o(e)888 +4042 y(is)37 b(native-code)f(support)g(for)g(performing)h(delimited)f +(r)o(eads)f(on)i(Unix)g(input)888 4141 y(sour)o(ces,)h(so)e(doing)f +(block)g(input)h(with)f(these)g(pr)o(ocedur)o(es)e(should)j(be)e(much) +888 4241 y(faster)20 b(than)h(the)g(equivalent)g(character)o +(-at-a-time)c(Scheme)j(code.)805 4405 y Fw(\017)41 b +FD(New)21 b(system)h(calls)888 4504 y(W)-5 b(ith)33 b(the)e(sole)h +(exception)g(of)f(signal)h(handlers,)h(scsh)f(now)h(has)e(all)g(of)j(P) +t Fv(O)t(S)t(I)t(X)r FD(.)888 4604 y(This)22 b(r)o(elease)d(intr)o +(oduces)988 4768 y FB(\226)41 b FA(select)p FD(,)988 +4898 y FB(\226)g FD(full)21 b(terminal)g(device)f(contr)o(ol,)2051 +5147 y(178)p eop +%%Page: 179 187 +179 186 bop 672 614 a FB(\226)42 b FD(support)20 b(for)h +(pseudo-terminal)f(\223pty\224)g(devices,)672 748 y FB(\226)42 +b FD(\002le)20 b(locking,)672 882 y FB(\226)42 b FD(pr)o(ocess)20 +b(timing,)672 1016 y FB(\226)42 b FA(set-file-times)p +FD(,)672 1150 y FB(\226)g FA(seek)19 b FD(and)h FA(tell)p +FD(.)573 1318 y(Note)d(that)g(having)g FA(select)p FD(,)e +(pseudo-terminals,)i(and)f(tty)h(device)f(contr)o(ol)h(means)573 +1417 y(that)23 b(it)h(is)g(now)g(possible)h(to)e(implement)i(inter)o +(esting)e(network)i(pr)o(otocols,)f(such)573 1517 y(as)c(telnet)h +(servers)f(and)h(clients,)g(dir)o(ectly)f(in)h(Scheme.)490 +1685 y Fw(\017)41 b FD(New)21 b(command-line)g(switches)573 +1785 y(Ther)o(e)32 b(is)h(a)g(new)g(set)g(of)g(command-line)h(switches) +g(that)e(make)h(it)h(possible)f(to)573 1884 y(write)26 +b(shell)h(scripts)f(using)i(the)e(Scheme)g(48)f(module)i(system.)43 +b(Scripts)26 b(can)g(use)573 1984 y(the)j(new)h(command-line)g +(switches)g(to)g(open)f(dependent)g(modules)h(and)f(load)573 +2084 y(dependent)16 b(sour)o(ce)g(code.)23 b(Scripts)16 +b(can)g(also)h(be)f(written)h(in)g(the)f(Scheme)g(48)g(mod-)573 +2183 y(ule)i(language,)h(which)g(allows)h(you)f(to)g(use)g(it)f(both)i +(as)e(a)g(standalone)h(shell)g(script,)573 2283 y(and)i(as)f(a)h(code)g +(module)g(that)g(can)g(be)g(loaded)f(and)h(used)g(by)g(other)h(Scheme)e +(pr)o(o-)573 2383 y(grams.)490 2551 y Fw(\017)41 b FD(Static)20 +b(heap)g(linking)573 2650 y(Ther)o(e)25 b(is)i(a)g(new)f(facility)h +(that)f(allows)h(you)h(to)f(compile)g(a)f(heap)g(image)g(to)h(a)f +FA(.o)573 2750 y FD(\002le)f(that)f(can)g(be)h(linked)f(with)i(the)e +(scsh)i(virtual)e(machine.)37 b(This)25 b(pr)o(oduces)f(a)g(s-)573 +2849 y(tandalone)17 b(executable)g(binary)-9 b(,)18 b(makes)g(startup)f +(time)h(near)o(-instantaneous,)g(and)573 2949 y(gr)o(eatly)h(impr)o +(oves)g(memory)i(performance\227the)e(initial)h(heap)f(image)h(is)g +(placed)573 3049 y(in)k(the)g(pr)o(ocess')f(text)h(pages,)f(wher)o(e)g +(it)h(is)g(shar)o(ed)f(by)g(dif)o(fer)o(ent)f(scsh)i(pr)o(ocesses,)573 +3148 y(and)c(does)h(not)g(occupy)g(space)f(in)i(the)e(r)o(un-time)i +(heap.)756 3325 y Fl(Oops:)79 b Fk(The)26 b(static)g(heap)g(linker)f +(was)h(not)h(documented)e(and)h(installed)g(in)756 3417 +y(time)18 b(for)g(this)h(r)o(elease.)365 3672 y FB(1)m(1.2.2)81 +b(Incompatible)18 b(improvements)365 3856 y FD(Some)30 +b(featur)o(es)f(of)h(scsh)h(have)e(been)h(impr)o(oved)g(in)h(ways)f +(that)g(ar)o(e)f(not)h(backwar)o(ds-)365 3956 y(compatible)20 +b(with)g(pr)o(evious)f(r)o(eleases.)k(These)d(changes)f(should)h(not)g +(af)o(fect)e(most)i(code;)365 4056 y(however)-6 b(,)21 +b(please)f(note)h(the)g(changes)g(and)f(modify)h(your)g(code)g(accor)o +(dingly)-9 b(.)490 4266 y Fw(\017)41 b FD(New)21 b(pr)o(ocess-object)f +(data-type)f(r)o(eturned)h(by)g FA(fork)573 4366 y FD(Pr)o(evious)h(r)o +(eleases)f(wer)o(e)h(pr)o(one)g(to)g(\002ll)h(up)g(the)f(kernel's)h(pr) +o(ocess)f(table)f(if)i(a)e(pr)o(o-)573 4466 y(gram)25 +b(forked)g(lar)o(ge)g(numbers)h(of)g(pr)o(ocesses)f(and)g(subsequently) +i(failed)d(to)j(use)573 4565 y FA(wait)15 b FD(to)j(r)o(eclaim)e(the)h +(entries)h(in)f(the)h(kernel's)f(pr)o(ocess)g(table.)23 +b(\(This)18 b(is)f(a)g(pr)o(oblem)573 4665 y(in)k(standar)o(d)e(C)i +(envir)o(onments,)g(as)g(well.\))573 4799 y(Scsh)27 b(0.4)f(intr)o +(oduces)h(a)f(new)i(mechanism)f(for)g(automatically)g(managing)h(sub-) +573 4898 y(pr)o(ocesses.)35 b(Pr)o(ocesses)24 b(ar)o(e)f(no)i(longer)g +(r)o(epr)o(esented)d(by)i(an)g(integer)g(pr)o(ocess)g(id,)1735 +5147 y(179)p eop +%%Page: 180 188 +180 187 bop 888 614 a FD(which)31 b(is)f(impossible)g(to)g +(garbage-collect,)g(but)g(by)f(an)h(abstract)e(pr)o(ocess)h(data)888 +714 y(type)d(that)g(encapsulates)g(the)g(pr)o(ocess)g(id.)41 +b(All)26 b(pr)o(ocesses)g(ar)o(e)e(r)o(epr)o(esented)g(us-)888 +814 y(ing)31 b(the)f(new)g(data)e(str)o(uctur)o(es;)34 +b(see)29 b(the)h(r)o(elevant)f(section)h(of)g(the)g(manual)f(for)888 +913 y(further)21 b(details.)805 1099 y Fw(\017)41 b FD(Better)20 +b(stdio/curr)o(ent-port)h(synchr)o(onisation)888 1199 +y(The)i FA(\(begin)41 b(...\))20 b FD(pr)o(ocess)i(form)g(now)h(does)g +(a)e FA(stdio->stdports)16 b FD(call)22 b(befor)o(e)888 +1298 y(executing)i(its)g(body)-9 b(.)35 b(This)24 b(means)g(that)g(the) +g(Scheme)f(code)h(in)g(the)g(body)g(\223sees\224)888 +1398 y(any)i(external)e(r)o(edir)o(ections.)38 b(For)25 +b(example,)h(it)f(means)g(that)g(if)g(a)g FA(begin)e +FD(form)j(in)888 1498 y(the)h(middle)g(of)f(a)g(pipeline)h(performs)f +(I/O)h(on)h(the)f(curr)o(ent)e(input)i(and)g(output)888 +1597 y(ports,)18 b(it)f(will)g(be)f(communicating)i(with)f(its)g(upstr) +o(eam)f(and)g(downstr)o(eam)g(pipes.)888 1697 y FC(E.g.)o +FD(,)j(this)h(code)f(works)g(as)g(intended)g(without)h(the)f(need)g +(for)g(explicit)f(synchr)o(oni-)888 1797 y(sation:)888 +2016 y FA(\(run)42 b(\(|)h(\(gunzip\))1237 2115 y(;;)g(Kill)f(line)g(1) +h(and)f(insert)f(doubled-sided)1237 2215 y(;;)i(code)f(at)g(head)g(of)h +(Postscript.)1237 2315 y(\(begin)e(\(read-line\))e(;)k(Eat)g(first)e +(line.)1542 2414 y(\(display)f("\045!PS-Adobe-2.0\\\\)o(n"\))1542 +2514 y(\(display)g("statusdict)f(/setduplexmode)f(known)k("\))1542 +2614 y(\(display)e("{statusdict)f(begin)j(true)f("\))1542 +2713 y(\(display)f("setduplexmode)e(end})k(if\\n"\))1542 +2813 y(\(exec-epf)e(\(cat\)\)\))1237 2912 y(\(lpr\)\))1106 +3012 y(\(<)j(paper.ps\)\))888 3231 y FD(Arranging)35 +b(for)f(the)g FA(begin)f FD(pr)o(ocess)h(form)g(to)h(synchr)o(onise)g +(the)g(curr)o(ent)e(I/O)888 3331 y(ports)d(with)g(stdio)g(means)f(that) +h(all)f(pr)o(ocess)g(forms)g(now)h(see)g(their)f(epf)5 +b('s)28 b(r)o(edi-)888 3430 y(r)o(ections.)805 3616 y +Fw(\017)41 b FA(file-match)17 b FD(mor)o(e)j(r)o(obust)888 +3716 y(The)h FA(file-match)16 b FD(pr)o(ocedur)o(e)i(now)k(catches)e +(any)g(err)o(or)g(condition)h(signalled)g(by)888 3816 +y(a)h(match)g(pr)o(ocedur)o(e,)f(and)g(tr)o(eats)h(it)g(as)g(if)g(the)g +(pr)o(ocedur)o(e)e(had)i(simply)h(r)o(eturned)888 3915 +y FA(#f)p FD(,)h FC(i.e.)p FD(,)h(match)f(failur)o(e.)34 +b(This)25 b(means)f FA(file-match)c FD(no)25 b(longer)f(gets)h(blown)g +(out)888 4015 y(of)19 b(the)f(water)g(by)g(trying)h(to)g(apply)f(a)g +(function)h(like)f FA(file-directory?)12 b FD(to)19 b(a)f(dan-)888 +4115 y(gling)k(symlink,)g(and)e(other)h(r)o(elated)e(OS)i(err)o(ors.) +805 4301 y Fw(\017)41 b FD(Standar)o(d)19 b(input)i(now)h(unbuf)o(fer)o +(ed)888 4400 y(Scsh's)c(startup)g(code)g(now)g(makes)g(the)g(initial)h +(curr)o(ent)e(input)h(port)g(\(corr)o(espond-)888 4500 +y(ing)25 b(to)f(\002le)g(descriptor)g(0\))f(unbuf)o(fer)o(ed.)32 +b(This)25 b(keeps)f(the)g(shell)g(fr)o(om)g(\223stealing\224)888 +4599 y(input)e(meant)f(for)f(subpr)o(ocesses.)26 b(However)-6 +b(,)21 b(it)g(does)g(slow)h(down)f(character)o(-at-)888 +4699 y(a-time)j(input)h(pr)o(ocessing.)37 b(If)24 b(you)h(ar)o(e)e +(writing)i(a)f(pr)o(ogram)g(that)g(is)h(tolerant)f(of)888 +4799 y(buf)o(fer)o(ed)19 b(input,)i(and)f(wish)i(the)f(ef)o(\002ciency) +g(gains,)g(you)g(can)g(r)o(eset)f(the)h(buf)o(fering)888 +4898 y(policy)h(yourself.)2051 5147 y(180)p eop +%%Page: 181 189 +181 188 bop 490 614 a Fw(\017)41 b FD(\223writeable\224)19 +b(now)j(spelled)e(\223writable\224)573 714 y(W)-8 b(e)27 +b(inconsistently)h(spelled)f FA(file-writable?)21 b FD(and)26 +b FA(file-not-writabl)o(e?)20 b FD(in)573 814 y(the)25 +b(manual)f(and)h(the)g(implementation.)38 b(W)-8 b(e)25 +b(have)f(now)i(standar)o(dised)d(on)i(the)573 913 y(common)g(spelling)f +(\223writable\224)d(in)j(both.)34 b(The)23 b(older)g(bindings)h(still)g +(exist)f(in)h(r)o(e-)573 1013 y(lease)c(0.4,)f(but)i(will)h(go)f(away)f +(in)h(futur)o(e)f(r)o(eleases.)490 1190 y Fw(\017)41 +b FA(char-set-member?)14 b FD(r)o(eplaced)573 1290 y(W)-8 +b(e)21 b(have)f(de-r)o(eleased)e(the)j FA(char-set-member?)14 +b FD(pr)o(ocedur)o(e.)24 b(The)d(scsh)g(0.3)f(ver)o(-)573 +1390 y(sion)i(of)e(this)i(pr)o(ocedur)o(e)d(took)i(ar)o(guments)g(in)g +(the)g(following)h(or)o(der:)756 1541 y FA(\(char-set-membe)o(r?)37 +b FC(char)43 b(char-set)o FA(\))573 1693 y FD(This)17 +b(ar)o(gument)g(or)o(der)f(is)h(in)h(accor)o(dance)d(with)j(standar)o +(d)d(mathematical)i(useage)573 1793 y(\()p FC(i.e.)o +FD(,)31 b Fo(x)38 b Fw(2)h Fo(S)5 b FD(\),)30 b(and)e(also)h +(consistent)h(with)g(the)f(R4RS)g FA(member)p FD(,)f +FA(memq)f FD(and)h FA(memv)573 1892 y FD(pr)o(ocedur)o(es.)59 +b(It)33 b(is,)j(however)-6 b(,)35 b(exactly)d(opposite)h(fr)o(om)g(the) +f(ar)o(gument)h(or)o(der)573 1992 y(used)23 b(by)h(the)g +FA(char-set-member?)18 b FD(in)24 b(MIT)f(Scheme's)h(character)o(-set)e +(library)-9 b(.)34 b(If)573 2092 y(we)27 b(left)g(things)h(as)f(they)g +(wer)o(e,)h(we)f(risked)g(pr)o(oblems)f(with)i(code)f(ported)g(over)573 +2191 y(fr)o(om)j(MIT)g(Scheme.)54 b(On)31 b(the)f(other)h(hand,)h +(changing)g(to)e(conformance)h(with)573 2291 y(MIT)c(Scheme)h(meant)f +(inconsistency)j(with)f(common)g(mathematical)e(notation)573 +2391 y(and)f(other)h(long-standing)h(Scheme)f(pr)o(ocedur)o(es.)42 +b(Either)26 b(way)h(was)g(bound)g(to)573 2490 y(intr)o(oduce)20 +b(confusion.)573 2629 y(W)-8 b(e've)34 b(taken)g(the)h(appr)o(oach)e +(of)i(simply)g(r)o(emoving)g(the)f FA(char-set-member?)573 +2728 y FD(pr)o(ocedur)o(e)19 b(altogether)-6 b(,)20 b(and)g(r)o +(eplacing)g(it)h(with)h(a)e(new)h(pr)o(ocedur)o(e:)756 +2880 y FA(\(char-set-conta)o(in)o(s?)37 b FC(cset)44 +b(char)o FA(\))573 3032 y FD(Note)21 b(that)f(the)h(ar)o(gument)g(or)o +(der)e(is)i(consistent)h(with)g(the)f(name.)490 3209 +y Fw(\017)41 b FA(file-attributes)14 b FD(now)22 b FA(file-info)573 +3309 y FD(In)17 b(keeping)g(with)g(the)g(general)f(convention)i(in)f +(scsh)g(of)f(naming)i(pr)o(ocedur)o(es)d(that)573 3409 +y(r)o(etrieve)33 b(information)i(about)f(system)h(r)o(esour)o(ces)f +FA(...-info)d FD(\()p FC(e.g.)o FD(,)37 b FA(tty-info)p +FD(,)573 3508 y FA(user-info)p FD(,)16 b FA(group-info)p +FD(\),)f(the)20 b FA(file-attributes)14 b FD(pr)o(ocedur)o(e)k(is)i +(now)h(named)573 3608 y FA(file-info)p FD(.)573 3747 +y(W)-8 b(e)17 b(continue)h(to)f(export)g(a)f FA(file-attributes)11 +b FD(binding)17 b(for)g(the)g(curr)o(ent)f(r)o(elease,)573 +3846 y(but)21 b(it)g(will)g(go)g(away)g(in)g(futur)o(e)e(r)o(eleases.) +490 4024 y Fw(\017)41 b FD(Renaming)22 b(of)e(I/O)i(synchr)o(onisation) +g(pr)o(ocedur)o(es)573 4123 y(The)107 b FA(\(stdio->stdports)37 +b FC(thunk)o FA(\))107 b FD(pr)o(ocedur)o(e)f(has)h(been)g(r)o(enamed) +573 4223 y FA(with-stdio-ports)o(*)p FD(;)35 b(ther)o(e)f(is)g(now)i(a) +e(corr)o(esponding)g FA(with-stdio-ports)573 4322 y FD(special)54 +b(form.)126 b(The)54 b FA(stdio->stdports)48 b FD(pr)o(ocedur)o(e)53 +b(is)h(now)i(a)d(nullary)573 4422 y(pr)o(ocedur)o(e)19 +b(that)h(side-ef)o(fects)f(the)i(curr)o(ent)f(set)h(of)f(curr)o(ent)g +(I/O)i(port)e(bindings.)490 4599 y Fw(\017)41 b FD(New)21 +b(meta-ar)o(g)e(line-two)i(syntax)573 4699 y(Scsh)h(now)g(uses)g(a)f +(simpli\002ed)i(grammar)e(for)g(describing)h(command-line)g(ar)o(gu-) +573 4799 y(ments)29 b(r)o(ead)d(by)i(the)h(\223meta-ar)o(g\224)c +(switch)k(fr)o(om)f(line)h(two)f(of)h(a)e(shell)i(script.)48 +b(If)573 4898 y(you)26 b(wer)o(e)e(using)j(this)f(featur)o(e)d(in)j(pr) +o(evious)f(r)o(eleases,)g(the)h(thr)o(ee)e(incompatible)1735 +5147 y(181)p eop +%%Page: 182 190 +182 189 bop 888 614 a FD(changes)19 b(of)g(which)h(to)f(be)f(awar)o(e)f +(ar)o(e:)23 b(\(1\))18 b(tab)g(is)h(no)g(longer)h(allowed)e(as)h(an)f +(ar)o(gu-)888 714 y(ment)24 b(delimiter)-6 b(,)23 b(\(2\))f(a)g(r)o(un) +i(of)f(space)f(characters)g(is)h(not)h(equivalent)f(to)h(a)e(single)888 +814 y(space,)e(\(3\))g(empty)h(ar)o(guments)f(ar)o(e)f(written)j(a)e +(dif)o(fer)o(ent)e(way)-9 b(.)681 1065 y FB(1)m(1.2.3)80 +b(Backwards-compatible)17 b(improvements)681 1248 y FD(Some)k(existing) +h(featur)o(es)d(in)j(scsh)f(have)g(been)g(impr)o(oved)f(in)i(ways)f +(that)g(will)h(not)g(ef)o(fect)681 1347 y(existing)f(code.)805 +1555 y Fw(\017)41 b FD(Impr)o(oved)20 b(err)o(or)g(r)o(eporting)888 +1654 y(Exception)d(handlers)f(that)g(print)g(out)h(err)o(or)e(messages) +i(and)f(warnings)h(now)g(print)888 1754 y(their)32 b(messages)g(on)g +(the)g(err)o(or)f(output)h(port,)j(instead)c(of)h(the)g(curr)o(ent)f +(output)888 1854 y(port.)26 b(Pr)o(evious)19 b(r)o(eleases)f(used)i +(the)g(curr)o(ent)f(output)h(port,)f(a)h(pr)o(oblem)f(inherited)888 +1953 y(fr)o(om)i(Scheme)f(48.)888 2086 y(Pr)o(evious)f(scsh)g(r)o +(eleases)e(\003ushed)i(the)g(Scheme)f(48)f(debugging)i(tables)f(when)h +(cr)o(e-)888 2186 y(ating)28 b(the)f(standar)o(d)f(scsh)h(heap)g +(image.)45 b(This)28 b(trimmed)f(the)g(size)g(of)g(the)h(heap)888 +2285 y(image,)23 b(but)f(made)g(err)o(or)f(messages)i(much)g(less)f +(compr)o(ehensible.)31 b(W)-8 b(e)22 b(now)h(r)o(e-)888 +2385 y(tain)c(the)g(debugging)g(tables.)25 b(This)19 +b(bloats)g(the)g(heap)g(image)f(up)h(by)g(about)g(600kb.)888 +2485 y(And)i(worth)g(it,)g(too.)888 2617 y(\(W)-8 b(e)22 +b(also)g(have)g(some)h(new)f(techniques)h(for)f(eliminating)h(the)f(r)o +(un-time)h(memo-)888 2717 y(ry)k(penalty)f(imposed)g(by)h(these)f(lar)o +(ge)f(heap)h(images.)42 b(Scsh's)26 b(new)h(static-heap)888 +2817 y(technology)34 b(allows)f(for)f(this)h(data)e(to)i(be)f(linked)g +(into)h(the)g(text)f(pages)g(of)g(the)888 2916 y(vm's)26 +b(binary)-9 b(,)27 b(wher)o(e)e(it)g(will)i(not)f(be)f(touched)h(by)g +(the)f(GC)h(or)g(otherwise)g(af)o(fect)888 3016 y(the)21 +b(memory)h(system)f(until)h(it)f(is)g(r)o(efer)o(enced.\))888 +3149 y(Finally)-9 b(,)26 b(scsh)g(now)f(generates)f(mor)o(e)h +(informative)g(err)o(or)e(messages)i(for)g(syscall)888 +3248 y(err)o(ors.)k(For)22 b(example,)f(a)g(\002le-open)h(err)o(or)f +(pr)o(eviously)h(told)g(you)h(what)f(the)g(err)o(or)888 +3348 y(was)29 b(\()p FC(e.g.)o FD(,)g(\223Permission)h(denied,\224)f +(or)f(\223No)g(such)h(\002le)f(or)h(dir)o(ectory\224\),)f(but)g(not)888 +3448 y(which)22 b(\002le)f(you)g(had)g(tried)f(to)h(open.)26 +b(W)-8 b(e've)20 b(impr)o(oved)h(this.)805 3614 y Fw(\017)41 +b FD(Closing)22 b(a)f(port)f(twice)h(allowed)888 3713 +y(Scsh)26 b(used)f(to)g(generate)g(an)g(err)o(or)f(if)h(you)h +(attempted)e(to)i(close)f(a)g(port)g(that)g(had)888 3813 +y(alr)o(eady)20 b(been)i(closed.)30 b(This)22 b(is)h(now)f(allowed.)30 +b(The)22 b(close)g(pr)o(ocedur)o(e)e(r)o(eturns)i(a)888 +3913 y(boolean)f(to)h(indicate)e(whether)h(the)g(port)g(had)f(alr)o +(eady)f(been)h(closed)h(or)g(not.)805 4079 y Fw(\017)41 +b FD(Better)20 b(time)h(pr)o(ecision)888 4178 y(The)34 +b FA(time+ticks)29 b FD(pr)o(ocedur)o(e)j(now)i(r)o(eturns)g +(sub-second)f(pr)o(ecision)h(on)g(OS's)888 4278 y(that)21 +b(support)g(it.)805 4444 y Fw(\017)41 b FD(Nicer)21 b(print-methods)g +(for)g(basic)f(data-types)888 4544 y(Scsh's)f(standar)o(d)d(r)o(ecor)o +(d)h(types)h(now)h(print)g(mor)o(e)f(informatively)-9 +b(.)25 b(For)18 b(example,)888 4643 y(a)23 b(pr)o(ocess)f(object)h +(includes)g(the)g(pr)o(ocess)g(id)f(in)i(its)f(printed)f(r)o(epr)o +(esentation:)29 b(the)888 4743 y(pr)o(ocess)21 b(object)g(for)f(pr)o +(ocess)h(id)f(2653)f(prints)i(as)g FA(#{proc)41 b(2653})p +FD(.)2051 5147 y(182)p eop +%%Page: 183 191 +183 190 bop 365 1262 a Fz(Chapter)45 b(12)365 1702 y +FE(T)-23 b(odo)365 2159 y FD(Ther)o(e)35 b(ar)o(e)e(always)i(many)-9 +b(,)39 b(many)d(impr)o(ovements)f(and)g(extensions)h(that)f(could)h(be) +365 2258 y(made)30 b(to)h(scsh.)55 b(W)-8 b(e)31 b(invite)g(inter)o +(ested)f(hackers)g(to)h(do)f(any)h(of)f(them,)k(and)c(send)g(us)365 +2358 y(the)22 b(code;)f(we'll)h(put)g(you)g(on)g(the)g(team.)28 +b(V)-5 b(isit)22 b(the)g(Scheme)f(Under)o(gr)o(ound)g(W)-8 +b(eb)21 b(page)365 2457 y(for)g(mor)o(e)f(information)i(on)f(good)h +(hacks)e(at)573 2557 y FA(http://www.ai.mi)o(t.)o(edu)o(/p)o(roj)o(ec)o +(ts)o(/su)o(/)365 2657 y FD(Scsh)h(is)h(a)e(tool)i(that)f(lets)g(you)h +(write)f(fun)g(pr)o(ograms)f(that)h(do)g(r)o(eal)f(things)i(in)g(an)f +(elegant)365 2756 y(language;)f(go)i(wild.)490 2959 y +Fw(\017)41 b FD(Thr)o(eads.)490 3123 y Fw(\017)g FD(An)21 +b(X)g(gui)g(interface.)j(\(Needs)c(thr)o(eads.\))490 +3287 y Fw(\017)41 b FD(A)20 b(better)g(C)h(function/data-str)o(uctur)o +(e)f(interface.)k(This)d(is)h(not)f(easy)-9 b(.)490 3451 +y Fw(\017)41 b FD(Mor)o(e)20 b(network)h(pr)o(otocols.)26 +b(T)-8 b(elnet)21 b(and)f(ftp)h(would)g(be)f(the)h(most)h(important.) +490 3615 y Fw(\017)41 b FD(An)21 b(ILU)f(interface.)490 +3779 y Fw(\017)41 b FD(An)21 b(RPC)g(system,)g(with)g(\223tail-r)o +(ecursion.\224)490 3943 y Fw(\017)41 b FD(Interfaces)21 +b(to)i(r)o(elational)f(db's.)31 b(This)23 b(would)g(be)f(quite)h +(useful)f(for)h(W)-8 b(eb)22 b(servers.)573 4043 y(An)d(s-expr)o +(ession)f(embedding)h(of)g(SQL)f(would)h(be)g(a)f(key)h(design)h +(component)g(of)573 4142 y(such)h(a)f(system,)i(along)f(the)g(lines)g +(of)g(scsh's)g(pr)o(ocess)g(notation)h(or)e FA(awk)g +FD(notation.)490 4307 y Fw(\017)41 b FD(Port)21 b(Edwin,)g(and)g(emacs) +g(text)g(editor)g(written)g(in)h(MIT)e(Scheme,)h(to)g(scsh.)27 +b(Com-)573 4406 y(bine)21 b(it)g(with)g(scsh's)h(OS)e(interfaces)g(to)h +(make)g(a)f(visual)h(shell.)490 4570 y Fw(\017)41 b FD(An)21 +b FA(expect)d FD(knock-of)o(f.)490 4734 y Fw(\017)41 +b FD(A)20 b FA(make)f FD(r)o(eplacement,)h(using)h(scsh's)h(pr)o(ocess) +e(notation)i(in)f(the)g(build)g(r)o(ules.)490 4898 y +Fw(\017)41 b FD(Manual)20 b(hacking.)1735 5147 y(183)p +eop +%%Page: 184 192 +184 191 bop 988 614 a FB(\226)41 b FD(The)17 b(L)1248 +597 y Fs(A)1281 614 y FD(T)1318 634 y(E)1358 614 y(X)h(hackery)f(needs) +h(yet)f(another)h(serious)g(pass.)24 b(Most)18 b(importantly)-9 +b(,)1071 714 y(long)22 b(pr)o(ocedur)o(e)c(\223declarations\224)i(need) +g(to)h(be)g(br)o(oken)f(acr)o(oss)g(two)i(lines.)988 +847 y FB(\226)41 b FD(Soup)24 b(up)h(the)f(markup)g(pr)o(ocessor)-6 +b(,)25 b(and)f(r)o(edo)g(manual)g(in)h(markup.)36 b(Gen-)1071 +946 y(erate)20 b(L)1294 929 y Fs(A)1327 946 y FD(T)1364 +966 y(E)1404 946 y(X,)g(HTML,)g(and)g(info)h(versions.)26 +b(Alternatively)-9 b(,)20 b(persuade)f(some)1071 1046 +y(kind)i(soul)h(to)f(hand-port)f(manual)h(to)g(HTML)f(or)h(info.)805 +1212 y Fw(\017)41 b FD(Job)21 b(contr)o(ol,)g(after)e +FA(jcontrol.scm)805 1378 y Fw(\017)41 b FD(Better)20 +b(static)h(heap)f(linker)-6 b(.)805 1544 y Fw(\017)41 +b FD(Gnu)22 b(r)o(eadline)d(lib.)2051 5147 y(184)p eop +%%Page: 185 193 +185 192 bop 365 1095 a FE(Index)365 1514 y FA(\045read-delimited!)p +FD(,)14 b(141)365 1616 y(*temp-\002le-template*,)20 b(50)365 +1719 y FA(->uid)p FD(,)f(62)365 1821 y FA(->username)p +FD(,)e(62)365 1924 y FA(\045exec)p FD(,)i(52)365 2027 +y FA(\045exit)p FD(,)g(53)365 2129 y FA(\045fork)p FD(,)g(53)365 +2232 y FA(\045fork/pipe)p FD(,)e(54)365 2334 y FA(\045fork/pipe+)p +FD(,)f(55)365 2437 y(&,)k(13)365 2539 y FA(&)p FD(,)g(13)365 +2642 y FA(&&)p FD(,)g(20)365 2744 y FA(interrupt/alarm)p +FD(,)15 b(65)365 2847 y FA(interrupt/alrm)p FD(,)g(65)365 +2950 y FA(interrupt/chld)p FD(,)g(65)365 3052 y FA(interrupt/cont)p +FD(,)g(65)365 3155 y FA(interrupt/hup)p FD(,)g(65)365 +3257 y FA(interrupt/info)p FD(,)g(65)365 3360 y FA(interrupt/int)p +FD(,)g(65)365 3462 y FA(interrupt/io)p FD(,)h(65)365 +3565 y FA(interrupt/keyboar)o(d)p FD(,)e(65)365 3668 +y FA(interrupt/memory-)o(sh)o(ort)o(ag)o(e)p FD(,)g(65)365 +3770 y FA(interrupt/poll)p FD(,)h(65)365 3873 y FA(interrupt/prof)p +FD(,)g(65)365 3975 y FA(interrupt/pwr)p FD(,)g(65)365 +4078 y FA(interrupt/quit)p FD(,)g(65)365 4180 y FA(interrupt/term)p +FD(,)g(65)365 4283 y FA(interrupt/tstp)p FD(,)g(65)365 +4385 y FA(interrupt/urg)p FD(,)g(65)365 4488 y FA(interrupt/usr1)p +FD(,)g(65)365 4591 y FA(interrupt/usr2)p FD(,)g(65)365 +4693 y FA(interrupt/vtalrm)p FD(,)f(65)365 4796 y FA(interrupt/winch)p +FD(,)h(65)365 4898 y FA(interrupt/xcpu)p FD(,)g(65)1943 +1514 y FA(interrupt/xfsz)p FD(,)f(65)1943 1616 y FA(signal/abrt)p +FD(,)i(66)1943 1719 y FA(signal/alrm)p FD(,)g(65)1943 +1821 y FA(signal/bus)p FD(,)g(66)1943 1924 y FA(signal/chld)p +FD(,)g(65)1943 2027 y FA(signal/cont)p FD(,)g(65)1943 +2129 y FA(signal/emt)p FD(,)g(66)1943 2232 y FA(signal/fpe)p +FD(,)g(66)1943 2334 y FA(signal/hup)p FD(,)g(65)1943 +2437 y FA(signal/ill)p FD(,)g(66)1943 2539 y FA(signal/info)p +FD(,)g(65)1943 2642 y FA(signal/int)p FD(,)g(65)1943 +2744 y FA(signal/iot)p FD(,)g(66)1943 2847 y FA(signal/io)p +FD(,)h(65)1943 2950 y FA(signal/kill)p FD(,)f(66)1943 +3052 y FA(signal/pipe)p FD(,)g(66)1943 3155 y FA(signal/poll)p +FD(,)g(65)1943 3257 y FA(signal/prof)p FD(,)g(65)1943 +3360 y FA(signal/pwr)p FD(,)g(65)1943 3462 y FA(signal/quit)p +FD(,)g(65)1943 3565 y FA(signal/segv)p FD(,)g(66)1943 +3668 y FA(signal/stop)p FD(,)g(66)1943 3770 y FA(signal/sys)p +FD(,)g(66)1943 3873 y FA(signal/term)p FD(,)g(65)1943 +3975 y FA(signal/trap)p FD(,)g(66)1943 4078 y FA(signal/tstp)p +FD(,)g(65)1943 4180 y FA(signal/ttin)p FD(,)g(66)1943 +4283 y FA(signal/ttou)p FD(,)g(66)1943 4385 y FA(signal/urg)p +FD(,)g(65)1943 4488 y FA(signal/usr1)p FD(,)g(65)1943 +4591 y FA(signal/usr2)p FD(,)g(65)1943 4693 y FA(signal/vtalrm)p +FD(,)f(65)1943 4796 y FA(signal/winch)p FD(,)g(65)1943 +4898 y FA(signal/xcpu)p FD(,)h(65)1735 5147 y(185)p eop +%%Page: 186 194 +186 193 bop 681 614 a FA(signal/xfsz)p FD(,)16 b(65)681 +808 y(r)o(educe-char)o(-set)h(,)k(107)681 908 y(r)o(educe-port)e(,)h +(16)681 1102 y FA(absolute-file-na)o(me)o FD(,)15 b(105)681 +1203 y FA(accept-connectio)o(n)p FD(,)f(94)681 1303 y +FA(add-after)p FD(,)j(76)681 1403 y FA(add-before)p FD(,)f(76)681 +1503 y FA(alist->env)p FD(,)g(75)681 1604 y FA(alist-compress)p +FD(,)e(75)681 1704 y FA(alist-delete)p FD(,)h(75)681 +1804 y FA(alist-update)p FD(,)g(75)681 1904 y FA(arg)p +FD(,)k(62)681 2005 y FA(arg*)p FD(,)g(62)681 2105 y FA(argv)p +FD(,)g(62)681 2205 y FA(arithmetic-shift)o FD(,)c(156)681 +2305 y FA(ascii->char)p FD(,)h(106)681 2406 y FA(ascii-range->cha)o(r-) +o(set)o FD(,)f(107)681 2506 y FA(autoreap-policy)p FD(,)f(56)681 +2606 y(awk,)20 b(151)681 2800 y FA(become-session-l)o(ea)o(der)o +FD(,)15 b(83)681 2900 y FA(bind-listen-acce)o(pt)o(-lo)o(op)o +FD(,)g(91)681 3001 y FA(bind-socket)p FD(,)h(94)681 3101 +y FA(bitwise-and)p FD(,)g(156)681 3201 y FA(bitwise-ior)p +FD(,)g(156)681 3301 y FA(bitwise-not)p FD(,)g(156)681 +3402 y FA(bitwise-xor)p FD(,)g(156)681 3596 y FA(call-terminally)p +FD(,)e(53)681 3696 y FA(call-with-string)o(-o)o(utp)o(ut)o(-p)o(ort)o +FD(,)1013 3795 y(26)681 3896 y FA(call/fdes)p FD(,)j(30)681 +3996 y FA(char->ascii)p FD(,)f(106)681 4096 y FA(char-alphabetic?)o +FD(,)f(1)-5 b(10)681 4196 y FA(char-alphanumeri)o(c?)o +FD(,)15 b(1)-5 b(10)681 4297 y FA(char-ascii?)p FD(,)16 +b(1)-5 b(10)681 4397 y FA(char-blank?)p FD(,)16 b(1)-5 +b(10)681 4497 y FA(char-control?)p FD(,)15 b(1)-5 b(10)681 +4598 y FA(char-filter)p FD(,)16 b(20)681 4698 y FA(char-graphic?)p +FD(,)f(1)-5 b(10)681 4798 y FA(char-hex-digit?)p FD(,)14 +b(1)-5 b(10)681 4898 y FA(char-lower-case?)o FD(,)15 +b(1)-5 b(10)2258 614 y FA(char-numeric?)82 b FD(,)21 +b(1)-5 b(10)2258 714 y FA(char-printing?)p FD(,)15 b(1)-5 +b(10)2258 814 y FA(char-punctuation?)o FD(,)15 b(1)-5 +b(10)2258 913 y FA(char-set)p FD(,)17 b(107)2258 1013 +y FA(char-set-adjoin)p FD(,)e(109)2258 1112 y FA(char-set-any?)p +FD(,)g(108)2258 1212 y FA(char-set-contains)o(?)p FD(,)f(108)2258 +1312 y FA(char-set-copy)p FD(,)h(1)-5 b(1)g(1)2258 1411 +y FA(char-set-delete)p FD(,)15 b(109)2258 1511 y FA(char-set-differen)o +(ce)o FD(,)g(108)2258 1611 y FA(char-set-every?)p FD(,)g(108)2258 +1710 y FA(char-set-fold)p FD(,)g(107)2258 1810 y FA(char-set-for-each)o +FD(,)g(107)2258 1910 y FA(char-set-intersec)o(ti)o(on)p +FD(,)f(108)2258 2009 y FA(char-set-invert)p FD(,)h(108)2258 +2109 y FA(char-set-members)p FD(,)f(108)2258 2208 y FA(char-set-size)p +FD(,)h(108)2258 2308 y FA(char-set-union)p FD(,)g(108)2258 +2408 y(char)o(-set:alphabetic,)j(109)2258 2507 y(char)o +(-set:alphanumeric,)h(109)2258 2607 y(char)o(-set:ascii,)g(109)2258 +2707 y(char)o(-set:blank,)g(109)2258 2806 y(char)o(-set:contr)o(ol,)g +(109)2258 2906 y(char)o(-set:empty)-9 b(,)19 b(109)2258 +3005 y(char)o(-set:full,)g(109)2258 3105 y(char)o(-set:graphic,)g(109) +2258 3205 y(char)o(-set:hex-digit,)g(109)2258 3304 y(char)o(-set:lower) +o(-case,)f(109)2258 3404 y(char)o(-set:numeric,)h(109)2258 +3504 y(char)o(-set:printing,)h(109)2258 3603 y(char)o +(-set:punctuation,)g(109)2258 3703 y(char)o(-set:upper)o(-case,)d(109) +2258 3802 y(char)o(-set:whitespace,)i(109)2258 3902 y +FA(char-set<=)p FD(,)e(107)2258 4002 y FA(char-set=)p +FD(,)g(107)2258 4101 y FA(char-set?)p FD(,)g(106)2258 +4201 y FA(char-upper-case?)p FD(,)d(1)-5 b(10)2258 4301 +y FA(char-whitespace?)p FD(,)14 b(1)-5 b(10)2258 4400 +y FA(chars->char-set)p FD(,)15 b(107)2258 4500 y FA(chdir)p +FD(,)k(60)2258 4599 y FA(clean-up-cres)p FD(,)c(138)2258 +4699 y FA(close)p FD(,)k(25)2258 4799 y FA(close-after)p +FD(,)d(24)2258 4898 y FA(close-socket)p FD(,)g(91)2051 +5147 y(186)p eop +%%Page: 187 195 +187 194 bop 365 614 a FA(command-line)p FD(,)16 b(62)365 +714 y(command-line-ar)o(guments,)21 b(62)365 815 y FA(connect-socket)p +FD(,)15 b(94)365 915 y FA(control-tty-file-)o(na)o(me)p +FD(,)f(83)365 1015 y FA(copy-tty-info)p FD(,)h(80)365 +1115 y FA(cpu-ticks/sec)p FD(,)g(61)365 1215 y FA(create-directory)p +FD(,)f(40)365 1315 y FA(create-fifo)p FD(,)i(40)365 1415 +y FA(create-hard-link)p FD(,)e(40)365 1515 y FA(create-socket)p +FD(,)h(91)365 1615 y FA(create-socket-pai)o(r)p FD(,)f(91)365 +1715 y FA(create-symlink)p FD(,)h(40)365 1815 y FA(create-temp-file)p +FD(,)f(49)365 1915 y FA(cwd)p FD(,)20 b(60)365 2106 y(date,)g(69)365 +2206 y FA(date)p FD(,)f(71)365 2306 y FA(date->string)p +FD(,)d(72)365 2406 y FA(define-record)p FD(,)f(7)365 +2506 y FA(delete-directory)p FD(,)f(40)365 2606 y FA(delete-file)p +FD(,)i(40)365 2706 y FA(delete-filesys-ob)o(je)o(ct)p +FD(,)e(40)365 2806 y FA(directory-as-file)o(-n)o(ame)o +FD(,)h(101)365 2906 y FA(directory-files)p FD(,)g(45)365 +3007 y FA(disable-tty-char)p FD(,)f(79)365 3107 y FA(drain-tty)p +FD(,)j(81)365 3207 y FA(dump-scsh)p FD(,)g(172)365 3307 +y FA(dump-scsh-program)o FD(,)e(172)365 3407 y FA(dup)p +FD(,)20 b(31)365 3507 y FA(dup->fdes)p FD(,)d(31)365 +3607 y FA(dup->inport)p FD(,)f(31)365 3707 y FA(dup->outport)p +FD(,)g(31)365 3898 y FA(enabled-interrupt)o(s)p FD(,)e(67)365 +3998 y FA(env->alist)p FD(,)j(74)365 4098 y FA(errno-error)p +FD(,)f(21)365 4198 y FA(error-output-port)o FD(,)f(24)365 +4298 y FA(exec)p FD(,)k(52)365 4398 y(exec-epf,)g(13)365 +4498 y FA(exec-epf)p FD(,)e(13)365 4598 y FA(exec-path)p +FD(,)g(52)365 4698 y(exec-path-list,)j(77)365 4798 y +FA(exec-path-search)p FD(,)14 b(52)365 4898 y FA(exec-path/env)p +FD(,)h(52)1943 614 y FA(exec/env)p FD(,)i(52)1943 714 +y FA(exit)p FD(,)i(53)1943 814 y FA(expand-file-name)o +FD(,)c(104)1943 1002 y FA(fdes->inport)p FD(,)g(30)1943 +1102 y FA(fdes->outport)p FD(,)g(30)1943 1202 y FA(fdes-flags)p +FD(,)h(32)1943 1302 y FA(fdes-status)p FD(,)g(33)1943 +1401 y FA(field-reader)p FD(,)f(148)1943 1501 y FA(field-splitter)p +FD(,)f(144)1943 1601 y FA(file-directory?)p FD(,)g(43)1943 +1701 y FA(file-executable?)o FD(,)h(44)1943 1801 y FA(file-exists?)p +FD(,)g(44)1943 1901 y FA(file-fifo?)p FD(,)h(43)1943 +2001 y FA(file-group)p FD(,)g(42)1943 2101 y FA(file-info)p +FD(,)h(41)1943 2201 y(\002le-info:atime,)j(42)1943 2301 +y(\002le-info:ctime,)g(42)1943 2401 y(\002le-info:device,)f(42)1943 +2500 y(\002le-info:gid,)h(42)1943 2600 y(\002le-info:inode,)h(42)1943 +2700 y(\002le-info:mode,)f(42)1943 2800 y(\002le-info:mtime,)h(42)1943 +2900 y(\002le-info:nlinks,)h(42)1943 3000 y(\002le-info:size,)e(42)1943 +3100 y(\002le-info:type,)g(42)1943 3200 y(\002le-info:uid,)g(42)1943 +3300 y FA(file-inode)p FD(,)c(42)1943 3400 y FA(file-last-access)o +FD(,)f(42)1943 3500 y FA(file-last-mod)p FD(,)g(42)1943 +3599 y FA(file-last-status)o(-c)o(ha)o(nge)o FD(,)g(42)1943 +3699 y FA(file-match)p FD(,)h(47)1943 3799 y FA(file-mode)p +FD(,)h(42)1943 3899 y FA(file-name-absolu)o(te)o(?)p +FD(,)d(101)1943 3999 y FA(file-name-as-dir)o(ec)o(to)o(ry)p +FD(,)g(101)1943 4099 y FA(file-name-direct)o(or)o(y)p +FD(,)g(102)1943 4199 y FA(file-name-direct)o(or)o(y?)o +FD(,)h(101)1943 4299 y FA(file-name-extens)o(io)o(n)p +FD(,)f(103)1943 4399 y FA(file-name-non-di)o(re)o(ct)o(ory)o(?)p +FD(,)g(101)1943 4499 y FA(file-name-nondir)o(ec)o(to)o(ry)p +FD(,)g(102)1943 4599 y FA(file-name-sans-e)o(xt)o(en)o(sio)o(n)p +FD(,)g(103)1943 4698 y FA(file-nlinks)p FD(,)i(42)1943 +4798 y FA(file-not-executa)o(bl)o(e?)o FD(,)f(43)1943 +4898 y FA(file-not-exists?)o FD(,)g(44)1735 5147 y(187)p +eop +%%Page: 188 196 +188 195 bop 681 614 a FA(file-not-readabl)o(e?)o FD(,)15 +b(43)681 714 y FA(file-not-writabl)o(e?)o FD(,)g(43)681 +814 y FA(file-owner)p FD(,)h(42)681 913 y FA(file-readable?)p +FD(,)e(44)681 1013 y FA(file-regular?)p FD(,)h(43)681 +1112 y FA(file-size)p FD(,)i(42)681 1212 y FA(file-socket?)p +FD(,)e(43)681 1312 y FA(file-special?)p FD(,)g(43)681 +1411 y FA(file-symlink?)p FD(,)g(43)681 1511 y FA(file-type)p +FD(,)i(42)681 1611 y FA(file-writable?)p FD(,)d(44)681 +1710 y FA(fill-in-date!)p FD(,)h(72)681 1810 y FA(flush-all-ports)p +FD(,)f(37)681 1910 y FA(flush-submatches)o FD(,)h(135)681 +2009 y FA(flush-tty/both)p FD(,)f(82)681 2109 y FA(flush-tty/input)p +FD(,)g(82)681 2208 y FA(flush-tty/output)o FD(,)h(82)681 +2308 y FA(force-output)p FD(,)g(37)681 2408 y FA(fork)p +FD(,)k(53)681 2507 y FA(fork-pty-session)o FD(,)c(83)681 +2607 y FA(fork/pipe)p FD(,)i(54)681 2707 y FA(fork/pipe+)p +FD(,)f(55)681 2806 y FA(format-date)p FD(,)g(72)681 2972 +y FA(get-lock-region)p FD(,)e(39)681 3072 y FA(getenv)p +FD(,)k(74)681 3171 y FA(glob)p FD(,)h(45)681 3271 y FA(glob-quote)p +FD(,)d(47)681 3371 y(gr)o(oup-info,)k(62)681 3470 y FA(group-info)p +FD(,)c(62)681 3570 y(gr)o(oup-info:gid,)k(62)681 3670 +y(gr)o(oup-info:members,)g(62)681 3769 y(gr)o(oup-info:name,)g(62)681 +3935 y FA(home-dir)p FD(,)d(105)681 4035 y(home-dir)o(ectory)-9 +b(,)20 b(77)681 4134 y FA(home-file)p FD(,)d(105)681 +4234 y FA(host-info)p FD(,)g(97)681 4400 y FA(if-match)p +FD(,)g(134)681 4500 y FA(if-sre-form)p FD(,)f(138)681 +4599 y FA(index)p FD(,)i(105)681 4699 y FA(infix-splitter)p +FD(,)c(144)681 4799 y FA(internet-address)o(->)o(soc)o(ke)o(t-)o(add)o +(re)o(ss)p FD(,)1013 4898 y(93)2258 614 y FA(interrupt-handler)o +FD(,)h(68)2258 714 y FA(interrupt-set)p FD(,)g(67)2258 +814 y FA(itimer)p FD(,)j(64)2258 993 y FA(join-strings)p +FD(,)e(147)2258 1172 y FA(let-match)p FD(,)h(134)2258 +1272 y FA(listen-socket)p FD(,)e(94)2258 1372 y FA(lock-region)p +FD(,)h(39)2258 1471 y FA(lock-region/no-bl)o(oc)o(k)p +FD(,)e(39)2258 1571 y(lock-r)o(egion:end,)20 b(38)2258 +1670 y(lock-r)o(egion:exclusive?,)g(38)2258 1770 y(lock-r)o(egion:len,) +h(38)2258 1870 y(lock-r)o(egion:pr)o(oc,)f(38)2258 1969 +y(lock-r)o(egion:start,)g(38)2258 2069 y(lock-r)o(egion:whence,)h(38) +2258 2169 y(lock-r)o(egion?,)g(38)2258 2348 y FA(make-date)p +FD(,)c(70)2258 2447 y FA(make-lock-region)p FD(,)d(39)2258 +2547 y FA(make-pty-generato)o(r)p FD(,)g(84)2258 2647 +y FA(make-re-char-set)p FD(,)g(137)2258 2746 y FA(make-re-choice)p +FD(,)h(136)2258 2846 y FA(make-re-dsm)p FD(,)h(137)2258 +2946 y FA(make-re-repeat)p FD(,)f(136)2258 3045 y FA(make-re-seq)p +FD(,)h(136)2258 3145 y FA(make-re-string)p FD(,)f(137)2258 +3244 y FA(make-re-submatch)p FD(,)f(136)2258 3344 y FA(make-regexp)p +FD(,)i(129)2258 3444 y FA(make-string-input)o(-p)o(ort)o +FD(,)f(26)2258 3543 y FA(make-string-outpu)o(t-)o(por)o(t)p +FD(,)f(26)2258 3643 y FA(make-tty-info)p FD(,)h(80)2258 +3743 y FA(match-cond)p FD(,)i(134)2258 3842 y FA(match:end)p +FD(,)g(130)2258 3942 y FA(match:start)p FD(,)f(130)2258 +4042 y FA(match:substring)p FD(,)f(130)2258 4141 y FA(move->fdes)p +FD(,)i(30)2258 4320 y FA(network-info)p FD(,)f(97)2258 +4420 y FA(nice)p FD(,)j(60)2258 4520 y FA(nth)p FD(,)g(156)2258 +4699 y FA(open-control-tty)p FD(,)14 b(82)2258 4799 y +FA(open-fdes)p FD(,)j(32)2258 4898 y FA(open-file)p FD(,)g(32)2051 +5147 y(188)p eop +%%Page: 189 197 +189 196 bop 365 614 a FA(open-input-file)p FD(,)15 b(32)365 +714 y FA(open-output-file)p FD(,)f(32)365 815 y FA(open-pty)p +FD(,)j(84)365 1005 y FA(parent-pid)p FD(,)g(60)365 1105 +y FA(parse-file-name)p FD(,)e(104)365 1205 y FA(parse-sre)p +FD(,)i(139)365 1305 y FA(parse-sres)p FD(,)g(139)365 +1405 y FA(path-list->file-n)o(am)o(e)p FD(,)e(103)365 +1505 y FA(pause-until-inter)o(ru)o(pt)p FD(,)f(64)365 +1605 y FA(pid)p FD(,)20 b(60)365 1706 y FA(pid->proc)p +FD(,)d(55)365 1806 y FA(pipe)p FD(,)i(33)365 1906 y FA(port->fdes)p +FD(,)e(30)365 2006 y FA(port->list)p FD(,)g(15)365 2106 +y FA(port->sexp-list)p FD(,)e(15)365 2206 y FA(port->string)p +FD(,)h(15)365 2306 y FA(port->string-list)o FD(,)f(15)365 +2406 y FA(port-fold)p FD(,)i(16)365 2506 y FA(port-revealed)p +FD(,)e(30)365 2606 y FA(posix-string->reg)o(ex)o(p)p +FD(,)g(135)365 2706 y FA(predicate->char-s)o(et)o FD(,)g(107)365 +2806 y FA(priority)p FD(,)i(60)365 2906 y(pr)o(oc,)j(55)365 +3007 y(pr)o(oc:pid,)g(55)365 3107 y(pr)o(oc?,)g(55)365 +3207 y FA(process-group)p FD(,)15 b(60)365 3307 y FA(process-times)p +FD(,)g(61)365 3407 y FA(protocol-info)p FD(,)g(97)365 +3507 y FA(pty-name->tty-nam)o(e)p FD(,)f(84)365 3697 +y(r)o(e-any)-9 b(,)19 b(138)365 3797 y FA(re-any?)p FD(,)f(138)365 +3898 y(r)o(e-bol,)i(137)365 3998 y FA(re-bol?)p FD(,)e(137)365 +4098 y(r)o(e-bos,)i(137)365 4198 y FA(re-bos?)p FD(,)e(137)365 +4298 y(r)o(e-bow)-8 b(,)20 b(137)365 4398 y FA(re-bow?)p +FD(,)e(137)365 4498 y FA(re-char-set)p FD(,)e(137)365 +4598 y FA(re-char-set:cset)p FD(,)e(137)365 4698 y FA(re-char-set?)p +FD(,)i(137)365 4798 y FA(re-choice)p FD(,)h(136)365 4898 +y FA(re-choice:elts)p FD(,)e(136)1943 614 y FA(re-choice:tsm)p +FD(,)g(136)1943 714 y FA(re-choice?)p FD(,)h(136)1943 +814 y FA(re-dsm)p FD(,)i(137)1943 913 y FA(re-dsm:body)p +FD(,)e(137)1943 1013 y FA(re-dsm:post-dsm)p FD(,)e(137)1943 +1112 y FA(re-dsm:pre-dsm)p FD(,)g(137)1943 1212 y FA(re-dsm:tsm)p +FD(,)i(137)1943 1312 y FA(re-dsm?)p FD(,)h(137)1943 1411 +y(r)o(e-empty)-9 b(,)19 b(138)1943 1511 y FA(re-empty?)p +FD(,)e(138)1943 1611 y(r)o(e-eol,)i(137)1943 1710 y FA(re-eol?)p +FD(,)e(137)1943 1810 y(r)o(e-eos,)i(137)1943 1910 y FA(re-eos?)p +FD(,)e(137)1943 2009 y(r)o(e-eow)-8 b(,)20 b(137)1943 +2109 y FA(re-eow?)p FD(,)d(137)1943 2208 y(r)o(e-nonl,)j(138)1943 +2308 y FA(re-repeat:from)p FD(,)14 b(136)1943 2408 y +FA(re-repeat:to)p FD(,)h(136)1943 2507 y FA(re-repeat:tsm)p +FD(,)g(136)1943 2607 y FA(re-repeat?)p FD(,)h(136)1943 +2707 y FA(re-seq)p FD(,)i(136)1943 2806 y FA(re-seq:elts)p +FD(,)e(136)1943 2906 y FA(re-seq:tsm)p FD(,)g(136)1943 +3005 y FA(re-seq?)p FD(,)h(136)1943 3105 y FA(re-string)p +FD(,)g(137)1943 3205 y FA(re-string:chars)p FD(,)d(137)1943 +3304 y FA(re-string?)p FD(,)i(137)1943 3404 y FA(re-submatch:post)o(-d) +o(sm)o FD(,)f(137)1943 3504 y FA(re-submatch:pre-)o(ds)o(m)p +FD(,)f(137)1943 3603 y FA(re-submatch:tsm)p FD(,)g(137)1943 +3703 y FA(re-submatch?)p FD(,)h(136)1943 3802 y(r)o(e-trivial,)k(137) +1943 3902 y FA(re-trivial?)p FD(,)d(137)1943 4002 y FA(re-tsm)p +FD(,)i(138)1943 4101 y(r)o(e-wor)o(d,)h(138)1943 4201 +y FA(read-delimited)p FD(,)14 b(141)1943 4301 y FA(read-delimited!)p +FD(,)g(141)1943 4400 y FA(read-line)p FD(,)j(140)1943 +4500 y FA(read-paragraph)p FD(,)d(141)1943 4599 y FA(read-string)p +FD(,)i(33)1943 4699 y FA(read-string!)p FD(,)f(33)1943 +4799 y FA(read-string!/par)o(ti)o(al)o FD(,)g(34)1943 +4898 y FA(read-string/part)o(ia)o(l)p FD(,)f(34)1735 +5147 y(189)p eop +%%Page: 190 198 +190 197 bop 681 614 a FA(read-symlink)p FD(,)15 b(40)681 +716 y FA(reap-zombies)p FD(,)g(57)681 818 y FA(receive-message)p +FD(,)f(95)681 920 y FA(receive-message!)o FD(,)h(95)681 +1022 y FA(receive-message!)o(/p)o(art)o(ia)o(l)p FD(,)f(95)681 +1124 y FA(receive-message/)o(pa)o(rti)o(al)o FD(,)h(95)681 +1226 y FA(record-reader)p FD(,)g(144)681 1328 y FA(regexp->posix-st)o +(ri)o(ng)p FD(,)f(135)681 1430 y FA(regexp->scheme)p +FD(,)g(139)681 1532 y FA(regexp->sre)p FD(,)i(135)681 +1634 y FA(regexp-fold)p FD(,)g(132)681 1736 y FA(regexp-fold-righ)o(t)p +FD(,)e(133)681 1838 y FA(regexp-for-each)p FD(,)g(134)681 +1940 y FA(regexp-search)p FD(,)h(130)681 2042 y FA(regexp-search?)p +FD(,)f(130)681 2144 y FA(regexp-substitut)o(e)p FD(,)g(130)681 +2246 y FA(regexp-substitut)o(e/)o(glo)o(ba)o(l)p FD(,)g(131)681 +2348 y FA(regexp?)p FD(,)j(130,)i(138)681 2450 y FA(release-port-han)o +(dl)o(e)p FD(,)14 b(30)681 2552 y FA(rename-file)p FD(,)i(40)681 +2654 y FA(repl)p FD(,)j(156)681 2756 y FA(replace-extensio)o(n)p +FD(,)14 b(104)681 2858 y FA(resolve-file-nam)o(e)p FD(,)g(104)681 +2960 y FA(rindex)p FD(,)k(105)681 3062 y(r)o(un,)j(13)681 +3164 y FA(run)p FD(,)e(13)681 3266 y FA(run/collecting)p +FD(,)14 b(17)681 3368 y FA(run/collecting*)p FD(,)g(17)681 +3470 y FA(run/file)p FD(,)j(14)681 3572 y FA(run/file*)p +FD(,)g(15)681 3674 y FA(run/port)p FD(,)g(14)681 3776 +y FA(run/port*)p FD(,)g(15)681 3878 y FA(run/port+proc)p +FD(,)e(17)681 3980 y FA(run/port+proc*)p FD(,)f(17)681 +4082 y FA(run/sexp)p FD(,)j(14)681 4184 y FA(run/sexp*)p +FD(,)g(15)681 4286 y FA(run/sexps)p FD(,)g(14)681 4388 +y FA(run/sexps*)p FD(,)f(15)681 4490 y FA(run/string)p +FD(,)g(14)681 4592 y FA(run/string*)p FD(,)g(15)681 4694 +y FA(run/strings)p FD(,)g(14)681 4796 y FA(run/strings*)p +FD(,)f(15)681 4898 y FA(rx)p FD(,)k(129)2258 614 y FA(seek)p +FD(,)g(31)2258 714 y FA(select)41 b FD(,)21 b(34)2258 +814 y FA(send-message)p FD(,)16 b(95)2258 913 y FA(send-message/part)o +(ia)o(l)p FD(,)e(95)2258 1013 y FA(send-tty-break)p FD(,)h(81)2258 +1112 y FA(service-info)p FD(,)h(97)2258 1212 y FA(set-enabled-inter)o +(ru)o(pts)o FD(,)f(67)2258 1312 y FA(set-fdes-flags)p +FD(,)g(32)2258 1411 y FA(set-fdes-status)p FD(,)g(33)2258 +1511 y FA(set-file-group)p FD(,)g(41)2258 1611 y FA(set-file-mode)p +FD(,)g(41)2258 1710 y FA(set-file-owner)p FD(,)g(41)2258 +1810 y FA(set-file-times)p FD(,)g(41)2258 1910 y FA(set-gid)p +FD(,)j(61)2258 2009 y FA(set-interrupt-han)o(dl)o(er)p +FD(,)c(67)2258 2109 y FA(set-port-bufferin)o(g)p FD(,)g(37)2258 +2208 y FA(set-priority)p FD(,)i(60)2258 2308 y FA(set-process-group)o +FD(,)f(60)2258 2408 y FA(set-socket-option)o FD(,)g(96)2258 +2507 y FA(set-tty-info/drai)o(n)p FD(,)f(81)2258 2607 +y FA(set-tty-info/flus)o(h)p FD(,)g(81)2258 2707 y FA(set-tty-info/now) +p FD(,)g(81)2258 2806 y FA(set-tty-process-g)o(ro)o(up)p +FD(,)g(83)2258 2906 y FA(set-uid)p FD(,)k(61)2258 3005 +y FA(set-umask)p FD(,)f(60)2258 3105 y FA(setenv)p FD(,)h(74)2258 +3205 y FA(shutdown-socket)p FD(,)d(95)2258 3304 y FA(signal->interrupt) +o FD(,)g(67)2258 3404 y FA(signal-process)p FD(,)g(64)2258 +3504 y FA(signal-process-gr)o(ou)o(p)p FD(,)f(64)2258 +3603 y FA(simplify-file-nam)o(e)p FD(,)g(104)2258 3703 +y FA(simplify-regexp)p FD(,)h(135)2258 3802 y FA(skip-char-set)p +FD(,)g(142)2258 3902 y FA(sleep)p FD(,)k(64)2258 4002 +y FA(sleep-until)p FD(,)d(64)2258 4101 y FA(sloppy-suffix-spl)o(it)o +(ter)o FD(,)f(144)2258 4201 y FA(socket-address->i)o(nt)o(ern)o(et)o +(-a)o(ddr)o(es)o(s)p FD(,)2590 4301 y(93)2258 4400 y +FA(socket-address->u)o(ni)o(x-a)o(dd)o(re)o(ss)p FD(,)2590 +4500 y(93)2258 4599 y FA(socket-connect)p FD(,)g(90)2258 +4699 y FA(socket-local-addr)o(es)o(s)p FD(,)f(94)2258 +4799 y FA(socket-option)p FD(,)h(96)2258 4898 y FA(socket-remote-add)o +(re)o(ss)p FD(,)f(94)2051 5147 y(190)p eop +%%Page: 191 199 +191 198 bop 365 614 a FA(split-file-name)p FD(,)15 b(102)365 +714 y FA(sre->regexp)p FD(,)h(135)365 814 y FA(sre-form?)p +FD(,)h(139)365 914 y FA(start-tty-input)p FD(,)e(82)365 +1014 y FA(start-tty-output)p FD(,)f(82)365 1114 y FA(static-regexp?)p +FD(,)h(139)365 1214 y FA(status:exit-val)p FD(,)g(59)365 +1314 y FA(status:stop-sig)p FD(,)g(59)365 1414 y FA(status:term-sig)p +FD(,)g(59)365 1514 y FA(stdio->stdports)p FD(,)g(25)365 +1613 y FA(stdports->stdio)p FD(,)g(25)365 1713 y FA(stop-tty-input)p +FD(,)g(82)365 1813 y FA(stop-tty-output)p FD(,)g(82)365 +1913 y FA(string->char-set)p FD(,)f(107)365 2013 y FA(string-filter)p +FD(,)h(20)365 2113 y FA(string-match)p FD(,)h(129)365 +2213 y FA(string-output-por)o(t-)o(out)o(pu)o(t)p FD(,)e(26)365 +2313 y FA(substitute-env-va)o(rs)o FD(,)h(106)365 2413 +y FA(suffix-splitter)p FD(,)g(144)365 2513 y FA(suspend)p +FD(,)j(53)365 2613 y FA(sync-file)p FD(,)f(41)365 2712 +y FA(sync-file-system)p FD(,)d(41)365 2812 y FA(system-name)p +FD(,)i(64)365 3000 y FA(tell)p FD(,)j(31)365 3100 y FA +(temp-file-channel)o FD(,)c(51)365 3200 y FA(temp-file-iterate)o +FD(,)g(50)365 3300 y FA(ticks/sec)p FD(,)i(70)365 3400 +y(time,)k(69)365 3500 y FA(time)p FD(,)e(71)365 3599 +y FA(time+ticks)p FD(,)e(70)365 3699 y FA(truncate-file)p +FD(,)e(41)365 3799 y FA(tty-file-name)p FD(,)g(78)365 +3899 y FA(tty-info)p FD(,)i(81)365 3999 y(tty-info)k(r)o(ecor)o(d)e +(type,)i(78)365 4099 y FA(tty-info:control-)o(ch)o(ars)o +FD(,)15 b(78)365 4199 y FA(tty-info:control-)o(fl)o(ags)o +FD(,)g(78)365 4299 y FA(tty-info:input-fl)o(ag)o(s)p +FD(,)g(78)365 4399 y FA(tty-info:input-sp)o(ee)o(d)p +FD(,)g(78)365 4499 y FA(tty-info:local-fl)o(ag)o(s)p +FD(,)g(78)365 4599 y FA(tty-info:min)p FD(,)h(78)365 +4698 y FA(tty-info:output-f)o(la)o(gs)p FD(,)e(78)365 +4798 y FA(tty-info:output-s)o(pe)o(ed)p FD(,)g(78)365 +4898 y FA(tty-info:time)p FD(,)h(78)1943 614 y FA(tty-info?)p +FD(,)i(78)1943 714 y FA(tty-name->pty-na)o(me)o FD(,)e(84)1943 +814 y FA(tty-process-grou)o(p)p FD(,)f(83)1943 913 y +FA(tty?)p FD(,)19 b(78)1943 1013 y FA(ttyc/2-stop-bits)o +FD(,)c(88)1943 1112 y FA(ttyc/carrier-flo)o(w-)o(ct)o(l)p +FD(,)g(88)1943 1212 y FA(ttyc/char-size)p FD(,)f(88)1943 +1312 y FA(ttyc/char-size5)p FD(,)g(88)1943 1411 y FA(ttyc/char-size6)p +FD(,)g(88)1943 1511 y FA(ttyc/char-size7)p FD(,)g(88)1943 +1611 y FA(ttyc/char-size8)p FD(,)g(88)1943 1710 y FA(ttyc/CTS-output-)o +(fl)o(ow)o(-ct)o(l)p FD(,)g(88)1943 1810 y FA(ttyc/enable-pari)o(ty)o +FD(,)h(88)1943 1910 y FA(ttyc/enable-read)o FD(,)g(88)1943 +2009 y FA(ttyc/hup-on-clos)o(e)p FD(,)f(88)1943 2109 +y FA(ttyc/ignore-flag)o(s)p FD(,)g(88)1943 2208 y FA(ttyc/no-modem-sy)o +(nc)o FD(,)h(88)1943 2308 y FA(ttyc/odd-parity)p FD(,)f(88)1943 +2408 y FA(ttyc/RTS-input-f)o(lo)o(w-)o(ctl)o FD(,)h(88)1943 +2507 y FA(ttychar/delayed-)o(su)o(sp)o(end)o FD(,)g(85)1943 +2607 y FA(ttychar/delete-c)o(ha)o(r)p FD(,)f(85)1943 +2707 y FA(ttychar/delete-l)o(in)o(e)p FD(,)g(85)1943 +2806 y FA(ttychar/delete-w)o(or)o(d)p FD(,)g(85)1943 +2906 y FA(ttychar/discard)p FD(,)g(85)1943 3005 y FA(ttychar/eof)p +FD(,)i(85)1943 3105 y FA(ttychar/eol)p FD(,)g(85)1943 +3205 y FA(ttychar/eol2)p FD(,)f(85)1943 3304 y FA(ttychar/interrup)o(t) +p FD(,)f(85)1943 3404 y FA(ttychar/literal-)o(ne)o(xt)o +FD(,)h(85)1943 3504 y FA(ttychar/quit)p FD(,)g(85)1943 +3603 y FA(ttychar/reprint)p FD(,)f(85)1943 3703 y FA(ttychar/start)p +FD(,)h(85)1943 3802 y FA(ttychar/status)p FD(,)f(85)1943 +3902 y FA(ttychar/stop)p FD(,)h(85)1943 4002 y FA(ttychar/suspend)p +FD(,)f(85)1943 4101 y FA(ttyin/7bits)p FD(,)i(86)1943 +4201 y FA(ttyin/beep-on-ov)o(er)o(fl)o(ow)p FD(,)e(86)1943 +4301 y FA(ttyin/check-pari)o(ty)o FD(,)h(86)1943 4400 +y FA(ttyin/cr->nl)p FD(,)g(86)1943 4500 y FA(ttyin/ignore-bad)o(-p)o +(ar)o(ity)o(-c)o(har)o(s)p FD(,)2275 4599 y(86)1943 4699 +y FA(ttyin/ignore-bre)o(ak)o FD(,)g(86)1943 4799 y FA(ttyin/ignore-cr)p +FD(,)f(86)1943 4898 y FA(ttyin/input-flow)o(-c)o(tl)o +FD(,)h(86)1735 5147 y(191)p eop +%%Page: 192 200 +192 199 bop 681 614 a FA(ttyin/interrupt-)o(on)o(-br)o(ea)o(k)p +FD(,)14 b(86)681 714 y FA(ttyin/lowercase)p FD(,)g(86)681 +814 y FA(ttyin/mark-parit)o(y-)o(err)o(or)o(s)p FD(,)g(86)681 +913 y FA(ttyin/nl->cr)p FD(,)h(86)681 1013 y FA(ttyin/output-flo)o(w-)o +(ctl)o FD(,)g(86)681 1112 y FA(ttyin/xon-any)p FD(,)g(86)681 +1212 y FA(ttyl/alt-delete-)o(wo)o(rd)p FD(,)f(89)681 +1312 y FA(ttyl/canonical)p FD(,)g(89)681 1411 y FA(ttyl/case-map)p +FD(,)h(89)681 1511 y FA(ttyl/echo)p FD(,)i(89)681 1611 +y FA(ttyl/echo-ctl)p FD(,)e(89)681 1710 y FA(ttyl/echo-delete)o(-l)o +(ine)o FD(,)g(89)681 1810 y FA(ttyl/echo-nl)p FD(,)g(89)681 +1910 y FA(ttyl/enable-sign)o(al)o(s)p FD(,)f(89)681 2009 +y FA(ttyl/extended)p FD(,)h(89)681 2109 y FA(ttyl/flush-outpu)o(t)p +FD(,)f(89)681 2208 y FA(ttyl/hardcopy-de)o(le)o(te)p +FD(,)g(89)681 2308 y FA(ttyl/no-flush-on)o(-i)o(nte)o(rr)o(up)o(t)p +FD(,)h(89)681 2408 y FA(ttyl/no-kernel-s)o(ta)o(tus)o +FD(,)g(89)681 2507 y FA(ttyl/reprint-unr)o(ea)o(d-c)o(ha)o(rs)o +FD(,)g(89)681 2607 y FA(ttyl/ttou-signal)o FD(,)g(89)681 +2707 y FA(ttyl/visual-dele)o(te)o FD(,)g(89)681 2806 +y FA(ttyl/visual-dele)o(te)o(-li)o(ne)o FD(,)g(89)681 +2906 y FA(ttyout/all-delay)o FD(,)g(87)681 3005 y FA(ttyout/bs-delay)p +FD(,)f(87)681 3105 y FA(ttyout/bs-delay0)o FD(,)h(87)681 +3205 y FA(ttyout/bs-delay1)o FD(,)g(87)681 3304 y FA(ttyout/cr->nl)p +FD(,)g(86)681 3404 y FA(ttyout/cr-delay)p FD(,)f(87)681 +3504 y FA(ttyout/cr-delay0)o FD(,)h(87)681 3603 y FA(ttyout/cr-delay1)o +FD(,)g(87)681 3703 y FA(ttyout/cr-delay2)o FD(,)g(87)681 +3802 y FA(ttyout/cr-delay3)o FD(,)g(87)681 3902 y FA(ttyout/delay-w/f)o +(il)o(l-c)o(ha)o(r)p FD(,)f(86)681 4002 y FA(ttyout/discard-e)o(ot)o +FD(,)h(86)681 4101 y FA(ttyout/enable)p FD(,)g(86)681 +4201 y FA(ttyout/expand-ta)o(bs)o FD(,)g(86)681 4301 +y FA(ttyout/ff-delay)p FD(,)f(87)681 4400 y FA(ttyout/ff-delay0)o +FD(,)h(87)681 4500 y FA(ttyout/ff-delay1)o FD(,)g(87)681 +4599 y FA(ttyout/fill-w/de)o(l)p FD(,)f(86)681 4699 y +FA(ttyout/nl->crnl)p FD(,)g(86)681 4799 y FA(ttyout/nl-delay)p +FD(,)g(87)681 4898 y FA(ttyout/nl-delay0)o FD(,)h(87)2258 +614 y FA(ttyout/nl-delay1)p FD(,)f(87)2258 714 y FA(ttyout/nl-does-cr)o +FD(,)h(86)2258 815 y FA(ttyout/no-col0-cr)o FD(,)g(86)2258 +915 y FA(ttyout/tab-delay)p FD(,)f(87)2258 1015 y FA(ttyout/tab-delay0) +o FD(,)h(87)2258 1115 y FA(ttyout/tab-delay1)o FD(,)g(87)2258 +1215 y FA(ttyout/tab-delay2)o FD(,)g(87)2258 1315 y FA +(ttyout/tab-delayx)o FD(,)g(87)2258 1415 y FA(ttyout/uppercase)p +FD(,)f(86)2258 1515 y FA(ttyout/vtab-delay)o FD(,)h(87)2258 +1615 y FA(ttyout/vtab-delay)o(0)p FD(,)f(87)2258 1715 +y FA(ttyout/vtab-delay)o(1)p FD(,)g(87)2258 1906 y FA(umask)p +FD(,)19 b(60)2258 2006 y FA(uncase)p FD(,)f(135)2258 +2106 y FA(uncase-char-set)p FD(,)d(135)2258 2206 y FA(uncase-string)p +FD(,)g(135)2258 2306 y FA(unix-address->soc)o(ke)o(t-a)o(dd)o(re)o(ss)p +FD(,)2590 2406 y(93)2258 2506 y FA(unlock-region)p FD(,)g(39)2258 +2606 y FA(user-effective-gi)o(d)p FD(,)f(61)2258 2706 +y FA(user-effective-ui)o(d)p FD(,)g(61)2258 2806 y FA(user-gid)p +FD(,)j(61)2258 2906 y(user)o(-info,)j(61)2258 3006 y +FA(user-info)p FD(,)d(61)2258 3106 y(user)o(-info:gid,)j(61)2258 +3206 y(user)o(-info:home-dir)-6 b(,)20 b(61)2258 3307 +y(user)o(-info:name,)g(61)2258 3407 y(user)o(-info:shell,)g(61)2258 +3507 y(user)o(-info:uid,)g(61)2258 3607 y FA(user-login-name)p +FD(,)15 b(61)2258 3707 y FA(user-supplementar)o(y-)o(gid)o(s)p +FD(,)f(61)2258 3807 y FA(user-uid)p FD(,)j(61)2258 3998 +y FA(wait)p FD(,)i(58)2258 4098 y FA(wait-any)p FD(,)e(58)2258 +4198 y FA(wait-process-grou)o(p)p FD(,)d(58)2258 4298 y FA(with-current-inpu)o(t-)o(por)o(t)p FD(,)g(24)2258 -2800 y FA(with-current-inpu)o(t-)o(por)o(t*)o FD(,)h(24)2258 -2900 y FA(with-current-outp)o(ut)o(-po)o(rt)o FD(,)g(24)2258 -3000 y FA(with-current-outp)o(ut)o(-po)o(rt)o(*)p FD(,)f(24)2258 -3100 y FA(with-cwd)p FD(,)j(59)2258 3200 y FA(with-cwd*)p -FD(,)g(59)2258 3300 y FA(with-enabled-inte)o(rr)o(upt)o(s)p -FD(,)d(66)2258 3400 y FA(with-enabled-inte)o(rr)o(upt)o(s*)o -FD(,)h(66)2258 3499 y FA(with-env)p FD(,)i(74)2258 3599 -y FA(with-env*)p FD(,)g(74)2258 3699 y FA(with-errno-handle)o(r)p -FD(,)d(22)2258 3799 y FA(with-errno-handle)o(r*)o FD(,)h(22)2258 -3899 y FA(with-error-output)o(-p)o(ort)o FD(,)g(24)2258 -3999 y FA(with-error-output)o(-p)o(ort)o(*)p FD(,)f(24)2258 -4099 y FA(with-region-lock)p FD(,)g(39)2258 4199 y FA -(with-region-lock*)o FD(,)h(39)2258 4299 y FA(with-stdio-ports)p -FD(,)f(26)2258 4399 y FA(with-stdio-ports*)o FD(,)h(26)2258 -4499 y FA(with-total-env)p FD(,)g(74)2258 4599 y FA(with-total-env*)p -FD(,)g(74)2258 4698 y FA(with-umask)p FD(,)i(59)2258 -4798 y FA(with-umask*)p FD(,)f(59)2258 4898 y FA(write-string)p -FD(,)g(35)2051 5147 y(162)p eop -%%Page: 163 169 -163 168 bop 365 614 a FA(write-string/part)o(ia)o(l)p -FD(,)15 b(36)1735 5147 y(163)p eop +4398 y FA(with-current-inpu)o(t-)o(por)o(t*)o FD(,)h(24)2258 +4498 y FA(with-current-outp)o(ut)o(-po)o(rt)o FD(,)g(24)2258 +4598 y FA(with-current-outp)o(ut)o(-po)o(rt)o(*)p FD(,)f(24)2258 +4698 y FA(with-cwd)p FD(,)j(60)2258 4798 y FA(with-cwd*)p +FD(,)g(60)2258 4898 y FA(with-enabled-inte)o(rr)o(upt)o(s)p +FD(,)d(67)2051 5147 y(192)p eop +%%Page: 193 201 +193 200 bop 365 614 a FA(with-enabled-inte)o(rr)o(upt)o(s*)o +FD(,)15 b(67)365 714 y FA(with-env)p FD(,)i(75)365 814 +y FA(with-env*)p FD(,)g(75)365 913 y FA(with-errno-handle)o(r)p +FD(,)d(22)365 1013 y FA(with-errno-handle)o(r*)o FD(,)h(22)365 +1112 y FA(with-error-output)o(-p)o(ort)o FD(,)g(24)365 +1212 y FA(with-error-output)o(-p)o(ort)o(*)p FD(,)f(24)365 +1312 y FA(with-region-lock)p FD(,)g(39)365 1411 y FA(with-region-lock*) +o FD(,)h(39)365 1511 y FA(with-stdio-ports)p FD(,)f(26)365 +1611 y FA(with-stdio-ports*)o FD(,)h(26)365 1710 y FA(with-total-env)p +FD(,)g(75)365 1810 y FA(with-total-env*)p FD(,)g(75)365 +1910 y FA(with-umask)p FD(,)i(60)365 2009 y FA(with-umask*)p +FD(,)f(60)365 2109 y FA(write-string)p FD(,)g(35)365 +2208 y FA(write-string/part)o(ia)o(l)p FD(,)f(36)1735 +5147 y(193)p eop %%Trailer end userdict /end-hook known{end-hook}if