extras.lsp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  1. % RLISP to LISP converter. A C Norman 2002
  2. %
  3. % This code may be used and modified, and redistributed in binary
  4. % or source form, subject to the "CCL Public License", which should
  5. % accompany it. This license is a variant on the BSD license, and thus
  6. % permits use of code derived from this in either open and commercial
  7. % projects: but it does require that updates to this code be made
  8. % available back to the originators of the package.
  9. % Before merging other code in with this or linking this code
  10. % with other packages or libraries please check that the license terms
  11. % of the other material are compatible with those of this.
  12. %
  13. (de oem!-supervisor nil (print (eval (read))))
  14. (de break!-loop (a) (prog (prompt ifile ofile u v) (setq ifile (rds
  15. !*debug!-io!*)) (setq ofile (wrs !*debug!-io!*)) (setq prompt (setpchar
  16. "Break loop (:X exits)> ")) top (setq u (read)) (if (equal u (quote !:x)) (go
  17. exit) (if (equal u (quote !:q)) (progn (enable!-backtrace nil) (princ
  18. "Backtrace now disabled") (terpri)) (if (equal u (quote !:v)) (progn (
  19. enable!-backtrace t) (princ "Backtrace now enabled") (terpri)) (progn (if (
  20. null u) (setq v nil) (setq v (errorset u nil nil))) (if (atom v) (progn (
  21. princ ":Q quietens backtrace") (terpri) (princ ":V enables backtrace") (
  22. terpri) (princ ":X exits from break loop") (terpri) (princ
  23. "else form for evaluation") (terpri)) (progn (prin "=> ") (prinl (car v)) (
  24. terpri))))))) (go top) exit (rds ifile) (wrs ofile) (setpchar prompt) (return
  25. nil)))
  26. (global (quote (s!:gensym!-serial)))
  27. (setq s!:gensym!-serial 0)
  28. (de s!:stamp (n) (if (lessp n 0) (append (s!:stamp (minus n)) (quote (!-))) (
  29. if (equal n 0) nil (cons (schar "0123456789abcdefghijklmnopqrstuvwxyz" (
  30. remainder n 36)) (s!:stamp (truncate n 36))))))
  31. (de dated!-name (base) (intern (list!-to!-string (append (explodec base) (
  32. cons (quote !_) (append (reverse (s!:stamp (datestamp))) (cons (quote !_) (
  33. explodec (setq s!:gensym!-serial (plus s!:gensym!-serial 1))))))))))
  34. (de hashtagged!-name (base value) (intern (list!-to!-string (append (explodec
  35. base) (cons (quote !_) (s!:stamp (md60 value)))))))
  36. (remflag (quote (sort sortip)) (quote lose))
  37. (de sort (l pred) (stable!-sortip (append l nil) pred))
  38. (de stable!-sort (l pred) (stable!-sortip (append l nil) pred))
  39. (de sortip (l pred) (stable!-sortip l pred))
  40. (de stable!-sortip (l pred) (prog (l1 l2 w) (if (null l) (return l)) (setq l1
  41. l) (setq l2 (cdr l)) (if (null l2) (return l)) (setq l (cdr l2)) (if (null l
  42. ) (progn (if (apply2 pred (car l2) (car l1)) (progn (setq l (car l1)) (rplaca
  43. l1 (car l2)) (rplaca l2 l))) (return l1))) (setq l l1) (prog nil lab1000 (if
  44. (null (and l2 (not (apply2 pred (car l2) (car l))))) (return nil)) (progn (
  45. setq l l2) (setq l2 (cdr l2))) (go lab1000)) (if (null l2) (return l1)) (setq
  46. l2 l1) (setq l (cddr l2)) (prog nil lab1001 (if (null (and l (cdr l))) (
  47. return nil)) (progn (setq l2 (cdr l2)) (setq l (cddr l))) (go lab1001)) (setq
  48. l l2) (setq l2 (cdr l2)) (rplacd l nil) (setq l1 (stable!-sortip l1 pred)) (
  49. setq l2 (stable!-sortip l2 pred)) (setq l (setq w (list nil))) (prog nil
  50. lab1002 (if (null (and l1 l2)) (return nil)) (progn (if (apply2 pred (car l2)
  51. (car l1)) (progn (rplacd w l2) (setq w l2) (setq l2 (cdr l2))) (progn (
  52. rplacd w l1) (setq w l1) (setq l1 (cdr l1))))) (go lab1002)) (if l1 (setq l2
  53. l1)) (rplacd w l2) (return (cdr l))))
  54. (fluid (quote (!*prinl!-visited!-nodes!* !*prinl!-index!* !*prinl!-fn!*
  55. !*loop!-print!* !*print!-array!* !*print!-length!* !*print!-level!*)))
  56. (setq !*print!-length!* (setq !*print!-level!* nil))
  57. (setq !*prinl!-visited!-nodes!* (mkhash 10 0 1.5))
  58. (de s!:prinl0 (x !*prinl!-fn!*) (prog (!*prinl!-index!*) (setq
  59. !*prinl!-index!* 0) (unwind!-protect (progn (s!:prinl1 x 0) (s!:prinl2 x 0))
  60. (clrhash !*prinl!-visited!-nodes!*)) (return x)))
  61. (de s!:prinl1 (x depth) (prog (w length) (if (and (fixp !*print!-level!*) (
  62. greaterp depth !*print!-level!*)) (return nil)) (setq length 0) top (if (and
  63. (atom x) (not (simple!-vector!-p x)) (not (gensymp x))) (return nil) (if (
  64. setq w (gethash x !*prinl!-visited!-nodes!*)) (progn (if (equal w 0) (progn (
  65. setq !*prinl!-index!* (plus !*prinl!-index!* 1)) (puthash x
  66. !*prinl!-visited!-nodes!* !*prinl!-index!*))) (return nil)) (progn (puthash x
  67. !*prinl!-visited!-nodes!* 0) (if (simple!-vector!-p x) (progn (if
  68. !*print!-array!* (progn (setq length (upbv x)) (if (and (fixp
  69. !*print!-length!*) (lessp !*print!-length!* length)) (setq length
  70. !*print!-length!*)) (prog (i) (setq i 0) lab1003 (if (minusp (times 1 (
  71. difference length i))) (return nil)) (s!:prinl1 (getv x i) (plus depth 1)) (
  72. setq i (plus i 1)) (go lab1003))))) (if (not (atom x)) (progn (s!:prinl1 (car
  73. x) (plus depth 1)) (if (and (fixp !*print!-length!*) (greaterp (setq length
  74. (plus length 1)) !*print!-length!*)) (return nil)) (setq x (cdr x)) (go top))
  75. )))))))
  76. (de s!:prinl2 (x depth) (if (and (fixp !*print!-level!*) (greaterp depth
  77. !*print!-level!*)) (princ "#") (if (and (atom x) (not (simple!-vector!-p x))
  78. (not (gensymp x))) (progn (funcall !*prinl!-fn!* x)) (prog (w length) (setq w
  79. (gethash x !*prinl!-visited!-nodes!*)) (if (not (zerop w)) (progn (if (lessp
  80. w 0) (progn (princ "#") (princ (minus w)) (princ "#") (return nil)) (progn (
  81. puthash x !*prinl!-visited!-nodes!* (minus w)) (princ "#") (princ w) (princ
  82. "="))))) (if (simple!-vector!-p x) (progn (princ "%(") (if !*print!-array!* (
  83. progn (setq length (upbv x)) (if (and (fixp !*print!-length!*) (lessp
  84. !*print!-length!* length)) (setq length !*print!-length!*)) (prog (i) (setq i
  85. 0) lab1004 (if (minusp (times 1 (difference length i))) (return nil)) (progn
  86. (s!:prinl2 (getv x i) (plus depth 1)) (if (not (equal i (upbv x))) (princ
  87. " "))) (setq i (plus i 1)) (go lab1004))) (princ "...")) (princ ")") (return
  88. nil)) (if (atom x) (return (funcall !*prinl!-fn!* x)))) (princ "(") (setq
  89. length 0) loop (s!:prinl2 (car x) (plus depth 1)) (setq x (cdr x)) (if (atom
  90. x) (progn (if (simple!-vector!-p x) (progn (princ " . %(") (if
  91. !*print!-array!* (progn (setq length (upbv x)) (if (and (fixp
  92. !*print!-length!*) (lessp !*print!-length!* length)) (setq length
  93. !*print!-length!*)) (prog (i) (setq i 0) lab1005 (if (minusp (times 1 (
  94. difference length i))) (return nil)) (progn (s!:prinl2 (getv x i) (plus depth
  95. 1)) (if (not (equal i (upbv x))) (princ " "))) (setq i (plus i 1)) (go
  96. lab1005))) (princ "...")) (princ ")")) (if x (progn (princ " . ") (funcall
  97. !*prinl!-fn!* x)))) (return (princ ")")))) (if (and (fixp !*print!-length!*)
  98. (greaterp (setq length (plus length 1)) !*print!-length!*)) (return (princ
  99. " ...)"))) (setq w (gethash x !*prinl!-visited!-nodes!*)) (if (not (equal w 0
  100. )) (if (lessp w 0) (progn (princ " . #") (princ (minus w)) (return (princ
  101. "#)"))) (progn (princ " . ") (s!:prinl2 x (plus depth 1)) (return (princ ")")
  102. ))) (princ " ")) (go loop)))))
  103. (de printl (x) (progn (prinl x) (terpri) x))
  104. (de printcl (x) (progn (princl x) (terpri) x))
  105. (de princl (x) (s!:prinl0 x (function princ)))
  106. (de prinl (x) (s!:prinl0 x (function prin)))
  107. (de s!:format (dest fmt args) (prog (len c a res o) (if (not (null dest)) (
  108. progn (if (equal dest (quote t)) (setq o (wrs nil)) (setq o (wrs dest))))) (
  109. setq len (upbv fmt)) (prog (i) (setq i 0) lab1012 (if (minusp (times 1 (
  110. difference len i))) (return nil)) (progn (setq c (schar fmt i)) (if (equal c
  111. (quote !~)) (progn (setq i (plus i 1)) (setq c (char!-downcase (schar fmt i))
  112. ) (if (equal c (quote !%)) (if (null dest) (setq res (cons !$eol!$ res)) (
  113. terpri)) (if (equal c (quote !~)) (if (null dest) (setq res (cons (quote !~)
  114. res)) (princ (quote !~))) (progn (if (null args) (setq a nil) (progn (setq a
  115. (car args)) (setq args (cdr args)))) (if (equal c (quote !a)) (if (null dest)
  116. (prog (var1007) (setq var1007 (explode2 a)) lab1006 (if (null var1007) (
  117. return nil)) (prog (k) (setq k (car var1007)) (setq res (cons k res))) (setq
  118. var1007 (cdr var1007)) (go lab1006)) (princ a)) (if (equal c (quote !s)) (if
  119. (null dest) (prog (var1009) (setq var1009 (explode a)) lab1008 (if (null
  120. var1009) (return nil)) (prog (k) (setq k (car var1009)) (setq res (cons k res
  121. ))) (setq var1009 (cdr var1009)) (go lab1008)) (prin a)) (if (null dest) (
  122. prog (var1011) (setq var1011 (explode a)) lab1010 (if (null var1011) (return
  123. nil)) (prog (k) (setq k (car var1011)) (setq res (cons k res))) (setq var1011
  124. (cdr var1011)) (go lab1010)) (prin (list (quote !?!?!?) c a))))))))) (progn
  125. (if (null dest) (setq res (cons c res)) (princ c))))) (setq i (plus i 1)) (go
  126. lab1012)) (if (null dest) (return (list!-to!-string (reversip res))) (progn
  127. (wrs o) (return nil)))))
  128. (dm format (u !&optional env) (list (quote s!:format) (cadr u) (caddr u) (
  129. cons (quote list) (cdddr u))))
  130. (fluid (quote (bn bufferi buffero indblanks indentlevel initialblanks lmar
  131. pendingrpars rmar rparcount stack)))
  132. (global (quote (!*quotes !*pretty!-symmetric thin!*)))
  133. (setq !*pretty!-symmetric t)
  134. (setq !*quotes t)
  135. (setq thin!* 5)
  136. (de prettyprint (x) (progn (superprinm x (posn)) (terpri) nil))
  137. (de superprintm (x lmar) (progn (superprinm x lmar) (terpri) x))
  138. (de superprinm (x lmar) (prog (stack bufferi buffero bn initialblanks rmar
  139. pendingrpars indentlevel indblanks rparcount w) (setq bufferi (setq buffero (
  140. list nil))) (setq initialblanks 0) (setq rparcount 0) (setq indblanks 0) (
  141. setq rmar (linelength nil)) (linelength 500) (if (lessp rmar 25) (error 0 (
  142. list rmar "Linelength too short for superprinting"))) (setq bn 0) (setq
  143. indentlevel 0) (if (geq (plus lmar 20) rmar) (setq lmar (difference rmar 21))
  144. ) (setq w (posn)) (if (greaterp w lmar) (progn (terpri) (setq w 0))) (if (
  145. lessp w lmar) (setq initialblanks (difference lmar w))) (s!:prindent x (plus
  146. lmar 3)) (s!:overflow (quote none)) (linelength rmar) (return x)))
  147. (dm s!:top (u !&optional v) (quote (car stack)))
  148. (dm s!:depth (u !&optional v) (list (quote car) (cadr u)))
  149. (dm s!:indenting (u !&optional v) (list (quote cadr) (cadr u)))
  150. (dm s!:blankcount (u !&optional v) (list (quote caddr) (cadr u)))
  151. (dm s!:blanklist (u !&optional v) (list (quote cdddr) (cadr u)))
  152. (dm s!:setindenting (u !&optional v) (list (quote rplaca) (list (quote cdr) (
  153. cadr u)) (caddr u)))
  154. (dm s!:setblankcount (u !&optional v) (list (quote rplaca) (list (quote cddr)
  155. (cadr u)) (caddr u)))
  156. (dm s!:setblanklist (u !&optional v) (list (quote rplacd) (list (quote cddr)
  157. (cadr u)) (caddr u)))
  158. (dm s!:newframe (u !&optional v) (list (quote list) (cadr u) nil 0))
  159. (dm s!:blankp (u !&optional v) (list (quote numberp) (list (quote car) (cadr
  160. u))))
  161. (de s!:prindent (x n) (if (atom x) (if (simple!-vector!-p x) (s!:prvector x n
  162. ) (prog (var1014) (setq var1014 (if !*pretty!-symmetric (if (stringp x) (
  163. s!:explodes x) (explode x)) (explode2 x))) lab1013 (if (null var1014) (return
  164. nil)) (prog (c) (setq c (car var1014)) (s!:putch c)) (setq var1014 (cdr
  165. var1014)) (go lab1013))) (if (s!:quotep x) (progn (s!:putch (quote !')) (
  166. s!:prindent (cadr x) (plus n 1))) (prog (cx) (if (greaterp (times 4 n) (times
  167. 3 rmar)) (progn (s!:overflow (quote all)) (setq n (truncate n 8)) (if (
  168. greaterp initialblanks n) (progn (setq lmar (plus (difference lmar
  169. initialblanks) n)) (setq initialblanks n))))) (setq stack (cons (s!:newframe
  170. n) stack)) (s!:putch (cons (quote lpar) (s!:top))) (setq cx (car x)) (
  171. s!:prindent cx (plus n 1)) (if (and (idp cx) (not (atom (cdr x)))) (setq cx (
  172. get cx (quote s!:ppformat))) (setq cx nil)) (if (and (equal cx 2) (atom (cddr
  173. x))) (setq cx nil)) (if (equal cx (quote prog)) (progn (s!:putch (quote ! ))
  174. (s!:prindent (car (setq x (cdr x))) (plus n 3)))) (setq x (cdr x)) scan (if
  175. (atom x) (go outt)) (s!:finishpending) (if (equal cx (quote prog)) (progn (
  176. s!:putblank) (s!:overflow bufferi) (if (atom (car x)) (progn (setq lmar (setq
  177. initialblanks (max (difference lmar 6) 0))) (s!:prindent (car x) (difference
  178. n 3)) (setq x (cdr x)) (if (and (not (atom x)) (atom (car x))) (go scan)) (
  179. if (greaterp (plus lmar bn) n) (s!:putblank) (prog (i) (setq i (plus lmar bn)
  180. ) lab1015 (if (minusp (times 1 (difference (difference n 1) i))) (return nil)
  181. ) (s!:putch (quote ! )) (setq i (plus i 1)) (go lab1015))) (if (atom x) (go
  182. outt))))) (if (numberp cx) (progn (setq cx (difference cx 1)) (if (equal cx 0
  183. ) (setq cx nil)) (s!:putch (quote ! ))) (s!:putblank))) (s!:prindent (car x)
  184. (plus n 3)) (setq x (cdr x)) (go scan) outt (if (not (null x)) (progn (
  185. s!:finishpending) (s!:putblank) (s!:putch (quote !.)) (s!:putch (quote ! )) (
  186. s!:prindent x (plus n 5)))) (s!:putch (cons (quote rpar) (difference n 3))) (
  187. if (and (equal (s!:indenting (s!:top)) (quote indent)) (not (null (
  188. s!:blanklist (s!:top))))) (s!:overflow (car (s!:blanklist (s!:top)))) (
  189. s!:endlist (s!:top))) (setq stack (cdr stack))))))
  190. (de s!:explodes (x) (explode x))
  191. (de s!:prvector (x n) (prog (bound) (setq bound (upbv x)) (setq stack (cons (
  192. s!:newframe n) stack)) (s!:putch (cons (quote lsquare) (s!:top))) (
  193. s!:prindent (getv x 0) (plus n 3)) (prog (i) (setq i 1) lab1016 (if (minusp (
  194. times 1 (difference bound i))) (return nil)) (progn (s!:putch (quote !,)) (
  195. s!:putblank) (s!:prindent (getv x i) (plus n 3))) (setq i (plus i 1)) (go
  196. lab1016)) (s!:putch (cons (quote rsquare) (difference n 3))) (s!:endlist (
  197. s!:top)) (setq stack (cdr stack))))
  198. (de s!:putblank nil (prog nil (s!:putch (s!:top)) (s!:setblankcount (s!:top)
  199. (plus (s!:blankcount (s!:top)) 1)) (s!:setblanklist (s!:top) (cons bufferi (
  200. s!:blanklist (s!:top)))) (setq indblanks (plus indblanks 1))))
  201. (de s!:endlist (l) (setq pendingrpars (cons l pendingrpars)))
  202. (de s!:finishpending nil (progn (prog (var1020) (setq var1020 pendingrpars)
  203. lab1019 (if (null var1020) (return nil)) (prog (stackframe) (setq stackframe
  204. (car var1020)) (progn (if (neq (s!:indenting stackframe) (quote indent)) (
  205. prog (var1018) (setq var1018 (s!:blanklist stackframe)) lab1017 (if (null
  206. var1018) (return nil)) (prog (b) (setq b (car var1018)) (progn (rplaca b (
  207. quote ! )) (setq indblanks (difference indblanks 1)))) (setq var1018 (cdr
  208. var1018)) (go lab1017))) (s!:setblanklist stackframe t))) (setq var1020 (cdr
  209. var1020)) (go lab1019)) (setq pendingrpars nil)))
  210. (de s!:quotep (x) (and !*quotes (not (atom x)) (equal (car x) (quote quote))
  211. (not (atom (cdr x))) (null (cddr x))))
  212. (put (quote prog) (quote s!:ppformat) (quote prog))
  213. (put (quote lambda) (quote s!:ppformat) 1)
  214. (put (quote lambdaq) (quote s!:ppformat) 1)
  215. (put (quote setq) (quote s!:ppformat) 1)
  216. (put (quote set) (quote s!:ppformat) 1)
  217. (put (quote while) (quote s!:ppformat) 1)
  218. (put (quote t) (quote s!:ppformat) 1)
  219. (put (quote de) (quote s!:ppformat) 2)
  220. (put (quote df) (quote s!:ppformat) 2)
  221. (put (quote dm) (quote s!:ppformat) 2)
  222. (put (quote defun) (quote s!:ppformat) 2)
  223. (put (quote defmacro) (quote s!:ppformat) 2)
  224. (put (quote foreach) (quote s!:ppformat) 4)
  225. (de s!:putch (c) (prog nil (if (atom c) (setq rparcount 0) (if (s!:blankp c)
  226. (progn (setq rparcount 0) (go nocheck)) (if (equal (car c) (quote rpar)) (
  227. progn (setq rparcount (plus rparcount 1)) (if (greaterp rparcount 4) (progn (
  228. s!:putch (quote ! )) (setq rparcount 2)))) (setq rparcount 0)))) (prog nil
  229. lab1021 (if (null (geq (plus lmar bn) rmar)) (return nil)) (s!:overflow (
  230. quote more)) (go lab1021)) nocheck (setq bufferi (cdr (rplacd bufferi (list c
  231. )))) (setq bn (plus bn 1))))
  232. (de s!:overflow (flg) (prog (c blankstoskip) (if (and (equal indblanks 0) (
  233. greaterp initialblanks 3) (equal flg (quote more))) (progn (setq
  234. initialblanks (difference initialblanks 3)) (setq lmar (difference lmar 3)) (
  235. return (quote moved!-left)))) fblank (if (equal bn 0) (progn (if (not (equal
  236. flg (quote more))) (return (quote empty))) (if (atom (car buffero)) (prin2
  237. "%+")) (terpri) (setq lmar 0) (return (quote continued))) (progn (spaces
  238. initialblanks) (setq initialblanks 0))) (setq buffero (cdr buffero)) (setq bn
  239. (difference bn 1)) (setq lmar (plus lmar 1)) (setq c (car buffero)) (if (
  240. atom c) (progn (prin2 c) (go fblank)) (if (s!:blankp c) (if (not (atom
  241. blankstoskip)) (progn (prin2 (quote ! )) (setq indblanks (difference
  242. indblanks 1)) (if (eq c (car blankstoskip)) (progn (rplacd blankstoskip (
  243. difference (cdr blankstoskip) 1)) (if (equal (cdr blankstoskip) 0) (setq
  244. blankstoskip t)))) (go fblank)) (go blankfound)) (if (or (equal (car c) (
  245. quote lpar)) (equal (car c) (quote lsquare))) (progn (prin2 (get (car c) (
  246. quote s!:ppchar))) (if (equal flg (quote none)) (go fblank)) (setq c (cdr c))
  247. (if (not (null (s!:blanklist c))) (go fblank)) (if (greaterp (s!:depth c)
  248. indentlevel) (progn (setq indentlevel (s!:depth c)) (s!:setindenting c (quote
  249. indent)))) (go fblank)) (if (or (equal (car c) (quote rpar)) (equal (car c)
  250. (quote rsquare))) (progn (if (lessp (cdr c) indentlevel) (setq indentlevel (
  251. cdr c))) (prin2 (get (car c) (quote s!:ppchar))) (go fblank)) (error 0 (list
  252. c "UNKNOWN TAG IN OVERFLOW")))))) blankfound (if (eqcar (s!:blanklist c)
  253. buffero) (s!:setblanklist c nil)) (setq indblanks (difference indblanks 1)) (
  254. if (greaterp (s!:depth c) indentlevel) (progn (if (equal flg (quote none)) (
  255. progn (prin2 (quote ! )) (go fblank))) (if blankstoskip (setq blankstoskip
  256. nil) (progn (setq indentlevel (s!:depth c)) (s!:setindenting c (quote indent)
  257. ))))) (if (greaterp (s!:blankcount c) (difference thin!* 1)) (progn (setq
  258. blankstoskip (cons c (difference (s!:blankcount c) 2))) (s!:setindenting c (
  259. quote thin)) (s!:setblankcount c 1) (setq indentlevel (difference (s!:depth c
  260. ) 1)) (prin2 (quote ! )) (go fblank))) (s!:setblankcount c (difference (
  261. s!:blankcount c) 1)) (terpri) (setq lmar (setq initialblanks (s!:depth c))) (
  262. if (eq buffero flg) (return (quote to!-flg))) (if (or blankstoskip (not (
  263. equal flg (quote more)))) (go fblank)) (return (quote more))))
  264. (put (quote lpar) (quote s!:ppchar) (quote !())
  265. (put (quote lsquare) (quote s!:ppchar) (quote ![))
  266. (put (quote rpar) (quote s!:ppchar) (quote !)))
  267. (put (quote rsquare) (quote s!:ppchar) (quote !]))
  268. (de fetch!-url (url !&optional dest) (prog (a b c d e w) (setq a (open!-url
  269. url)) (if (null a) (return nil)) (if dest (progn (setq d (open dest (quote
  270. output))) (if (null d) (progn (close a) (return (error 0
  271. "unable to open destination file")))) (setq d (wrs d)))) (setq b (rds a)) (
  272. setq w (linelength 500)) (prog nil lab1022 (if (null (not (equal (setq c (
  273. readch)) !$eof!$))) (return nil)) (princ c) (go lab1022)) (linelength e) (rds
  274. b) (close a) (if dest (close (wrs d)))))
  275. % end of file