1 | ;;; scheme-complete.el -*- Emacs-Lisp -*- |
---|
2 | |
---|
3 | ;;; Smart tab completion for Emacs |
---|
4 | |
---|
5 | ;;; This code is written by Alex Shinn and placed in the Public |
---|
6 | ;;; Domain. All warranties are disclaimed. |
---|
7 | |
---|
8 | ;;; This file provides a single function, `scheme-smart-complete', |
---|
9 | ;;; which you can use for intelligent, context-sensitive completion |
---|
10 | ;;; for any Scheme implementation. To use it just load this file and |
---|
11 | ;;; bind that function to a key in your preferred mode: |
---|
12 | ;;; |
---|
13 | ;;; (autoload 'scheme-smart-complete "scheme-complete" nil t) |
---|
14 | ;;; (eval-after-load 'scheme |
---|
15 | ;;; '(define-key scheme-mode-map "\e\t" 'scheme-smart-complete)) |
---|
16 | ;;; |
---|
17 | ;;; Alternately, you may want to just bind TAB to the |
---|
18 | ;;; `scheme-complete-or-indent' function, which indents at the start |
---|
19 | ;;; of a line and otherwise performs the smart completion: |
---|
20 | ;;; |
---|
21 | ;;; (eval-after-load 'scheme |
---|
22 | ;;; '(define-key scheme-mode-map "\t" 'scheme-complete-or-indent)) |
---|
23 | ;;; |
---|
24 | ;;; If you use eldoc-mode (included in Emacs), you can also get live |
---|
25 | ;;; scheme documentation with: |
---|
26 | ;;; |
---|
27 | ;;; (autoload 'scheme-get-current-symbol-info "scheme-complete" nil t) |
---|
28 | ;;; (add-hook 'scheme-mode-hook |
---|
29 | ;;; (lambda () |
---|
30 | ;;; (make-local-variable 'eldoc-documentation-function) |
---|
31 | ;;; (setq eldoc-documentation-function 'scheme-get-current-symbol-info) |
---|
32 | ;;; (eldoc-mode))) |
---|
33 | ;;; |
---|
34 | ;;; You can enable slightly smarter indentation with |
---|
35 | ;;; |
---|
36 | ;;; (setq lisp-indent-function 'scheme-smart-indent-function) |
---|
37 | ;;; |
---|
38 | ;;; which basically ignores the scheme-indent-function property for |
---|
39 | ;;; locally overridden symbols (e.g. if you use the (let loop () ...) |
---|
40 | ;;; idiom it won't use the special loop indentation inside). |
---|
41 | ;;; |
---|
42 | ;;; There's a single custom variable, `scheme-default-implementation', |
---|
43 | ;;; which you can use to specify your preferred implementation when we |
---|
44 | ;;; can't infer it from the source code. |
---|
45 | ;;; |
---|
46 | ;;; That's all there is to it. |
---|
47 | |
---|
48 | ;;; History: |
---|
49 | ;;; 0.8.3: 2008/10/06 - smart indent, inferring types from imported modules, |
---|
50 | ;; optionally caching exports, chicken 4 support |
---|
51 | ;;; 0.8.2: 2008/07/04 - both TAB and M-TAB scroll results (thanks Peter Bex), |
---|
52 | ;;; better MATCH handling, fixed SRFI-55, other bugfixes |
---|
53 | ;;; 0.8.1: 2008/04/17 - great renaming, everthing starts with `scheme-' |
---|
54 | ;; also, don't scan imported modules multiple times |
---|
55 | ;;; 0.8: 2008/02/08 - several parsing bugfixes on unclosed parenthesis |
---|
56 | ;;; (thanks to Kazushi NODA) |
---|
57 | ;;; filename completion works properly on absolute paths |
---|
58 | ;;; eldoc works properly on dotted lambdas |
---|
59 | ;;; 0.7: 2008/01/18 - handles higher-order types (for apply, map, etc.) |
---|
60 | ;;; smarter string completion (hostname, username, etc.) |
---|
61 | ;;; smarter type inference, various bugfixes |
---|
62 | ;;; 0.6: 2008/01/06 - more bugfixes (merry christmas) |
---|
63 | ;;; 0.5: 2008/01/03 - handling internal defines, records, smarter |
---|
64 | ;;; parsing |
---|
65 | ;;; 0.4: 2007/11/14 - silly bugfix plus better repo env support |
---|
66 | ;;; for searching chicken and gauche modules |
---|
67 | ;;; 0.3: 2007/11/13 - bugfixes, better inference, smart strings |
---|
68 | ;;; 0.2: 2007/10/15 - basic type inference |
---|
69 | ;;; 0.1: 2007/09/11 - initial release |
---|
70 | ;;; |
---|
71 | ;;; What is this talk of 'release'? Klingons do not make software |
---|
72 | ;;; 'releases'. Our software 'escapes' leaving a bloody trail of |
---|
73 | ;;; designers and quality assurance people in its wake. |
---|
74 | |
---|
75 | (require 'cl) |
---|
76 | |
---|
77 | ;; this is just to eliminate some warnings when compiling - this file |
---|
78 | ;; should be loaded after 'scheme |
---|
79 | (eval-when (compile) |
---|
80 | (require 'scheme)) |
---|
81 | |
---|
82 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
---|
83 | ;; info |
---|
84 | ;; |
---|
85 | ;; identifier type [doc-string no-type-display?] |
---|
86 | ;; |
---|
87 | ;; types: |
---|
88 | ;; |
---|
89 | ;; pair, number, symbol, etc. |
---|
90 | ;; (lambda (param-types) [return-type]) |
---|
91 | ;; (syntax (param-types) [return-type]) |
---|
92 | ;; (set name values ...) |
---|
93 | ;; (flags name values ...) |
---|
94 | ;; (list type) |
---|
95 | ;; (string expander) |
---|
96 | ;; (special type function [outer-function]) |
---|
97 | |
---|
98 | (defvar *scheme-r5rs-info* |
---|
99 | '((define (syntax (identifier value) undefined) "define a new variable") |
---|
100 | (set! (syntax (identifier value) undefined) "set the value of a variable") |
---|
101 | (let (syntax (vars body \.\.\.)) "bind new local variables in parallel") |
---|
102 | (let* (syntax (vars body \.\.\.)) "bind new local variables sequentially") |
---|
103 | (letrec (syntax (vars body \.\.\.)) "bind new local variables recursively") |
---|
104 | (lambda (syntax (params body \.\.\.)) "procedure syntax") |
---|
105 | (if (syntax (cond then else)) "conditional evaluation") |
---|
106 | (cond (syntax (clause \.\.\.)) "try each clause until one succeeds") |
---|
107 | (case (syntax (expr clause \.\.\.)) "look for EXPR among literal lists") |
---|
108 | (delay (syntax (expr)) "create a promise to evaluate EXPR") |
---|
109 | (and (syntax (expr \.\.\.)) "evaluate EXPRs while true, return last") |
---|
110 | (or (syntax (expr \.\.\.)) "return the first true EXPR") |
---|
111 | (begin (syntax (expr \.\.\.)) "evaluate each EXPR in turn and return the last") |
---|
112 | (do (syntax (vars finish body \.\.\.)) "simple iterator") |
---|
113 | (quote (syntax (expr)) "represent EXPR literally without evaluating it") |
---|
114 | (quasiquote (syntax (expr)) "quote literals allowing escapes") |
---|
115 | (unquote (syntax (expr)) "escape an expression inside quasiquote") |
---|
116 | (unquote-splicing (syntax (expr)) "escape and splice a list expression inside quasiquote") |
---|
117 | (define-syntax (syntax (identifier body \.\.\.) undefined) "create a macro") |
---|
118 | (let-syntax (syntax (syntaxes body \.\.\.)) "a local macro") |
---|
119 | (letrec-syntax (syntax (syntaxes body \.\.\.)) "a local macro") |
---|
120 | (syntax-rules (syntax (literals clauses \.\.\.) undefined) "simple macro language") |
---|
121 | (eqv? (lambda (obj1 obj2) bool) "returns #t if OBJ1 and OBJ2 are the same object") |
---|
122 | (eq? (lambda (obj1 obj2) bool) "finer grained version of EQV?") |
---|
123 | (equal? (lambda (obj1 obj2) bool) "recursive equivalence") |
---|
124 | (not (lambda (obj) bool) "returns #t iff OBJ is false") |
---|
125 | (boolean? (lambda (obj) bool) "returns #t iff OBJ is #t or #f") |
---|
126 | (number? (lambda (obj) bool) "returns #t iff OBJ is a number") |
---|
127 | (complex? (lambda (obj) bool) "returns #t iff OBJ is a complex number") |
---|
128 | (real? (lambda (obj) bool) "returns #t iff OBJ is a real number") |
---|
129 | (rational? (lambda (obj) bool) "returns #t iff OBJ is a rational number") |
---|
130 | (integer? (lambda (obj) bool) "returns #t iff OBJ is an integer") |
---|
131 | (exact? (lambda (z) bool) "returns #t iff Z is exact") |
---|
132 | (inexact? (lambda (z) bool) "returns #t iff Z is inexact") |
---|
133 | (= (lambda (z1 z2 \.\.\.) bool) "returns #t iff the arguments are all equal") |
---|
134 | (< (lambda (x1 x2 \.\.\.) bool) "returns #t iff the arguments are monotonically increasing") |
---|
135 | (> (lambda (x1 x2 \.\.\.) bool) "returns #t iff the arguments are monotonically decreasing") |
---|
136 | (<= (lambda (x1 x2 \.\.\.) bool) "returns #t iff the arguments are monotonically nondecreasing") |
---|
137 | (>= (lambda (x1 x2 \.\.\.) bool) "returns #t iff the arguments are monotonically nonincreasing") |
---|
138 | (zero? (lambda (z) bool)) |
---|
139 | (positive? (lambda (x1) bool)) |
---|
140 | (negative? (lambda (x1) bool)) |
---|
141 | (odd? (lambda (n) bool)) |
---|
142 | (even? (lambda (n) bool)) |
---|
143 | (max (lambda (x1 x2 \.\.\.) x3) "returns the maximum of the arguments") |
---|
144 | (min (lambda (x1 x2 \.\.\.) x3) "returns the minimum of the arguments") |
---|
145 | (+ (lambda (z1 \.\.\.) z)) |
---|
146 | (* (lambda (z1 \.\.\.) z)) |
---|
147 | (- (lambda (z1 \.\.\.) z)) |
---|
148 | (/ (lambda (z1 \.\.\.) z)) |
---|
149 | (abs (lambda (x1) x2) "returns the absolute value of X") |
---|
150 | (quotient (lambda (n1 n2) n) "integer division") |
---|
151 | (remainder (lambda (n1 n2) n) "same sign as N1") |
---|
152 | (modulo (lambda (n1 n2) n) "same sign as N2") |
---|
153 | (gcd (lambda (n1 \.\.\.) n) "greatest common divisor") |
---|
154 | (lcm (lambda (n2 \.\.\.) n) "least common multiple") |
---|
155 | (numerator (lambda (rational) n)) |
---|
156 | (denominator (lambda (rational) n)) |
---|
157 | (floor (lambda (x1) n) "largest integer not larger than X") |
---|
158 | (ceiling (lambda (x1) n) "smallest integer not smaller than X") |
---|
159 | (truncate (lambda (x1) n) "drop fractional part") |
---|
160 | (round (lambda (x1) n) "round to even (banker's rounding)") |
---|
161 | (rationalize (lambda (x1 y) n) "rational number differing from X by at most Y") |
---|
162 | (exp (lambda (z) z) "e^Z") |
---|
163 | (log (lambda (z) z) "natural logarithm of Z") |
---|
164 | (sin (lambda (z) z) "sine function") |
---|
165 | (cos (lambda (z) z) "cosine function") |
---|
166 | (tan (lambda (z) z) "tangent function") |
---|
167 | (asin (lambda (z) z) "arcsine function") |
---|
168 | (acos (lambda (z) z) "arccosine function") |
---|
169 | (atan (lambda (z) z) "arctangent function") |
---|
170 | (sqrt (lambda (z) z) "principal square root of Z") |
---|
171 | (expt (lambda (z1 z2) z) "returns Z1 raised to the Z2 power") |
---|
172 | (make-rectangular (lambda (x1 x2) z) "create a complex number") |
---|
173 | (make-polar (lambda (x1 x2) z) "create a complex number") |
---|
174 | (real-part (lambda (z) x1)) |
---|
175 | (imag-part (lambda (z) x1)) |
---|
176 | (magnitude (lambda (z) x1)) |
---|
177 | (angle (lambda (z) x1)) |
---|
178 | (exact->inexact (lambda (z) z)) |
---|
179 | (inexact->exact (lambda (z) z)) |
---|
180 | (number->string (lambda (z :optional radix) str)) |
---|
181 | (string->number (lambda (str :optional radix) z)) |
---|
182 | (pair? (lambda (obj) bool) "returns #t iff OBJ is a pair") |
---|
183 | (cons (lambda (obj1 obj2) pair) "create a newly allocated pair") |
---|
184 | (car (lambda (pair) obj)) |
---|
185 | (cdr (lambda (pair) obj)) |
---|
186 | (set-car! (lambda (pair obj) undefined)) |
---|
187 | (set-cdr! (lambda (pair obj) undefined)) |
---|
188 | (caar (lambda (pair) obj)) |
---|
189 | (cadr (lambda (pair) obj)) |
---|
190 | (cdar (lambda (pair) obj)) |
---|
191 | (cddr (lambda (pair) obj)) |
---|
192 | (caaar (lambda (pair) obj)) |
---|
193 | (caadr (lambda (pair) obj)) |
---|
194 | (cadar (lambda (pair) obj)) |
---|
195 | (caddr (lambda (pair) obj)) |
---|
196 | (cdaar (lambda (pair) obj)) |
---|
197 | (cdadr (lambda (pair) obj)) |
---|
198 | (cddar (lambda (pair) obj)) |
---|
199 | (cdddr (lambda (pair) obj)) |
---|
200 | (caaaar (lambda (pair) obj)) |
---|
201 | (caaadr (lambda (pair) obj)) |
---|
202 | (caadar (lambda (pair) obj)) |
---|
203 | (caaddr (lambda (pair) obj)) |
---|
204 | (cadaar (lambda (pair) obj)) |
---|
205 | (cadadr (lambda (pair) obj)) |
---|
206 | (caddar (lambda (pair) obj)) |
---|
207 | (cadddr (lambda (pair) obj)) |
---|
208 | (cdaaar (lambda (pair) obj)) |
---|
209 | (cdaadr (lambda (pair) obj)) |
---|
210 | (cdadar (lambda (pair) obj)) |
---|
211 | (cdaddr (lambda (pair) obj)) |
---|
212 | (cddaar (lambda (pair) obj)) |
---|
213 | (cddadr (lambda (pair) obj)) |
---|
214 | (cdddar (lambda (pair) obj)) |
---|
215 | (cddddr (lambda (pair) obj)) |
---|
216 | (null? (lambda (obj) bool) "returns #t iff OBJ is the empty list") |
---|
217 | (list? (lambda (obj) bool) "returns #t iff OBJ is a proper list") |
---|
218 | (list (lambda (obj \.\.\.) list) "returns a newly allocated list") |
---|
219 | (length (lambda (list) n)) |
---|
220 | (append (lambda (list \.\.\.) list) "concatenates the list arguments") |
---|
221 | (reverse (lambda (list) list)) |
---|
222 | (list-tail (lambda (list k) list) "returns the Kth cdr of LIST") |
---|
223 | (list-ref (lambda (list k) obj) "returns the Kth element of LIST") |
---|
224 | (memq (lambda (obj list)) "the sublist of LIST whose car is eq? to OBJ") |
---|
225 | (memv (lambda (obj list)) "the sublist of LIST whose car is eqv? to OBJ") |
---|
226 | (member (lambda (obj list)) "the sublist of LIST whose car is equal? to OBJ") |
---|
227 | (assq (lambda (obj list)) "the element of LIST whose car is eq? to OBJ") |
---|
228 | (assv (lambda (obj list)) "the element of LIST whose car is eqv? to OBJ") |
---|
229 | (assoc (lambda (obj list)) "the element of LIST whose car is equal? to OBJ") |
---|
230 | (symbol? (lambda (obj) bool) "returns #t iff OBJ is a symbol") |
---|
231 | (symbol->string (lambda (symbol) str)) |
---|
232 | (string->symbol (lambda (str) symbol)) |
---|
233 | (char? (lambda (obj) bool) "returns #t iff OBJ is a character") |
---|
234 | (char=? (lambda (ch1 ch2) bool)) |
---|
235 | (char<? (lambda (ch1 ch2) bool)) |
---|
236 | (char>? (lambda (ch1 ch2) bool)) |
---|
237 | (char<=? (lambda (ch1 ch2) bool)) |
---|
238 | (char>=? (lambda (ch1 ch2) bool)) |
---|
239 | (char-ci=? (lambda (ch1 ch2) bool)) |
---|
240 | (char-ci<? (lambda (ch1 ch2) bool)) |
---|
241 | (char-ci>? (lambda (ch1 ch2) bool)) |
---|
242 | (char-ci<=? (lambda (ch1 ch2) bool)) |
---|
243 | (char-ci>=? (lambda (ch1 ch2) bool)) |
---|
244 | (char-alphabetic? (lambda (ch) bool)) |
---|
245 | (char-numeric? (lambda (ch) bool)) |
---|
246 | (char-whitespace? (lambda (ch) bool)) |
---|
247 | (char-upper-case? (lambda (ch) bool)) |
---|
248 | (char-lower-case? (lambda (ch) bool)) |
---|
249 | (char->integer (lambda (ch) int)) |
---|
250 | (integer->char (lambda (int) ch)) |
---|
251 | (char-upcase (lambda (ch) ch)) |
---|
252 | (char-downcase (lambda (ch) ch)) |
---|
253 | (string? (lambda (obj) bool) "returns #t iff OBJ is a string") |
---|
254 | (make-string (lambda (k :optional ch) str) "a new string of length k") |
---|
255 | (string (lambda (ch \.\.\.) str) "a new string made of the char arguments") |
---|
256 | (string-length (lambda (str) n) "the number of characters in STR") |
---|
257 | (string-ref (lambda (str i) ch) "the Ith character of STR") |
---|
258 | (string-set! (lambda (str i ch) undefined) "set the Ith character of STR to CH") |
---|
259 | (string=? (lambda (str1 str2) bool)) |
---|
260 | (string-ci=? (lambda (str1 str2) bool)) |
---|
261 | (string<? (lambda (str1 str2) bool)) |
---|
262 | (string>? (lambda (str1 str2) bool)) |
---|
263 | (string<=? (lambda (str1 str2) bool)) |
---|
264 | (string>=? (lambda (str1 str2) bool)) |
---|
265 | (string-ci<? (lambda (str1 str2) bool)) |
---|
266 | (string-ci>? (lambda (str1 str2) bool)) |
---|
267 | (string-ci<=? (lambda (str1 str2) bool)) |
---|
268 | (string-ci>=? (lambda (str1 str2) bool)) |
---|
269 | (substring (lambda (str start end) str)) |
---|
270 | (string-append (lambda (str \.\.\.) str) "concatenate the string arguments") |
---|
271 | (string->list (lambda (str) list)) |
---|
272 | (list->string (lambda (list) str)) |
---|
273 | (string-copy (lambda (str) str)) |
---|
274 | (string-fill! (lambda (str ch) undefined) "set every char in STR to CH") |
---|
275 | (vector? (lambda (obj) bool) "returns #t iff OBJ is a vector") |
---|
276 | (make-vector (lambda (len :optional fill) vec) "a new vector of K elements") |
---|
277 | (vector (lambda (obj \.\.\.) vec)) |
---|
278 | (vector-length (lambda (vec) n) "the number of elements in VEC") |
---|
279 | (vector-ref (lambda (vec i) obj) "the Ith element of VEC") |
---|
280 | (vector-set! (lambda (vec i obj) undefined) "set the Ith element of VEC to OBJ") |
---|
281 | (vector->list (lambda (vec) list)) |
---|
282 | (list->vector (lambda (list) vec)) |
---|
283 | (vector-fill! (lambda (vec obj) undefined) "set every element in VEC to OBJ") |
---|
284 | (procedure? (lambda (obj) bool) "returns #t iff OBJ is a procedure") |
---|
285 | (apply (lambda ((lambda obj a) obj \.\.\.) a) "procedure application") |
---|
286 | (map (lambda ((lambda obj a) obj \.\.\.) (list a)) "a new list of PROC applied to every element of LIST") |
---|
287 | (for-each (lambda ((lambda obj a) obj \.\.\.) undefined) "apply PROC to each element of LIST in order") |
---|
288 | (force (lambda (promise) obj) "force the delayed value of PROMISE") |
---|
289 | (call-with-current-continuation (lambda (proc) obj) "goto on steroids") |
---|
290 | (values (lambda (obj \.\.\.)) "send multiple values to the calling continuation") |
---|
291 | (call-with-values (lambda (producer consumer) obj)) |
---|
292 | (dynamic-wind (lambda (before-thunk thunk after-thunk) obj)) |
---|
293 | (scheme-report-environment (lambda (int) env) "INT should be 5") |
---|
294 | (null-environment (lambda (int) env) "INT should be 5") |
---|
295 | (call-with-input-file (lambda (path proc) input-port)) |
---|
296 | (call-with-output-file (lambda (path proc) output-port)) |
---|
297 | (input-port? (lambda (obj) bool) "returns #t iff OBJ is an input port") |
---|
298 | (output-port? (lambda (obj) bool) "returns #t iff OBJ is an output port") |
---|
299 | (current-input-port (lambda () input-port) "the default input for read procedures") |
---|
300 | (current-output-port (lambda () output-port) "the default output for write procedures") |
---|
301 | (with-input-from-file (lambda (path thunk) obj)) |
---|
302 | (with-output-to-file (lambda (path thunk) obj)) |
---|
303 | (open-input-file (lambda (path) input-port)) |
---|
304 | (open-output-file (lambda (path) output-port)) |
---|
305 | (close-input-port (lambda (input-port))) |
---|
306 | (close-output-port (lambda (output-port))) |
---|
307 | (read (lambda (:optional input-port) obj) "read a datum") |
---|
308 | (read-char (lambda (:optional input-port) ch) "read a single character") |
---|
309 | (peek-char (lambda (:optional input-port) ch)) |
---|
310 | (eof-object? (lambda (obj) bool) "returns #t iff OBJ is the end-of-file object") |
---|
311 | (char-ready? (lambda (:optional input-port) bool)) |
---|
312 | (write (lambda (object :optional output-port) undefined) "write a datum") |
---|
313 | (display (lambda (object :optional output-port) undefined) "display") |
---|
314 | (newline (lambda (:optional output-port) undefined) "send a linefeed") |
---|
315 | (write-char (lambda (char :optional output-port) undefined) "write a single character") |
---|
316 | (load (lambda (filename) undefined) "evaluate expressions from a file") |
---|
317 | (eval (lambda (expr env))) |
---|
318 | )) |
---|
319 | |
---|
320 | (defvar *scheme-srfi-info* |
---|
321 | [ |
---|
322 | ;; SRFI 0 |
---|
323 | ("Feature-based conditional expansion construct" |
---|
324 | (cond-expand (syntax (clause \.\.\.)))) |
---|
325 | |
---|
326 | ;; SRFI 1 |
---|
327 | ("List Library" |
---|
328 | (xcons (lambda (object object) pair)) |
---|
329 | (cons* (lambda (object \.\.\.) pair)) |
---|
330 | (make-list (lambda (integer :optional object) list)) |
---|
331 | (list-tabulate (lambda (integer procedure) list)) |
---|
332 | (list-copy (lambda (list) list)) |
---|
333 | (circular-list (lambda (object \.\.\.) list)) |
---|
334 | (iota (lambda (integer :optional integer integer) list)) |
---|
335 | (proper-list? (lambda (object) bool)) |
---|
336 | (circular-list? (lambda (object) bool)) |
---|
337 | (dotted-list? (lambda (object) bool)) |
---|
338 | (not-pair? (lambda (object) bool)) |
---|
339 | (null-list? (lambda (object) bool)) |
---|
340 | (list= (lambda (procedure list \.\.\.) bool)) |
---|
341 | (first (lambda (pair))) |
---|
342 | (second (lambda (pair))) |
---|
343 | (third (lambda (pair))) |
---|
344 | (fourth (lambda (pair))) |
---|
345 | (fifth (lambda (pair))) |
---|
346 | (sixth (lambda (pair))) |
---|
347 | (seventh (lambda (pair))) |
---|
348 | (eighth (lambda (pair))) |
---|
349 | (ninth (lambda (pair))) |
---|
350 | (tenth (lambda (pair))) |
---|
351 | (car+cdr (lambda (pair))) |
---|
352 | (take (lambda (pair integer) list)) |
---|
353 | (drop (lambda (pair integer) list)) |
---|
354 | (take-right (lambda (pair integer) list)) |
---|
355 | (drop-right (lambda (pair integer) list)) |
---|
356 | (take! (lambda (pair integer) list)) |
---|
357 | (drop-right! (lambda (pair integer) list)) |
---|
358 | (split-at (lambda (pair integer) list)) |
---|
359 | (split-at! (lambda (pair integer) list)) |
---|
360 | (last (lambda (pair) obj)) |
---|
361 | (last-pair (lambda (pair) pair)) |
---|
362 | (length+ (lambda (object) n)) |
---|
363 | (concatenate (lambda (list) list)) |
---|
364 | (append! (lambda (list \.\.\.) list)) |
---|
365 | (concatenate! (lambda (list) list)) |
---|
366 | (reverse! (lambda (list) list)) |
---|
367 | (append-reverse (lambda (list list) list)) |
---|
368 | (append-reverse! (lambda (list list) list)) |
---|
369 | (zip (lambda (list \.\.\.) list)) |
---|
370 | (unzip1 (lambda (list) list)) |
---|
371 | (unzip2 (lambda (list) list)) |
---|
372 | (unzip3 (lambda (list) list)) |
---|
373 | (unzip4 (lambda (list) list)) |
---|
374 | (unzip5 (lambda (list) list)) |
---|
375 | (count (lambda (procedure list \.\.\.) n)) |
---|
376 | (fold (lambda ((lambda obj a) object list \.\.\.) a)) |
---|
377 | (unfold (lambda (procedure procedure procedure object :optional procedure) obj)) |
---|
378 | (pair-fold (lambda ((lambda obj a) object list \.\.\.) a)) |
---|
379 | (reduce (lambda ((lambda obj a) object list \.\.\.) a)) |
---|
380 | (fold-right (lambda ((lambda obj a) object list \.\.\.) a)) |
---|
381 | (unfold-right (lambda (procedure procedure procedure object :optional object) obj)) |
---|
382 | (pair-fold-right (lambda ((lambda obj a) object list \.\.\.) a)) |
---|
383 | (reduce-right (lambda ((lambda obj a) object list \.\.\.) a)) |
---|
384 | (append-map (lambda (procedure list \.\.\.) list)) |
---|
385 | (append-map! (lambda (procedure list \.\.\.) list)) |
---|
386 | (map! (lambda (procedure list \.\.\.) list)) |
---|
387 | (pair-for-each (lambda (procedure list \.\.\.) undefined)) |
---|
388 | (filter-map (lambda (procedure list \.\.\.) list)) |
---|
389 | (map-in-order (lambda (procedure list \.\.\.) list)) |
---|
390 | (filter (lambda (procedure list) list)) |
---|
391 | (partition (lambda (procedure list) list)) |
---|
392 | (remove (lambda (procedure list) list)) |
---|
393 | (filter! (lambda (procedure list) list)) |
---|
394 | (partition! (lambda (procedure list) list)) |
---|
395 | (remove! (lambda (procedure list) list)) |
---|
396 | (find (lambda (procedure list) obj)) |
---|
397 | (find-tail (lambda (procedure list) obj)) |
---|
398 | (any (lambda ((lambda obj a) list \.\.\.) a)) |
---|
399 | (every (lambda ((lambda obj a) list \.\.\.) a)) |
---|
400 | (list-index (lambda (procedure list \.\.\.) (or bool integer))) |
---|
401 | (take-while (lambda (procedure list) list)) |
---|
402 | (drop-while (lambda (procedure list) list)) |
---|
403 | (take-while! (lambda (procedure list) list)) |
---|
404 | (span (lambda (procedure list) list)) |
---|
405 | (break (lambda (procedure list) list)) |
---|
406 | (span! (lambda (procedure list) list)) |
---|
407 | (break! (lambda (procedure list) list)) |
---|
408 | (delete (lambda (object list :optional procedure) list)) |
---|
409 | (delete-duplicates (lambda (list :optional procedure) list)) |
---|
410 | (delete! (lambda (obj list :optional procedure) list)) |
---|
411 | (delete-duplicates! (lambda (list :optional procedure) list)) |
---|
412 | (alist-cons (lambda (obj1 obj2 alist) alist)) |
---|
413 | (alist-copy (lambda (alist) alist)) |
---|
414 | (alist-delete (lambda (obj alist) alist)) |
---|
415 | (alist-delete! (lambda (obj alist) alist)) |
---|
416 | (lset<= (lambda (procedure list \.\.\.) bool)) |
---|
417 | (lset= (lambda (procedure list \.\.\.) bool)) |
---|
418 | (lset-adjoin (lambda (procedure list object \.\.\.) list)) |
---|
419 | (lset-union (lambda (procedure list \.\.\.) list)) |
---|
420 | (lset-union! (lambda (procedure list \.\.\.) list)) |
---|
421 | (lset-intersection (lambda (procedure list \.\.\.) list)) |
---|
422 | (lset-intersection! (lambda (procedure list \.\.\.) list)) |
---|
423 | (lset-difference (lambda (procedure list \.\.\.) list)) |
---|
424 | (lset-difference! (lambda (procedure list \.\.\.) list)) |
---|
425 | (lset-xor (lambda (procedure list \.\.\.) list)) |
---|
426 | (lset-xor! (lambda (procedure list \.\.\.) list)) |
---|
427 | (lset-diff+intersection (lambda (procedure list \.\.\.) list)) |
---|
428 | (lset-diff+intersection! (lambda (procedure list \.\.\.) list)) |
---|
429 | |
---|
430 | ) |
---|
431 | |
---|
432 | ;; SRFI 2 |
---|
433 | ("AND-LET*: an AND with local bindings, a guarded LET* special form" |
---|
434 | (and-let* (syntax (bindings body \.\.\.)))) |
---|
435 | |
---|
436 | () |
---|
437 | |
---|
438 | ;; SRFI 4 |
---|
439 | ("Homogeneous numeric vector datatypes" |
---|
440 | |
---|
441 | (u8vector? (lambda (obj) bool)) |
---|
442 | (make-u8vector (lambda (size integer) u8vector)) |
---|
443 | (u8vector (lambda (integer \.\.\.) u8vector)) |
---|
444 | (u8vector-length (lambda (u8vector) n)) |
---|
445 | (u8vector-ref (lambda (u8vector i) int)) |
---|
446 | (u8vector-set! (lambda (u8vector i u8value) undefined)) |
---|
447 | (u8vector->list (lambda (u8vector) list)) |
---|
448 | (list->u8vector (lambda (list) u8vector)) |
---|
449 | |
---|
450 | (s8vector? (lambda (obj) bool)) |
---|
451 | (make-s8vector (lambda (size integer) s8vector)) |
---|
452 | (s8vector (lambda (integer \.\.\.) s8vector)) |
---|
453 | (s8vector-length (lambda (s8vector) n)) |
---|
454 | (s8vector-ref (lambda (s8vector i) int)) |
---|
455 | (s8vector-set! (lambda (s8vector i s8value) undefined)) |
---|
456 | (s8vector->list (lambda (s8vector) list)) |
---|
457 | (list->s8vector (lambda (list) s8vector)) |
---|
458 | |
---|
459 | (u16vector? (lambda (obj) bool)) |
---|
460 | (make-u16vector (lambda (size integer) u16vector)) |
---|
461 | (u16vector (lambda (integer \.\.\.))) |
---|
462 | (u16vector-length (lambda (u16vector) n)) |
---|
463 | (u16vector-ref (lambda (u16vector i) int)) |
---|
464 | (u16vector-set! (lambda (u16vector i u16value) undefined)) |
---|
465 | (u16vector->list (lambda (u16vector) list)) |
---|
466 | (list->u16vector (lambda (list) u16vector)) |
---|
467 | |
---|
468 | (s16vector? (lambda (obj) bool)) |
---|
469 | (make-s16vector (lambda (size integer) s16vector)) |
---|
470 | (s16vector (lambda (integer \.\.\.) s16vector)) |
---|
471 | (s16vector-length (lambda (s16vector) n)) |
---|
472 | (s16vector-ref (lambda (s16vector i) int)) |
---|
473 | (s16vector-set! (lambda (s16vector i s16value) undefined)) |
---|
474 | (s16vector->list (lambda (s16vector) list)) |
---|
475 | (list->s16vector (lambda (list) s16vector)) |
---|
476 | |
---|
477 | (u32vector? (lambda (obj) bool)) |
---|
478 | (make-u32vector (lambda (size integer) u32vector)) |
---|
479 | (u32vector (lambda (integer \.\.\.) u32vector)) |
---|
480 | (u32vector-length (lambda (u32vector) n)) |
---|
481 | (u32vector-ref (lambda (u32vector i) int)) |
---|
482 | (u32vector-set! (lambda (u32vector i u32value) undefined)) |
---|
483 | (u32vector->list (lambda (u32vector) list)) |
---|
484 | (list->u32vector (lambda (list) u32vector)) |
---|
485 | |
---|
486 | (s32vector? (lambda (obj) bool)) |
---|
487 | (make-s32vector (lambda (size integer) s32vector)) |
---|
488 | (s32vector (lambda (integer \.\.\.) s32vector)) |
---|
489 | (s32vector-length (lambda (s32vector) n)) |
---|
490 | (s32vector-ref (lambda (s32vector i) int)) |
---|
491 | (s32vector-set! (lambda (s32vector i s32value) undefined)) |
---|
492 | (s32vector->list (lambda (s32vector) list)) |
---|
493 | (list->s32vector (lambda (list) s32vector)) |
---|
494 | |
---|
495 | (u64vector? (lambda (obj) bool)) |
---|
496 | (make-u64vector (lambda (size integer) u64vector)) |
---|
497 | (u64vector (lambda (integer \.\.\.) u64vector)) |
---|
498 | (u64vector-length (lambda (u64vector) n)) |
---|
499 | (u64vector-ref (lambda (u64vector i) int)) |
---|
500 | (u64vector-set! (lambda (u64vector i u64value) undefined)) |
---|
501 | (u64vector->list (lambda (u64vector) list)) |
---|
502 | (list->u64vector (lambda (list) u64vector)) |
---|
503 | |
---|
504 | (s64vector? (lambda (obj) bool)) |
---|
505 | (make-s64vector (lambda (size integer) s64vector)) |
---|
506 | (s64vector (lambda (integer \.\.\.) s64vector)) |
---|
507 | (s64vector-length (lambda (s64vector) n)) |
---|
508 | (s64vector-ref (lambda (s64vector i) int)) |
---|
509 | (s64vector-set! (lambda (s64vector i s64value) undefined)) |
---|
510 | (s64vector->list (lambda (s64vector) list)) |
---|
511 | (list->s64vector (lambda (list) s64vector)) |
---|
512 | |
---|
513 | (f32vector? (lambda (obj) bool)) |
---|
514 | (make-f32vector (lambda (size integer) f32vector)) |
---|
515 | (f32vector (lambda (number \.\.\.) f32vector)) |
---|
516 | (f32vector-length (lambda (f32vector) n)) |
---|
517 | (f32vector-ref (lambda (f32vector i) int)) |
---|
518 | (f32vector-set! (lambda (f32vector i f32value) undefined)) |
---|
519 | (f32vector->list (lambda (f32vector) list)) |
---|
520 | (list->f32vector (lambda (list) f32vector)) |
---|
521 | |
---|
522 | (f64vector? (lambda (obj) bool)) |
---|
523 | (make-f64vector (lambda (size integer) f64vector)) |
---|
524 | (f64vector (lambda (number \.\.\.) f64vector)) |
---|
525 | (f64vector-length (lambda (f64vector) n)) |
---|
526 | (f64vector-ref (lambda (f64vector i) int)) |
---|
527 | (f64vector-set! (lambda (f64vector i f64value) undefined)) |
---|
528 | (f64vector->list (lambda (f64vector) list)) |
---|
529 | (list->f64vector (lambda (list) f64vector)) |
---|
530 | ) |
---|
531 | |
---|
532 | ;; SRFI 5 |
---|
533 | ("A compatible let form with signatures and rest arguments" |
---|
534 | (let (syntax (bindings body \.\.\.)))) |
---|
535 | |
---|
536 | ;; SRFI 6 |
---|
537 | ("Basic String Ports" |
---|
538 | (open-input-string (lambda (str) input-port)) |
---|
539 | (open-output-string (lambda () output-port)) |
---|
540 | (get-output-string (lambda (output-port) str))) |
---|
541 | |
---|
542 | ;; SRFI 7 |
---|
543 | ("Feature-based program configuration language" |
---|
544 | (program (syntax (clause \.\.\.))) |
---|
545 | (feature-cond (syntax (clause)))) |
---|
546 | |
---|
547 | ;; SRFI 8 |
---|
548 | ("receive: Binding to multiple values" |
---|
549 | (receive (syntax (identifiers producer body \.\.\.)))) |
---|
550 | |
---|
551 | ;; SRFI 9 |
---|
552 | ("Defining Record Types" |
---|
553 | (define-record-type (syntax (name constructor-name pred-name fields \.\.\.)))) |
---|
554 | |
---|
555 | ;; SRFI 10 |
---|
556 | ("Sharp-Comma External Form" |
---|
557 | (define-reader-ctor (syntax (name proc) undefined))) |
---|
558 | |
---|
559 | ;; SRFI 11 |
---|
560 | ("Syntax for receiving multiple values" |
---|
561 | (let-values (syntax (bindings body \.\.\.))) |
---|
562 | (let-values* (syntax (bindings body \.\.\.)))) |
---|
563 | |
---|
564 | () |
---|
565 | |
---|
566 | ;; SRFI 13 |
---|
567 | ("String Library" |
---|
568 | (string-map (lambda (proc str :optional start end) str)) |
---|
569 | (string-map! (lambda (proc str :optional start end) undefined)) |
---|
570 | (string-fold (lambda (kons knil str :optional start end) obj)) |
---|
571 | (string-fold-right (lambda (kons knil str :optional start end) obj)) |
---|
572 | (string-unfold (lambda (p f g seed :optional base make-final) str)) |
---|
573 | (string-unfold-right (lambda (p f g seed :optional base make-final) str)) |
---|
574 | (string-tabulate (lambda (proc len) str)) |
---|
575 | (string-for-each (lambda (proc str :optional start end) undefined)) |
---|
576 | (string-for-each-index (lambda (proc str :optional start end) undefined)) |
---|
577 | (string-every (lambda (pred str :optional start end) obj)) |
---|
578 | (string-any (lambda (pred str :optional start end) obj)) |
---|
579 | (string-hash (lambda (str :optional bound start end) int)) |
---|
580 | (string-hash-ci (lambda (str :optional bound start end) int)) |
---|
581 | (string-compare (lambda (string1 string2 lt-proc eq-proc gt-proc :optional start end) obj)) |
---|
582 | (string-compare-ci (lambda (string1 string2 lt-proc eq-proc gt-proc :optional start end) obj)) |
---|
583 | (string= (lambda (string1 string2 :optional start1 end1 start2 end2) bool)) |
---|
584 | (string<> (lambda (string1 string2 :optional start1 end1 start2 end2) bool)) |
---|
585 | (string< (lambda (string1 string2 :optional start1 end1 start2 end2) bool)) |
---|
586 | (string> (lambda (string1 string2 :optional start1 end1 start2 end2) bool)) |
---|
587 | (string<= (lambda (string1 string2 :optional start1 end1 start2 end2) bool)) |
---|
588 | (string>= (lambda (string1 string2 :optional start1 end1 start2 end2) bool)) |
---|
589 | (string-ci= (lambda (string1 string2 :optional start1 end1 start2 end2) bool)) |
---|
590 | (string-ci<> (lambda (string1 string2 :optional start1 end1 start2 end2) bool)) |
---|
591 | (string-ci< (lambda (string1 string2 :optional start1 end1 start2 end2) bool)) |
---|
592 | (string-ci> (lambda (string1 string2 :optional start1 end1 start2 end2) bool)) |
---|
593 | (string-ci<= (lambda (string1 string2 :optional start1 end1 start2 end2) bool)) |
---|
594 | (string-ci>= (lambda (string1 string2 :optional start1 end1 start2 end2) bool)) |
---|
595 | (string-titlecase (lambda (string :optional start end) str)) |
---|
596 | (string-upcase (lambda (string :optional start end) str)) |
---|
597 | (string-downcase (lambda (string :optional start end) str)) |
---|
598 | (string-titlecase! (lambda (string :optional start end) undefined)) |
---|
599 | (string-upcase! (lambda (string :optional start end) undefined)) |
---|
600 | (string-downcase! (lambda (string :optional start end) undefined)) |
---|
601 | (string-take (lambda (string nchars) str)) |
---|
602 | (string-drop (lambda (string nchars) str)) |
---|
603 | (string-take-right (lambda (string nchars) str)) |
---|
604 | (string-drop-right (lambda (string nchars) str)) |
---|
605 | (string-pad (lambda (string k :optional char start end) str)) |
---|
606 | (string-pad-right (lambda (string k :optional char start end) str)) |
---|
607 | (string-trim (lambda (string :optional char/char-set/pred start end) str)) |
---|
608 | (string-trim-right (lambda (string :optional char/char-set/pred start end) str)) |
---|
609 | (string-trim-both (lambda (string :optional char/char-set/pred start end) str)) |
---|
610 | (string-filter (lambda (char/char-set/pred string :optional start end) str)) |
---|
611 | (string-delete (lambda (char/char-set/pred string :optional start end) str)) |
---|
612 | (string-index (lambda (string char/char-set/pred :optional start end) (or integer bool))) |
---|
613 | (string-index-right (lambda (string char/char-set/pred :optional end start) (or integer bool))) |
---|
614 | (string-skip (lambda (string char/char-set/pred :optional start end) (or integer bool))) |
---|
615 | (string-skip-right (lambda (string char/char-set/pred :optional end start) (or integer bool))) |
---|
616 | (string-count (lambda (string char/char-set/pred :optional start end) n)) |
---|
617 | (string-prefix-length (lambda (string1 string2 :optional start1 end1 start2 end2) n)) |
---|
618 | (string-suffix-length (lambda (string1 string2 :optional start1 end1 start2 end2) n)) |
---|
619 | (string-prefix-length-ci (lambda (string1 string2 :optional start1 end1 start2 end2) n)) |
---|
620 | (string-suffix-length-ci (lambda (string1 string2 :optional start1 end1 start2 end2) n)) |
---|
621 | (string-prefix? (lambda (string1 string2 :optional start1 end1 start2 end2) bool)) |
---|
622 | (string-suffix? (lambda (string1 string2 :optional start1 end1 start2 end2) bool)) |
---|
623 | (string-prefix-ci? (lambda (string1 string2 :optional start1 end1 start2 end2) bool)) |
---|
624 | (string-suffix-ci? (lambda (string1 string2 :optional start1 end1 start2 end2) bool)) |
---|
625 | (string-contains (lambda (string pattern :optional s-start s-end p-start p-end) obj)) |
---|
626 | (string-contains-ci (lambda (string pattern :optional s-start s-end p-start p-end) obj)) |
---|
627 | (string-fill! (lambda (string char :optional start end) undefined)) |
---|
628 | (string-copy! (lambda (to tstart from :optional fstart fend) undefined)) |
---|
629 | (string-copy (lambda (str :optional start end) str)) |
---|
630 | (substring/shared (lambda (str start :optional end) str)) |
---|
631 | (string-reverse (lambda (str :optional start end) str)) |
---|
632 | (string-reverse! (lambda (str :optional start end) undefined)) |
---|
633 | (reverse-list->string (lambda (char-list) str)) |
---|
634 | (string->list (lambda (str :optional start end) list)) |
---|
635 | (string-concatenate (lambda (string-list) str)) |
---|
636 | (string-concatenate/shared (lambda (string-list) str)) |
---|
637 | (string-append/shared (lambda (str \.\.\.) str)) |
---|
638 | (string-concatenate-reverse (lambda (string-list :optional final-string end) str)) |
---|
639 | (string-concatenate-reverse/shared (lambda (string-list :optional final-string end) str)) |
---|
640 | (xsubstring (lambda (str from :optional to start end) str)) |
---|
641 | (string-xcopy! (lambda (target tstart str from :optional to start end) undefined)) |
---|
642 | (string-null? (lambda (str) bool)) |
---|
643 | (string-join (lambda (string-list :optional delim grammar) str)) |
---|
644 | (string-tokenize (lambda (string :optional token-chars start end) str)) |
---|
645 | (string-replace (lambda (str1 str2 start1 end1 :optional start2 end2) str)) |
---|
646 | (string-kmp-partial-search (lambda (pat rv str i :optional c= p-start s-start s-end) n)) |
---|
647 | (make-kmp-restart-vector (lambda (str :optional c= start end) vec)) |
---|
648 | (kmp-step (lambda (pat rv c i c= p-start) n)) |
---|
649 | ) |
---|
650 | |
---|
651 | ;; SRFI 14 |
---|
652 | ("Character-Set Library" |
---|
653 | (char-set? (lambda (cset) bool)) |
---|
654 | (char-set= (lambda (cset \.\.\.) bool)) |
---|
655 | (char-set<= (lambda (cset \.\.\.) bool)) |
---|
656 | (char-set-hash (lambda (cset :optional int) int)) |
---|
657 | (char-set-cursor (lambda (cset) cursor)) |
---|
658 | (char-set-ref (lambda (cset cursor) ch)) |
---|
659 | (char-set-cursor-next (lambda (cset cursor) int)) |
---|
660 | (end-of-char-set? (lambda (cursor) bool)) |
---|
661 | (char-set-fold (lambda (proc obj cset) obj)) |
---|
662 | (char-set-unfold (lambda (proc proc proc obj :optional obj) cset)) |
---|
663 | (char-set-unfold! (lambda (proc proc proc obj obj) cset)) |
---|
664 | (char-set-for-each (lambda (proc cset) undefined)) |
---|
665 | (char-set-map (lambda (proc cset) cset)) |
---|
666 | (char-set-copy (lambda (cset) cset)) |
---|
667 | (char-set (lambda (ch \.\.\.) cset)) |
---|
668 | (list->char-set (lambda (list :optional obj) cset)) |
---|
669 | (list->char-set! (lambda (list cset) cset)) |
---|
670 | (string->char-set (lambda (str :optional cset) cset)) |
---|
671 | (string->char-set! (lambda (str cset) cset)) |
---|
672 | (ucs-range->char-set (lambda (int int :optional bool cset) cset)) |
---|
673 | (ucs-range->char-set! (lambda (int int bool cset) cset)) |
---|
674 | (char-set-filter (lambda (proc cset :optional base-cset) cset)) |
---|
675 | (char-set-filter! (lambda (proc cset base-cset) cset)) |
---|
676 | (->char-set (lambda (obj) cset)) |
---|
677 | (char-set-size (lambda (cset) n)) |
---|
678 | (char-set-count (lambda (proc cset) n)) |
---|
679 | (char-set-contains? (lambda (cset ch) bool)) |
---|
680 | (char-set-every (lambda (proc cset) obj)) |
---|
681 | (char-set-any (lambda (proc cset) obj)) |
---|
682 | (char-set-adjoin (lambda (cset ch \.\.\.) cset)) |
---|
683 | (char-set-delete (lambda (cset ch \.\.\.) cset)) |
---|
684 | (char-set-adjoin! (lambda (cset ch \.\.\.) cset)) |
---|
685 | (char-set-delete! (lambda (cset ch \.\.\.) cset)) |
---|
686 | (char-set->list (lambda (cset) list)) |
---|
687 | (char-set->string (lambda (cset) str)) |
---|
688 | (char-set-complement (lambda (cset) cset)) |
---|
689 | (char-set-union (lambda (cset \.\.\.) cset)) |
---|
690 | (char-set-intersection (lambda (cset \.\.\.) cset)) |
---|
691 | (char-set-xor (lambda (cset \.\.\.) cset)) |
---|
692 | (char-set-difference (lambda (cset \.\.\.) cset)) |
---|
693 | (char-set-diff+intersection (lambda (cset \.\.\.) cset)) |
---|
694 | (char-set-complement! (lambda (cset) cset)) |
---|
695 | (char-set-union! (lambda (cset \.\.\.) cset)) |
---|
696 | (char-set-intersection! (lambda (cset \.\.\.) cset)) |
---|
697 | (char-set-xor! (lambda (cset \.\.\.) cset)) |
---|
698 | (char-set-difference! (lambda (cset \.\.\.) cset)) |
---|
699 | (char-set-diff+intersection! (lambda (cset \.\.\.) cset)) |
---|
700 | (char-set:lower-case char-set) |
---|
701 | (char-set:upper-case char-set) |
---|
702 | (char-set:letter char-set) |
---|
703 | (char-set:digit char-set) |
---|
704 | (char-set:letter+digit char-set) |
---|
705 | (char-set:graphic char-set) |
---|
706 | (char-set:printing char-set) |
---|
707 | (char-set:whitespace char-set) |
---|
708 | (char-set:blank char-set) |
---|
709 | (char-set:iso-control char-set) |
---|
710 | (char-set:punctuation char-set) |
---|
711 | (char-set:symbol char-set) |
---|
712 | (char-set:hex-digit char-set) |
---|
713 | (char-set:ascii char-set) |
---|
714 | (char-set:empty char-set) |
---|
715 | (char-set:full char-set) |
---|
716 | ) |
---|
717 | |
---|
718 | () |
---|
719 | |
---|
720 | ;; SRFI 16 |
---|
721 | ("Syntax for procedures of variable arity" |
---|
722 | (case-lambda (syntax (clauses \.\.\.) procedure))) |
---|
723 | |
---|
724 | ;; SRFI 17 |
---|
725 | ("Generalized set!" |
---|
726 | (set! (syntax (what value) undefined))) |
---|
727 | |
---|
728 | ;; SRFI 18 |
---|
729 | ("Multithreading support" |
---|
730 | (current-thread (lambda () thread)) |
---|
731 | (thread? (lambda (obj) bool)) |
---|
732 | (make-thread (lambda (thunk :optional name) thread)) |
---|
733 | (thread-name (lambda (thread) name)) |
---|
734 | (thread-specific (lambda (thread))) |
---|
735 | (thread-specific-set! (lambda (thread obj))) |
---|
736 | (thread-base-priority (lambda (thread))) |
---|
737 | (thread-base-priority-set! (lambda (thread number))) |
---|
738 | (thread-priority-boost (lambda (thread))) |
---|
739 | (thread-priority-boost-set! (lambda (thread number))) |
---|
740 | (thread-quantum (lambda (thread))) |
---|
741 | (thread-quantum-set! (lambda (thread number))) |
---|
742 | (thread-start! (lambda (thread))) |
---|
743 | (thread-yield! (lambda ())) |
---|
744 | (thread-sleep! (lambda (number))) |
---|
745 | (thread-terminate! (lambda (thread))) |
---|
746 | (thread-join! (lambda (thread :optional timeout timeout-val))) |
---|
747 | (mutex? (lambda (obj) bool)) |
---|
748 | (make-mutex (lambda (:optional name) mutex)) |
---|
749 | (mutex-name (lambda (mutex) name)) |
---|
750 | (mutex-specific (lambda (mutex))) |
---|
751 | (mutex-specific-set! (lambda (mutex obj))) |
---|
752 | (mutex-state (lambda (mutex))) |
---|
753 | (mutex-lock! (lambda (mutex :optional timeout thread))) |
---|
754 | (mutex-unlock! (lambda (mutex :optional condition-variable timeout))) |
---|
755 | (condition-variable? (lambda (obj) bool)) |
---|
756 | (make-condition-variable (lambda (:optional name) condition-variable)) |
---|
757 | (condition-variable-name (lambda (condition-variable) name)) |
---|
758 | (condition-variable-specific (lambda (condition-variable))) |
---|
759 | (condition-variable-specific-set! (lambda (condition-variable obj))) |
---|
760 | (condition-variable-signal! (lambda (condition-variable))) |
---|
761 | (condition-variable-broadcast! (lambda (condition-variable))) |
---|
762 | (current-time (lambda () time)) |
---|
763 | (time? (lambda (obj) bool)) |
---|
764 | (time->seconds (lambda (time) x1)) |
---|
765 | (seconds->time (lambda (x1) time)) |
---|
766 | (current-exception-handler (lambda () handler)) |
---|
767 | (with-exception-handler (lambda (handler thunk))) |
---|
768 | (raise (lambda (obj))) |
---|
769 | (join-timeout-exception? (lambda (obj) bool)) |
---|
770 | (abandoned-mutex-exception? (lambda (obj) bool)) |
---|
771 | (terminated-thread-exception? (lambda (obj) bool)) |
---|
772 | (uncaught-exception? (lambda (obj) bool)) |
---|
773 | (uncaught-exception-reason (lambda (exc) obj)) |
---|
774 | ) |
---|
775 | |
---|
776 | ;; SRFI 19 |
---|
777 | ("Time Data Types and Procedures" |
---|
778 | (current-date (lambda (:optional tz-offset)) date) |
---|
779 | (current-julian-day (lambda ()) jdn) |
---|
780 | (current-modified-julian-day (lambda ()) mjdn) |
---|
781 | (current-time (lambda (:optional time-type)) time) |
---|
782 | (time-resolution (lambda (:optional time-type)) nanoseconds) |
---|
783 | (make-time (lambda (type nanosecond second))) |
---|
784 | (time? (lambda (obj))) |
---|
785 | (time-type (lambda (time))) |
---|
786 | (time-nanosecond (lambda (time))) |
---|
787 | (time-second (lambda (time))) |
---|
788 | (set-time-type! (lambda (time))) |
---|
789 | (set-time-nanosecond! (lambda (time))) |
---|
790 | (set-time-second! (lambda (time))) |
---|
791 | (copy-time (lambda (time))) |
---|
792 | (time<=? (lambda (time1 time2))) |
---|
793 | (time<? (lambda (time1 time2))) |
---|
794 | (time=? (lambda (time1 time2))) |
---|
795 | (time>=? (lambda (time1 time2))) |
---|
796 | (time>? (lambda (time1 time2))) |
---|
797 | (time-difference (lambda (time1 time2))) |
---|
798 | (time-difference! (lambda (time1 time2))) |
---|
799 | (add-duration (lambda (time duration))) |
---|
800 | (add-duration! (lambda (time duration))) |
---|
801 | (subtract-duration (lambda (time duration))) |
---|
802 | (subtract-duration! (lambda (time duration))) |
---|
803 | (make-date (lambda (nanosecond second minute hour day month year zone-offset))) |
---|
804 | (date? (lambda (obj))) |
---|
805 | (date-nanosecond (lambda (date))) |
---|
806 | (date-second (lambda (date))) |
---|
807 | (date-minute (lambda (date))) |
---|
808 | (date-hour (lambda (date))) |
---|
809 | (date-day (lambda (date))) |
---|
810 | (date-month (lambda (date))) |
---|
811 | (date-year (lambda (date))) |
---|
812 | (date-zone-offset (lambda (date))) |
---|
813 | (date-year-day (lambda (date))) |
---|
814 | (date-week-day (lambda (date))) |
---|
815 | (date-week-number (lambda (date))) |
---|
816 | (date->julian-day (lambda (date))) |
---|
817 | (date->modified-julian-day (lambda (date))) |
---|
818 | (date->time-monotonic (lambda (date))) |
---|
819 | (date->time-tai (lambda (date))) |
---|
820 | (date->time-utc (lambda (date))) |
---|
821 | (julian-day->date (lambda (date))) |
---|
822 | (julian-day->time-monotonic (lambda (date))) |
---|
823 | (julian-day->time-tai (lambda (date))) |
---|
824 | (julian-day->time-utc (lambda (date))) |
---|
825 | (modified-julian-day->date (lambda (date))) |
---|
826 | (modified-julian-day->time-monotonic (lambda (date))) |
---|
827 | (modified-julian-day->time-tai (lambda (date))) |
---|
828 | (modified-julian-day->time-utc (lambda (date))) |
---|
829 | (time-monotonic->date (lambda (date))) |
---|
830 | (time-monotonic->julian-day (lambda (date))) |
---|
831 | (time-monotonic->modified-julian-day (lambda (date))) |
---|
832 | (time-monotonic->time-monotonic (lambda (date))) |
---|
833 | (time-monotonic->time-tai (lambda (date))) |
---|
834 | (time-monotonic->time-tai! (lambda (date))) |
---|
835 | (time-monotonic->time-utc (lambda (date))) |
---|
836 | (time-monotonic->time-utc! (lambda (date))) |
---|
837 | (time-tai->date (lambda (date))) |
---|
838 | (time-tai->julian-day (lambda (date))) |
---|
839 | (time-tai->modified-julian-day (lambda (date))) |
---|
840 | (time-tai->time-monotonic (lambda (date))) |
---|
841 | (time-tai->time-monotonic! (lambda (date))) |
---|
842 | (time-tai->time-utc (lambda (date))) |
---|
843 | (time-tai->time-utc! (lambda (date))) |
---|
844 | (time-utc->date (lambda (date))) |
---|
845 | (time-utc->julian-day (lambda (date))) |
---|
846 | (time-utc->modified-julian-day (lambda (date))) |
---|
847 | (time-utc->time-monotonic (lambda (date))) |
---|
848 | (time-utc->time-monotonic! (lambda (date))) |
---|
849 | (time-utc->time-tai (lambda (date))) |
---|
850 | (time-utc->time-tai! (lambda (date))) |
---|
851 | (date->string (lambda (date :optional format-string))) |
---|
852 | (string->date (lambda (input-string template-string))) |
---|
853 | ) |
---|
854 | |
---|
855 | () |
---|
856 | |
---|
857 | ;; SRFI 21 |
---|
858 | ("Real-time multithreading support" |
---|
859 | srfi-18) ; same as srfi-18 |
---|
860 | |
---|
861 | ;; SRFI 22 |
---|
862 | ("Running Scheme Scripts on Unix" |
---|
863 | ) |
---|
864 | |
---|
865 | ;; SRFI 23 |
---|
866 | ("Error reporting mechanism" |
---|
867 | (error (lambda (reason-string arg \.\.\.)))) |
---|
868 | |
---|
869 | () |
---|
870 | |
---|
871 | ;; SRFI 25 |
---|
872 | ("Multi-dimensional Array Primitives" |
---|
873 | (array? (lambda (obj))) |
---|
874 | (make-array (lambda (shape :optional init))) |
---|
875 | (shape (lambda (bound \.\.\.))) |
---|
876 | (array (lambda (shape obj \.\.\.))) |
---|
877 | (array-rank (lambda (array))) |
---|
878 | (array-start (lambda (array))) |
---|
879 | (array-end (lambda (array))) |
---|
880 | (array-shape (lambda (array))) |
---|
881 | (array-ref (lambda (array i \.\.\.))) |
---|
882 | (array-set! (lambda (array obj \.\.\.) undefined)) |
---|
883 | (share-array (lambda (array shape proc))) |
---|
884 | ) |
---|
885 | |
---|
886 | ;; SRFI 26 |
---|
887 | ("Notation for Specializing Parameters without Currying" |
---|
888 | (cut (syntax (obj \.\.\.))) |
---|
889 | (cute (lambda (obj \.\.\.)))) |
---|
890 | |
---|
891 | ;; SRFI 27 |
---|
892 | ("Sources of Random Bits" |
---|
893 | (random-integer (lambda (n))) |
---|
894 | (random-real (lambda ())) |
---|
895 | (default-random-source (lambda ())) |
---|
896 | (make-random-source (lambda ())) |
---|
897 | (random-source? (lambda (obj))) |
---|
898 | (random-source-state-ref (lambda (random-source))) |
---|
899 | (random-source-state-set! (lambda (random-source state))) |
---|
900 | (random-source-randomize! (lambda (random-source))) |
---|
901 | (random-source-pseudo-randomize! (lambda (random-source i j))) |
---|
902 | (random-source-make-integers (lambda (random-source))) |
---|
903 | (random-source-make-reals (lambda (random-source))) |
---|
904 | ) |
---|
905 | |
---|
906 | ;; SRFI 28 |
---|
907 | ("Basic Format Strings" |
---|
908 | (format (lambda (port-or-boolean format-string arg \.\.\.)))) |
---|
909 | |
---|
910 | ;; SRFI 29 |
---|
911 | ("Localization" |
---|
912 | (current-language (lambda (:optional symbol))) |
---|
913 | (current-country (lambda (:optional symbol))) |
---|
914 | (current-locale-details (lambda (:optional list))) |
---|
915 | (declare-bundle! (lambda (bundle-name association-list))) |
---|
916 | (store-bundle (lambda (bundle-name))) |
---|
917 | (load-bundle! (lambda (bundle-name))) |
---|
918 | (localized-template (lambda (package-name message-template-name))) |
---|
919 | ) |
---|
920 | |
---|
921 | ;; SRFI 30 |
---|
922 | ("Nested Multi-line Comments" |
---|
923 | ) |
---|
924 | |
---|
925 | ;; SRFI 31 |
---|
926 | ("A special form for recursive evaluation" |
---|
927 | (rec (syntax (name body \.\.\.) procedure))) |
---|
928 | |
---|
929 | () |
---|
930 | |
---|
931 | () |
---|
932 | |
---|
933 | ;; SRFI 34 |
---|
934 | ("Exception Handling for Programs" |
---|
935 | (guard (syntax (clauses \.\.\.))) |
---|
936 | (raise (lambda (obj))) |
---|
937 | ) |
---|
938 | |
---|
939 | ;; SRFI 35 |
---|
940 | ("Conditions" |
---|
941 | (make-condition-type (lambda (id parent field-name-list))) |
---|
942 | (condition-type? (lambda (obj))) |
---|
943 | (make-condition (lambda (condition-type))) |
---|
944 | (condition? (lambda (obj))) |
---|
945 | (condition-has-type? (lambda (condition condition-type))) |
---|
946 | (condition-ref (lambda (condition field-name))) |
---|
947 | (make-compound-condition (lambda (condition \.\.\.))) |
---|
948 | (extract-condition (lambda (condition condition-type))) |
---|
949 | (define-condition-type (syntax (name parent pred-name fields \.\.\.))) |
---|
950 | (condition (syntax (type-field-binding \.\.\.))) |
---|
951 | ) |
---|
952 | |
---|
953 | ;; SRFI 36 |
---|
954 | ("I/O Conditions" |
---|
955 | (&error condition) |
---|
956 | (&i/o-error condition) |
---|
957 | (&i/o-port-error condition) |
---|
958 | (&i/o-read-error condition) |
---|
959 | (&i/o-write-error condition) |
---|
960 | (&i/o-closed-error condition) |
---|
961 | (&i/o-filename-error condition) |
---|
962 | (&i/o-malformed-filename-error condition) |
---|
963 | (&i/o-file-protection-error condition) |
---|
964 | (&i/o-file-is-read-only-error condition) |
---|
965 | (&i/o-file-already-exists-error condition) |
---|
966 | (&i/o-no-such-file-error condition) |
---|
967 | ) |
---|
968 | |
---|
969 | ;; SRFI 37 |
---|
970 | ("args-fold: a program argument processor" |
---|
971 | (args-fold |
---|
972 | (arg-list option-list unrecognized-option-proc operand-proc seed \.\.\.)) |
---|
973 | (option-processor (lambda (option name arg seeds \.\.\.))) |
---|
974 | (operand-processor (lambda (operand seeds \.\.\.))) |
---|
975 | (option (lambda (name-list required-arg? optional-arg? option-proc))) |
---|
976 | (option-names (lambda (option))) |
---|
977 | (option-required-arg? (lambda (option))) |
---|
978 | (option-optional-arg? (lambda (option))) |
---|
979 | (option-processor (lambda (option))) |
---|
980 | ) |
---|
981 | |
---|
982 | ;; SRFI 38 |
---|
983 | ("External Representation for Data With Shared Structure" |
---|
984 | (write-with-shared-structure (lambda (obj :optional port optarg))) |
---|
985 | (read-with-shared-structure (lambda (:optional port))) |
---|
986 | ) |
---|
987 | |
---|
988 | ;; SRFI 39 |
---|
989 | ("Parameter objects" |
---|
990 | (make-parameter (lambda (init-value :optional converter))) |
---|
991 | (parameterize (syntax (bindings body \.\.\.)))) |
---|
992 | |
---|
993 | ;; SRFI 40 |
---|
994 | ("A Library of Streams" |
---|
995 | (stream-null stream) |
---|
996 | (stream-cons (syntax (obj stream))) |
---|
997 | (stream? (lambda (obj))) |
---|
998 | (stream-null? (lambda (obj))) |
---|
999 | (stream-pair? (lambda (obj))) |
---|
1000 | (stream-car (lambda (stream))) |
---|
1001 | (stream-cdr (lambda (stream))) |
---|
1002 | (stream-delay (syntax (expr))) |
---|
1003 | (stream (lambda (obj \.\.\.))) |
---|
1004 | (stream-unfoldn (lambda (generator-proc seed n))) |
---|
1005 | (stream-map (lambda (proc stream \.\.\.))) |
---|
1006 | (stream-for-each (lambda (proc stream \.\.\.) undefined)) |
---|
1007 | (stream-filter (lambda (pred stream))) |
---|
1008 | ) |
---|
1009 | |
---|
1010 | () |
---|
1011 | |
---|
1012 | ;; SRFI 42 |
---|
1013 | ("Eager Comprehensions" |
---|
1014 | (list-ec (syntax)) |
---|
1015 | (append-ec (syntax)) |
---|
1016 | (sum-ec (syntax)) |
---|
1017 | (min-ec (syntax)) |
---|
1018 | (max-ec (syntax)) |
---|
1019 | (any?-ec (syntax)) |
---|
1020 | (every?-ec (syntax)) |
---|
1021 | (first-ec (syntax)) |
---|
1022 | (do-ec (syntax)) |
---|
1023 | (fold-ec (syntax)) |
---|
1024 | (fold3-ec (syntax)) |
---|
1025 | (:list (syntax () undefined)) |
---|
1026 | (:string (syntax () undefined)) |
---|
1027 | (:vector (syntax () undefined)) |
---|
1028 | (:integers (syntax () undefined)) |
---|
1029 | (:range (syntax () undefined)) |
---|
1030 | (:real-range (syntax () undefined)) |
---|
1031 | (:char-range (syntax () undefined)) |
---|
1032 | (:port (syntax () undefined)) |
---|
1033 | (:do (syntax () undefined)) |
---|
1034 | (:let (syntax () undefined)) |
---|
1035 | (:parallel (syntax () undefined)) |
---|
1036 | (:while (syntax () undefined)) |
---|
1037 | (:until (syntax () undefined)) |
---|
1038 | ) |
---|
1039 | |
---|
1040 | ;; SRFI 43 |
---|
1041 | ("Vector Library" |
---|
1042 | (vector-unfold (f length initial-seed \.\.\.)) |
---|
1043 | (vector-unfold-right (lambda (f length initial-seed \.\.\.))) |
---|
1044 | (vector-tabulate (lambda (f size))) |
---|
1045 | (vector-copy (lambda (vec :optional start end fill))) |
---|
1046 | (vector-reverse-copy (lambda (vec :optional start end))) |
---|
1047 | (vector-append (lambda (vec \.\.\.))) |
---|
1048 | (vector-concatenate (lambda (vector-list))) |
---|
1049 | (vector-empty? (lambda (obj))) |
---|
1050 | (vector= (lambda (eq-proc vec \.\.\.))) |
---|
1051 | (vector-fold (lambda (kons knil vec \.\.\.))) |
---|
1052 | (vector-fold-right (lambda (kons knil vec \.\.\.))) |
---|
1053 | (vector-map (lambda (f vec \.\.\.))) |
---|
1054 | (vector-map! (lambda (f vec \.\.\.))) |
---|
1055 | (vector-for-each (lambda (f vec \.\.\.) undefined)) |
---|
1056 | (vector-count (lambda (pred vec \.\.\.))) |
---|
1057 | (vector-index (lambda (pred vec \.\.\.))) |
---|
1058 | (vector-index-right (lambda (pred vec \.\.\.))) |
---|
1059 | (vector-skip (lambda (pred vec \.\.\.))) |
---|
1060 | (vector-skip-right (lambda (pred vec \.\.\.))) |
---|
1061 | (vector-binary-search (lambda (vec value cmp-proc))) |
---|
1062 | (vector-any (lambda (pred vec \.\.\.))) |
---|
1063 | (vector-every (lambda (pred vec \.\.\.))) |
---|
1064 | (vector-swap! (lambda (vec i j) undefined)) |
---|
1065 | (vector-reverse! (lambda (vec :optional start end) undefined)) |
---|
1066 | (vector-copy! (lambda (target-vec t-start source-vec :optional start end) undefined)) |
---|
1067 | (vector-reverse-copy! (lambda (target-vec t-start source-vec :optional start end) undefined)) |
---|
1068 | (reverse-vector-to-list (lambda (vec :optional start end))) |
---|
1069 | (reverse-list-to-vector (lambda (list))) |
---|
1070 | ) |
---|
1071 | |
---|
1072 | ;; SRFI 44 |
---|
1073 | ("Collections" |
---|
1074 | ) |
---|
1075 | |
---|
1076 | ;; SRFI 45 |
---|
1077 | ("Primitives for expressing iterative lazy algorithms" |
---|
1078 | (delay (syntax (expr))) |
---|
1079 | (lazy (syntax (expr))) |
---|
1080 | (force (lambda (promise))) |
---|
1081 | (eager (lambda (promise))) |
---|
1082 | ) |
---|
1083 | |
---|
1084 | ;; SRFI 46 |
---|
1085 | ("Basic Syntax-rules Extensions" |
---|
1086 | (syntax-rules (syntax () undefined))) |
---|
1087 | |
---|
1088 | ;; SRFI 47 |
---|
1089 | ("Array" |
---|
1090 | (make-array (lambda (prototype k \.\.\.))) |
---|
1091 | (ac64 (lambda (:optional z))) |
---|
1092 | (ac32 (lambda (:optional z))) |
---|
1093 | (ar64 (lambda (:optional x1))) |
---|
1094 | (ar32 (lambda (:optional x1))) |
---|
1095 | (as64 (lambda (:optional n))) |
---|
1096 | (as32 (lambda (:optional n))) |
---|
1097 | (as16 (lambda (:optional n))) |
---|
1098 | (as8 (lambda (:optional n))) |
---|
1099 | (au64 (lambda (:optional n))) |
---|
1100 | (au32 (lambda (:optional n))) |
---|
1101 | (au16 (lambda (:optional n))) |
---|
1102 | (au8 (lambda (:optional n))) |
---|
1103 | (at1 (lambda (:optional bool))) |
---|
1104 | (make-shared-array (lambda (array mapper k \.\.\.))) |
---|
1105 | (array-rank (lambda (obj))) |
---|
1106 | (array-dimensions (lambda (array))) |
---|
1107 | (array-in-bounds? (lambda (array k \.\.\.))) |
---|
1108 | (array-ref (lambda (array k \.\.\.))) |
---|
1109 | (array-set! (lambda (array obj k \.\.\.))) |
---|
1110 | ) |
---|
1111 | |
---|
1112 | ;; SRFI 48 |
---|
1113 | ("Intermediate Format Strings" |
---|
1114 | (format (lambda (port-or-boolean format-string arg \.\.\.)))) |
---|
1115 | |
---|
1116 | ;; SRFI 49 |
---|
1117 | ("Indentation-sensitive syntax" |
---|
1118 | ) |
---|
1119 | |
---|
1120 | () |
---|
1121 | |
---|
1122 | ;; SRFI 51 |
---|
1123 | ("Handling rest list" |
---|
1124 | (rest-values (lambda (caller rest-list :optional args-number-limit default))) |
---|
1125 | (arg-and (syntax)) |
---|
1126 | (arg-ands (syntax)) |
---|
1127 | (err-and (syntax)) |
---|
1128 | (err-ands (syntax)) |
---|
1129 | (arg-or (syntax)) |
---|
1130 | (arg-ors (syntax)) |
---|
1131 | (err-or (syntax)) |
---|
1132 | (err-ors (syntax)) |
---|
1133 | ) |
---|
1134 | |
---|
1135 | () |
---|
1136 | |
---|
1137 | () |
---|
1138 | |
---|
1139 | ;; SRFI 54 |
---|
1140 | ("Formatting" |
---|
1141 | (cat (lambda (obj \.\.\.)))) |
---|
1142 | |
---|
1143 | ;; SRFI 55 |
---|
1144 | ("require-extension" |
---|
1145 | (require-extension (syntax))) |
---|
1146 | |
---|
1147 | () |
---|
1148 | |
---|
1149 | ;; SRFI 57 |
---|
1150 | ("Records" |
---|
1151 | (define-record-type (syntax)) |
---|
1152 | (define-record-scheme (syntax)) |
---|
1153 | (record-update (syntax)) |
---|
1154 | (record-update! (syntax)) |
---|
1155 | (record-compose (syntax))) |
---|
1156 | |
---|
1157 | ;; SRFI 58 |
---|
1158 | ("Array Notation" |
---|
1159 | ) |
---|
1160 | |
---|
1161 | ;; SRFI 59 |
---|
1162 | ("Vicinity" |
---|
1163 | (program-vicinity (lambda ())) |
---|
1164 | (library-vicinity (lambda ())) |
---|
1165 | (implementation-vicinity (lambda ())) |
---|
1166 | (user-vicinity (lambda ())) |
---|
1167 | (home-vicinity (lambda ())) |
---|
1168 | (in-vicinity (lambda (vicinity filename))) |
---|
1169 | (sub-vicinity (lambda (vicinity name))) |
---|
1170 | (make-vicinity (lambda (dirname))) |
---|
1171 | (path-vicinity (lambda (path))) |
---|
1172 | (vicinity:suffix? (lambda (ch))) |
---|
1173 | ) |
---|
1174 | |
---|
1175 | ;; SRFI 60 |
---|
1176 | ("Integers as Bits" |
---|
1177 | (bitwise-and (lambda (n \.\.\.) int)) |
---|
1178 | (bitwise-ior (lambda (n \.\.\.) int)) |
---|
1179 | (bitwise-xor (lambda (n \.\.\.) int)) |
---|
1180 | (bitwise-not (lambda (n) int)) |
---|
1181 | (bitwise-if (lambda (mask n m) int)) |
---|
1182 | (any-bits-set? (lambda (n m) bool)) |
---|
1183 | (bit-count (lambda (n) int)) |
---|
1184 | (integer-length (lambda (n) int)) |
---|
1185 | (first-bit-set (lambda (n) int)) |
---|
1186 | (bit-set? (lambda (i n) bool)) |
---|
1187 | (copy-bit (lambda (index n bool) int)) |
---|
1188 | (bit-field (lambda (n start end) int)) |
---|
1189 | (copy-bit-field (lambda (to-int from-int start end) int)) |
---|
1190 | (arithmetic-shift (lambda (n count) int)) |
---|
1191 | (rotate-bit-field (lambda (n count start end) int)) |
---|
1192 | (reverse-bit-field (lambda (n start end) int)) |
---|
1193 | (integer->list (lambda (k :optional len) list)) |
---|
1194 | (list->integer (lambda (list) int)) |
---|
1195 | ) |
---|
1196 | |
---|
1197 | ;; SRFI 61 |
---|
1198 | ("A more general cond clause" |
---|
1199 | (cond (syntax))) |
---|
1200 | |
---|
1201 | ;; SRFI 62 |
---|
1202 | ("S-expression comments" |
---|
1203 | ) |
---|
1204 | |
---|
1205 | ;; SRFI 63 |
---|
1206 | ("Homogeneous and Heterogeneous Arrays" |
---|
1207 | ) |
---|
1208 | |
---|
1209 | ;; SRFI 64 |
---|
1210 | ("A Scheme API for test suites" |
---|
1211 | (test-assert (syntax)) |
---|
1212 | (test-eqv (syntax)) |
---|
1213 | (test-equal (syntax)) |
---|
1214 | (test-eq (syntax)) |
---|
1215 | (test-approximate (syntax)) |
---|
1216 | (test-error (syntax)) |
---|
1217 | (test-read-eval-string (lambda (string))) |
---|
1218 | (test-begin (syntax (suite-name :optional count))) |
---|
1219 | (test-end (syntax (suite-name))) |
---|
1220 | (test-group (syntax (suite-name decl-or-expr \.\.\.))) |
---|
1221 | (test-group-with-cleanup (syntax (suite-name decl-or-expr \.\.\.))) |
---|
1222 | (test-match-name (lambda (name))) |
---|
1223 | (test-match-nth (lambda (n :optional count))) |
---|
1224 | (test-match-any (lambda (specifier \.\.\.))) |
---|
1225 | (test-match-all (lambda (specifier \.\.\.))) |
---|
1226 | (test-skip (syntax (specifier))) |
---|
1227 | (test-expect-fail (syntax (specifier))) |
---|
1228 | (test-runner? (lambda (obj))) |
---|
1229 | (test-runner-current (lambda (:optional runner))) |
---|
1230 | (test-runner-get (lambda ())) |
---|
1231 | (test-runner-simple (lambda ())) |
---|
1232 | (test-runner-null (lambda ())) |
---|
1233 | (test-runner-create (lambda ())) |
---|
1234 | (test-runner-factory (lambda (:optional factory))) |
---|
1235 | (test-apply (syntax (runner specifier \.\.\.))) |
---|
1236 | (test-with-runner (syntax (runner decl-or-expr \.\.\.))) |
---|
1237 | (test-result-kind (lambda (:optional runner))) |
---|
1238 | (test-passed? (lambda (:optional runner))) |
---|
1239 | (test-result-ref (lambda (runner prop-name (:optional default)))) |
---|
1240 | (test-result-set! (lambda (runner prop-name value))) |
---|
1241 | (test-result-remove (lambda (runner prop-name))) |
---|
1242 | (test-result-clear (lambda (runner))) |
---|
1243 | (test-result-alist (lambda (runner))) |
---|
1244 | (test-runner-on-test-begin (lambda (runner :optional proc))) |
---|
1245 | (test-runner-on-test-begin! (lambda (runner :optional proc))) |
---|
1246 | (test-runner-on-test-end (lambda (runner :optional proc))) |
---|
1247 | (test-runner-on-test-end! (lambda (runner :optional proc))) |
---|
1248 | (test-runner-on-group-begin (lambda (runner :optional proc))) |
---|
1249 | (test-runner-on-group-begin! (lambda (runner :optional proc))) |
---|
1250 | (test-runner-on-group-end (lambda (runner :optional proc))) |
---|
1251 | (test-runner-on-group-end! (lambda (runner :optional proc))) |
---|
1252 | (test-runner-on-bad-count (lambda (runner :optional proc))) |
---|
1253 | (test-runner-on-bad-count! (lambda (runner :optional proc))) |
---|
1254 | (test-runner-on-bad-end-name (lambda (runner :optional proc))) |
---|
1255 | (test-runner-on-bad-end-name! (lambda (runner :optional proc))) |
---|
1256 | (test-runner-on-final (lambda (runner :optional proc))) |
---|
1257 | (test-runner-on-final! (lambda (runner :optional proc))) |
---|
1258 | (test-runner-pass-count (lambda (runner))) |
---|
1259 | (test-runner-fail-count (lambda (runner))) |
---|
1260 | (test-runner-xpass-count (lambda (runner))) |
---|
1261 | (test-runner-skip-count (lambda (runner))) |
---|
1262 | (test-runner-test-name (lambda (runner))) |
---|
1263 | (test-runner-group-path (lambda (runner))) |
---|
1264 | (test-runner-group-stack (lambda (runner))) |
---|
1265 | (test-runner-aux-value (lambda (runner))) |
---|
1266 | (test-runner-aux-value! (lambda (runner))) |
---|
1267 | (test-runner-reset (lambda (runner))) |
---|
1268 | ) |
---|
1269 | |
---|
1270 | () |
---|
1271 | |
---|
1272 | ;; SRFI 66 |
---|
1273 | ("Octet Vectors" |
---|
1274 | (make-u8vector (lambda (len n))) |
---|
1275 | (u8vector (lambda (n \.\.\.))) |
---|
1276 | (u8vector->list (lambda (u8vector))) |
---|
1277 | (list->u8vector (lambda (octet-list))) |
---|
1278 | (u8vector-length u8vector) |
---|
1279 | (u8vector-ref (lambda (u8vector k))) |
---|
1280 | (u8vector-set! (lambda (u8vector k n))) |
---|
1281 | (u8vector=? (lambda (u8vector-1 u8vector-2))) |
---|
1282 | (u8vector-compare (lambda (u8vector-1 u8vector-2))) |
---|
1283 | (u8vector-copy! (lambda (source source-start target target-start n))) |
---|
1284 | (u8vector-copy (lambda (u8vector))) |
---|
1285 | ) |
---|
1286 | |
---|
1287 | ;; SRFI 67 |
---|
1288 | ("Compare Procedures" |
---|
1289 | ) |
---|
1290 | |
---|
1291 | () |
---|
1292 | |
---|
1293 | ;; SRFI 69 |
---|
1294 | ("Basic hash tables" |
---|
1295 | ) |
---|
1296 | |
---|
1297 | ;; SRFI 70 |
---|
1298 | ("Numbers" |
---|
1299 | ) |
---|
1300 | |
---|
1301 | ;; SRFI 71 |
---|
1302 | ("LET-syntax for multiple values" |
---|
1303 | ) |
---|
1304 | |
---|
1305 | ;; SRFI 72 |
---|
1306 | ("Simple hygienic macros" |
---|
1307 | ) |
---|
1308 | |
---|
1309 | () |
---|
1310 | |
---|
1311 | ;; SRFI 74 |
---|
1312 | ("Octet-Addressed Binary Blocks" |
---|
1313 | ) |
---|
1314 | |
---|
1315 | ]) |
---|
1316 | |
---|
1317 | (defvar *scheme-chicken-modules* |
---|
1318 | '((extras |
---|
1319 | (->string (lambda (obj) str)) |
---|
1320 | (alist->hash-table (lambda (alist) hash-table)) |
---|
1321 | (alist-ref (lambda (alist key :optional eq-fn default))) |
---|
1322 | (alist-update! (lambda (key value alist :optional eq-fn) undefined)) |
---|
1323 | (atom? (lambda (obj) bool)) |
---|
1324 | (binary-search (lambda (vec proc))) |
---|
1325 | (butlast (lambda (list) list) "drops the last element of list") |
---|
1326 | (call-with-input-string (lambda (string proc))) |
---|
1327 | (call-with-output-string (lambda (proc) str)) |
---|
1328 | (chop (lambda (list k) list)) |
---|
1329 | (complement (lambda (f) f2)) |
---|
1330 | (compose (lambda (f1 f2 \.\.\.) f)) |
---|
1331 | (compress (lambda (boolean-list list))) |
---|
1332 | (conc (lambda (obj \.\.\.))) |
---|
1333 | (conjoin (lambda (pred \.\.\.) pred)) |
---|
1334 | (constantly (lambda (obj \.\.\.) f)) |
---|
1335 | (disjoin (lambda (pred \.\.\.) pred)) |
---|
1336 | (each (lambda (proc \.\.\.) proc)) |
---|
1337 | (flatten (lambda (list1 \.\.\.) list)) |
---|
1338 | (flip (lambda (proc) proc)) |
---|
1339 | (format (lambda (format-string arg \.\.\.))) |
---|
1340 | (fprintf (lambda (port format-string arg \.\.\.))) |
---|
1341 | (hash (lambda (obj :optional n) int)) |
---|
1342 | (hash-by-identity (lambda (obj :optional n) int)) |
---|
1343 | (hash-table->alist (lambda (hash-table) alist)) |
---|
1344 | (hash-table-copy (lambda (hash-table) hash-table)) |
---|
1345 | (hash-table-delete! (lambda (hash-table key) undefined)) |
---|
1346 | (hash-table-equivalence-function (lambda (hash-table) pred)) |
---|
1347 | (hash-table-exists? (lambda (hash-table key) bool)) |
---|
1348 | (hash-table-fold (lambda (hash-table f init-value))) |
---|
1349 | (hash-table-hash-function (lambda (hash-table) f)) |
---|
1350 | (hash-table-keys (lambda (hash-table) list)) |
---|
1351 | (hash-table-merge! (lambda (hash-table1 hash-table2) undefined)) |
---|
1352 | (hash-table-ref (lambda (hash-table key :optional thunk))) |
---|
1353 | (hash-table-ref/default (lambda (hash-table key default))) |
---|
1354 | (hash-table-remove! (lambda (hash-table proc) undefined)) |
---|
1355 | (hash-table-set! (lambda (hash-table key value) undefined)) |
---|
1356 | (hash-table-size (lambda (hash-table) n)) |
---|
1357 | (hash-table-update! (lambda (hash-table key proc :optional thunk) undefined)) |
---|
1358 | (hash-table-update!/default (lambda (hash-table key proc default) undefined)) |
---|
1359 | (hash-table-values (lambda (hash-table) list)) |
---|
1360 | (hash-table-walk (lambda (hash-table proc) undefined)) |
---|
1361 | (hash-table? (lambda (obj) bool)) |
---|
1362 | (identity (lambda (obj))) |
---|
1363 | (intersperse (lambda (list obj) list)) |
---|
1364 | (join (lambda (list-of-lists :optional list) list)) |
---|
1365 | (list->queue (lambda (list) queue)) |
---|
1366 | (list-of (lambda (pred))) |
---|
1367 | (make-hash-table (lambda (:optional eq-fn hash-fn size) hash-table)) |
---|
1368 | (make-input-port (lambda (read-proc ready?-pred close-proc :optional peek-proc) input-port)) |
---|
1369 | (make-output-port (lambda (write-proc close-proc :optional flush-proc) output-port)) |
---|
1370 | (make-queue (lambda () queue)) |
---|
1371 | (merge (lambda (list1 list2 less-fn) list)) |
---|
1372 | (merge! (lambda (list1 list2 less-fn) list)) |
---|
1373 | (noop (lambda (obj \.\.\.) undefined)) |
---|
1374 | (pp (lambda (obj :optional output-port) undefined)) |
---|
1375 | (pretty-print (lambda (obj :optional output-port) undefined)) |
---|
1376 | (pretty-print-width (lambda (:optional new-width) n)) |
---|
1377 | (printf (lambda (format-string arg \.\.\.) undefined)) |
---|
1378 | (project (lambda (n) proc)) |
---|
1379 | (queue->list (lambda (queue) list)) |
---|
1380 | (queue-add! (lambda (queue obj) undefined)) |
---|
1381 | (queue-empty? (lambda (queue) bool)) |
---|
1382 | (queue-first (lambda (queue))) |
---|
1383 | (queue-last (lambda (queue))) |
---|
1384 | (queue-push-back! (lambda (queue obj) undefined)) |
---|
1385 | (queue-push-back-list! (lambda (queue list) undefined)) |
---|
1386 | (queue-remove! (lambda (queue) undefined)) |
---|
1387 | (queue? (lambda (obj) bool)) |
---|
1388 | (random (lambda (n) n)) |
---|
1389 | (randomize (lambda (:optional x1) undefined)) |
---|
1390 | (rassoc (lambda (key list :optional eq-fn))) |
---|
1391 | (read-file (lambda (:optional file-or-port reader-fn max-count) str)) |
---|
1392 | (read-line (lambda (:optional port limit) str)) |
---|
1393 | (read-lines (lambda (:optional port max) list)) |
---|
1394 | (read-string (lambda (:optional n port) str)) |
---|
1395 | (read-string! (lambda (n dest :optional port start) undefined)) |
---|
1396 | (read-token (lambda (predicate :optional port) str)) |
---|
1397 | (shuffle (lambda (list) list)) |
---|
1398 | (sort (lambda (sequence less-fn) sequence)) |
---|
1399 | (sort! (lambda (sequence less-fn) sequence)) |
---|
1400 | (sorted? (lambda (sequence less-fn) bool)) |
---|
1401 | (sprintf (lambda (format-string arg \.\.\.) str)) |
---|
1402 | (string-chomp (lambda (str :optional suffix-str) str)) |
---|
1403 | (string-chop (lambda (str length) list)) |
---|
1404 | (string-ci-hash (lambda (str :optional n) n)) |
---|
1405 | (string-compare3 (lambda (str1 str2) n)) |
---|
1406 | (string-compare3-ci (lambda (str1 str2) n)) |
---|
1407 | (string-hash (lambda (str1 :optional n) n)) |
---|
1408 | (string-intersperse (lambda (list :optional seperator-string) str)) |
---|
1409 | (string-split (lambda (str :optional delimiter-str keep-empty?) list)) |
---|
1410 | (string-translate (lambda (str from-str :optional to-str) str)) |
---|
1411 | (string-translate* (lambda (str list) str)) |
---|
1412 | (substring-ci=? (lambda (str1 str2 :optional start1 start2 length) str)) |
---|
1413 | (substring-index (lambda (which-str where-str :optional start) i)) |
---|
1414 | (substring-index-ci (lambda (which-str where-str :optional start) i)) |
---|
1415 | (substring=? (lambda (str1 str2 :optional start1 start2 length) bool)) |
---|
1416 | (tail? (lambda (obj list) bool)) |
---|
1417 | (with-error-output-to-port (lambda (output-port thunk))) |
---|
1418 | (with-input-from-port (lambda (port thunk))) |
---|
1419 | (with-input-from-string (lambda (str thunk))) |
---|
1420 | (with-output-to-port (lambda (port thunk))) |
---|
1421 | (with-output-to-string (lambda (thunk) str)) |
---|
1422 | (write-line (lambda (str :optional port) undefined)) |
---|
1423 | (write-string (lambda (str :optional num port) undefined)) |
---|
1424 | ) |
---|
1425 | (lolevel |
---|
1426 | (address->pointer (lambda (n) ptr)) |
---|
1427 | (align-to-word (lambda (ptr-or-int) ptr)) |
---|
1428 | (allocate (lambda (size) block)) |
---|
1429 | (block-ref (lambda (block index) int)) |
---|
1430 | (block-set! (lambda (block index obj) undefined)) |
---|
1431 | (byte-vector (lambda (n \.\.\.) byte-vector)) |
---|
1432 | (byte-vector->list (lambda (byte-vector) list)) |
---|
1433 | (byte-vector->string (lambda (byte-vector) string)) |
---|
1434 | (byte-vector-fill! (lambda (byte-vector n) undefined)) |
---|
1435 | (byte-vector-length (lambda (byte-vector) n)) |
---|
1436 | (byte-vector-ref (lambda (byte-vector i) int)) |
---|
1437 | (byte-vector-set! (lambda (byte-vector i n) undefined)) |
---|
1438 | (byte-vector? (lambda (obj) bool)) |
---|
1439 | (extend-procedure (lambda (proc x1) proc)) |
---|
1440 | (extended-procedure? (lambda (proc) bool)) |
---|
1441 | (free (lambda (pointer) undefined)) |
---|
1442 | (global-bound? (lambda (sym) bool)) |
---|
1443 | (global-make-unbound! (lambda (sym) undefined)) |
---|
1444 | (global-ref (lambda (sym))) |
---|
1445 | (global-set! (lambda (sym val) undefined)) |
---|
1446 | (list->byte-vector (lambda (list) byte-vector)) |
---|
1447 | (locative->object (lambda (locative) obj)) |
---|
1448 | (locative-ref (lambda (locative))) |
---|
1449 | (locative-set! (lambda (locative val) undefined)) |
---|
1450 | (locative? (lambda (obj) bool)) |
---|
1451 | (make-byte-vector (lambda (size :optional init-n) byte-vector)) |
---|
1452 | (make-locative (lambda (obj :optional index) locative)) |
---|
1453 | (make-record-instance (lambda (sym arg \.\.\.))) |
---|
1454 | (make-static-byte-vector (lambda (size :optional init-n))) |
---|
1455 | (make-weak-locative (lambda (obj :optional index) locative)) |
---|
1456 | (move-memory! (lambda (from to :optional bytes from-offset to-offset) undefined)) |
---|
1457 | (mutate-procedure (lambda (proc proc) proc)) |
---|
1458 | (null-pointer (lambda () pointer)) |
---|
1459 | (null-pointer? (lambda (pointer) bool)) |
---|
1460 | (number-of-bytes (lambda (block) int)) |
---|
1461 | (number-of-slots (lambda (block) int)) |
---|
1462 | (object->pointer (lambda (obj) ptr)) |
---|
1463 | (object-become! (lambda (alist) undefined)) |
---|
1464 | (object-copy (lambda (obj))) |
---|
1465 | (object-evict (lambda (obj :optional allocator-proc))) |
---|
1466 | (object-evict-to-location (lambda (obj ptr :optional limit))) |
---|
1467 | (object-evicted? (lambda (obj) bool)) |
---|
1468 | (object-release (lambda (obj :optional releaser-proc))) |
---|
1469 | (object-size (lambda (obj) int)) |
---|
1470 | (object-unevict (lambda (obj :optional full))) |
---|
1471 | (pointer->address (lambda (ptr) n)) |
---|
1472 | (pointer->object (lambda (ptr))) |
---|
1473 | (pointer-f32-ref (lambda (ptr) real)) |
---|
1474 | (pointer-f32-set! (lambda (ptr x1) undefined)) |
---|
1475 | (pointer-f64-ref (lambda (ptr) real)) |
---|
1476 | (pointer-f64-set! (lambda (ptr x1) undefined)) |
---|
1477 | (pointer-offset (lambda (ptr n) n)) |
---|
1478 | (pointer-s16-ref (lambda (ptr) int)) |
---|
1479 | (pointer-s16-set! (lambda (ptr n) undefined)) |
---|
1480 | (pointer-s32-ref (lambda (ptr) int)) |
---|
1481 | (pointer-s32-set! (lambda (ptr n) undefined)) |
---|
1482 | (pointer-s8-ref (lambda (ptr) int)) |
---|
1483 | (pointer-s8-set! (lambda (ptr n) undefined)) |
---|
1484 | (pointer-tag (lambda (ptr) tag)) |
---|
1485 | (pointer-u16-ref (lambda (ptr) int)) |
---|
1486 | (pointer-u16-set! (lambda (ptr n) undefined)) |
---|
1487 | (pointer-u32-ref (lambda (ptr) int)) |
---|
1488 | (pointer-u32-set! (lambda (ptr n) undefined)) |
---|
1489 | (pointer-u8-ref (lambda (ptr) int)) |
---|
1490 | (pointer-u8-set! (lambda (ptr n) undefined)) |
---|
1491 | (pointer=? (lambda (ptr1 ptr2) bool)) |
---|
1492 | (pointer? (lambda (obj) bool)) |
---|
1493 | (procedure-data (lambda (proc))) |
---|
1494 | (record->vector (lambda (block) vector)) |
---|
1495 | (record-instance? (lambda (obj) bool)) |
---|
1496 | (set-invalid-procedure-call-handler! (lambda (proc) undefined)) |
---|
1497 | (set-procedure-data! (lambda (proc obj) undefined)) |
---|
1498 | (static-byte-vector->pointer (lambda (byte-vector) pointer)) |
---|
1499 | (string->byte-vector (lambda (str) byte-vector)) |
---|
1500 | (tag-pointer (lambda (ptr tag))) |
---|
1501 | (tagged-pointer? (lambda (obj tag) bool)) |
---|
1502 | (unbound-variable-value (lambda (:optional value))) |
---|
1503 | ) |
---|
1504 | (posix |
---|
1505 | (_exit (lambda (:optional n) undefined)) |
---|
1506 | (call-with-input-pipe (lambda (cmdline-string proc :optional mode))) |
---|
1507 | (call-with-output-pipe (lambda (cmdline-string proc :optional mode))) |
---|
1508 | (change-directory (lambda (dir))) |
---|
1509 | (change-file-mode (lambda (filename mode))) |
---|
1510 | (change-file-owner (lambda (filename user-n group-n))) |
---|
1511 | (close-input-pipe (lambda (input-port))) |
---|
1512 | (close-output-pipe (lambda (output-port))) |
---|
1513 | (create-directory (lambda (filename))) |
---|
1514 | (create-fifo (lambda (filename :optional mode))) |
---|
1515 | (create-pipe (lambda ())) |
---|
1516 | (create-session (lambda ())) |
---|
1517 | (create-symbolic-link (lambda (old-filename new-filename))) |
---|
1518 | (current-directory (lambda (:optional new-dir))) |
---|
1519 | (current-effective-group-id (lambda () int)) |
---|
1520 | (current-effective-user-id (lambda () int)) |
---|
1521 | (current-environment (lambda ())) |
---|
1522 | (current-group-id (lambda ())) |
---|
1523 | (current-process-id (lambda ())) |
---|
1524 | (current-user-id (lambda ())) |
---|
1525 | (delete-directory (lambda (dir))) |
---|
1526 | (directory (lambda (:optional dir show-dotfiles?) list)) |
---|
1527 | (directory? (lambda (filename) bool)) |
---|
1528 | (duplicate-fileno (lambda (old-n :optional new-n))) |
---|
1529 | ;; (errno/acces integer) |
---|
1530 | ;; (errno/again integer) |
---|
1531 | ;; (errno/badf integer) |
---|
1532 | ;; (errno/busy integer) |
---|
1533 | ;; (errno/child integer) |
---|
1534 | ;; (errno/exist integer) |
---|
1535 | ;; (errno/fault integer) |
---|
1536 | ;; (errno/intr integer) |
---|
1537 | ;; (errno/inval integer) |
---|
1538 | ;; (errno/io integer) |
---|
1539 | ;; (errno/isdir integer) |
---|
1540 | ;; (errno/mfile integer) |
---|
1541 | ;; (errno/noent integer) |
---|
1542 | ;; (errno/noexec integer) |
---|
1543 | ;; (errno/nomem integer) |
---|
1544 | ;; (errno/nospc integer) |
---|
1545 | ;; (errno/notdir integer) |
---|
1546 | ;; (errno/perm integer) |
---|
1547 | ;; (errno/pipe integer) |
---|
1548 | ;; (errno/rofs integer) |
---|
1549 | ;; (errno/spipe integer) |
---|
1550 | ;; (errno/srch integer) |
---|
1551 | ;; (errno/wouldblock integer) |
---|
1552 | (fifo? (lambda (filename) bool)) |
---|
1553 | (file-access-time (lambda (filename) real)) |
---|
1554 | (file-change-time (lambda (filename) real)) |
---|
1555 | (file-close (lambda (fileno))) |
---|
1556 | (file-execute-access? (lambda (filename) bool)) |
---|
1557 | (file-link (lambda (old-filename new-filename))) |
---|
1558 | (file-lock (lambda (port :optional start len))) |
---|
1559 | (file-lock/blocking (lambda (port :optional start len))) |
---|
1560 | (file-mkstemp (lambda (template-filename))) |
---|
1561 | (file-modification-time (lambda (filename) real)) |
---|
1562 | (file-open (lambda (filename (flags open-mode open/binary open/excl open/fsync open/noctty open/nonblock open/rdonly open/rdwr open/read open/sync open/text) :optional mode) fileno)) |
---|
1563 | (file-owner (lambda (filename))) |
---|
1564 | (file-permissions (lambda (filename) int)) |
---|
1565 | (file-position (lambda (port-or-fileno) int)) |
---|
1566 | (file-read (lambda (fileno size :optional buffer-string))) |
---|
1567 | (file-read-access? (lambda (filename) bool)) |
---|
1568 | (file-select (lambda (read-fd-list write-fd-list :optional timeout))) |
---|
1569 | (file-size (lambda (filename) int)) |
---|
1570 | (file-stat (lambda (filename :optional follow-link?))) |
---|
1571 | (file-test-lock (lambda (port :optional start len))) |
---|
1572 | (file-truncate (lambda (filename-or-fileno offset))) |
---|
1573 | (file-unlock (lambda (lock))) |
---|
1574 | (file-write (lambda (fileno buffer-string :optional size))) |
---|
1575 | (file-write-access? (lambda (filename))) |
---|
1576 | (fileno/stderr integer) |
---|
1577 | (fileno/stdin integer) |
---|
1578 | (fileno/stdout integer) |
---|
1579 | (find-files (lambda (dir pred :optional action-proc identity limit))) |
---|
1580 | (get-groups (lambda ())) |
---|
1581 | (get-host-name (lambda ())) |
---|
1582 | (glob (lambda (pattern1 \.\.\.))) |
---|
1583 | (group-information (lambda (group-name-or-n))) |
---|
1584 | (initialize-groups (lambda (user-name base-group-n))) |
---|
1585 | (local-time->seconds (lambda (vector))) |
---|
1586 | (local-timezone-abbreviation (lambda ())) |
---|
1587 | (map-file-to-memory (lambda (address len protection flag fileno :optional offset))) |
---|
1588 | (memory-mapped-file-pointer (lambda (mmap))) |
---|
1589 | (memory-mapped-file? (lambda (obj))) |
---|
1590 | (open-input-file* (lambda (fileno :optional (flags open-mode open/binary open/excl open/fsync open/noctty open/nonblock open/rdonly open/rdwr open/read open/sync open/text)))) |
---|
1591 | (open-input-pipe (lambda (cmdline-string :optional mode))) |
---|
1592 | (open-output-file* (lambda (fileno :optional (flags open-mode open/append open/binary open/creat open/excl open/fsync open/noctty open/nonblock open/rdwr open/sync open/text open/trunc open/write open/wronly)))) |
---|
1593 | (open-output-pipe (lambda (cmdline-string :optional mode))) |
---|
1594 | ;; (open/append integer) |
---|
1595 | ;; (open/binary integer) |
---|
1596 | ;; (open/creat integer) |
---|
1597 | ;; (open/excl integer) |
---|
1598 | ;; (open/fsync integer) |
---|
1599 | ;; (open/noctty integer) |
---|
1600 | ;; (open/nonblock integer) |
---|
1601 | ;; (open/rdonly integer) |
---|
1602 | ;; (open/rdwr integer) |
---|
1603 | ;; (open/read integer) |
---|
1604 | ;; (open/sync integer) |
---|
1605 | ;; (open/text integer) |
---|
1606 | ;; (open/trunc integer) |
---|
1607 | ;; (open/write integer) |
---|
1608 | ;; (open/wronly integer) |
---|
1609 | (parent-process-id (lambda ())) |
---|
1610 | ;; (perm/irgrp integer) |
---|
1611 | ;; (perm/iroth integer) |
---|
1612 | ;; (perm/irusr integer) |
---|
1613 | ;; (perm/irwxg integer) |
---|
1614 | ;; (perm/irwxo integer) |
---|
1615 | ;; (perm/irwxu integer) |
---|
1616 | ;; (perm/isgid integer) |
---|
1617 | ;; (perm/isuid integer) |
---|
1618 | ;; (perm/isvtx integer) |
---|
1619 | ;; (perm/iwgrp integer) |
---|
1620 | ;; (perm/iwoth integer) |
---|
1621 | ;; (perm/iwusr integer) |
---|
1622 | ;; (perm/ixgrp integer) |
---|
1623 | ;; (perm/ixoth integer) |
---|
1624 | ;; (perm/ixusr integer) |
---|
1625 | ;; (pipe/buf integer) |
---|
1626 | (port->fileno (lambda (port))) |
---|
1627 | (process (lambda (cmdline-string :optional arg-list env-list))) |
---|
1628 | (process-execute (lambda (filename :optional arg-list env-list))) |
---|
1629 | (process-fork (lambda (:optional thunk))) |
---|
1630 | (process-group-id (lambda ())) |
---|
1631 | (process-run (lambda (filename :optional list))) |
---|
1632 | (process-signal (lambda (pid :optional signal))) |
---|
1633 | (process-wait (lambda (:optional pid nohang?))) |
---|
1634 | (read-symbolic-link (lambda (filename) filename)) |
---|
1635 | (regular-file? (lambda (filename))) |
---|
1636 | (seconds->local-time (lambda (seconds))) |
---|
1637 | (seconds->string (lambda (seconds))) |
---|
1638 | (seconds->utc-time (lambda (seconds))) |
---|
1639 | (set-alarm! (lambda (seconds))) |
---|
1640 | (set-buffering-mode! (lambda (port mode :optional buf-size))) |
---|
1641 | (set-file-position! (lambda (port-or-fileno pos :optional whence))) |
---|
1642 | (set-group-id! (lambda (n))) |
---|
1643 | (set-groups! (lambda (group-n-list))) |
---|
1644 | (set-process-group-id! (lambda (process-n n))) |
---|
1645 | (set-root-directory! (lambda (dir)) "chroot") |
---|
1646 | (set-signal-handler! (lambda (sig-n proc))) |
---|
1647 | (set-signal-mask! (lambda (sig-n-list))) |
---|
1648 | (set-user-id! (lambda (n))) |
---|
1649 | (setenv (lambda (name value-string))) |
---|
1650 | ;; (signal/abrt integer) |
---|
1651 | ;; (signal/alrm integer) |
---|
1652 | ;; (signal/chld integer) |
---|
1653 | ;; (signal/cont integer) |
---|
1654 | ;; (signal/fpe integer) |
---|
1655 | ;; (signal/hup integer) |
---|
1656 | ;; (signal/ill integer) |
---|
1657 | ;; (signal/int integer) |
---|
1658 | ;; (signal/io integer) |
---|
1659 | ;; (signal/kill integer) |
---|
1660 | ;; (signal/pipe integer) |
---|
1661 | ;; (signal/prof integer) |
---|
1662 | ;; (signal/quit integer) |
---|
1663 | ;; (signal/segv integer) |
---|
1664 | ;; (signal/stop integer) |
---|
1665 | ;; (signal/term integer) |
---|
1666 | ;; (signal/trap integer) |
---|
1667 | ;; (signal/tstp integer) |
---|
1668 | ;; (signal/urg integer) |
---|
1669 | ;; (signal/usr1 integer) |
---|
1670 | ;; (signal/usr2 integer) |
---|
1671 | ;; (signal/vtalrm integer) |
---|
1672 | ;; (signal/winch integer) |
---|
1673 | ;; (signal/xcpu integer) |
---|
1674 | ;; (signal/xfsz integer) |
---|
1675 | (sleep (lambda (seconds))) |
---|
1676 | (symbolic-link? (lambda (filename))) |
---|
1677 | (system-information (lambda ())) |
---|
1678 | (terminal-name (lambda (port))) |
---|
1679 | (terminal-port? (lambda (port))) |
---|
1680 | (time->string (lambda (vector))) |
---|
1681 | (unmap-file-from-memory (lambda (mmap :optional len))) |
---|
1682 | (unsetenv (lambda (name) undefined)) |
---|
1683 | (user-information (lambda ((or integer (string scheme-complete-user-name))) list)) |
---|
1684 | (utc-time->seconds (lambda (vector))) |
---|
1685 | (with-input-from-pipe (lambda (cmdline-string thunk :optional mode))) |
---|
1686 | (with-output-to-pipe (lambda (cmdline-string thunk :optional mode))) |
---|
1687 | ) |
---|
1688 | (regex |
---|
1689 | (glob->regexp (lambda (pattern))) |
---|
1690 | (glob? (lambda (obj))) |
---|
1691 | (grep (lambda (pattern list) list)) |
---|
1692 | (regexp (lambda (pattern ignore-case? ignore-space? utf-8?))) |
---|
1693 | (regexp-escape (lambda (str) str)) |
---|
1694 | (regexp? (lambda (obj) bool)) |
---|
1695 | (string-match (lambda (pattern str :optional start))) |
---|
1696 | (string-match-positions (lambda (pattern str :optional start))) |
---|
1697 | (string-search (lambda (pattern str :optional start))) |
---|
1698 | (string-search-positions (lambda (pattern str :optional start))) |
---|
1699 | (string-split-fields (lambda (pattern str :optional mode start))) |
---|
1700 | (string-substitute (lambda (pattern subst str :optional mode))) |
---|
1701 | (string-substitute* (lambda (str subst-list :optional mode))) |
---|
1702 | ) |
---|
1703 | (tcp |
---|
1704 | (tcp-abandon-port (lambda (port))) |
---|
1705 | (tcp-accept (lambda (listener))) |
---|
1706 | (tcp-accept-ready? (lambda (listener))) |
---|
1707 | (tcp-addresses (lambda (port))) |
---|
1708 | (tcp-buffer-size (lambda (:optional new-size))) |
---|
1709 | (tcp-close (lambda (listener))) |
---|
1710 | (tcp-connect (lambda ((string scheme-complete-host-name) :optional (string scheme-complete-port-name)))) |
---|
1711 | (tcp-listen (lambda (tcp-port-n :optional backlog-n host-string))) |
---|
1712 | (tcp-listener-fileno (lambda (listener))) |
---|
1713 | (tcp-listener-port (lambda (listener))) |
---|
1714 | (tcp-listener? (lambda (obj))) |
---|
1715 | (tcp-port-numbers (lambda (port))) |
---|
1716 | ) |
---|
1717 | (utils |
---|
1718 | (absolute-pathname? (lambda (pathname))) |
---|
1719 | (create-temporary-file (lambda (:optional ext-str))) |
---|
1720 | (decompose-pathname (lambda (pathname))) |
---|
1721 | (delete-file* (lambda (filename))) |
---|
1722 | (for-each-argv-line (lambda (proc) undefined)) |
---|
1723 | (for-each-line (lambda (proc :optional input-port) undefined)) |
---|
1724 | (make-absolute-pathname (lambda (dir filename :optional ext-str))) |
---|
1725 | (make-pathname (lambda (dir filename :optional ext-str))) |
---|
1726 | (pathname-directory (lambda (pathname))) |
---|
1727 | (pathname-extension (lambda (pathname))) |
---|
1728 | (pathname-file (lambda (pathname))) |
---|
1729 | (pathname-replace-directory (lambda (pathname dir))) |
---|
1730 | (pathname-replace-extension (lambda (pathname ext-str))) |
---|
1731 | (pathname-replace-file (lambda (pathname filename))) |
---|
1732 | (pathname-strip-directory (lambda (pathname))) |
---|
1733 | (pathname-strip-extension (lambda (pathname))) |
---|
1734 | (port-for-each (lambda (read-fn thunk) undefined)) |
---|
1735 | (port-map (lambda (read-fn thunk))) |
---|
1736 | (read-all (lambda (:optional file-or-port))) |
---|
1737 | (shift! (lambda (list :optional default))) |
---|
1738 | (system* (lambda (format-string arg1 \.\.\.))) |
---|
1739 | (unshift! (lambda (obj pair))) |
---|
1740 | ) |
---|
1741 | )) |
---|
1742 | |
---|
1743 | ;; another big table - consider moving to a separate file |
---|
1744 | (defvar *scheme-implementation-exports* |
---|
1745 | '((chicken |
---|
1746 | (abort (lambda (obj) undefined)) |
---|
1747 | (add1 (lambda (z) z)) |
---|
1748 | (andmap (lambda (pred list) bool)) |
---|
1749 | (any? (lambda (obj) bool)) |
---|
1750 | (argc+argv (lambda () (values n ptr))) |
---|
1751 | (argv (lambda () list)) |
---|
1752 | (bit-set? (lambda (n index) bool)) |
---|
1753 | (bitwise-and (lambda (n \.\.\.) n)) |
---|
1754 | (bitwise-ior (lambda (n \.\.\.) n)) |
---|
1755 | (bitwise-not (lambda (n \.\.\.) n)) |
---|
1756 | (bitwise-xor (lambda (n \.\.\.) n)) |
---|
1757 | (blob->string (lambda (blob) string)) |
---|
1758 | (blob-size (lambda (blob) n)) |
---|
1759 | (blob? (lambda (obj) bool)) |
---|
1760 | (breakpoint (lambda (:optional name))) |
---|
1761 | (build-platform (lambda () symbol)) |
---|
1762 | (c-runtime (lambda () symbol)) |
---|
1763 | (call/cc (lambda (proc))) |
---|
1764 | (case-sensitive (lambda (:optional on?))) |
---|
1765 | (chicken-home (lambda () string)) |
---|
1766 | (chicken-version (lambda () string)) |
---|
1767 | (command-line-arguments (lambda () list)) |
---|
1768 | (condition-predicate (lambda (kind) pred)) |
---|
1769 | (condition-property-accessor (lambda (kind prop :optional err?) proc)) |
---|
1770 | (condition? (lambda (obj) bool)) |
---|
1771 | (continuation-capture (lambda (proc))) |
---|
1772 | (continuation-graft (lambda (continuation thunk))) |
---|
1773 | (continuation-return (lambda (continuation vals\.\.\.))) |
---|
1774 | (continuation? (lambda (obj) bool)) |
---|
1775 | (copy-read-table (lambda (read-table) read-table)) |
---|
1776 | (cpu-time (lambda () (values n n))) |
---|
1777 | (current-error-port (lambda () output-port)) |
---|
1778 | (current-exception-handler (lambda () proc)) |
---|
1779 | (current-gc-milliseconds (lambda () n)) |
---|
1780 | (current-milliseconds (lambda () n)) |
---|
1781 | (current-read-table (lambda () read-table)) |
---|
1782 | (current-seconds (lambda () x1)) |
---|
1783 | (define-reader-ctor (lambda (sym proc) undefined)) |
---|
1784 | (delete-file (lambda (filename) undefined)) |
---|
1785 | (disable-interrupts (lambda () undefined)) |
---|
1786 | (dynamic-load-libraries (lambda () list)) |
---|
1787 | (dynamic-wind (lambda (before-thunk thunk after-thunk))) |
---|
1788 | (enable-interrupts (lambda () undefined)) |
---|
1789 | (enable-warnings (lambda () undefined)) |
---|
1790 | (errno (lambda () n)) |
---|
1791 | (error (lambda (error-string args \.\.\.) undefined)) |
---|
1792 | (eval-handler (lambda () proc)) |
---|
1793 | (exit (lambda (:optional n) undefined)) |
---|
1794 | (exit-handler (lambda () proc)) |
---|
1795 | (extension-info (lambda (proc))) |
---|
1796 | (extension-information (lambda (proc))) |
---|
1797 | (feature? (lambda (sym) bool)) |
---|
1798 | (features (lambda () list)) |
---|
1799 | (file-exists? (lambda (filename) bool)) |
---|
1800 | (finite? (lambda (z) bool)) |
---|
1801 | (fixnum? (lambda (obj) bool)) |
---|
1802 | (flonum? (lambda (obj) bool)) |
---|
1803 | (flush-output (lambda (:optional port) undefined)) |
---|
1804 | (force (lambda (promise))) |
---|
1805 | (force-finalizers (lambda (f args \.\.\.))) |
---|
1806 | (fp* (lambda (x1 x2) x3)) |
---|
1807 | (fp+ (lambda (x1 x2) x3)) |
---|
1808 | (fp- (lambda (x1 x2) x3)) |
---|
1809 | (fp/ (lambda (x1 x2) x3)) |
---|
1810 | (fp< (lambda (x1 x2) x3)) |
---|
1811 | (fp<= (lambda (x1 x2) x3)) |
---|
1812 | (fp= (lambda (x1 x2) x3)) |
---|
1813 | (fp> (lambda (x1 x2) x3)) |
---|
1814 | (fp>= (lambda (x1 x2) x3)) |
---|
1815 | (fpmax (lambda (x1 x2) x3)) |
---|
1816 | (fpmin (lambda (x1 x2) x3)) |
---|
1817 | (fpneg (lambda (x1 x2) x3)) |
---|
1818 | (fx* (lambda (n1 n2) n)) |
---|
1819 | (fx+ (lambda (n1 n2) n)) |
---|
1820 | (fx- (lambda (n1 n2) n)) |
---|
1821 | (fx/ (lambda (n1 n2) n)) |
---|
1822 | (fx< (lambda (n1 n2) n)) |
---|
1823 | (fx<= (lambda (n1 n2) n)) |
---|
1824 | (fx= (lambda (n1 n2) n)) |
---|
1825 | (fx> (lambda (n1 n2) n)) |
---|
1826 | (fx>= (lambda (n1 n2) n)) |
---|
1827 | (fxand (lambda (n1 n2) n)) |
---|
1828 | (fxior (lambda (n1 n2) n)) |
---|
1829 | (fxmax (lambda (n1 n2) n)) |
---|
1830 | (fxmin (lambda (n1 n2) n)) |
---|
1831 | (fxmod (lambda (n1 n2) n)) |
---|
1832 | (fxneg (lambda (n1 n2) n)) |
---|
1833 | (fxnot (lambda (n1 n2) n)) |
---|
1834 | (fxshl (lambda (n1 n2) n)) |
---|
1835 | (fxshr (lambda (n1 n2) n)) |
---|
1836 | (fxxor (lambda (n1 n2) n)) |
---|
1837 | (gc (lambda () n)) |
---|
1838 | (gensym (lambda (:optional name) sym)) |
---|
1839 | (get-call-chain (lambda (:optional n) list)) |
---|
1840 | (get-keyword (lambda (sym list :optional default))) |
---|
1841 | (get-line-number (lambda (sexp) n)) |
---|
1842 | (get-output-string (lambda (string-output-port) string)) |
---|
1843 | (getenv (lambda (name) string)) |
---|
1844 | (getter-with-setter (lambda (get-proc set-proc) proc)) |
---|
1845 | (implicit-exit-handler (lambda (:optional proc) proc)) |
---|
1846 | (invalid-procedure-call-handler (lambda (:optional proc) proc)) |
---|
1847 | (keyword->string (lambda (sym) string)) |
---|
1848 | (keyword-style (lambda (:optional sym) sym)) |
---|
1849 | (keyword? (lambda (obj) bool)) |
---|
1850 | (load-library (lambda (sym) undefined)) |
---|
1851 | (load-noisily (lambda (string) undefined)) |
---|
1852 | (load-relative (lambda (string) undefined)) |
---|
1853 | (load-verbose (lambda (:optional bool) bool)) |
---|
1854 | (machine-byte-order (lambda () sym)) |
---|
1855 | (machine-type (lambda () sym)) |
---|
1856 | (macro? (lambda (obj) bool)) |
---|
1857 | (macroexpand (lambda (sexp) sexp)) |
---|
1858 | (macroexpand-1 (lambda (sexp) sexp)) |
---|
1859 | (make-blob (lambda (size) blob)) |
---|
1860 | (make-composite-condition (lambda (condition \.\.\.) condition)) |
---|
1861 | (make-parameter (lambda (val) proc)) |
---|
1862 | (make-property-condition (lambda (kind \.\.\.) condition)) |
---|
1863 | (match-error-control (lambda (:optional proc) proc)) |
---|
1864 | (match-error-procedure (lambda (:optional proc) proc)) |
---|
1865 | (memory-statistics (lambda () vector)) |
---|
1866 | (on-exit (lambda (thunk) undefined)) |
---|
1867 | (open-input-string (lambda (string) string-input-port)) |
---|
1868 | (open-output-string (lambda () string-output-port)) |
---|
1869 | (ormap (lambda (pred list \.\.\.) bool)) |
---|
1870 | (port-name (lambda (port) name)) |
---|
1871 | (port-position (lambda (port) n)) |
---|
1872 | (port? (lambda (obj) bool)) |
---|
1873 | (print (lambda (obj \.\.\.) undefined)) |
---|
1874 | (print* (lambda (obj \.\.\.) undefined)) |
---|
1875 | (print-backtrace (lambda (:optional n) undefined)) |
---|
1876 | (print-call-chain (lambda (:optional n) undefined)) |
---|
1877 | (print-error-message (lambda (err args \.\.\.) undefined)) |
---|
1878 | (procedure-information (lambda (proc))) |
---|
1879 | (program-name (lambda (:optional name) name)) |
---|
1880 | (provide (lambda (name))) |
---|
1881 | (provided? (lambda (name) bool)) |
---|
1882 | (rational? (lambda (obj) bool)) |
---|
1883 | (read-byte (lambda (:optional input-port) n)) |
---|
1884 | (register-feature! (lambda (name) undefined)) |
---|
1885 | (rename-file (lambda (old-name new-name) undefined)) |
---|
1886 | (repl (lambda () undefined)) |
---|
1887 | (repository-path (lambda (:optional dirname) dirname)) |
---|
1888 | (require (lambda (sym \.\.\.) undefined)) |
---|
1889 | (reset (lambda () undefined)) |
---|
1890 | (reset-handler (lambda (:optional proc) proc)) |
---|
1891 | (return-to-host (lambda () undefined)) |
---|
1892 | (reverse-list->string (lambda (list) string)) |
---|
1893 | (set-dynamic-load-mode! (lambda (obj) undefined)) |
---|
1894 | (set-extension-specifier! (lambda (name proc) undefined)) |
---|
1895 | (set-finalizer! (lambda (obj proc) undefined)) |
---|
1896 | (set-gc-report! (lambda (bool) undefined)) |
---|
1897 | (set-parameterized-read-syntax! (lambda (ch proc) undefined)) |
---|
1898 | (set-port-name! (lambda (port name) undefined)) |
---|
1899 | (set-read-syntax! (lambda (ch proc) undefined)) |
---|
1900 | (set-sharp-read-syntax! (lambda (ch proc) undefined)) |
---|
1901 | (setter (lambda (proc) proc)) |
---|
1902 | (signal (lambda (n) undefined)) |
---|
1903 | (signum (lambda (x1) x2)) |
---|
1904 | (singlestep (lambda (thunk))) |
---|
1905 | (software-type (lambda () sym)) |
---|
1906 | (software-version (lambda () sym)) |
---|
1907 | (string->blob (lambda (string) blob)) |
---|
1908 | (string->keyword (lambda (string) sym)) |
---|
1909 | (string->uninterned-symbol (lambda (string) sym)) |
---|
1910 | (string-copy (lambda (string) string)) |
---|
1911 | (sub1 (lambda (z1) z2)) |
---|
1912 | (syntax-error (lambda (args \.\.\.) undefined)) |
---|
1913 | (system (lambda (str) n)) |
---|
1914 | (test-feature? (lambda (obj) bool)) |
---|
1915 | (undefine-macro! (lambda (sym) undefined)) |
---|
1916 | (unregister-feature! (lambda (sym) undefined)) |
---|
1917 | (use (special symbol scheme-chicken-available-modules) |
---|
1918 | "import extensions into top-level namespace") |
---|
1919 | (vector-copy! (lambda (from-vector to-vector :optional start) undefined)) |
---|
1920 | (vector-resize (lambda (vec n :optional init))) |
---|
1921 | (void (lambda () undefined)) |
---|
1922 | (warning (lambda (msg-str args \.\.\.) undefined)) |
---|
1923 | (with-exception-handler (lambda (handler thunk))) |
---|
1924 | (write-byte (lambda (n :optional output-port) undefined)) |
---|
1925 | ) |
---|
1926 | (gauche |
---|
1927 | (E2BIG integer) |
---|
1928 | (EACCES integer) |
---|
1929 | (EADDRINUSE integer) |
---|
1930 | (EADDRNOTAVAIL integer) |
---|
1931 | (EADV integer) |
---|
1932 | (EAFNOSUPPORT integer) |
---|
1933 | (EAGAIN integer) |
---|
1934 | (EALREADY integer) |
---|
1935 | (EBADE integer) |
---|
1936 | (EBADF integer) |
---|
1937 | (EBADFD integer) |
---|
1938 | (EBADMSG integer) |
---|
1939 | (EBADR integer) |
---|
1940 | (EBADRQC integer) |
---|
1941 | (EBADSLT integer) |
---|
1942 | (EBFONT integer) |
---|
1943 | (EBUSY integer) |
---|
1944 | (ECANCELED integer) |
---|
1945 | (ECHILD integer) |
---|
1946 | (ECHRNG integer) |
---|
1947 | (ECOMM integer) |
---|
1948 | (ECONNABORTED integer) |
---|
1949 | (ECONNREFUSED integer) |
---|
1950 | (ECONNRESET integer) |
---|
1951 | (EDEADLK integer) |
---|
1952 | (EDEADLOCK integer) |
---|
1953 | (EDESTADDRREQ integer) |
---|
1954 | (EDOM integer) |
---|
1955 | (EDOTDOT integer) |
---|
1956 | (EDQUOT integer) |
---|
1957 | (EEXIST integer) |
---|
1958 | (EFAULT integer) |
---|
1959 | (EFBIG integer) |
---|
1960 | (EHOSTDOWN integer) |
---|
1961 | (EHOSTUNREACH integer) |
---|
1962 | (EIDRM integer) |
---|
1963 | (EILSEQ integer) |
---|
1964 | (EINPROGRESS integer) |
---|
1965 | (EINTR integer) |
---|
1966 | (EINVAL integer) |
---|
1967 | (EIO integer) |
---|
1968 | (EISCONN integer) |
---|
1969 | (EISDIR integer) |
---|
1970 | (EISNAM integer) |
---|
1971 | (EKEYEXPIRED integer) |
---|
1972 | (EKEYREJECTED integer) |
---|
1973 | (EKEYREVOKED integer) |
---|
1974 | (EL2HLT integer) |
---|
1975 | (EL2NSYNC integer) |
---|
1976 | (EL3HLT integer) |
---|
1977 | (EL3RST integer) |
---|
1978 | (ELIBACC integer) |
---|
1979 | (ELIBBAD integer) |
---|
1980 | (ELIBEXEC integer) |
---|
1981 | (ELIBMAX integer) |
---|
1982 | (ELIBSCN integer) |
---|
1983 | (ELNRNG integer) |
---|
1984 | (ELOOP integer) |
---|
1985 | (EMEDIUMTYPE integer) |
---|
1986 | (EMFILE integer) |
---|
1987 | (EMLINK integer) |
---|
1988 | (EMSGSIZE integer) |
---|
1989 | (EMULTIHOP integer) |
---|
1990 | (ENAMETOOLONG integer) |
---|
1991 | (ENAVAIL integer) |
---|
1992 | (ENETDOWN integer) |
---|
1993 | (ENETRESET integer) |
---|
1994 | (ENETUNREACH integer) |
---|
1995 | (ENFILE integer) |
---|
1996 | (ENOANO integer) |
---|
1997 | (ENOBUFS integer) |
---|
1998 | (ENOCSI integer) |
---|
1999 | (ENODATA integer) |
---|
2000 | (ENODEV integer) |
---|
2001 | (ENOENT integer) |
---|
2002 | (ENOEXEC integer) |
---|
2003 | (ENOKEY integer) |
---|
2004 | (ENOLCK integer) |
---|
2005 | (ENOLINK integer) |
---|
2006 | (ENOMEDIUM integer) |
---|
2007 | (ENOMEM integer) |
---|
2008 | (ENOMSG integer) |
---|
2009 | (ENONET integer) |
---|
2010 | (ENOPKG integer) |
---|
2011 | (ENOPROTOOPT integer) |
---|
2012 | (ENOSPC integer) |
---|
2013 | (ENOSR integer) |
---|
2014 | (ENOSTR integer) |
---|
2015 | (ENOSYS integer) |
---|
2016 | (ENOTBLK integer) |
---|
2017 | (ENOTCONN integer) |
---|
2018 | (ENOTDIR integer) |
---|
2019 | (ENOTEMPTY integer) |
---|
2020 | (ENOTNAM integer) |
---|
2021 | (ENOTSOCK integer) |
---|
2022 | (ENOTTY integer) |
---|
2023 | (ENOTUNIQ integer) |
---|
2024 | (ENXIO integer) |
---|
2025 | (EOPNOTSUPP integer) |
---|
2026 | (EOVERFLOW integer) |
---|
2027 | (EPERM integer) |
---|
2028 | (EPFNOSUPPORT integer) |
---|
2029 | (EPIPE integer) |
---|
2030 | (EPROTO integer) |
---|
2031 | (EPROTONOSUPPORT integer) |
---|
2032 | (EPROTOTYPE integer) |
---|
2033 | (ERANGE integer) |
---|
2034 | (EREMCHG integer) |
---|
2035 | (EREMOTE integer) |
---|
2036 | (EREMOTEIO integer) |
---|
2037 | (ERESTART integer) |
---|
2038 | (EROFS integer) |
---|
2039 | (ESHUTDOWN integer) |
---|
2040 | (ESOCKTNOSUPPORT integer) |
---|
2041 | (ESPIPE integer) |
---|
2042 | (ESRCH integer) |
---|
2043 | (ESRMNT integer) |
---|
2044 | (ESTALE integer) |
---|
2045 | (ESTRPIPE integer) |
---|
2046 | (ETIME integer) |
---|
2047 | (ETIMEDOUT integer) |
---|
2048 | (ETOOMANYREFS integer) |
---|
2049 | (ETXTBSY integer) |
---|
2050 | (EUCLEAN integer) |
---|
2051 | (EUNATCH integer) |
---|
2052 | (EUSERS integer) |
---|
2053 | (EWOULDBLOCK integer) |
---|
2054 | (EXDEV integer) |
---|
2055 | (EXFULL integer) |
---|
2056 | (F_OK integer) |
---|
2057 | (LC_ALL integer) |
---|
2058 | (LC_COLLATE integer) |
---|
2059 | (LC_CTYPE integer) |
---|
2060 | (LC_MONETARY integer) |
---|
2061 | (LC_NUMERIC integer) |
---|
2062 | (LC_TIME integer) |
---|
2063 | (RAND_MAX integer) |
---|
2064 | (R_OK integer) |
---|
2065 | (SEEK_CUR integer) |
---|
2066 | (SEEK_END integer) |
---|
2067 | (SEEK_SET integer) |
---|
2068 | (SIGABRT integer) |
---|
2069 | (SIGALRM integer) |
---|
2070 | (SIGBUS integer) |
---|
2071 | (SIGCHLD integer) |
---|
2072 | (SIGCONT integer) |
---|
2073 | (SIGFPE integer) |
---|
2074 | (SIGHUP integer) |
---|
2075 | (SIGILL integer) |
---|
2076 | (SIGINT integer) |
---|
2077 | (SIGIO integer) |
---|
2078 | (SIGIOT integer) |
---|
2079 | (SIGKILL integer) |
---|
2080 | (SIGPIPE integer) |
---|
2081 | (SIGPOLL integer) |
---|
2082 | (SIGPROF integer) |
---|
2083 | (SIGPWR integer) |
---|
2084 | (SIGQUIT integer) |
---|
2085 | (SIGSEGV integer) |
---|
2086 | (SIGSTKFLT integer) |
---|
2087 | (SIGSTOP integer) |
---|
2088 | (SIGTERM integer) |
---|
2089 | (SIGTRAP integer) |
---|
2090 | (SIGTSTP integer) |
---|
2091 | (SIGTTIN integer) |
---|
2092 | (SIGTTOU integer) |
---|
2093 | (SIGURG integer) |
---|
2094 | (SIGUSR1 integer) |
---|
2095 | (SIGUSR2 integer) |
---|
2096 | (SIGVTALRM integer) |
---|
2097 | (SIGWINCH integer) |
---|
2098 | (SIGXCPU integer) |
---|
2099 | (SIGXFSZ integer) |
---|
2100 | (SIG_BLOCK integer) |
---|
2101 | (SIG_SETMASK integer) |
---|
2102 | (SIG_UNBLOCK integer) |
---|
2103 | (W_OK integer) |
---|
2104 | (X_OK integer) |
---|
2105 | (acons (lambda (key value alist) alist)) |
---|
2106 | (acosh (lambda (z) z)) |
---|
2107 | (add-load-path (lambda (path) undefined)) |
---|
2108 | (add-method! (lambda (generic method) undefined)) |
---|
2109 | (all-modules (lambda () list)) |
---|
2110 | (allocate-instance (lambda (class list))) |
---|
2111 | (and-let* (syntax)) |
---|
2112 | (any (lambda (pred list))) |
---|
2113 | (any$ (lambda (pred) proc)) |
---|
2114 | (any-pred (lambda (pred \.\.\.) pred)) |
---|
2115 | (append! (lambda (list \.\.\.) list)) |
---|
2116 | (apply$ (lambda (proc) proc)) |
---|
2117 | (apply-generic (lambda (generic list))) |
---|
2118 | (apply-method (lambda (method list))) |
---|
2119 | (apply-methods (lambda (generic list list))) |
---|
2120 | (arity (lambda (proc) n)) |
---|
2121 | (arity-at-least-value (lambda (n))) |
---|
2122 | (arity-at-least? (lambda (proc) bool)) |
---|
2123 | (ash (lambda (n i) n)) |
---|
2124 | (asinh (lambda (z) z)) |
---|
2125 | (assoc$ (lambda (obj) proc)) |
---|
2126 | (atanh (lambda (z) z)) |
---|
2127 | (autoload (syntax)) |
---|
2128 | (begin0 (syntax)) |
---|
2129 | (bignum? (lambda (obj) bool)) |
---|
2130 | (bit-field (lambda (n start end) n)) |
---|
2131 | (byte-ready? (lambda (:optional input-port) bool)) |
---|
2132 | (call-with-input-string (lambda (str proc))) |
---|
2133 | (call-with-output-string (lambda (proc) str)) |
---|
2134 | (call-with-string-io (lambda (str proc) str)) |
---|
2135 | (case-lambda (syntax)) |
---|
2136 | (change-class (lambda (obj new-class))) |
---|
2137 | (change-object-class (lambda (obj orig-class new-class))) |
---|
2138 | (char->ucs (lambda (ch) int)) |
---|
2139 | (char-set (lambda (ch \.\.\.) char-set)) |
---|
2140 | (char-set-contains? (lambda (char-set ch) bool)) |
---|
2141 | (char-set-copy (lambda (char-set) char-set)) |
---|
2142 | (char-set? (lambda (obj) bool)) |
---|
2143 | (check-arg (syntax)) |
---|
2144 | (circular-list? (lambda (obj) bool)) |
---|
2145 | (clamp (lambda (x1 :optional min-x max-x) x2)) |
---|
2146 | (class-direct-methods (lambda (class) list)) |
---|
2147 | (class-direct-slots (lambda (class) list)) |
---|
2148 | (class-direct-subclasses (lambda (class) list)) |
---|
2149 | (class-direct-supers (lambda (class) list)) |
---|
2150 | (class-name (lambda (class) sym)) |
---|
2151 | (class-of (lambda (obj) class)) |
---|
2152 | (class-precedence-list (lambda (class) list)) |
---|
2153 | (class-slot-accessor (lambda (class id) proc)) |
---|
2154 | (class-slot-bound? (lambda (class id) bool)) |
---|
2155 | (class-slot-definition (lambda (class id))) |
---|
2156 | (class-slot-ref (lambda (class slot))) |
---|
2157 | (class-slot-set! (lambda (class slot val) undefined)) |
---|
2158 | (class-slots (lambda (class) list)) |
---|
2159 | (closure-code (lambda (proc))) |
---|
2160 | (closure? (lambda (obj) bool)) |
---|
2161 | (compare (lambda (obj1 obj2) n)) |
---|
2162 | (complement (lambda (proc) proc)) |
---|
2163 | (compose (lambda (proc \.\.\.) proc)) |
---|
2164 | (compute-applicable-methods (lambda (generic list))) |
---|
2165 | (compute-cpl (lambda (generic list))) |
---|
2166 | (compute-get-n-set (lambda (class slot))) |
---|
2167 | (compute-slot-accessor (lambda (class slot))) |
---|
2168 | (compute-slots (lambda (class))) |
---|
2169 | (cond-expand (syntax)) |
---|
2170 | (condition (syntax)) |
---|
2171 | (condition-has-type? (lambda (condition obj))) |
---|
2172 | (condition-ref (lambda (condition id))) |
---|
2173 | (condition-type? (lambda (obj) bool)) |
---|
2174 | (condition? (lambda (obj) bool)) |
---|
2175 | (copy-bit (lambda (index n i) n)) |
---|
2176 | (copy-bit-field (lambda (n start end from) n)) |
---|
2177 | (copy-port (lambda (from-port to-port :optional unit-sym) undefined)) |
---|
2178 | (cosh (lambda (z) z)) |
---|
2179 | (count$ (lambda (pred) proc)) |
---|
2180 | (current-class-of (lambda (obj) class)) |
---|
2181 | (current-error-port (lambda () output-port)) |
---|
2182 | (current-exception-handler (lambda () handler)) |
---|
2183 | (current-load-history (lambda () list)) |
---|
2184 | (current-load-next (lambda () list)) |
---|
2185 | (current-load-port (lambda () port)) |
---|
2186 | (current-module (lambda () env)) |
---|
2187 | (current-thread (lambda () thread)) |
---|
2188 | (current-time (lambda () time)) |
---|
2189 | (cut (syntax)) |
---|
2190 | (cute (lambda (args \.\.\.) proc)) |
---|
2191 | (debug-print (lambda (obj))) |
---|
2192 | (debug-print-width (lambda () int)) |
---|
2193 | (debug-source-info (lambda (obj))) |
---|
2194 | (dec! (syntax)) |
---|
2195 | (decode-float (lambda (x1) vector)) |
---|
2196 | (define-class (syntax)) |
---|
2197 | (define-condition-type (syntax)) |
---|
2198 | (define-constant (syntax)) |
---|
2199 | (define-generic (syntax)) |
---|
2200 | (define-in-module (syntax)) |
---|
2201 | (define-inline (syntax)) |
---|
2202 | (define-macro (syntax)) |
---|
2203 | (define-method (syntax)) |
---|
2204 | (define-module (syntax)) |
---|
2205 | (define-reader-ctor (lambda (sym proc) undefined)) |
---|
2206 | (define-values (syntax)) |
---|
2207 | (delete$ (lambda (obj) proc)) |
---|
2208 | (delete-keyword (lambda (id list) list)) |
---|
2209 | (delete-keyword! (lambda (id list) list)) |
---|
2210 | (delete-method! (lambda (generic method) undefined)) |
---|
2211 | (digit->integer (lambda (ch) n)) |
---|
2212 | (disasm (lambda (proc) undefined)) |
---|
2213 | (dolist (syntax)) |
---|
2214 | (dotimes (syntax)) |
---|
2215 | (dotted-list? (lambda (obj) bool)) |
---|
2216 | (dynamic-load (lambda (file))) |
---|
2217 | (eager (lambda (obj))) |
---|
2218 | (eq-hash (lambda (obj))) |
---|
2219 | (eqv-hash (lambda (obj))) |
---|
2220 | (error (lambda (msg-string args \.\.\.))) |
---|
2221 | (errorf (lambda (fmt-string args \.\.\.))) |
---|
2222 | (eval-when (syntax)) |
---|
2223 | (every$ (lambda (pred) pred)) |
---|
2224 | (every-pred (lambda (pred \.\.\.) pred)) |
---|
2225 | (exit (lambda (:optional n) undefined)) |
---|
2226 | (export (syntax)) |
---|
2227 | (export-all (syntax)) |
---|
2228 | (export-if-defined (syntax)) |
---|
2229 | (extend (syntax)) |
---|
2230 | (extract-condition (lambda (condition type))) |
---|
2231 | (file-exists? (lambda (filename) bool)) |
---|
2232 | (file-is-directory? (lambda (filename) bool)) |
---|
2233 | (file-is-regular? (lambda (filename) bool)) |
---|
2234 | (filter$ (lambda (pred) proc)) |
---|
2235 | (find (lambda (pred list))) |
---|
2236 | (find$ (lambda (pred) proc)) |
---|
2237 | (find-module (lambda (id) env)) |
---|
2238 | (find-tail$ (lambda (pred) proc)) |
---|
2239 | (fixnum? (lambda (obj) bool)) |
---|
2240 | (flonum? (lambda (obj) bool)) |
---|
2241 | (fluid-let (syntax)) |
---|
2242 | (flush (lambda (:optional output-port) undefined)) |
---|
2243 | (flush-all-ports (lambda () undefined)) |
---|
2244 | (fmod (lambda (x1 x2) x3)) |
---|
2245 | (fold (lambda (proc init list))) |
---|
2246 | (fold$ (lambda (proc :optional init) proc)) |
---|
2247 | (fold-right (lambda (proc init list))) |
---|
2248 | (fold-right$ (lambda (proc :optional init))) |
---|
2249 | (for-each$ (lambda (proc) (lambda (ls) undefined))) |
---|
2250 | (foreign-pointer-attribute-get (lambda (ptr attr))) |
---|
2251 | (foreign-pointer-attribute-set (lambda (ptr attr val))) |
---|
2252 | (foreign-pointer-attributes (lambda (ptr) list)) |
---|
2253 | (format (lambda (fmt-string arg \.\.\.))) |
---|
2254 | (format/ss (lambda (fmt-string arg \.\.\.))) |
---|
2255 | (frexp (lambda (x1) x2)) |
---|
2256 | (gauche-architecture (lambda () string)) |
---|
2257 | (gauche-architecture-directory (lambda () string)) |
---|
2258 | (gauche-character-encoding (lambda () symbol)) |
---|
2259 | (gauche-dso-suffix (lambda () string)) |
---|
2260 | (gauche-library-directory (lambda () string)) |
---|
2261 | (gauche-site-architecture-directory (lambda () string)) |
---|
2262 | (gauche-site-library-directory (lambda () string)) |
---|
2263 | (gauche-version (lambda () string)) |
---|
2264 | (gc (lambda () undefined)) |
---|
2265 | (gc-stat (lambda () list)) |
---|
2266 | (gensym (lambda (:optional name) symbol)) |
---|
2267 | (get-keyword (lambda (id list :optional default))) |
---|
2268 | (get-keyword* (syntax)) |
---|
2269 | (get-optional (syntax)) |
---|
2270 | (get-output-string (lambda (string-output-port) string)) |
---|
2271 | (get-remaining-input-string (lambda (port) string)) |
---|
2272 | (get-signal-handler (lambda (n) proc)) |
---|
2273 | (get-signal-handler-mask (lambda (n) n)) |
---|
2274 | (get-signal-handlers (lambda () list)) |
---|
2275 | (get-signal-pending-limit (lambda () n)) |
---|
2276 | (getter-with-setter (lambda (get-proc set-proc) proc)) |
---|
2277 | (global-variable-bound? (lambda (sym) bool)) |
---|
2278 | (global-variable-ref (lambda (sym))) |
---|
2279 | (guard (syntax)) |
---|
2280 | (has-setter? (lambda (proc) bool)) |
---|
2281 | (hash (lambda (obj))) |
---|
2282 | (hash-table (lambda (id pair \.\.\.) hash-table)) |
---|
2283 | (hash-table-delete! (lambda (hash-table key) undefined)) |
---|
2284 | (hash-table-exists? (lambda (hash-table key) bool)) |
---|
2285 | (hash-table-fold (lambda (hash-table proc init))) |
---|
2286 | (hash-table-for-each (lambda (hash-table proc) undefined)) |
---|
2287 | (hash-table-get (lambda (hash-table key :optional default))) |
---|
2288 | (hash-table-keys (lambda (hash-table) list)) |
---|
2289 | (hash-table-map (lambda (hash-table proc) list)) |
---|
2290 | (hash-table-num-entries (lambda (hash-table) n)) |
---|
2291 | (hash-table-pop! (lambda (hash-table key :optional default))) |
---|
2292 | (hash-table-push! (lambda (hash-table key value) undefined)) |
---|
2293 | (hash-table-put! (lambda (hash-table key value) undefined)) |
---|
2294 | (hash-table-stat (lambda (hash-table) list)) |
---|
2295 | (hash-table-type (lambda (hash-table) id)) |
---|
2296 | (hash-table-update! (lambda (hash-table key proc :optional default) undefined)) |
---|
2297 | (hash-table-values (lambda (hash-table) list)) |
---|
2298 | (hash-table? (lambda (obj) bool)) |
---|
2299 | (identifier->symbol (lambda (obj) sym)) |
---|
2300 | (identifier? (lambda (obj) bool)) |
---|
2301 | (identity (lambda (obj))) |
---|
2302 | (import (syntax)) |
---|
2303 | (inc! (syntax)) |
---|
2304 | (inexact-/ (lambda (x1 x2) x3)) |
---|
2305 | (initialize (lambda (obj))) |
---|
2306 | (instance-slot-ref (lambda (obj id))) |
---|
2307 | (instance-slot-set (lambda (obj id value))) |
---|
2308 | (integer->digit (lambda (n) ch)) |
---|
2309 | (integer-length (lambda (n) n)) |
---|
2310 | (is-a? (lambda (obj class) bool)) |
---|
2311 | (keyword->string (lambda (id) string)) |
---|
2312 | (keyword? (lambda (obj) bool)) |
---|
2313 | (last-pair (lambda (pair) pair)) |
---|
2314 | (lazy (syntax)) |
---|
2315 | (ldexp (lambda (x1 n) x2)) |
---|
2316 | (let-keywords* (syntax)) |
---|
2317 | (let-optionals* (syntax)) |
---|
2318 | (let/cc (syntax)) |
---|
2319 | (let1 (syntax)) |
---|
2320 | (library-exists? (lambda (filename) bool)) |
---|
2321 | (library-fold (lambda (string proc init))) |
---|
2322 | (library-for-each (lambda (string proc) undefined)) |
---|
2323 | (library-has-module? (lambda (filename id) bool)) |
---|
2324 | (library-map (lambda (string proc) list)) |
---|
2325 | (list* (lambda (obj \.\.\.) list)) |
---|
2326 | (list-copy (lambda (list) list)) |
---|
2327 | (logand (lambda (n \.\.\.) n)) |
---|
2328 | (logbit? (lambda (index n) bool)) |
---|
2329 | (logcount (lambda (n) n)) |
---|
2330 | (logior (lambda (n \.\.\.) n)) |
---|
2331 | (lognot (lambda (n) n)) |
---|
2332 | (logtest (lambda (n \.\.\.) bool)) |
---|
2333 | (logxor (lambda (n \.\.\.) n)) |
---|
2334 | (macroexpand (lambda (obj))) |
---|
2335 | (macroexpand-1 (lambda (obj))) |
---|
2336 | (make (lambda (class args \.\.\.))) |
---|
2337 | (make-byte-string (lambda (n :optional int) byte-string)) |
---|
2338 | (make-compound-condition (lambda (condition \.\.\.) condition)) |
---|
2339 | (make-condition (lambda (condition-type field+value \.\.\.) condition)) |
---|
2340 | (make-condition-type (lambda (id condition-type list) condition-type)) |
---|
2341 | (make-hash-table (lambda (:optional id) hash-table)) |
---|
2342 | (make-keyword (lambda (string) sym)) |
---|
2343 | (make-list (lambda (n :optional init) list)) |
---|
2344 | (make-module (lambda (id :optional if-exists-proc) env)) |
---|
2345 | (make-weak-vector (lambda (n) vector)) |
---|
2346 | (map$ (lambda (proc) proc)) |
---|
2347 | (member$ (lambda (obj) proc)) |
---|
2348 | (merge (lambda (list1 list2 proc) list)) |
---|
2349 | (merge! (lambda (list1 list2 proc) list)) |
---|
2350 | (method-more-specific? (lambda (method1 method2 list) bool)) |
---|
2351 | (min&max (lambda (x1 \.\.\.) (values x2 x3))) |
---|
2352 | (modf (lambda (x1) x2)) |
---|
2353 | (module-exports (lambda (env) list)) |
---|
2354 | (module-imports (lambda (env) list)) |
---|
2355 | (module-name (lambda (env) sym)) |
---|
2356 | (module-name->path (lambda (sym) string)) |
---|
2357 | (module-parents (lambda (env) list)) |
---|
2358 | (module-precedence-list (lambda (env) list)) |
---|
2359 | (module-table (lambda (env) hash-table)) |
---|
2360 | (module? (lambda (obj) bool)) |
---|
2361 | (null-list? (lambda (obj) bool)) |
---|
2362 | (object-* (lambda (z \.\.\.) z)) |
---|
2363 | (object-+ (lambda (z \.\.\.) z)) |
---|
2364 | (object-- (lambda (z \.\.\.) z)) |
---|
2365 | (object-/ (lambda (z \.\.\.) z)) |
---|
2366 | (object-apply (lambda (proc arg \.\.\.))) |
---|
2367 | (object-compare (lambda (obj1 obj2) n)) |
---|
2368 | (object-equal? (lambda (obj1 obj2) bool)) |
---|
2369 | (object-hash (lambda (obj) n)) |
---|
2370 | (open-coding-aware-port (lambda (input-port) input-port)) |
---|
2371 | (open-input-buffered-port (lambda ())) |
---|
2372 | (open-input-fd-port (lambda (fileno) input-port)) |
---|
2373 | (open-input-string (lambda (str) input-port)) |
---|
2374 | (open-output-buffered-port (lambda ())) |
---|
2375 | (open-output-fd-port (lambda (fileno) output-port)) |
---|
2376 | (open-output-string (lambda () string-output-port)) |
---|
2377 | (pa$ (lambda (proc arg \.\.\.) proc)) |
---|
2378 | (partition$ (lambda (pred) proc)) |
---|
2379 | (path->module-name (lambda (str) sym)) |
---|
2380 | (peek-byte (lambda (:optional input-port) n)) |
---|
2381 | (pop! (syntax (list))) |
---|
2382 | (port->byte-string (lambda (input-port) byte-string)) |
---|
2383 | (port->list (lambda (proc input-port) list)) |
---|
2384 | (port->sexp-list (lambda (port) list)) |
---|
2385 | (port->string (lambda (port) string)) |
---|
2386 | (port->string-list (lambda (port) list)) |
---|
2387 | (port-buffering (lambda (port) sym)) |
---|
2388 | (port-closed? (lambda (port) bool)) |
---|
2389 | (port-current-line (lambda (port) n)) |
---|
2390 | (port-file-number (lambda (port) n)) |
---|
2391 | (port-fold (lambda (proc init port))) |
---|
2392 | (port-fold-right (lambda (proc init port))) |
---|
2393 | (port-for-each (lambda (proc read-proc) undefined)) |
---|
2394 | (port-map (lambda (proc read-proc))) |
---|
2395 | (port-name (lambda (port) name)) |
---|
2396 | (port-position-prefix (lambda ())) |
---|
2397 | (port-seek (lambda (port offset (set int SEEK_SET SEEK_CUR SEEK_END)))) |
---|
2398 | (port-tell (lambda (port) n)) |
---|
2399 | (port-type (lambda (port) sym)) |
---|
2400 | (print (lambda (obj \.\.\.))) |
---|
2401 | (procedure-arity-includes? (lambda (proc n) bool)) |
---|
2402 | (procedure-info (lambda (proc))) |
---|
2403 | (profiler-reset (lambda () undefined)) |
---|
2404 | (profiler-show (lambda () undefined)) |
---|
2405 | (profiler-show-load-stats (lambda () undefined)) |
---|
2406 | (profiler-start (lambda () undefined)) |
---|
2407 | (profiler-stop (lambda () undefined)) |
---|
2408 | (program (syntax)) |
---|
2409 | (promise-kind (lambda ())) |
---|
2410 | (promise? (lambda (obj) bool)) |
---|
2411 | (proper-list? (lambda (obj) bool)) |
---|
2412 | (provide (lambda (str) undefined)) |
---|
2413 | (provided? (lambda (str) bool)) |
---|
2414 | (push! (syntax)) |
---|
2415 | (quotient&remainder (lambda (n1 n2) (values n1 n2))) |
---|
2416 | (raise (lambda (exn) undefined)) |
---|
2417 | (read-block (lambda (n :optional input-port) string)) |
---|
2418 | (read-byte (lambda (:optional input-port) n)) |
---|
2419 | (read-eval-print-loop (lambda () undefined)) |
---|
2420 | (read-from-string (lambda (str))) |
---|
2421 | (read-line (lambda (:optional input-port) str)) |
---|
2422 | (read-list (lambda (ch :optional input-port))) |
---|
2423 | (read-reference-has-value? (lambda ())) |
---|
2424 | (read-reference-value (lambda ())) |
---|
2425 | (read-reference? (lambda ())) |
---|
2426 | (read-with-shared-structure (lambda (:optional input-port))) |
---|
2427 | (read/ss (lambda (:optional input-port))) |
---|
2428 | (rec (syntax)) |
---|
2429 | (receive (syntax)) |
---|
2430 | (redefine-class! (lambda ())) |
---|
2431 | (reduce$ (lambda (proc :optional default) proc)) |
---|
2432 | (reduce-right$ (lambda (proc :optional default) proc)) |
---|
2433 | (ref (lambda (obj key \.\.\.))) |
---|
2434 | (ref* (lambda (obj key \.\.\.))) |
---|
2435 | (regexp->string (lambda (regexp) string)) |
---|
2436 | (regexp-case-fold? (lambda (regexp) bool)) |
---|
2437 | (regexp-compile (lambda (str) regexp)) |
---|
2438 | (regexp-optimize (lambda (str) str)) |
---|
2439 | (regexp-parse (lambda (str) list)) |
---|
2440 | (regexp-quote (lambda (str) str)) |
---|
2441 | (regexp-replace (lambda (regexp string subst) string)) |
---|
2442 | (regexp-replace* (lambda (string regexp subst \.\.\.) string)) |
---|
2443 | (regexp-replace-all (lambda (regexp string subst) string)) |
---|
2444 | (regexp-replace-all* (lambda (string regexp subst \.\.\.))) |
---|
2445 | (regexp? (lambda (obj) bool)) |
---|
2446 | (regmatch? (lambda (obj) bool)) |
---|
2447 | (remove$ (lambda (pred) proc)) |
---|
2448 | (report-error (lambda ())) |
---|
2449 | (require (syntax)) |
---|
2450 | (require-extension (syntax)) |
---|
2451 | (reverse! (lambda (list) list)) |
---|
2452 | (rxmatch (lambda (regexp string) regmatch)) |
---|
2453 | (rxmatch-after (lambda (regmatch :optional i) str)) |
---|
2454 | (rxmatch-before (lambda (regmatch :optional i) str)) |
---|
2455 | (rxmatch-case (syntax)) |
---|
2456 | (rxmatch-cond (syntax)) |
---|
2457 | (rxmatch-end (lambda (regmatch :optional i) n)) |
---|
2458 | (rxmatch-if (syntax)) |
---|
2459 | (rxmatch-let (syntax)) |
---|
2460 | (rxmatch-num-matches (lambda (regmatch) i)) |
---|
2461 | (rxmatch-start (lambda (regmatch :optional i) n)) |
---|
2462 | (rxmatch-substring (lambda (regmatch :optional i) str)) |
---|
2463 | (seconds->time (lambda (x1) time)) |
---|
2464 | (select-module (syntax)) |
---|
2465 | (set!-values (syntax)) |
---|
2466 | (set-signal-handler! (lambda (signals handler) undefined)) |
---|
2467 | (set-signal-pending-limit (lambda (n) undefined)) |
---|
2468 | (setter (lambda (proc) proc)) |
---|
2469 | (sinh (lambda (z) z)) |
---|
2470 | (slot-bound-using-accessor? (lambda (proc obj id) bool)) |
---|
2471 | (slot-bound-using-class? (lambda (class obj id) bool)) |
---|
2472 | (slot-bound? (lambda (obj id) bool)) |
---|
2473 | (slot-definition-accessor (lambda ())) |
---|
2474 | (slot-definition-allocation (lambda ())) |
---|
2475 | (slot-definition-getter (lambda ())) |
---|
2476 | (slot-definition-name (lambda ())) |
---|
2477 | (slot-definition-option (lambda ())) |
---|
2478 | (slot-definition-options (lambda ())) |
---|
2479 | (slot-definition-setter (lambda ())) |
---|
2480 | (slot-exists-using-class? (lambda (class obj id) bool)) |
---|
2481 | (slot-exists? (lambda (obj id) bool)) |
---|
2482 | (slot-initialize-using-accessor! (lambda ())) |
---|
2483 | (slot-missing (lambda (class obj id))) |
---|
2484 | (slot-push! (lambda (obj id value) undefined)) |
---|
2485 | (slot-ref (lambda (obj id))) |
---|
2486 | (slot-ref-using-accessor (lambda (proc obj id))) |
---|
2487 | (slot-ref-using-class (lambda (class obj id))) |
---|
2488 | (slot-set! (lambda (obj id value) undefined)) |
---|
2489 | (slot-set-using-accessor! (lambda (proc obj id value) undefined)) |
---|
2490 | (slot-set-using-class! (lambda (class obj id value) undefined)) |
---|
2491 | (slot-unbound (lambda (class obj id))) |
---|
2492 | (sort (lambda (seq :optional proc))) |
---|
2493 | (sort! (lambda (seq :optional proc))) |
---|
2494 | (sort-applicable-methods (lambda ())) |
---|
2495 | (sorted? (lambda (seq :optional proc))) |
---|
2496 | (split-at (lambda (list i) (values list list))) |
---|
2497 | (stable-sort (lambda (seq :optional proc))) |
---|
2498 | (stable-sort! (lambda (seq :optional proc))) |
---|
2499 | (standard-error-port (lambda () output-port)) |
---|
2500 | (standard-input-port (lambda () input-port)) |
---|
2501 | (standard-output-port (lambda () output-port)) |
---|
2502 | (string->regexp (lambda (str) regexp)) |
---|
2503 | (string-byte-ref (lambda (str i) n)) |
---|
2504 | (string-byte-set! (lambda (str i n) undefined)) |
---|
2505 | (string-complete->incomplete (lambda (str) str)) |
---|
2506 | (string-immutable? (lambda (str) bool)) |
---|
2507 | (string-incomplete->complete (lambda (str) str)) |
---|
2508 | (string-incomplete->complete! (lambda (str) str)) |
---|
2509 | (string-incomplete? (lambda (str) bool)) |
---|
2510 | (string-interpolate (lambda (str) list)) |
---|
2511 | (string-join (lambda (list :optional delim-str (set grammar infix strict-infix prefix suffix)))) |
---|
2512 | ;; deprecated |
---|
2513 | ;; (string-pointer-byte-index (lambda ())) |
---|
2514 | ;; (string-pointer-copy (lambda ())) |
---|
2515 | ;; (string-pointer-index (lambda ())) |
---|
2516 | ;; (string-pointer-next! (lambda ())) |
---|
2517 | ;; (string-pointer-prev! (lambda ())) |
---|
2518 | ;; (string-pointer-ref (lambda ())) |
---|
2519 | ;; (string-pointer-set! (lambda ())) |
---|
2520 | ;; (string-pointer-substring (lambda ())) |
---|
2521 | ;; (string-pointer? (lambda ())) |
---|
2522 | (string-scan (lambda (string item :optional (set return index before after before* after* both)))) |
---|
2523 | (string-size (lambda (str) n)) |
---|
2524 | (string-split (lambda (str splitter) list)) |
---|
2525 | (string-substitute! (lambda ())) |
---|
2526 | (subr? (lambda (obj) bool)) |
---|
2527 | (supported-character-encoding? (lambda (id) bool)) |
---|
2528 | (supported-character-encodings (lambda () list)) |
---|
2529 | (symbol-bound? (lambda (id) bool)) |
---|
2530 | (syntax-error (syntax)) |
---|
2531 | (syntax-errorf (syntax)) |
---|
2532 | (sys-abort (lambda () undefined)) |
---|
2533 | (sys-access (lambda (filename (flags amode R_OK W_OK X_OK F_OK)))) |
---|
2534 | (sys-alarm (lambda (x1) x2)) |
---|
2535 | (sys-asctime (lambda (time) str)) |
---|
2536 | (sys-basename (lambda (filename) str)) |
---|
2537 | (sys-chdir (lambda (dirname))) |
---|
2538 | (sys-chmod (lambda (filename n))) |
---|
2539 | (sys-chown (lambda (filename uid gid))) |
---|
2540 | (sys-close (lambda (fileno))) |
---|
2541 | (sys-crypt (lambda (key-str salt-str) str)) |
---|
2542 | (sys-ctermid (lambda () string)) |
---|
2543 | (sys-ctime (lambda (time) string)) |
---|
2544 | (sys-difftime (lambda (time1 time2) x1)) |
---|
2545 | (sys-dirname (lambda (filename) string)) |
---|
2546 | (sys-exec (lambda (command-string list) n)) |
---|
2547 | (sys-exit (lambda (n) undefined)) |
---|
2548 | (sys-fchmod (lambda (port-or-fileno n))) |
---|
2549 | (sys-fdset-max-fd (lambda (fdset))) |
---|
2550 | (sys-fdset-ref (lambda (fdset port-or-fileno))) |
---|
2551 | (sys-fdset-set! (lambda (fdset port-or-fileno))) |
---|
2552 | (sys-fork (lambda () n)) |
---|
2553 | (sys-fork-and-exec (lambda (command-string list) n)) |
---|
2554 | (sys-fstat (lambda (port-or-fileno) sys-stat)) |
---|
2555 | (sys-ftruncate (lambda (port-or-fileno n))) |
---|
2556 | (sys-getcwd (lambda () string)) |
---|
2557 | (sys-getdomainname (lambda () string)) |
---|
2558 | (sys-getegid (lambda () gid)) |
---|
2559 | (sys-getenv (lambda (name) string)) |
---|
2560 | (sys-geteuid (lambda () uid)) |
---|
2561 | (sys-getgid (lambda () gid)) |
---|
2562 | (sys-getgrgid (lambda () gid)) |
---|
2563 | (sys-getgrnam (lambda (name))) |
---|
2564 | (sys-getgroups (lambda () list)) |
---|
2565 | (sys-gethostname (lambda () string)) |
---|
2566 | (sys-getloadavg (lambda () list)) |
---|
2567 | (sys-getlogin (lambda () string)) |
---|
2568 | (sys-getpgid (lambda () gid)) |
---|
2569 | (sys-getpgrp (lambda () gid)) |
---|
2570 | (sys-getpid (lambda () pid)) |
---|
2571 | (sys-getppid (lambda () pid)) |
---|
2572 | (sys-getpwnam (lambda (name))) |
---|
2573 | (sys-getpwuid (lambda () uid)) |
---|
2574 | (sys-gettimeofday (lambda () (values x1 x2))) |
---|
2575 | (sys-getuid (lambda () uid)) |
---|
2576 | (sys-gid->group-name (lambda (gid) name)) |
---|
2577 | (sys-glob (lambda (string) list)) |
---|
2578 | (sys-gmtime (lambda (time) string)) |
---|
2579 | (sys-group-name->gid (lambda (name) gid)) |
---|
2580 | (sys-isatty (lambda (port-or-fileno) bool)) |
---|
2581 | (sys-kill (lambda (pid))) |
---|
2582 | (sys-lchown (lambda (filename uid gid))) |
---|
2583 | (sys-link (lambda (old-filename new-filename))) |
---|
2584 | (sys-localeconv (lambda () alist)) |
---|
2585 | (sys-localtime (lambda (time) string)) |
---|
2586 | (sys-lstat (lambda (filename) sys-stat)) |
---|
2587 | (sys-mkdir (lambda (dirname))) |
---|
2588 | (sys-mkfifo (lambda (filename))) |
---|
2589 | (sys-mkstemp (lambda (filename))) |
---|
2590 | (sys-mktime (lambda (time) x1)) |
---|
2591 | (sys-nanosleep (lambda (x1))) |
---|
2592 | (sys-normalize-pathname (lambda (filename) string)) |
---|
2593 | (sys-pause (lambda (x1))) |
---|
2594 | (sys-pipe (lambda (:optional buffering) (values input-port output-port))) |
---|
2595 | (sys-putenv (lambda (name string))) |
---|
2596 | (sys-random (lambda () n)) |
---|
2597 | (sys-readdir (lambda (dirname) list)) |
---|
2598 | (sys-readlink (lambda (filename) string)) |
---|
2599 | (sys-realpath (lambda (filename) string)) |
---|
2600 | (sys-remove (lambda (filename))) |
---|
2601 | (sys-rename (lambda (old-filename new-filename))) |
---|
2602 | (sys-rmdir (lambda (dirname))) |
---|
2603 | (sys-select (lambda (read-filenos write-filenos execpt-filenos :optional timeout-x))) |
---|
2604 | (sys-select! (lambda (read-filenos write-filenos execpt-filenos :optional timeout-x))) |
---|
2605 | (sys-setenv (lambda (name string))) |
---|
2606 | (sys-setgid (lambda (gid))) |
---|
2607 | (sys-setlocale (lambda (locale-string))) |
---|
2608 | (sys-setpgid (lambda (gid))) |
---|
2609 | (sys-setsid (lambda ())) |
---|
2610 | (sys-setuid (lambda (uid))) |
---|
2611 | (sys-sigmask (lambda ((set how SIG_SETMASK SIG_BLOCK SIG_UNBLOCK) sigset))) |
---|
2612 | (sys-signal-name (lambda (n))) |
---|
2613 | (sys-sigset (lambda (n \.\.\.) sigset)) |
---|
2614 | (sys-sigset-add! (lambda (sigset n))) |
---|
2615 | (sys-sigset-delete! (lambda (sigset n))) |
---|
2616 | (sys-sigset-empty! (lambda (sigset))) |
---|
2617 | (sys-sigset-fill! (lambda (sigset))) |
---|
2618 | (sys-sigsuspend (lambda (sigset))) |
---|
2619 | (sys-sigwait (lambda (sigset))) |
---|
2620 | (sys-sleep (lambda (x1))) |
---|
2621 | (sys-srandom (lambda (n))) |
---|
2622 | (sys-stat (lambda (filename))) |
---|
2623 | ;; deprecated |
---|
2624 | ;; (sys-stat->atime (lambda ())) |
---|
2625 | ;; (sys-stat->ctime (lambda ())) |
---|
2626 | ;; (sys-stat->dev (lambda ())) |
---|
2627 | ;; (sys-stat->file-type (lambda ())) |
---|
2628 | ;; (sys-stat->gid (lambda ())) |
---|
2629 | ;; (sys-stat->ino (lambda ())) |
---|
2630 | ;; (sys-stat->mode (lambda ())) |
---|
2631 | ;; (sys-stat->mtime (lambda ())) |
---|
2632 | ;; (sys-stat->nlink (lambda ())) |
---|
2633 | ;; (sys-stat->rdev (lambda ())) |
---|
2634 | ;; (sys-stat->size (lambda ())) |
---|
2635 | ;; (sys-stat->type (lambda ())) |
---|
2636 | ;; (sys-stat->uid (lambda ())) |
---|
2637 | (sys-strerror (lambda (errno) string)) |
---|
2638 | (sys-strftime (lambda (format-string time))) |
---|
2639 | (sys-symlink (lambda (old-filename new-filename))) |
---|
2640 | (sys-system (lambda (command) n)) |
---|
2641 | (sys-time (lambda () n)) |
---|
2642 | (sys-times (lambda () list)) |
---|
2643 | ;; (sys-tm->alist (lambda ())) |
---|
2644 | (sys-tmpnam (lambda () string)) |
---|
2645 | (sys-truncate (lambda (filename n))) |
---|
2646 | (sys-ttyname (lambda (port-or-fileno) string)) |
---|
2647 | (sys-uid->user-name (lambda (uid) name)) |
---|
2648 | (sys-umask (lambda () n)) |
---|
2649 | (sys-uname (lambda () string)) |
---|
2650 | (sys-unlink (lambda (filename))) |
---|
2651 | (sys-unsetenv (lambda (name))) |
---|
2652 | (sys-user-name->uid (lambda (name) uid)) |
---|
2653 | (sys-utime (lambda (filename))) |
---|
2654 | (sys-wait (lambda ())) |
---|
2655 | (sys-wait-exit-status (lambda (n) n)) |
---|
2656 | (sys-wait-exited? (lambda (n) bool)) |
---|
2657 | (sys-wait-signaled? (lambda (n) bool)) |
---|
2658 | (sys-wait-stopped? (lambda (n) bool)) |
---|
2659 | (sys-wait-stopsig (lambda (n) n)) |
---|
2660 | (sys-wait-termsig (lambda (n) n)) |
---|
2661 | (sys-waitpid (lambda (pid))) |
---|
2662 | (tanh (lambda (z) z)) |
---|
2663 | (time (syntax)) |
---|
2664 | (time->seconds (lambda (time) x1)) |
---|
2665 | (time? (lambda (obj) bool)) |
---|
2666 | (toplevel-closure? (lambda (obj) bool)) |
---|
2667 | (touch-instance! (lambda ())) |
---|
2668 | (ucs->char (lambda (n) ch)) |
---|
2669 | (undefined (lambda () undefined)) |
---|
2670 | (undefined? (lambda (obj) bool)) |
---|
2671 | (unless (syntax)) |
---|
2672 | (until (syntax)) |
---|
2673 | (unwrap-syntax (lambda (obj))) |
---|
2674 | (update! (syntax)) |
---|
2675 | (update-direct-method! (lambda ())) |
---|
2676 | (update-direct-subclass! (lambda ())) |
---|
2677 | (use (special symbol scheme-gauche-available-modules)) |
---|
2678 | (use-version (syntax)) |
---|
2679 | (values-ref (syntax)) |
---|
2680 | (vector-copy (lambda (vector :optional start end fill) vector)) |
---|
2681 | (vm-dump (lambda () undefined)) |
---|
2682 | (vm-get-stack-trace (lambda () undefined)) |
---|
2683 | (vm-get-stack-trace-lite (lambda () undefined)) |
---|
2684 | (vm-set-default-exception-handler (lambda (handler) undefined)) |
---|
2685 | (warn (lambda (message-str args) undefined)) |
---|
2686 | (weak-vector-length (lambda (vector) n)) |
---|
2687 | (weak-vector-ref (lambda (vector i))) |
---|
2688 | (weak-vector-set! (lambda (vector i value) undefined)) |
---|
2689 | (when (syntax)) |
---|
2690 | (while (syntax)) |
---|
2691 | (with-error-handler (lambda (handler thunk))) |
---|
2692 | (with-error-to-port (lambda (port thunk))) |
---|
2693 | (with-exception-handler (lambda (handler thunk))) |
---|
2694 | (with-input-from-port (lambda (port thunk))) |
---|
2695 | (with-input-from-string (lambda (string thunk))) |
---|
2696 | (with-module (syntax)) |
---|
2697 | (with-output-to-port (lambda (port thunk))) |
---|
2698 | (with-output-to-string (lambda (thunk) string)) |
---|
2699 | (with-port-locking (lambda (port thunk))) |
---|
2700 | (with-ports (lambda (input-port output-port error-port thunk))) |
---|
2701 | (with-signal-handlers (syntax)) |
---|
2702 | (with-string-io (lambda (string thunk) string)) |
---|
2703 | (write* (lambda (obj :optional output-port) undefined)) |
---|
2704 | (write-byte (lambda (n :optional output-port) undefined)) |
---|
2705 | (write-limited (lambda (obj :optional output-port))) |
---|
2706 | (write-object (lambda (obj output-port))) |
---|
2707 | (write-to-string (lambda (obj) string)) |
---|
2708 | (write-with-shared-structure (lambda (obj :optional output-port))) |
---|
2709 | (write/ss (lambda (obj :optional output-port))) |
---|
2710 | (x->integer (lambda (obj) integer)) |
---|
2711 | (x->number (lambda (obj) number)) |
---|
2712 | (x->string (lambda (obj) string)) |
---|
2713 | ))) |
---|
2714 | |
---|
2715 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
---|
2716 | ;; special lookups (XXXX add more impls, try to abstract better) |
---|
2717 | |
---|
2718 | (defvar *scheme-chicken-base-repo* |
---|
2719 | (or (getenv "CHICKEN_REPOSITORY") |
---|
2720 | (let ((dir |
---|
2721 | (car (remove-if-not #'file-directory-p |
---|
2722 | '("/usr/lib/chicken" |
---|
2723 | "/usr/local/lib/chicken" |
---|
2724 | "/opt/lib/chicken" |
---|
2725 | "/opt/local/lib/chicken"))))) |
---|
2726 | (and dir |
---|
2727 | (car (reverse (sort (directory-files dir t "^[0-9]+$") |
---|
2728 | #'string-lessp))))) |
---|
2729 | (and (fboundp 'shell-command-to-string) |
---|
2730 | (let* ((res (shell-command-to-string "chicken-setup -R")) |
---|
2731 | (res (substring res 0 (- (length res) 1)))) |
---|
2732 | (and res (file-directory-p res) res))) |
---|
2733 | "/usr/local/lib/chicken")) |
---|
2734 | |
---|
2735 | (defvar *scheme-chicken-repo-dirs* |
---|
2736 | (remove-if-not |
---|
2737 | #'(lambda (x) (and (stringp x) (not (equal x "")))) |
---|
2738 | (let ((home (getenv "CHICKEN_HOME"))) |
---|
2739 | (if (and home (not (equal home ""))) |
---|
2740 | (let ((res (split-string home ";"))) |
---|
2741 | (if (member *scheme-chicken-repo-dirs* res) |
---|
2742 | res |
---|
2743 | (cons *scheme-chicken-repo-dirs* res))) |
---|
2744 | (list *scheme-chicken-base-repo*))))) |
---|
2745 | |
---|
2746 | (defun scheme-chicken-available-modules (&optional sym) |
---|
2747 | (append |
---|
2748 | (mapcar #'symbol-name (mapcar #'car *scheme-chicken-modules*)) |
---|
2749 | (mapcar |
---|
2750 | #'file-name-sans-extension |
---|
2751 | (directory-files "." nil ".*\\.scm$" t)) |
---|
2752 | (scheme-append-map |
---|
2753 | #'(lambda (dir) |
---|
2754 | (mapcar |
---|
2755 | #'file-name-sans-extension |
---|
2756 | (directory-files dir nil ".*\\.\\(so\\|scm\\)$" t))) |
---|
2757 | *scheme-chicken-repo-dirs*))) |
---|
2758 | |
---|
2759 | (defvar *scheme-gauche-repo-path* |
---|
2760 | (or (car (remove-if-not #'file-directory-p |
---|
2761 | '("/usr/share/gauche" |
---|
2762 | "/usr/local/share/gauche" |
---|
2763 | "/opt/share/gauche" |
---|
2764 | "/opt/local/share/gauche"))) |
---|
2765 | (and (fboundp 'shell-command-to-string) |
---|
2766 | (let* ((res (shell-command-to-string "gauche-config --syslibdir")) |
---|
2767 | (res (substring res 0 (- (length res) 1)))) |
---|
2768 | (and res (file-directory-p res) |
---|
2769 | (let* ((dir (file-name-directory res)) |
---|
2770 | (dir2 (file-name-directory |
---|
2771 | (substring dir 0 (- (length dir) 1))))) |
---|
2772 | (substring dir2 0 (- (length dir2) 1)))))) |
---|
2773 | "/usr/local/share/gauche")) |
---|
2774 | |
---|
2775 | (defvar *scheme-gauche-site-repo-path* |
---|
2776 | (concat *scheme-gauche-repo-path* "/site/lib")) |
---|
2777 | |
---|
2778 | (defun scheme-gauche-available-modules (&optional sym) |
---|
2779 | (let ((version-dir |
---|
2780 | (concat |
---|
2781 | (car (directory-files *scheme-gauche-repo-path* t "^[0-9]")) |
---|
2782 | "/lib")) |
---|
2783 | (site-dir *scheme-gauche-site-repo-path*) |
---|
2784 | (other-dirs |
---|
2785 | (remove-if-not |
---|
2786 | #'(lambda (d) (and (not (equal d "")) (file-directory-p d))) |
---|
2787 | (split-string (or (getenv "GAUCHE_LOAD_PATH") "") ":")))) |
---|
2788 | (mapcar |
---|
2789 | #'(lambda (f) (subst-char-in-string ?/ ?. f)) |
---|
2790 | (mapcar |
---|
2791 | #'file-name-sans-extension |
---|
2792 | (scheme-append-map |
---|
2793 | #'(lambda (dir) |
---|
2794 | (let ((len (length dir))) |
---|
2795 | (mapcar #'(lambda (f) (substring f (+ 1 len))) |
---|
2796 | (scheme-directory-tree-files dir t "\\.scm")))) |
---|
2797 | (cons version-dir (cons site-dir other-dirs))))))) |
---|
2798 | |
---|
2799 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
---|
2800 | ;; utilities |
---|
2801 | |
---|
2802 | (defun scheme-append-map (proc init-ls) |
---|
2803 | (if (null init-ls) |
---|
2804 | '() |
---|
2805 | (let* ((ls (reverse init-ls)) |
---|
2806 | (res (funcall proc (pop ls)))) |
---|
2807 | (while (consp ls) |
---|
2808 | (setq res (append (funcall proc (pop ls)) res))) |
---|
2809 | res))) |
---|
2810 | |
---|
2811 | (defun scheme-flatten (ls) |
---|
2812 | (cond |
---|
2813 | ((consp ls) (cons (car ls) (scheme-flatten (cdr ls)))) |
---|
2814 | ((null ls) '()) |
---|
2815 | (t (list ls)))) |
---|
2816 | |
---|
2817 | (defun scheme-in-string-p () |
---|
2818 | (let ((orig (point))) |
---|
2819 | (save-excursion |
---|
2820 | (goto-char (point-min)) |
---|
2821 | (let ((parses (parse-partial-sexp (point) orig))) |
---|
2822 | (nth 3 parses))))) |
---|
2823 | |
---|
2824 | (defun scheme-beginning-of-sexp () |
---|
2825 | (let ((syn (char-syntax (char-before (point))))) |
---|
2826 | (if (or (eq syn ?\() |
---|
2827 | (and (eq syn ?\") (scheme-in-string-p))) |
---|
2828 | (forward-char -1) |
---|
2829 | (forward-sexp -1)))) |
---|
2830 | |
---|
2831 | (defun scheme-find-file-in-path (file path) |
---|
2832 | (car (remove-if-not |
---|
2833 | #'(lambda (dir) (file-exists-p (concat dir "/" file))) |
---|
2834 | path))) |
---|
2835 | |
---|
2836 | ;; visit a file and kill the buffer only if it wasn't already open |
---|
2837 | (defmacro scheme-with-find-file (path-expr &rest body) |
---|
2838 | (let ((path (gensym)) |
---|
2839 | (buf (gensym)) |
---|
2840 | (res (gensym))) |
---|
2841 | `(save-window-excursion |
---|
2842 | (let* ((,path (file-truename ,path-expr)) |
---|
2843 | (,buf (find-if #'(lambda (x) (equal ,path (buffer-file-name x))) |
---|
2844 | (buffer-list)))) |
---|
2845 | (if ,buf |
---|
2846 | (switch-to-buffer ,buf) |
---|
2847 | (switch-to-buffer (find-file-noselect ,path t t))) |
---|
2848 | (let ((,res (save-excursion ,@body))) |
---|
2849 | (unless ,buf (kill-buffer (current-buffer))) |
---|
2850 | ,res))))) |
---|
2851 | |
---|
2852 | (defun scheme-directory-tree-files (init-dir &optional full match) |
---|
2853 | (let ((res '()) |
---|
2854 | (stack (list init-dir))) |
---|
2855 | (while (consp stack) |
---|
2856 | (let* ((dir (pop stack)) |
---|
2857 | (files (cddr (directory-files dir full)))) |
---|
2858 | (setq res (append (if match |
---|
2859 | (remove-if-not |
---|
2860 | #'(lambda (f) (string-match match f)) |
---|
2861 | files) |
---|
2862 | files) |
---|
2863 | res)) |
---|
2864 | (setq stack |
---|
2865 | (append |
---|
2866 | (remove-if-not 'file-directory-p |
---|
2867 | (if full |
---|
2868 | files |
---|
2869 | (mapcar #'(lambda (f) (concat dir "/" f)) |
---|
2870 | files))) |
---|
2871 | stack)))) |
---|
2872 | res)) |
---|
2873 | |
---|
2874 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
---|
2875 | ;; sexp manipulation |
---|
2876 | |
---|
2877 | ;; returns current argument position within sexp |
---|
2878 | (defun scheme-beginning-of-current-sexp-operator () |
---|
2879 | (let ((pos 0)) |
---|
2880 | (skip-syntax-backward "w_") |
---|
2881 | (while (and (not (bobp)) (not (eq ?\( (char-before)))) |
---|
2882 | (scheme-beginning-of-sexp) |
---|
2883 | (incf pos)) |
---|
2884 | pos)) |
---|
2885 | |
---|
2886 | (defun scheme-beginning-of-next-sexp () |
---|
2887 | (forward-sexp 2) |
---|
2888 | (backward-sexp 1)) |
---|
2889 | |
---|
2890 | (defun scheme-beginning-of-string () |
---|
2891 | (interactive) |
---|
2892 | (search-backward "\"" nil t) |
---|
2893 | (while (and (> (point) (point-min)) (eq ?\\ (char-before))) |
---|
2894 | (search-backward "\"" nil t))) |
---|
2895 | |
---|
2896 | ;; for the enclosing sexp, returns a cons of the leading symbol (if |
---|
2897 | ;; any) and the current position within the sexp (starting at 0) |
---|
2898 | ;; (defun scheme-enclosing-sexp-prefix () |
---|
2899 | ;; (save-excursion |
---|
2900 | ;; (let ((pos (scheme-beginning-of-current-sexp-operator))) |
---|
2901 | ;; (cons (scheme-symbol-at-point) pos)))) |
---|
2902 | |
---|
2903 | (defun scheme-enclosing-2-sexp-prefixes () |
---|
2904 | (save-excursion |
---|
2905 | (let* ((pos1 (scheme-beginning-of-current-sexp-operator)) |
---|
2906 | (sym1 (scheme-symbol-at-point))) |
---|
2907 | (backward-char) |
---|
2908 | (or |
---|
2909 | (ignore-errors |
---|
2910 | (let ((pos2 (scheme-beginning-of-current-sexp-operator))) |
---|
2911 | (list sym1 pos1 (scheme-symbol-at-point) pos2))) |
---|
2912 | (list sym1 pos1 nil 0))))) |
---|
2913 | |
---|
2914 | ;; sexp-at-point is always fragile, both because the user can input |
---|
2915 | ;; incomplete sexps and because some scheme sexps are not valid elisp |
---|
2916 | ;; sexps. this is one of the few places we use it, so we're careful |
---|
2917 | ;; to wrap it in ignore-errors. |
---|
2918 | (defun scheme-nth-sexp-at-point (n) |
---|
2919 | (ignore-errors |
---|
2920 | (save-excursion |
---|
2921 | (forward-sexp (+ n 1)) |
---|
2922 | (let ((end (point))) |
---|
2923 | (forward-sexp -1) |
---|
2924 | (car (read-from-string (buffer-substring (point) end))))))) |
---|
2925 | |
---|
2926 | (defun scheme-symbol-at-point () |
---|
2927 | (save-excursion |
---|
2928 | (skip-syntax-backward "w_") |
---|
2929 | (let ((start (point))) |
---|
2930 | (skip-syntax-forward "w_") |
---|
2931 | (and (< start (point)) |
---|
2932 | (intern (buffer-substring start (point))))))) |
---|
2933 | |
---|
2934 | (defun scheme-goto-next-top-level () |
---|
2935 | (let ((here (point))) |
---|
2936 | (or (ignore-errors (end-of-defun) (end-of-defun) |
---|
2937 | (beginning-of-defun) |
---|
2938 | (< here (point))) |
---|
2939 | (progn (forward-char) (re-search-forward "^(" nil t)) |
---|
2940 | (goto-char (point-max))))) |
---|
2941 | |
---|
2942 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
---|
2943 | ;; variable extraction |
---|
2944 | |
---|
2945 | (defun scheme-sexp-type-at-point (&optional env) |
---|
2946 | (case (char-syntax (char-after)) |
---|
2947 | ((?\() |
---|
2948 | (forward-char 1) |
---|
2949 | (if (eq ?w (char-syntax (char-after))) |
---|
2950 | (let ((op (scheme-symbol-at-point))) |
---|
2951 | (cond |
---|
2952 | ((eq op 'lambda) |
---|
2953 | (let ((params |
---|
2954 | (scheme-nth-sexp-at-point 1))) |
---|
2955 | `(lambda ,params))) |
---|
2956 | (t |
---|
2957 | (let ((spec (scheme-env-lookup env op))) |
---|
2958 | (and spec |
---|
2959 | (consp (cadr spec)) |
---|
2960 | (eq 'lambda (caadr spec)) |
---|
2961 | (cddadr spec) |
---|
2962 | (car (cddadr spec))))))) |
---|
2963 | nil)) |
---|
2964 | ((?\") |
---|
2965 | 'string) |
---|
2966 | ((?\w) |
---|
2967 | (if (string-match "[0-9]" (string (char-after))) |
---|
2968 | 'number |
---|
2969 | nil)) |
---|
2970 | (t |
---|
2971 | nil))) |
---|
2972 | |
---|
2973 | (defun scheme-let-vars-at-point (&optional env) |
---|
2974 | (let ((end (or (ignore-errors |
---|
2975 | (save-excursion (forward-sexp) (point))) |
---|
2976 | (point-min))) |
---|
2977 | (vars '())) |
---|
2978 | (forward-char 1) |
---|
2979 | (while (< (point) end) |
---|
2980 | (when (eq ?\( (char-after)) |
---|
2981 | (save-excursion |
---|
2982 | (forward-char 1) |
---|
2983 | (if (eq ?w (char-syntax (char-after))) |
---|
2984 | (let* ((sym (scheme-symbol-at-point)) |
---|
2985 | (type (ignore-errors |
---|
2986 | (scheme-beginning-of-next-sexp) |
---|
2987 | (scheme-sexp-type-at-point env)))) |
---|
2988 | (push (if type (list sym type) (list sym)) vars))))) |
---|
2989 | (unless (ignore-errors (let ((here (point))) |
---|
2990 | (scheme-beginning-of-next-sexp) |
---|
2991 | (> (point) here))) |
---|
2992 | (goto-char end))) |
---|
2993 | (reverse vars))) |
---|
2994 | |
---|
2995 | (defun scheme-extract-match-clause-vars (x) |
---|
2996 | (cond |
---|
2997 | ((null x) '()) |
---|
2998 | ((symbolp x) |
---|
2999 | (if (memq x '(_ ___ \.\.\.)) |
---|
3000 | '() |
---|
3001 | (list (list x)))) |
---|
3002 | ((consp x) |
---|
3003 | (case (car x) |
---|
3004 | ((or not) |
---|
3005 | (scheme-extract-match-clause-vars (cdr x))) |
---|
3006 | ((and) |
---|
3007 | (if (and (consp (cdr x)) |
---|
3008 | (consp (cddr x)) |
---|
3009 | (symbolp (cadr x)) |
---|
3010 | (consp (caddr x)) |
---|
3011 | (not (memq (caaddr x) |
---|
3012 | '(= $ @ ? and or not quote quasiquote get! set!)))) |
---|
3013 | (cons (list (cadr x) (if (listp (caddr x)) 'list 'pair)) |
---|
3014 | (scheme-extract-match-clause-vars (cddr x))) |
---|
3015 | (scheme-extract-match-clause-vars (cddr x)))) |
---|
3016 | ((= $ @) |
---|
3017 | (if (consp (cdr x)) (scheme-extract-match-clause-vars (cddr x)) '())) |
---|
3018 | ((\? ? ) ; XXXX this is a hack, the lone ? gets read as a char (space) |
---|
3019 | (if (and (consp (cdr x)) |
---|
3020 | (consp (cddr x)) |
---|
3021 | (symbolp (cadr x)) |
---|
3022 | (symbolp (caddr x))) |
---|
3023 | (cons (list (caddr x) (scheme-predicate->type (cadr x))) |
---|
3024 | (scheme-extract-match-clause-vars (cdddr x))) |
---|
3025 | (scheme-extract-match-clause-vars (cddr x)))) |
---|
3026 | ((get! set!) |
---|
3027 | (if (consp (cdr x)) (scheme-extract-match-clause-vars (cadr x)) '())) |
---|
3028 | ((quote) '()) |
---|
3029 | ((quasiquote) '()) ; XXXX |
---|
3030 | (t |
---|
3031 | (union (scheme-extract-match-clause-vars (car x)) |
---|
3032 | (scheme-extract-match-clause-vars (cdr x)))))) |
---|
3033 | ((vectorp x) |
---|
3034 | (scheme-extract-match-clause-vars (concatenate 'list x))) |
---|
3035 | (t |
---|
3036 | '()))) |
---|
3037 | |
---|
3038 | ;; call this from the first opening paren of the match clauses |
---|
3039 | (defun scheme-extract-match-vars (&optional pos limit) |
---|
3040 | (let ((match-vars '()) |
---|
3041 | (limit (or limit |
---|
3042 | (save-excursion |
---|
3043 | (or |
---|
3044 | (ignore-errors (end-of-defun) (point)) |
---|
3045 | (point-max)))))) |
---|
3046 | (save-excursion |
---|
3047 | (while (< (point) limit) |
---|
3048 | (let* ((end (ignore-errors (forward-sexp) (point))) |
---|
3049 | (start (and end (progn (backward-sexp) (point))))) |
---|
3050 | (cond |
---|
3051 | ((and pos start end (or (< pos start) (> pos end))) |
---|
3052 | (goto-char (if end (+ end 1) limit))) |
---|
3053 | (t |
---|
3054 | (forward-char 1) |
---|
3055 | (let* ((pat (scheme-nth-sexp-at-point 0)) |
---|
3056 | (new-vars (ignore-errors |
---|
3057 | (scheme-extract-match-clause-vars pat)))) |
---|
3058 | (setq match-vars (append new-vars match-vars))) |
---|
3059 | (goto-char (if (or pos (not end)) limit (+ end 1))))))) |
---|
3060 | match-vars))) |
---|
3061 | |
---|
3062 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
---|
3063 | ;; You can set the *scheme-default-implementation* to your preferred |
---|
3064 | ;; implementation, for when we can't figure out the file from |
---|
3065 | ;; heuristics. Alternately, in any given buffer, just |
---|
3066 | ;; |
---|
3067 | ;; (setq *scheme-current-implementation* whatever) |
---|
3068 | |
---|
3069 | (defgroup scheme-complete nil |
---|
3070 | "Smart tab completion" |
---|
3071 | :group 'scheme) |
---|
3072 | |
---|
3073 | (defcustom scheme-default-implementation nil |
---|
3074 | "Default scheme implementation to provide completion for |
---|
3075 | when scheme-complete can't infer the current implementation." |
---|
3076 | :type 'symbol |
---|
3077 | :group 'scheme-complete) |
---|
3078 | |
---|
3079 | (defcustom scheme-complete-smart-indent-p t |
---|
3080 | "Toggles using `scheme-smart-indent' for `scheme-complete-or-indent'." |
---|
3081 | :type 'boolean |
---|
3082 | :group 'scheme-complete) |
---|
3083 | |
---|
3084 | (defcustom scheme-complete-cache-p t |
---|
3085 | "Toggles caching of module/load export information." |
---|
3086 | :type 'boolean |
---|
3087 | :group 'scheme-complete) |
---|
3088 | |
---|
3089 | ;; (defcustom scheme-complete-learn-syntax-p nil |
---|
3090 | ;; "Toggles parsing of syntax-rules macros for completion info." |
---|
3091 | ;; :type 'boolean |
---|
3092 | ;; :group 'scheme-complete) |
---|
3093 | |
---|
3094 | (defvar *scheme-complete-module-cache* '()) |
---|
3095 | |
---|
3096 | (defvar *scheme-current-implementation* nil) |
---|
3097 | (make-variable-buffer-local '*scheme-current-implementation*) |
---|
3098 | |
---|
3099 | ;; most implementations use their name as the script name |
---|
3100 | (defvar *scheme-interpreter-alist* |
---|
3101 | '(("csi" . chicken) |
---|
3102 | ("gosh" . gauche) |
---|
3103 | ("gsi" . gambit) |
---|
3104 | ("mred" . mzscheme) |
---|
3105 | )) |
---|
3106 | |
---|
3107 | (defvar *scheme-imported-modules* '()) |
---|
3108 | |
---|
3109 | (defun scheme-current-implementation () |
---|
3110 | (unless *scheme-current-implementation* |
---|
3111 | (setq *scheme-current-implementation* |
---|
3112 | (save-excursion |
---|
3113 | (goto-char (point-min)) |
---|
3114 | (or |
---|
3115 | (and (looking-at "#! *\\([^ \t\n]+\\)") |
---|
3116 | (let ((script (file-name-nondirectory (match-string 1)))) |
---|
3117 | (cdr (assoc script *scheme-interpreter-alist*)))) |
---|
3118 | (cond |
---|
3119 | ((re-search-forward "(define-module +\\(.\\)" nil t) |
---|
3120 | (if (equal "(" (match-string 1)) |
---|
3121 | 'guile |
---|
3122 | 'gauche)) |
---|
3123 | ((re-search-forward "(use " nil t) |
---|
3124 | 'chicken) |
---|
3125 | ((re-search-forward |
---|
3126 | "\\(?:(module \\|#\\(?:lang\\|reader\\)\\)" nil t) |
---|
3127 | 'mzscheme)))))) |
---|
3128 | (or *scheme-current-implementation* |
---|
3129 | scheme-default-implementation)) |
---|
3130 | |
---|
3131 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
---|
3132 | |
---|
3133 | (defun scheme-current-local-vars (&optional env) |
---|
3134 | (let ((vars '()) |
---|
3135 | (limit (save-excursion (beginning-of-defun) (+ (point) 1))) |
---|
3136 | (start (point)) |
---|
3137 | (scan-internal)) |
---|
3138 | (save-excursion |
---|
3139 | (while (> (point) limit) |
---|
3140 | (or (ignore-errors |
---|
3141 | (progn |
---|
3142 | (skip-chars-backward " \t\n" limit) |
---|
3143 | (scheme-beginning-of-sexp) |
---|
3144 | t)) |
---|
3145 | (goto-char limit)) |
---|
3146 | (when (and (> (point) (point-min)) |
---|
3147 | (eq ?\( (char-syntax (char-before (point)))) |
---|
3148 | (eq ?w (char-syntax (char-after (point))))) |
---|
3149 | (setq scan-internal t) |
---|
3150 | (let ((sym (scheme-symbol-at-point))) |
---|
3151 | (case sym |
---|
3152 | ((lambda) |
---|
3153 | (setq vars |
---|
3154 | (append |
---|
3155 | (mapcar #'list |
---|
3156 | (scheme-flatten (scheme-nth-sexp-at-point 1))) |
---|
3157 | vars))) |
---|
3158 | ((match match-let match-let*) |
---|
3159 | (setq vars |
---|
3160 | (append |
---|
3161 | (ignore-errors |
---|
3162 | (save-excursion |
---|
3163 | (let ((limit (save-excursion |
---|
3164 | (cond |
---|
3165 | ((eq sym 'match) |
---|
3166 | (backward-char 1) |
---|
3167 | (forward-sexp 1)) |
---|
3168 | (t |
---|
3169 | (forward-sexp 2))) |
---|
3170 | (point)))) |
---|
3171 | (forward-sexp 2) |
---|
3172 | (if (eq sym 'match) |
---|
3173 | (forward-sexp 1)) |
---|
3174 | (backward-sexp 1) |
---|
3175 | (if (not (eq sym 'match)) |
---|
3176 | (forward-char 1)) |
---|
3177 | (scheme-extract-match-vars |
---|
3178 | (and (or (eq sym 'match) (< start limit)) start) |
---|
3179 | limit)))) |
---|
3180 | vars))) |
---|
3181 | ((let let* letrec letrec* let-syntax letrec-syntax and-let* do) |
---|
3182 | (or |
---|
3183 | (ignore-errors |
---|
3184 | (save-excursion |
---|
3185 | (scheme-beginning-of-next-sexp) |
---|
3186 | (if (and (eq sym 'let) |
---|
3187 | (eq ?w (char-syntax (char-after (point))))) |
---|
3188 | ;; named let |
---|
3189 | (let* ((sym (scheme-symbol-at-point)) |
---|
3190 | (args (progn |
---|
3191 | (scheme-beginning-of-next-sexp) |
---|
3192 | (scheme-let-vars-at-point env)))) |
---|
3193 | (setq vars (cons `(,sym (lambda ,(mapcar #'car args))) |
---|
3194 | (append args vars)))) |
---|
3195 | (setq vars (append (scheme-let-vars-at-point env) vars))) |
---|
3196 | t)) |
---|
3197 | (goto-char limit))) |
---|
3198 | ((let-values let*-values) |
---|
3199 | (setq vars |
---|
3200 | (append (mapcar |
---|
3201 | #'list |
---|
3202 | (scheme-append-map |
---|
3203 | #'scheme-flatten |
---|
3204 | (remove-if-not #'consp |
---|
3205 | (scheme-nth-sexp-at-point 1)))) |
---|
3206 | vars))) |
---|
3207 | ((receive defun defmacro) |
---|
3208 | (setq vars |
---|
3209 | (append (mapcar #'list |
---|
3210 | (scheme-flatten |
---|
3211 | (scheme-nth-sexp-at-point 1))) |
---|
3212 | vars))) |
---|
3213 | (t |
---|
3214 | (if (string-match "^define\\(-.*\\)?" (symbol-name sym)) |
---|
3215 | (let ((defs (save-excursion |
---|
3216 | (backward-char) |
---|
3217 | (scheme-extract-definitions)))) |
---|
3218 | (setq vars |
---|
3219 | (append (scheme-append-map |
---|
3220 | #'(lambda (x) |
---|
3221 | (and (consp (cdr x)) |
---|
3222 | (consp (cadr x)) |
---|
3223 | (eq 'lambda (caadr x)) |
---|
3224 | (mapcar #'list |
---|
3225 | (scheme-flatten |
---|
3226 | (cadadr x))))) |
---|
3227 | defs) |
---|
3228 | defs |
---|
3229 | vars))) |
---|
3230 | (setq scan-internal nil)))) |
---|
3231 | ;; check for internal defines |
---|
3232 | (when scan-internal |
---|
3233 | (ignore-errors |
---|
3234 | (save-excursion |
---|
3235 | (forward-sexp |
---|
3236 | (+ 1 (if (numberp scan-internal) scan-internal 2))) |
---|
3237 | (backward-sexp) |
---|
3238 | (if (< (point) start) |
---|
3239 | (setq vars (append (scheme-current-definitions) vars)) |
---|
3240 | )))))))) |
---|
3241 | (reverse vars))) |
---|
3242 | |
---|
3243 | (defun scheme-extract-import-module-imports (sexp) |
---|
3244 | (case (and (consp sexp) (car sexp)) |
---|
3245 | ((prefix prefix-in) |
---|
3246 | (let* ((ids (scheme-extract-import-module-imports (cadr sexp))) |
---|
3247 | (prefix0 (caddr sexp)) |
---|
3248 | (prefix (if (symbolp prefix0) (symbol-name prefix0) prefix0))) |
---|
3249 | (mapcar #'(lambda (x) |
---|
3250 | (cons (intern (concat prefix (symbol-name (car x)))) |
---|
3251 | (cdr x))) |
---|
3252 | ids))) |
---|
3253 | ((prefix-all-except) |
---|
3254 | (let ((prefix |
---|
3255 | (if (symbolp (cadr sexp)) (symbol-name (cadr sexp)) (cadr sexp))) |
---|
3256 | (exceptions (cddr sexp))) |
---|
3257 | (mapcar #'(lambda (x) |
---|
3258 | (if (memq (car x) exceptions) |
---|
3259 | x |
---|
3260 | (cons (intern (concat prefix (symbol-name (car x)))) |
---|
3261 | (cdr x)))) |
---|
3262 | (scheme-extract-import-module-imports (caddr sexp))))) |
---|
3263 | ((for for-syntax for-template for-label for-meta) |
---|
3264 | (scheme-extract-import-module-imports (cadr sexp))) |
---|
3265 | ((rename rename-in) |
---|
3266 | (let ((renames (cddr sexp))) |
---|
3267 | (mapcar #'(lambda (x) |
---|
3268 | (cons (or (cadr (assq (car x) renames)) (car x)) (cdr x))) |
---|
3269 | (scheme-extract-import-module-imports (cadr sexp))))) |
---|
3270 | ((except except-in) |
---|
3271 | (remove-if #'(lambda (x) (memq (car x) (cddr sexp))) |
---|
3272 | (scheme-extract-import-module-imports (cadr sexp)))) |
---|
3273 | ((only only-in) |
---|
3274 | (remove-if-not |
---|
3275 | #'(lambda (x) (memq (car x) (cddr sexp))) |
---|
3276 | (scheme-extract-import-module-imports (cadr sexp)))) |
---|
3277 | ((import import-for-syntax require) |
---|
3278 | (scheme-extract-import-module-imports (cadr sexp))) |
---|
3279 | ((library) |
---|
3280 | (if (and (stringp (cadr sexp)) (file-exists-p (cadr sexp))) |
---|
3281 | (scheme-module-exports (intern (cadr sexp))))) |
---|
3282 | ((lib) |
---|
3283 | (if (and (equal "srfi" (caddr sexp)) |
---|
3284 | (stringp (cadr sexp)) |
---|
3285 | (string-match "^[0-9]+\\." (cadr sexp))) |
---|
3286 | (scheme-module-exports |
---|
3287 | (intern (file-name-sans-extension (concat "srfi-" (cadr sexp))))) |
---|
3288 | (scheme-module-exports |
---|
3289 | (intern (apply 'concat (append (cddr sexp) (list (cadr sexp)))))))) |
---|
3290 | (t |
---|
3291 | (scheme-module-exports sexp)))) |
---|
3292 | |
---|
3293 | (defun scheme-extract-sexp-imports (sexp) |
---|
3294 | (case (and (consp sexp) (car sexp)) |
---|
3295 | ((begin define-module) |
---|
3296 | (scheme-append-map #'scheme-extract-sexp-imports (cdr sexp))) |
---|
3297 | ((cond-expand) |
---|
3298 | (scheme-append-map #'scheme-extract-sexp-imports |
---|
3299 | (scheme-append-map #'cdr (cdr sexp)))) |
---|
3300 | ((use require-extension) |
---|
3301 | (scheme-append-map #'scheme-module-exports (cdr sexp))) |
---|
3302 | ((import) |
---|
3303 | (scheme-extract-import-module-imports (cadr sexp))) |
---|
3304 | ((autoload) |
---|
3305 | (unless (member (cadr sexp) *scheme-imported-modules*) |
---|
3306 | (push (cadr sexp) *scheme-imported-modules*) |
---|
3307 | (mapcar #'(lambda (x) (cons (if (consp x) (car x) x) '((lambda obj)))) |
---|
3308 | (cddr sexp)))) |
---|
3309 | ((load) |
---|
3310 | (unless (member (cadr sexp) *scheme-imported-modules*) |
---|
3311 | (push (cadr sexp) *scheme-imported-modules*) |
---|
3312 | (and (file-exists-p (cadr sexp)) |
---|
3313 | (scheme-with-find-file (cadr sexp) |
---|
3314 | (scheme-current-globals))))) |
---|
3315 | ((library module) |
---|
3316 | (scheme-append-map #'scheme-extract-import-module-imports |
---|
3317 | (remove-if #'(lambda (x) |
---|
3318 | (memq (car x) '(import require))) |
---|
3319 | (cdr sexp)))) |
---|
3320 | )) |
---|
3321 | |
---|
3322 | (defun scheme-module-symbol-p (sym) |
---|
3323 | (memq sym '(use require require-extension begin cond-expand |
---|
3324 | module library define-module autoload load import))) |
---|
3325 | |
---|
3326 | (defun scheme-skip-shebang () |
---|
3327 | ;; skip shebang if present |
---|
3328 | (if (looking-at "#!") |
---|
3329 | ;; guile skips until a closing !# |
---|
3330 | (if (eq 'guile (scheme-current-implementation)) |
---|
3331 | (re-search-forward "!#" nil t) |
---|
3332 | (next-line)))) |
---|
3333 | |
---|
3334 | (defun scheme-current-imports () |
---|
3335 | (let ((imports '()) |
---|
3336 | (*scheme-imported-modules* '())) |
---|
3337 | (save-excursion |
---|
3338 | (goto-char (point-min)) |
---|
3339 | (scheme-skip-shebang) |
---|
3340 | ;; scan for module forms |
---|
3341 | (while (not (eobp)) |
---|
3342 | (if (ignore-errors (progn (forward-sexp) t)) |
---|
3343 | (let ((end (point))) |
---|
3344 | (backward-sexp) |
---|
3345 | (when (eq ?\( (char-after)) |
---|
3346 | (forward-char) |
---|
3347 | (when (and (not (eq ?\( (char-after))) |
---|
3348 | (scheme-module-symbol-p (scheme-symbol-at-point))) |
---|
3349 | (backward-char) |
---|
3350 | (ignore-errors |
---|
3351 | (setq imports |
---|
3352 | (append (scheme-extract-sexp-imports |
---|
3353 | (scheme-nth-sexp-at-point 0)) |
---|
3354 | imports))))) |
---|
3355 | (goto-char end)) |
---|
3356 | ;; if an incomplete sexp is found, try to recover at the |
---|
3357 | ;; next line beginning with an open paren |
---|
3358 | (scheme-goto-next-top-level)))) |
---|
3359 | imports)) |
---|
3360 | |
---|
3361 | ;; we should be just inside the opening paren of an expression |
---|
3362 | (defun scheme-name-of-define () |
---|
3363 | (save-excursion |
---|
3364 | (scheme-beginning-of-next-sexp) |
---|
3365 | (if (eq ?\( (char-syntax (char-after))) |
---|
3366 | (forward-char)) |
---|
3367 | (and (memq (char-syntax (char-after)) '(?\w ?\_)) |
---|
3368 | (scheme-symbol-at-point)))) |
---|
3369 | |
---|
3370 | (defun scheme-type-of-define () |
---|
3371 | (save-excursion |
---|
3372 | (scheme-beginning-of-next-sexp) |
---|
3373 | (cond |
---|
3374 | ((eq ?\( (char-syntax (char-after))) |
---|
3375 | `(lambda ,(cdr (scheme-nth-sexp-at-point 0)))) |
---|
3376 | (t |
---|
3377 | (scheme-beginning-of-next-sexp) |
---|
3378 | (scheme-sexp-type-at-point))))) |
---|
3379 | |
---|
3380 | ;; we should be at the opening paren of an expression |
---|
3381 | (defun scheme-extract-definitions (&optional env) |
---|
3382 | (save-excursion |
---|
3383 | (let ((sym (ignore-errors (and (eq ?\( (char-syntax (char-after))) |
---|
3384 | (progn (forward-char) |
---|
3385 | (scheme-symbol-at-point)))))) |
---|
3386 | (case sym |
---|
3387 | ((define-syntax define-compiled-syntax defmacro define-macro) |
---|
3388 | (list (list (scheme-name-of-define) '(syntax)))) |
---|
3389 | ((define define-inline define-constant define-primitive defun) |
---|
3390 | (let ((name (scheme-name-of-define)) |
---|
3391 | (type (scheme-type-of-define))) |
---|
3392 | (list (if type (list name type) (list name))))) |
---|
3393 | ((defvar define-class) |
---|
3394 | (list (list (scheme-name-of-define) 'non-procedure))) |
---|
3395 | ((define-record) |
---|
3396 | (backward-char) |
---|
3397 | (ignore-errors |
---|
3398 | (let* ((sexp (scheme-nth-sexp-at-point 0)) |
---|
3399 | (name (symbol-name (cadr sexp)))) |
---|
3400 | `((,(intern (concat name "?")) (lambda (obj) boolean)) |
---|
3401 | (,(intern (concat "make-" name)) (lambda ,(cddr sexp) )) |
---|
3402 | ,@(scheme-append-map |
---|
3403 | #'(lambda (x) |
---|
3404 | `((,(intern (concat name "-" (symbol-name x))) |
---|
3405 | (lambda (non-procedure))) |
---|
3406 | (,(intern (concat name "-" (symbol-name x) "-set!")) |
---|
3407 | (lambda (non-procedure val) undefined)))) |
---|
3408 | (cddr sexp)))))) |
---|
3409 | ((define-record-type) |
---|
3410 | (backward-char) |
---|
3411 | (ignore-errors |
---|
3412 | (let ((sexp (scheme-nth-sexp-at-point 0))) |
---|
3413 | `((,(caaddr sexp) (lambda ,(cdaddr sexp))) |
---|
3414 | (,(cadddr sexp) (lambda (obj))) |
---|
3415 | ,@(scheme-append-map |
---|
3416 | #'(lambda (x) |
---|
3417 | (if (consp x) |
---|
3418 | (if (consp (cddr x)) |
---|
3419 | `((,(cadr x) (lambda (non-procedure))) |
---|
3420 | (,(caddr x) |
---|
3421 | (lambda (non-procedure val) undefined))) |
---|
3422 | `((,(cadr x) (lambda (non-procedure))))))) |
---|
3423 | (cddddr sexp)))))) |
---|
3424 | ((begin progn) |
---|
3425 | (forward-sexp) |
---|
3426 | (scheme-current-definitions)) |
---|
3427 | (t |
---|
3428 | '()))))) |
---|
3429 | |
---|
3430 | ;; a little more liberal than -definitions, we try to scan to a new |
---|
3431 | ;; top-level form (i.e. a line beginning with an open paren) if |
---|
3432 | ;; there's an error during normal sexp movement |
---|
3433 | (defun scheme-current-globals () |
---|
3434 | (let ((globals '())) |
---|
3435 | (save-excursion |
---|
3436 | (goto-char (point-min)) |
---|
3437 | (or (ignore-errors (end-of-defun) (beginning-of-defun) t) |
---|
3438 | (re-search-forward "^(" nil t) |
---|
3439 | (goto-char (point-max))) |
---|
3440 | (while (not (eobp)) |
---|
3441 | (setq globals |
---|
3442 | (append (ignore-errors (scheme-extract-definitions)) globals)) |
---|
3443 | (scheme-goto-next-top-level))) |
---|
3444 | globals)) |
---|
3445 | |
---|
3446 | ;; for internal defines, etc. |
---|
3447 | (defun scheme-current-definitions (&optional enclosing-end) |
---|
3448 | (let ((defs '()) |
---|
3449 | (end (or enclosing-end (point-max)))) |
---|
3450 | (save-excursion |
---|
3451 | (while (< (point) end) |
---|
3452 | (let ((here (point)) |
---|
3453 | (new-defs (scheme-extract-definitions))) |
---|
3454 | (cond |
---|
3455 | (new-defs |
---|
3456 | (setq defs (append new-defs defs)) |
---|
3457 | (or (ignore-errors (scheme-beginning-of-next-sexp) |
---|
3458 | (> (point) here)) |
---|
3459 | (goto-char end))) |
---|
3460 | (t ;; non-definition form, stop scanning |
---|
3461 | (goto-char end)))))) |
---|
3462 | defs)) |
---|
3463 | |
---|
3464 | (defun scheme-current-exports () |
---|
3465 | (let ((res '())) |
---|
3466 | (save-excursion |
---|
3467 | (goto-char (point-min)) |
---|
3468 | (or (ignore-errors (end-of-defun) (beginning-of-defun) t) |
---|
3469 | (re-search-forward "^(" nil t) |
---|
3470 | (goto-char (point-max))) |
---|
3471 | (while (not (eobp)) |
---|
3472 | (when (and (eq ?\( (char-syntax (char-after))) |
---|
3473 | (eq ?w (char-syntax (char-after (1+ (point)))))) |
---|
3474 | (let ((sym (save-excursion (forward-char) (scheme-symbol-at-point)))) |
---|
3475 | (case sym |
---|
3476 | ((declare define-module) |
---|
3477 | (let ((decls (scheme-nth-sexp-at-point 0))) |
---|
3478 | (cond |
---|
3479 | ((and (listp decls) (assq 'export decls)) |
---|
3480 | (setq res (nconc (cdr (assq 'export decls)) res))) |
---|
3481 | ((and (listp decls) (assq 'export-all decls)) |
---|
3482 | (goto-char (point-max)))))) |
---|
3483 | ((export provide) |
---|
3484 | (unless (and (eq 'provide sym) |
---|
3485 | (eq 'chicken (scheme-current-implementation))) |
---|
3486 | (setq res (nconc (cdr (scheme-nth-sexp-at-point 0)) res)))) |
---|
3487 | ((export-all) |
---|
3488 | (goto-char (point-max))) |
---|
3489 | ((extend) |
---|
3490 | (let ((parents (cdr (scheme-nth-sexp-at-point 0)))) |
---|
3491 | (setq res (nconc (mapcar #'car |
---|
3492 | (scheme-append-map |
---|
3493 | #'scheme-module-exports |
---|
3494 | parents)) |
---|
3495 | res)))) |
---|
3496 | ((module) |
---|
3497 | (forward-char) |
---|
3498 | (forward-sexp) |
---|
3499 | (let ((x (scheme-nth-sexp-at-point 0))) |
---|
3500 | (cond |
---|
3501 | ((eq '* x) |
---|
3502 | (goto-char (point-max))) |
---|
3503 | ((listp x) |
---|
3504 | (setq res |
---|
3505 | (nconc (remove-if-not #'symbolp (cdr x)) res)))))) |
---|
3506 | ))) |
---|
3507 | (scheme-goto-next-top-level))) |
---|
3508 | res)) |
---|
3509 | |
---|
3510 | (defun scheme-srfi-exports (i) |
---|
3511 | (and (integerp i) |
---|
3512 | (>= i 0) |
---|
3513 | (< i (length *scheme-srfi-info*)) |
---|
3514 | (let ((info (cdr (aref *scheme-srfi-info* i)))) |
---|
3515 | (if (and (consp info) (null (cdr info)) (symbolp (car info))) |
---|
3516 | (scheme-module-exports (car info)) |
---|
3517 | info)))) |
---|
3518 | |
---|
3519 | (defvar scheme-module-exports-function nil) |
---|
3520 | |
---|
3521 | (defvar *scheme-module-exports-functions* |
---|
3522 | '((chicken . scheme-module-exports/chicken) |
---|
3523 | (gauche . scheme-module-exports/gauche) |
---|
3524 | (mzscheme . scheme-module-exports/mzscheme))) |
---|
3525 | |
---|
3526 | (defun scheme-module-exports (mod) |
---|
3527 | (unless (member mod *scheme-imported-modules*) |
---|
3528 | (push mod *scheme-imported-modules*) |
---|
3529 | (cond |
---|
3530 | ((and (consp mod) (eq 'srfi (car mod))) |
---|
3531 | (scheme-append-map #'scheme-srfi-exports (cdr mod))) |
---|
3532 | ((and (symbolp mod) (string-match "^srfi-" (symbol-name mod))) |
---|
3533 | (scheme-srfi-exports |
---|
3534 | (string-to-number (substring (symbol-name mod) 5)))) |
---|
3535 | (t |
---|
3536 | (let ((cached (assq mod *scheme-complete-module-cache*))) |
---|
3537 | ;; remove stale caches |
---|
3538 | (when (and cached |
---|
3539 | (stringp (cadr cached)) |
---|
3540 | (ignore-errors |
---|
3541 | (let ((mtime (nth 5 (file-attributes (cadr cached)))) |
---|
3542 | (ptime (caddr cached))) |
---|
3543 | (or (> (car mtime) (car ptime)) |
---|
3544 | (and (= (car mtime) (car ptime)) |
---|
3545 | (>= (cadr mtime) (cadr ptime))))))) |
---|
3546 | (setq *scheme-complete-module-cache* |
---|
3547 | (assq-delete-all mod *scheme-complete-module-cache*)) |
---|
3548 | (setq cached nil)) |
---|
3549 | (if cached |
---|
3550 | (cadddr cached) |
---|
3551 | ;; (re)compute module exports |
---|
3552 | (let ((export-fun |
---|
3553 | (or scheme-module-exports-function |
---|
3554 | (cdr (assq (scheme-current-implementation) |
---|
3555 | *scheme-module-exports-functions*))))) |
---|
3556 | (when export-fun |
---|
3557 | (let ((res (funcall export-fun mod))) |
---|
3558 | (when res |
---|
3559 | (when (and scheme-complete-cache-p (car res)) |
---|
3560 | (push (list mod |
---|
3561 | (car res) |
---|
3562 | (nth 5 (file-attributes (car res))) |
---|
3563 | (cadr res)) |
---|
3564 | *scheme-complete-module-cache*)) |
---|
3565 | (cadr res))))))))))) |
---|
3566 | |
---|
3567 | (defun scheme-module-exports/chicken (mod) |
---|
3568 | (let ((predefined (assq mod *scheme-chicken-modules*))) |
---|
3569 | (if predefined |
---|
3570 | (list nil (cdr predefined)) |
---|
3571 | (let ((export-file |
---|
3572 | (concat *scheme-chicken-base-repo* "/" |
---|
3573 | (symbol-name mod) ".exports")) |
---|
3574 | (setup-file |
---|
3575 | (concat *scheme-chicken-base-repo* "/" |
---|
3576 | (symbol-name mod) ".setup-info")) |
---|
3577 | (source-file |
---|
3578 | (concat (symbol-name mod) ".scm"))) |
---|
3579 | (cond |
---|
3580 | ((file-exists-p source-file) |
---|
3581 | (list source-file |
---|
3582 | (scheme-with-find-file source-file |
---|
3583 | (let ((env (scheme-current-globals)) |
---|
3584 | (exports (scheme-current-exports))) |
---|
3585 | (if (consp exports) |
---|
3586 | (remove-if-not #'(lambda (x) (memq (car x) exports)) env) |
---|
3587 | env))))) |
---|
3588 | ((file-exists-p export-file) |
---|
3589 | (list export-file |
---|
3590 | (mapcar #'(lambda (x) (cons (intern x) '((lambda obj)))) |
---|
3591 | (scheme-file->lines export-file)))) |
---|
3592 | ((file-exists-p setup-file) |
---|
3593 | (list setup-file |
---|
3594 | (mapcar #'(lambda (x) (cons (intern x) '((lambda obj)))) |
---|
3595 | (scheme-with-find-file setup-file |
---|
3596 | (let* ((alist (scheme-nth-sexp-at-point 0)) |
---|
3597 | (cell (assq 'exports alist))) |
---|
3598 | (cdr cell)))))) |
---|
3599 | ))))) |
---|
3600 | |
---|
3601 | (defun scheme-module-exports/gauche (mod) |
---|
3602 | (let* ((file (concat (subst-char-in-string ?. ?/ (symbol-name mod)) ".scm")) |
---|
3603 | (dir |
---|
3604 | (scheme-find-file-in-path |
---|
3605 | file |
---|
3606 | (cons |
---|
3607 | (concat *scheme-gauche-site-repo-path* "/site/lib") |
---|
3608 | (mapcar |
---|
3609 | #'(lambda (x) (concat x "/lib")) |
---|
3610 | (reverse |
---|
3611 | (directory-files *scheme-gauche-repo-path* t "^[0-9]"))))))) |
---|
3612 | (when dir |
---|
3613 | (list |
---|
3614 | (concat dir "/" file) |
---|
3615 | (scheme-with-find-file (concat dir "/" file) |
---|
3616 | (let ((env (scheme-current-globals)) |
---|
3617 | (exports (scheme-current-exports))) |
---|
3618 | (if (consp exports) |
---|
3619 | (remove-if-not #'(lambda (x) (memq (car x) exports)) env) |
---|
3620 | env))))))) |
---|
3621 | |
---|
3622 | (defun scheme-module-exports/mzscheme (mod) |
---|
3623 | (let ((dir (scheme-find-file-in-path |
---|
3624 | (symbol-name mod) |
---|
3625 | '("." |
---|
3626 | "/usr/local/lib/plt/collects" |
---|
3627 | "/usr/local/lib/plt/collects/mzlib")))) |
---|
3628 | (when dir |
---|
3629 | ;; XXXX parse, don't use regexps |
---|
3630 | (list |
---|
3631 | (concat dir "/" (symbol-name mod)) |
---|
3632 | (scheme-with-find-file (concat dir "/" (symbol-name mod)) |
---|
3633 | (when (re-search-forward "(provide" nil t) |
---|
3634 | (backward-sexp) |
---|
3635 | (backward-char) |
---|
3636 | (mapcar #'list (cdr (ignore-errors (scheme-nth-sexp-at-point 0)))) |
---|
3637 | )))))) |
---|
3638 | |
---|
3639 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
---|
3640 | ;; This is rather complicated because we to auto-generate docstring |
---|
3641 | ;; summaries from the type information, which means inferring various |
---|
3642 | ;; types from common names. The benefit is that you don't have to |
---|
3643 | ;; input the same information twice, and can often cut&paste&munge |
---|
3644 | ;; procedure descriptions from the original documentation. |
---|
3645 | |
---|
3646 | (defun scheme-translate-type (type) |
---|
3647 | (if (not (symbolp type)) |
---|
3648 | type |
---|
3649 | (case type |
---|
3650 | ((pred proc thunk handler dispatch producer consumer f fn g kons) |
---|
3651 | 'procedure) |
---|
3652 | ((num) 'number) |
---|
3653 | ((z) 'complex) |
---|
3654 | ((x1 x2 x3 y timeout seconds nanoseconds) 'real) |
---|
3655 | ((i j k n m int index size count len length bound nchars start end |
---|
3656 | pid uid gid fd fileno errno) |
---|
3657 | 'integer) |
---|
3658 | ((ch) 'char) |
---|
3659 | ((str name pattern) 'string) |
---|
3660 | ((file path pathname) 'filename) |
---|
3661 | ((dir dirname) 'directory) |
---|
3662 | ((sym id identifier) 'symbol) |
---|
3663 | ((ls lis lst alist lists) 'list) |
---|
3664 | ((vec) 'vector) |
---|
3665 | ((exc excn err error) 'exception) |
---|
3666 | ((ptr) 'pointer) |
---|
3667 | ((bool) 'boolean) |
---|
3668 | ((env) 'environment) |
---|
3669 | ((char string boolean number complex real integer procedure char-set |
---|
3670 | port input-port output-port pair list vector array stream hash-table |
---|
3671 | thread mutex condition-variable time exception date duration locative |
---|
3672 | random-source state condition condition-type queue sequence pointer |
---|
3673 | u8vector s8vector u16vector s16vector u32vector s32vector |
---|
3674 | u64vector s64vector f32vector f64vector undefined symbol |
---|
3675 | block filename directory mmap listener environment non-procedure |
---|
3676 | read-table continuation blob generic method class regexp regmatch |
---|
3677 | sys-stat fdset) |
---|
3678 | type) |
---|
3679 | ((parent seed option mode) 'non-procedure) |
---|
3680 | (t |
---|
3681 | (let* ((str (symbol-name type)) |
---|
3682 | (i (string-match "-?[0-9]+$" str))) |
---|
3683 | (if i |
---|
3684 | (scheme-translate-type (intern (substring str 0 i))) |
---|
3685 | (let ((i (string-match "-\\([^-]+\\)$" str))) |
---|
3686 | (if i |
---|
3687 | (scheme-translate-type (intern (substring str (+ i 1)))) |
---|
3688 | (if (string-match "\\?$" str) |
---|
3689 | 'boolean |
---|
3690 | 'object))))))))) |
---|
3691 | |
---|
3692 | (defun scheme-lookup-type (spec pos) |
---|
3693 | (let ((i 1) |
---|
3694 | (type nil)) |
---|
3695 | (while (and (consp spec) (<= i pos)) |
---|
3696 | (cond |
---|
3697 | ((eq :optional (car spec)) |
---|
3698 | (if (and (= i pos) (consp (cdr spec))) |
---|
3699 | (setq type (cadr spec))) |
---|
3700 | (setq i (+ pos 1))) |
---|
3701 | ((= i pos) |
---|
3702 | (setq type (car spec)) |
---|
3703 | (setq spec nil)) |
---|
3704 | ((and (consp (cdr spec)) (eq '\.\.\. (cadr spec))) |
---|
3705 | (setq type (car spec)) |
---|
3706 | (setq spec nil))) |
---|
3707 | (setq spec (cdr spec)) |
---|
3708 | (incf i)) |
---|
3709 | (if type |
---|
3710 | (setq type (scheme-translate-type type))) |
---|
3711 | type)) |
---|
3712 | |
---|
3713 | (defun scheme-predicate->type (pred) |
---|
3714 | (case pred |
---|
3715 | ((even? odd?) 'integer) |
---|
3716 | ((char-upper-case? char-lower-case? |
---|
3717 | char-alphabetic? char-numeric? char-whitespace?) |
---|
3718 | 'char) |
---|
3719 | (t |
---|
3720 | ;; catch all the `type?' predicates with pattern matching |
---|
3721 | ;; ... we could be smarter if the env was passed |
---|
3722 | (let ((str (symbol-name pred))) |
---|
3723 | (if (string-match "\\?$" str) |
---|
3724 | (scheme-translate-type |
---|
3725 | (intern (substring str 0 (- (length str) 1)))) |
---|
3726 | 'object))))) |
---|
3727 | |
---|
3728 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
---|
3729 | ;; completion |
---|
3730 | |
---|
3731 | (eval-when (compile load eval) |
---|
3732 | (unless (fboundp 'event-matches-key-specifier-p) |
---|
3733 | (defalias 'event-matches-key-specifier-p 'eq))) |
---|
3734 | |
---|
3735 | (unless (fboundp 'read-event) |
---|
3736 | (defun read-event () |
---|
3737 | (aref (read-key-sequence nil) 0))) |
---|
3738 | |
---|
3739 | (unless (fboundp 'event-basic-type) |
---|
3740 | (defalias 'event-basic-type 'event-key)) |
---|
3741 | |
---|
3742 | (defun scheme-string-prefix-p (pref str) |
---|
3743 | (let ((p-len (length pref)) |
---|
3744 | (s-len (length str))) |
---|
3745 | (and (<= p-len s-len) |
---|
3746 | (equal pref (substring str 0 p-len))))) |
---|
3747 | |
---|
3748 | (defun scheme-do-completion (str coll &optional strs pred) |
---|
3749 | (let* ((coll (mapcar #'(lambda (x) |
---|
3750 | (cond |
---|
3751 | ((symbolp x) (list (symbol-name x))) |
---|
3752 | ((stringp x) (list x)) |
---|
3753 | (t x))) |
---|
3754 | coll)) |
---|
3755 | (completion1 (try-completion str coll pred)) |
---|
3756 | (completion2 (and strs (try-completion str strs pred))) |
---|
3757 | (completion (if (and completion2 |
---|
3758 | (or (not completion1) |
---|
3759 | (< (length completion2) |
---|
3760 | (length completion1)))) |
---|
3761 | completion2 |
---|
3762 | completion1))) |
---|
3763 | (cond |
---|
3764 | ((eq completion t)) |
---|
3765 | ((not completion) |
---|
3766 | (message "Can't find completion for \"%s\"" str) |
---|
3767 | (ding)) |
---|
3768 | ((not (string= str completion)) |
---|
3769 | (let ((prefix-p (scheme-string-prefix-p completion completion1))) |
---|
3770 | (unless prefix-p |
---|
3771 | (save-excursion |
---|
3772 | (backward-char (length str)) |
---|
3773 | (insert "\""))) |
---|
3774 | (insert (substring completion (length str))) |
---|
3775 | (unless prefix-p |
---|
3776 | (insert "\"") |
---|
3777 | (backward-char)))) |
---|
3778 | (t |
---|
3779 | (let ((win-config (current-window-configuration)) |
---|
3780 | (done nil)) |
---|
3781 | (message "Hit space to flush") |
---|
3782 | (with-output-to-temp-buffer "*Completions*" |
---|
3783 | (display-completion-list |
---|
3784 | (sort |
---|
3785 | (all-completions str (append strs coll) pred) |
---|
3786 | 'string-lessp))) |
---|
3787 | (while (not done) |
---|
3788 | (let* ((orig-event |
---|
3789 | (with-current-buffer (get-buffer "*Completions*") |
---|
3790 | (read-event))) |
---|
3791 | (event (event-basic-type orig-event))) |
---|
3792 | (cond |
---|
3793 | ((or (event-matches-key-specifier-p event 'tab) |
---|
3794 | (event-matches-key-specifier-p event 9)) |
---|
3795 | (save-selected-window |
---|
3796 | (select-window (get-buffer-window "*Completions*")) |
---|
3797 | (if (pos-visible-in-window-p (point-max)) |
---|
3798 | (goto-char (point-min)) |
---|
3799 | (scroll-up)))) |
---|
3800 | (t |
---|
3801 | (set-window-configuration win-config) |
---|
3802 | (if (or (event-matches-key-specifier-p event 'space) |
---|
3803 | (event-matches-key-specifier-p event 32)) |
---|
3804 | (bury-buffer (get-buffer "*Completions*")) |
---|
3805 | (setq unread-command-events (list orig-event))) |
---|
3806 | (setq done t)))))) |
---|
3807 | )))) |
---|
3808 | |
---|
3809 | (defun scheme-env-lookup (env sym) |
---|
3810 | (let ((spec nil) |
---|
3811 | (ls env)) |
---|
3812 | (while (and ls (not spec)) |
---|
3813 | (setq spec (assq sym (pop ls)))) |
---|
3814 | spec)) |
---|
3815 | |
---|
3816 | (defun scheme-current-env () |
---|
3817 | ;; r5rs |
---|
3818 | (let ((env (list *scheme-r5rs-info*))) |
---|
3819 | ;; base language |
---|
3820 | (let ((base (cdr (assq (scheme-current-implementation) |
---|
3821 | *scheme-implementation-exports*)))) |
---|
3822 | (if base (push base env))) |
---|
3823 | ;; imports |
---|
3824 | (let ((imports (ignore-errors (scheme-current-imports)))) |
---|
3825 | (if imports (push imports env))) |
---|
3826 | ;; top-level defs |
---|
3827 | (let ((top (ignore-errors (scheme-current-globals)))) |
---|
3828 | (if top (push top env))) |
---|
3829 | ;; current local vars |
---|
3830 | (let ((locals (ignore-errors (scheme-current-local-vars env)))) |
---|
3831 | (if locals (push locals env))) |
---|
3832 | env)) |
---|
3833 | |
---|
3834 | (defun scheme-env-filter (pred env) |
---|
3835 | (mapcar #'car |
---|
3836 | (apply #'concatenate |
---|
3837 | 'list |
---|
3838 | (mapcar #'(lambda (e) (remove-if-not pred e)) |
---|
3839 | env)))) |
---|
3840 | |
---|
3841 | ;; checking return values: |
---|
3842 | ;; a should be capable of returning instances of b |
---|
3843 | (defun scheme-type-match-p (a b) |
---|
3844 | (let ((a1 (scheme-translate-type a)) |
---|
3845 | (b1 (scheme-translate-type b))) |
---|
3846 | (and (not (eq a1 'undefined)) ; check a *does* return something |
---|
3847 | (or (eq a1 b1) ; and they're the same |
---|
3848 | (eq a1 'object) ; ... or a can return anything |
---|
3849 | (eq b1 'object) ; ... or b can receive anything |
---|
3850 | (if (symbolp a1) |
---|
3851 | (if (symbolp b1) |
---|
3852 | (case a1 ; ... or the types overlap |
---|
3853 | ((number complex real rational integer) |
---|
3854 | (memq b1 '(number complex real rational integer))) |
---|
3855 | ((port input-port output-port) |
---|
3856 | (memq b1 '(port input-port output-port))) |
---|
3857 | ((pair list) |
---|
3858 | (memq b1 '(pair list))) |
---|
3859 | ((non-procedure) |
---|
3860 | (not (eq 'procedure b1)))) |
---|
3861 | (and |
---|
3862 | (consp b1) |
---|
3863 | (if (eq 'or (car b1)) |
---|
3864 | ;; type unions |
---|
3865 | (find-if |
---|
3866 | #'(lambda (x) |
---|
3867 | (scheme-type-match-p |
---|
3868 | a1 (scheme-translate-type x))) |
---|
3869 | (cdr b1)) |
---|
3870 | (let ((b2 (scheme-translate-special-type b1))) |
---|
3871 | (and (not (equal b1 b2)) |
---|
3872 | (scheme-type-match-p a1 b2)))))) |
---|
3873 | (and (consp a1) |
---|
3874 | ;; type unions |
---|
3875 | (if (eq 'or (car a1)) |
---|
3876 | (find-if |
---|
3877 | #'(lambda (x) |
---|
3878 | (scheme-type-match-p (scheme-translate-type x) b1)) |
---|
3879 | (cdr a1)) |
---|
3880 | ;; other special types |
---|
3881 | (let ((a2 (scheme-translate-special-type a1)) |
---|
3882 | (b2 (scheme-translate-special-type b1))) |
---|
3883 | (and (or (not (equal a1 a2)) (not (equal b1 b2))) |
---|
3884 | (scheme-type-match-p a2 b2)))) |
---|
3885 | )))))) |
---|
3886 | |
---|
3887 | (defun scheme-translate-special-type (x) |
---|
3888 | (if (not (consp x)) |
---|
3889 | x |
---|
3890 | (case (car x) |
---|
3891 | ((list string) (car x)) |
---|
3892 | ((set special) (cadr x)) |
---|
3893 | ((flags) 'integer) |
---|
3894 | (t x)))) |
---|
3895 | |
---|
3896 | (defun scheme-nth* (n ls) |
---|
3897 | (while (and (consp ls) (> n 0)) |
---|
3898 | (setq n (- n 1) |
---|
3899 | ls (cdr ls))) |
---|
3900 | (and (consp ls) (car ls))) |
---|
3901 | |
---|
3902 | (defun scheme-file->lines (file) |
---|
3903 | (and (file-readable-p file) |
---|
3904 | (scheme-with-find-file file |
---|
3905 | (goto-char (point-min)) |
---|
3906 | (let ((res '())) |
---|
3907 | (while (not (eobp)) |
---|
3908 | (let ((start (point))) |
---|
3909 | (forward-line) |
---|
3910 | (push (buffer-substring-no-properties start (- (point) 1)) |
---|
3911 | res))) |
---|
3912 | (reverse res))))) |
---|
3913 | |
---|
3914 | (defun scheme-passwd-file-names (file &optional pat) |
---|
3915 | (delete |
---|
3916 | nil |
---|
3917 | (mapcar |
---|
3918 | #'(lambda (line) |
---|
3919 | (and (not (string-match "^[ ]*#" line)) |
---|
3920 | (or (not pat) (string-match pat line)) |
---|
3921 | (string-match "^\\([^:]*\\):" line) |
---|
3922 | (match-string 1 line))) |
---|
3923 | (scheme-file->lines file)))) |
---|
3924 | |
---|
3925 | (defun scheme-host-file-names (file) |
---|
3926 | (scheme-append-map |
---|
3927 | #'(lambda (line) |
---|
3928 | (let ((i (string-match "#" line))) |
---|
3929 | (if i (setq line (substring line 0 i)))) |
---|
3930 | (cdr (split-string line))) |
---|
3931 | (scheme-file->lines file))) |
---|
3932 | |
---|
3933 | (defun scheme-ssh-known-hosts-file-names (file) |
---|
3934 | (scheme-append-map |
---|
3935 | #'(lambda (line) |
---|
3936 | (split-string (car (split-string line)) ",")) |
---|
3937 | (scheme-file->lines file))) |
---|
3938 | |
---|
3939 | (defun scheme-ssh-config-file-names (file) |
---|
3940 | (scheme-append-map |
---|
3941 | #'(lambda (line) |
---|
3942 | (and (string-match "^ *Host" line) |
---|
3943 | (cdr (split-string line)))) |
---|
3944 | (scheme-file->lines file))) |
---|
3945 | |
---|
3946 | (defun scheme-complete-user-name (trans sym) |
---|
3947 | (if (string-match "apple" (emacs-version)) |
---|
3948 | (append (scheme-passwd-file-names "/etc/passwd" "^[^_].*") |
---|
3949 | (delete "Shared" (directory-files "/Users" nil "^[^.].*"))) |
---|
3950 | (scheme-passwd-file-names "/etc/passwd"))) |
---|
3951 | |
---|
3952 | (defun scheme-complete-host-name (trans sym) |
---|
3953 | (append (scheme-host-file-names "/etc/hosts") |
---|
3954 | (scheme-ssh-known-hosts-file-names "~/.ssh/known_hosts") |
---|
3955 | (scheme-ssh-config-file-names "~/.ssh/config"))) |
---|
3956 | |
---|
3957 | ;; my /etc/services is 14k lines, so we try to optimize this |
---|
3958 | (defun scheme-complete-port-name (trans sym) |
---|
3959 | (and (file-readable-p "/etc/services") |
---|
3960 | (scheme-with-find-file "/etc/services" |
---|
3961 | (goto-char (point-min)) |
---|
3962 | (let ((rx (concat "^\\(" (regexp-quote (if (symbolp sym) |
---|
3963 | (symbol-name sym) |
---|
3964 | sym)) |
---|
3965 | "[^ ]*\\)")) |
---|
3966 | (res '())) |
---|
3967 | (while (not (eobp)) |
---|
3968 | (if (not (re-search-forward rx nil t)) |
---|
3969 | (goto-char (point-max)) |
---|
3970 | (let ((str (match-string-no-properties 1))) |
---|
3971 | (if (not (equal str (car res))) |
---|
3972 |
---|