-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathscheme-complete.el
More file actions
4770 lines (4517 loc) · 194 KB
/
scheme-complete.el
File metadata and controls
4770 lines (4517 loc) · 194 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
;;; scheme-complete.el --- Smart auto completion for Scheme in Emacs
;;; Author: Alex Shinn
;;; Version: 0.9.10
;;; This code is written by Alex Shinn and placed in the Public
;;; Domain. All warranties are disclaimed.
;;; Commentary:
;;; This file provides a single function, `scheme-smart-complete',
;;; which you can use for intelligent, context-sensitive completion
;;; for any Scheme implementation. To use it just load this file and
;;; bind that function to a key in your preferred mode:
;;;
;;; (autoload 'scheme-smart-complete "scheme-complete" nil t)
;;; (eval-after-load 'scheme
;;; '(define-key scheme-mode-map "\e\t" 'scheme-smart-complete))
;;;
;;; Alternately, you may want to just bind TAB to the
;;; `scheme-complete-or-indent' function, which indents at the start
;;; of a line and otherwise performs the smart completion:
;;;
;;; (eval-after-load 'scheme
;;; '(define-key scheme-mode-map "\t" 'scheme-complete-or-indent))
;;;
;;; Note: the completion uses a somewhat less common style than
;;; typically found in other modes. The first tab will complete the
;;; longest prefix common to all possible completions. The second
;;; tab will show a list of those completions. Subsequent tabs will
;;; scroll that list. You can't use the mouse to select from the
;;; list - when you see what you want, just type the next one or
;;; more characters in the symbol you want and hit tab again to
;;; continue completing it. Any key typed will bury the completion
;;; list. This ensures you can achieve a completion with the
;;; minimal number of keystrokes without the completions window
;;; lingering and taking up space.
;;;
;;; If you use eldoc-mode (included in Emacs), you can also get live
;;; scheme documentation with:
;;;
;;; (autoload 'scheme-get-current-symbol-info "scheme-complete" nil t)
;;; (add-hook 'scheme-mode-hook
;;; (lambda ()
;;; (make-local-variable 'eldoc-documentation-function)
;;; (setq eldoc-documentation-function 'scheme-get-current-symbol-info)
;;; (eldoc-mode)))
;;;
;;; You can enable slightly smarter indentation with
;;;
;;; (setq lisp-indent-function 'scheme-smart-indent-function)
;;;
;;; which basically ignores the scheme-indent-function property for
;;; locally overridden symbols (e.g. if you use the (let loop () ...)
;;; idiom it won't use the special loop indentation inside).
;;;
;;; There's a single custom variable, `scheme-default-implementation',
;;; which you can use to specify your preferred implementation when we
;;; can't infer it from the source code.
;;;
;;; That's all there is to it.
;;; History:
;;; 0.9.10: 2024/12/05 - add SRFI 227, fix rename exports, don't add implicitly
;;; opened files to file-name-history
;;; 0.9.9: 2020/06/30 - add support for alias-for, add `scheme-insert-globals'
;;; 0.9.8: 2018/10/29 - replace old eldoc symbol functions with elisp equivs
;;; 0.9.7: 2017/08/24 - improving caching, adding some missing (scheme char)
;;; bindings
;;; 0.9.6: 2017/04/10 - fix possible inf loop in enclosing-2-sexp-prefixes
;;; 0.9.5: 2017/04/02 - completiong for only/except/export, better caching
;;; 0.9.4: 2017/04/01 - don't open non-existant files
;;; 0.9.3: 2016/06/04 - string-cursors, bugfixes, speedups, introducing
;;: unit tests with ert
;;; 0.9.2: 2016/05/03 - several bugfixes
;;; 0.9.1: 2016/04/08 - fixing bug in cond-expand parsing
;;; 0.9.0: 2015/12/23 - R7RS support
;;; 0.8.11: 2013/02/20 - formatting for melpa packaging
;;; 0.8.10: 2010/01/31 - factoring out a `scheme-get-completions' utility
;;; (thanks to Scott Dolim), and not jumping to end
;;; of current symbol if there are no completions for it
;;; 0.8.9: 2009/10/28 - allowing indented module/library definitions,
;;; added various customizations for tab/indent behavior,
;;; complete jumps to end of current symbol
;;; 0.8.8: 2009/08/18 - fixing bug in scheme-directory-tree-files
;; with funny file names
;;; 0.8.7: 2009/07/18 - foof-loop support, don't complete current var,
;; updating chicken 4 module information
;;; 0.8.6: 2009/05/03 - fixing support for chicken 4 w/ unbalanced parens
;;; 0.8.5: 2009/04/30 - full support for chicken 4, fixed bug in caching
;;; 0.8.4: 2008/12/26 - numerous small bugfixes (Merry Christmas!)
;;; 0.8.3: 2008/10/06 - smart indent, inferring types from imported modules,
;;; optionally caching exports, chicken 4 support
;;; 0.8.2: 2008/07/04 - both TAB and M-TAB scroll results (thanks Peter Bex),
;;; better MATCH handling, fixed SRFI-55, other bugfixes
;;; 0.8.1: 2008/04/17 - great renaming, everthing starts with `scheme-'
;;; also, don't scan imported modules multiple times
;;; 0.8: 2008/02/08 - several parsing bugfixes on unclosed parenthesis
;;; (thanks to Kazushi NODA)
;;; filename completion works properly on absolute paths
;;; eldoc works properly on dotted lambdas
;;; 0.7: 2008/01/18 - handles higher-order types (for apply, map, etc.)
;;; smarter string completion (hostname, username, etc.)
;;; smarter type inference, various bugfixes
;;; 0.6: 2008/01/06 - more bugfixes (merry christmas)
;;; 0.5: 2008/01/03 - handling internal defines, records, smarter
;;; parsing
;;; 0.4: 2007/11/14 - silly bugfix plus better repo env support
;;; for searching chicken and gauche modules
;;; 0.3: 2007/11/13 - bugfixes, better inference, smart strings
;;; 0.2: 2007/10/15 - basic type inference
;;; 0.1: 2007/09/11 - initial release
;;;
;;; What is this talk of 'release'? Klingons do not make software
;;; 'releases'. Our software 'escapes' leaving a bloody trail of
;;; designers and quality assurance people in its wake.
(require 'cl)
;; this is just to eliminate some warnings when compiling - this file
;; should be loaded after 'scheme
(eval-when (compile)
(require 'scheme))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; You can set the `scheme-default-implementation' to your preferred
;; implementation, for when we can't figure out the file from
;; heuristics. Alternately, in any given buffer, just
;;
;; (setq *scheme-current-implementation* whatever)
(defvar *scheme-current-implementation* nil)
(make-variable-buffer-local '*scheme-current-implementation*)
(defvar *scheme-current-context* nil)
(make-variable-buffer-local '*scheme-current-context*)
;; most implementations use their name as the script name
(defvar *scheme-interpreter-alist*
'(("chibi-scheme" . chibi)
("csi" . chicken)
("gosh" . gauche)
("gsi" . gambit)
))
(defvar in-mod-p nil)
(defgroup scheme-complete nil
"Smart tab completion"
:group 'scheme)
(defcustom scheme-default-implementation nil
"Default scheme implementation to provide completion for
when scheme-complete can't infer the current implementation."
:type 'symbol
:group 'scheme-complete)
(defcustom scheme-always-use-default-implementation-p nil
"Always use `scheme-default-implementation' instead of heuristics."
:type 'symbol
:group 'scheme-complete)
(defcustom scheme-complete-smart-indent-p t
"Toggles using `scheme-smart-indent' for `scheme-complete-or-indent'."
:type 'boolean
:group 'scheme-complete)
(defcustom scheme-indent-before-complete-p nil
"Toggles indenting the current line before completing."
:type 'boolean
:group 'scheme-complete)
(defcustom scheme-complete-empty-tab-behavior 'complete
"Behavior for `scheme-complete-or-indent' when completing an empty symbol.
A value of `complete' (the default) will complete all symbols
elligible according to the normal type inference rules. Since
they are not being filtered by any prefix, the list may be long -
you can scroll through it or switch to the *Completions* buffer
to view it. A value of `indent' will assume you meant to indent
at that location, and `beep' will just beep and do nothing."
:type '(choice (const complete) (const indent) (const beep))
:group 'scheme-complete)
(defcustom scheme-complete-from-end-of-symbol-p t
"If true jump to the end when completing from the middle of a symbol."
:type 'boolean
:group 'scheme-complete)
(defcustom scheme-complete-cache-p t
"Toggles caching of module/load export information."
:type 'boolean
:group 'scheme-complete)
(defcustom scheme-interleave-definitions-p nil
"Allow internal defines to be mixed with expressions."
:type 'boolean
:group 'scheme-complete)
(defcustom scheme-complete-recursive-inference-p t
"Recursively infer types from imported modules rather than shallow parses."
:type 'boolean
:group 'scheme-complete)
(defcustom *scheme-r7rs-extension* ".sld"
"File extension for R7RS library declarations."
:type 'string
:group 'scheme-complete)
(defcustom *scheme-max-decl-file-search-depth* 5
"Maximum number of directories to backtrack looking for including libraries."
:type 'integer
:group 'scheme-complete)
(defcustom *scheme-use-r7rs* t
"Set to nil to restore legacy behavior."
:type 'boolean
:group 'scheme-complete)
(defcustom *scheme-default-library-path* nil
"Library path to search for modules. Inferred (possibly slowly) if not set."
:type '(repeat file)
:group 'scheme-complete)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; info
;;
;; identifier type [doc-string no-type-display?]
;;
;; types:
;;
;; pair, number, symbol, etc.
;; (lambda (param-types) [return-type])
;; (syntax (param-types) [return-type])
;; (set name values ...)
;; (flags name values ...)
;; (list type)
;; (string expander)
;; (special type function [outer-function])
(defvar *scheme-r7rs-lib-decl-info*
'((begin (syntax (body \.\.\.)))
(cond-expand (syntax (clause \.\.\.)))
(export (syntax identifier \.\.\.))
(import (special list scheme-available-modules))
(include (syntax filename \.\.\.))
(include-ci (syntax filename \.\.\.))
(include-library-declarations (syntax filename \.\.\.))
(alias-for (special list scheme-available-modules))))
(defvar *scheme-r7rs-info*
`(((scheme base)
(_ (syntax) "auxiliary syntax")
(... (syntax) "auxiliary syntax")
(* (lambda (z1 \.\.\.) z))
(+ (lambda (z1 \.\.\.) z))
(- (lambda (z1 \.\.\.) z))
(/ (lambda (z1 \.\.\.) z))
(<= (lambda (x1 x2 \.\.\.) bool) "returns #t iff the arguments are monotonically nondecreasing")
(< (lambda (x1 x2 \.\.\.) bool) "returns #t iff the arguments are monotonically increasing")
(=> (syntax) "auxiliary syntax")
(= (lambda (z1 z2 \.\.\.) bool) "returns #t iff the arguments are all equal")
(>= (lambda (x1 x2 \.\.\.) bool) "returns #t iff the arguments are monotonically nonincreasing")
(> (lambda (x1 x2 \.\.\.) bool) "returns #t iff the arguments are monotonically decreasing")
(abs (lambda (x1) x2) "returns the absolute value of X")
(and (syntax (expr \.\.\.)) "evaluate EXPRs while true, return last")
(append (lambda (list \.\.\.) list) "concatenates the list arguments")
(apply (lambda ((lambda obj a) obj \.\.\.) a) "procedure application")
(assoc (lambda (obj list)) "the element of LIST whose car is equal? to OBJ")
(assq (lambda (obj list)) "the element of LIST whose car is eq? to OBJ")
(assv (lambda (obj list)) "the element of LIST whose car is eqv? to OBJ")
(begin (syntax (expr \.\.\.)) "evaluate each EXPR in turn and return the last")
(boolean? (lambda (obj) bool) "returns #t iff OBJ is #t or #f")
(boolean=? (lambda (bool1 bool2) bool))
(bytevector (lambda (i \.\.\.) bytevector))
(bytevector-copy (lambda (bytevector :optional start end) bytevector))
(bytevector-append (lambda (bytevector \.\.\.) bytevector))
(bytevector-copy! (lambda (bytevector i \.\.\. bytevector :optional start end) undefined))
(bytevector-length (lambda (bytevector) i))
(bytevector-u8-ref (lambda (bytevector i) i))
(bytevector-u8-set! (lambda (bytevector i i) undefined))
(bytevector? (lambda (obj) bool))
(caar (lambda (pair) obj))
(cadr (lambda (pair) obj))
(call-with-current-continuation (lambda (proc) obj) "goto on steroids")
(call-with-values (lambda (producer consumer) obj))
(call-with-port (lambda (port proc) obj))
(call/cc (lambda (proc) obj) "short for call-with-current-continuation")
(case (syntax (expr clause \.\.\.)) "look for EXPR among literal lists")
(car (lambda (pair) obj))
(cdr (lambda (pair) obj))
(cdar (lambda (pair) obj))
(cddr (lambda (pair) obj))
(ceiling (lambda (x1) n) "smallest integer not smaller than X")
(char->integer (lambda (ch) int))
(char<=? (lambda (ch1 ch2) bool))
(char<? (lambda (ch1 ch2) bool))
(char=? (lambda (ch1 ch2) bool))
(char>=? (lambda (ch1 ch2) bool))
(char>? (lambda (ch1 ch2) bool))
(char? (lambda (obj) bool) "returns #t iff OBJ is a character")
(complex? (lambda (obj) bool) "returns #t iff OBJ is a complex number")
(cond (syntax (clause \.\.\.)) "try each clause until one succeeds")
(cond-expand (syntax (clause \.\.\.)))
(cons (lambda (obj1 obj2) pair) "create a newly allocated pair")
(define-syntax (syntax (identifier body \.\.\.) undefined) "create a macro")
(define (syntax (identifier value) undefined) "define a new variable")
(define-values (syntax (identifier \.\.\.) expr))
(define-record-type (syntax name (make field \.\.\.) pred-name (field get set) \.\.\.))
(denominator (lambda (rational) n))
(do (syntax (vars finish body \.\.\.)) "simple iterator")
(dynamic-wind (lambda (before-thunk thunk after-thunk) obj))
(else (syntax) "auxiliary syntax")
(eq? (lambda (obj1 obj2) bool) "finer grained version of EQV?")
(equal? (lambda (obj1 obj2) bool) "recursive equivalence")
(eqv? (lambda (obj1 obj2) bool) "returns #t if OBJ1 and OBJ2 are the same object")
(error (lambda (msg args \.\.\.) error))
(error-object? (lambda (obj) bool))
(error-object-message (lambda (error) string))
(error-object-irritants (lambda (error) list))
(even? (lambda (n) bool))
(exact (lambda (z) z))
(exact-integer-sqrt (lambda (n) n))
(exact-integer? (lambda (z) bool))
(exact? (lambda (z) bool) "returns #t iff Z is exact")
(expt (lambda (z1 z2) z) "returns Z1 raised to the Z2 power")
(floor (lambda (x1) n) "largest integer not larger than X")
(for-each (lambda ((lambda obj a) obj \.\.\.) undefined) "apply PROC to each element of LIST in order")
(gcd (lambda (n1 \.\.\.) n) "greatest common divisor")
(floor/ (lambda (x1) (values n n)))
(floor-quotient (lambda (x1) n))
(floor-remainder (lambda (x1) n))
(truncate/ (lambda (x1) (values n n)))
(truncate-quotient (lambda (x1) n))
(truncate-remainder (lambda (x1) n))
(features (lambda () (list symbol)))
(guard (syntax ((var clause \.\.\.) body \.\.\.)))
(if (syntax (cond then else)) "conditional evaluation")
(include (syntax filename \.\.\.))
(include-ci (syntax filename \.\.\.))
(inexact (lambda (z) z))
(inexact? (lambda (z) bool) "returns #t iff Z is inexact")
(integer->char (lambda (int) ch))
(integer? (lambda (obj) bool) "returns #t iff OBJ is an integer")
(lambda (syntax (params body \.\.\.)) "procedure syntax")
(lcm (lambda (n2 \.\.\.) n) "least common multiple")
(length (lambda (list) n))
(let* (syntax (vars body \.\.\.)) "bind new local variables sequentially")
(let-syntax (syntax (syntaxes body \.\.\.)) "a local macro")
(letrec* (syntax (vars body \.\.\.)) "bind new local variables recursively in order")
(letrec-syntax (syntax (syntaxes body \.\.\.)) "a local macro")
(let-values (syntax (vars body \.\.\.)))
(let*-values (syntax (vars body \.\.\.)))
(letrec (syntax (vars body \.\.\.)) "bind new local variables recursively")
(let (syntax (vars body \.\.\.)) "bind new local variables in parallel")
(list-copy (lambda (list) list))
(list->string (lambda (list) str))
(list->vector (lambda (list) vec))
(list-ref (lambda (list k) obj) "returns the Kth element of LIST")
(list-set! (lambda (list k val) undefined))
(list-tail (lambda (list k) list) "returns the Kth cdr of LIST")
(list? (lambda (obj) bool) "returns #t iff OBJ is a proper list")
(list (lambda (obj \.\.\.) list) "returns a newly allocated list")
(make-bytevector (lambda (k :optional u8) bytevector))
(make-list (lambda (k :optional obj) list))
(make-parameter (lambda (init :optional converter) parameter))
(make-string (lambda (k :optional ch) str) "a new string of length k")
(make-vector (lambda (len :optional fill) vec) "a new vector of K elements")
(map (lambda ((lambda (obj1 . obj2) a) list \.\.\.) (list a)) "a new list of PROC applied to every element of LIST")
(max (lambda (x1 x2 \.\.\.) x3) "returns the maximum of the arguments")
(member (lambda (obj list)) "the sublist of LIST whose car is equal? to OBJ")
(memq (lambda (obj list)) "the sublist of LIST whose car is eq? to OBJ")
(memv (lambda (obj list)) "the sublist of LIST whose car is eqv? to OBJ")
(min (lambda (x1 x2 \.\.\.) x3) "returns the minimum of the arguments")
(modulo (lambda (n1 n2) n) "same sign as N2")
(negative? (lambda (x1) bool))
(not (lambda (obj) bool) "returns #t iff OBJ is false")
(null? (lambda (obj) bool) "returns #t iff OBJ is the empty list")
(number->string (lambda (z :optional radix) str))
(number? (lambda (obj) bool) "returns #t iff OBJ is a number")
(numerator (lambda (rational) n))
(odd? (lambda (n) bool))
(or (syntax (expr \.\.\.)) "return the first true EXPR")
(pair? (lambda (obj) bool) "returns #t iff OBJ is a pair")
(parameterize (syntax (((id value) \.\.\.) body \.\.\.)))
(positive? (lambda (x1) bool))
(procedure? (lambda (obj) bool) "returns #t iff OBJ is a procedure")
(quasiquote (syntax (expr)) "quote literals allowing escapes")
(quote (syntax (expr)) "represent EXPR literally without evaluating it")
(quotient (lambda (n1 n2) n) "integer division")
(raise-continuable (lambda (obj) error))
(raise (lambda (obj) error))
(rational? (lambda (obj) bool) "returns #t iff OBJ is a rational number")
(rationalize (lambda (x1 y) n) "rational number differing from X by at most Y")
(real? (lambda (obj) bool) "returns #t iff OBJ is a real number")
(remainder (lambda (n1 n2) n) "same sign as N1")
(reverse (lambda (list) list))
(round (lambda (x1) n) "round to even (banker's rounding)")
(set! (syntax (identifier value) undefined) "set the value of a variable")
(set-car! (lambda (pair obj) undefined))
(set-cdr! (lambda (pair obj) undefined))
(square (lambda (z) z))
(string->list (lambda (str) list))
(string->number (lambda (str :optional radix) z))
(string->symbol (lambda (str) symbol))
(string->vector (lambda (str) vector))
(string-append (lambda (str \.\.\.) str) "concatenate the string arguments")
(string-copy (lambda (str) str))
(string-copy! (lambda (str k str :optional start end) undefined))
(string-fill! (lambda (str ch) undefined) "set every char in STR to CH")
(string-for-each (lambda (proc str \.\.\.) undefined))
(string-length (lambda (str) n) "the number of characters in STR")
(string-map (lambda (proc str \.\.\.) str))
(string-ref (lambda (str i) ch) "the Ith character of STR")
(string-set! (lambda (str i ch) undefined) "set the Ith character of STR to CH")
(string<=? (lambda (str1 str2) bool))
(string<? (lambda (str1 str2) bool))
(string=? (lambda (str1 str2) bool))
(string>=? (lambda (str1 str2) bool))
(string>? (lambda (str1 str2) bool))
(string? (lambda (obj) bool) "returns #t iff OBJ is a string")
(string (lambda (ch \.\.\.) str) "a new string made of the char arguments")
(substring (lambda (str start end) str))
(symbol->string (lambda (symbol) str))
(symbol=? (lambda (symbol1 symbol2) bool))
(symbol? (lambda (obj) bool) "returns #t iff OBJ is a symbol")
(syntax-error (syntax (msg obj \.\.\.) error))
(syntax-rules (syntax (literals clauses \.\.\.) undefined) "simple macro language")
(truncate (lambda (x1) n) "drop fractional part")
(values (lambda (obj \.\.\.) (values obj \.\.\.)) "send multiple values to the calling continuation")
(unquote (syntax (expr)) "escape an expression inside quasiquote")
(unquote-splicing (syntax (expr)) "escape and splice a list expression inside quasiquote")
(vector-append (lambda (vec \.\.\.) vec))
(vector-copy (lambda (vec :optional start end) vec))
(vector-copy! (lambda (vec k vec :optional start end) undefined))
(vector->list (lambda (vec) list))
(vector->string (lambda (vec) str))
(vector-fill! (lambda (vec obj) undefined) "set every element in VEC to OBJ")
(vector-for-each (lambda (proc vec \.\.\.) undefined))
(vector-length (lambda (vec) n) "the number of elements in VEC")
(vector-map (lambda (proc vec \.\.\.) map))
(vector-ref (lambda (vec i) obj) "the Ith element of VEC")
(vector-set! (lambda (vec i obj) undefined) "set the Ith element of VEC to OBJ")
(vector? (lambda (obj) bool) "returns #t iff OBJ is a vector")
(vector (lambda (obj \.\.\.) vec))
(zero? (lambda (z) bool))
(when (syntax (expr body \.\.\.)))
(with-exception-handler (lambda (proc thunk)))
(unless (syntax (expr body \.\.\.)))
(binary-port? (lambda (obj) bool))
(char-ready? (lambda (:optional input-port) bool))
(textual-port? (lambda (obj) bool))
(close-port (lambda (port) undefined))
(close-input-port (lambda (input-port)))
(close-output-port (lambda (output-port)))
(current-error-port (lambda () output-port) "the default output for error messages")
(current-input-port (lambda () input-port) "the default input for read procedures")
(current-output-port (lambda () output-port) "the default output for write procedures")
(eof-object (lambda () eof-object))
(eof-object? (lambda (obj) bool) "returns #t iff OBJ is the end-of-file object")
(file-error? (lambda (obj) bool))
(flush-output-port (lambda (:optional output-port) undefined))
(get-output-string (lambda (output-port) str))
(get-output-bytevector (lambda (output-port) bytevector))
(input-port? (lambda (obj) bool) "returns #t iff OBJ is an input port")
(input-port-open? (lambda (input-port) bool))
(newline (lambda (:optional output-port) undefined) "send a linefeed")
(open-input-string (lambda (str) input-port))
(open-input-bytevector (lambda (bytevector) input-port))
(open-output-string (lambda () output-port))
(open-output-bytevector (lambda () output-port))
(output-port? (lambda (obj) bool) "returns #t iff OBJ is an output port")
(output-port-open? (lambda (output-port) bool))
(peek-char (lambda (:optional input-port) ch))
(peek-u8 (lambda (:optional input-port) u8))
(port? (lambda (obj) port))
(read-bytevector (lambda (k :optional input-port) bytevector))
(read-bytevector! (lambda (bytevector :optional input-port start end) undefined))
(read-char (lambda (:optional input-port) ch) "read a single character")
(read-error? (lambda (obj) error))
(read-line (lambda (:optional input-port) str))
(read-string (lambda (k :optional input-port)))
(read-u8 (lambda (:optional input-port) u8))
(string->utf8 (lambda (str :optional start end) bytevector))
(utf8->string (lambda (bytevector :optional start end) str))
(u8-ready? (lambda (:optional input-port) bool))
(write-bytevector (lambda (bytevector :optional output-port start end)))
(write-char (lambda (char :optional output-port) undefined) "write a single character")
(write-string (lambda (str :optional output-port start end)))
(write-u8 (lambda (u8 :optional output-port))))
((scheme case-lambda)
(case-lambda (syntax (clauses \.\.\.) procedure)))
((scheme char)
(digit-value (lambda (ch) n))
(char-downcase (lambda (ch) ch))
(char-foldcase (lambda (ch) ch))
(char-upcase (lambda (ch) ch))
(char-alphabetic? (lambda (ch) bool))
(char-lower-case? (lambda (ch) bool))
(char-upper-case? (lambda (ch) bool))
(char-numeric? (lambda (ch) bool))
(char-whitespace? (lambda (ch) bool))
(char-ci<=? (lambda (ch1 ch2 \.\.\.) bool))
(char-ci<? (lambda (ch1 ch2 \.\.\.) bool))
(char-ci=? (lambda (ch1 ch2 \.\.\.) bool))
(char-ci>=? (lambda (ch1 ch2 \.\.\.) bool))
(char-ci>? (lambda (ch1 ch2 \.\.\.) bool))
(string-downcase (lambda (str) str))
(string-foldcase (lambda (str) str))
(string-upcase (lambda (str) str))
(string-ci<=? (lambda (str1 str2 \.\.\.) bool))
(string-ci<? (lambda (str1 str2 \.\.\.) bool))
(string-ci=? (lambda (str1 str2 \.\.\.) bool))
(string-ci>=? (lambda (str1 str2 \.\.\.) bool))
(string-ci>? (lambda (str1 str2 \.\.\.) bool)))
((scheme complex)
(angle (lambda (z) x1))
(imag-part (lambda (z) x1))
(magnitude (lambda (z) x1))
(make-polar (lambda (x1 x2) z) "create a complex number")
(make-rectangular (lambda (x1 x2) z) "create a complex number")
(real-part (lambda (z) x1)))
((scheme cxr)
(caaaar (lambda (pair))) (caaadr (lambda (pair)))
(caadar (lambda (pair))) (caaddr (lambda (pair)))
(cadaar (lambda (pair))) (cadadr (lambda (pair)))
(caddar (lambda (pair))) (cadddr (lambda (pair)))
(cdaaar (lambda (pair))) (cdaadr (lambda (pair)))
(cdadar (lambda (pair))) (cdaddr (lambda (pair)))
(cddaar (lambda (pair))) (cddadr (lambda (pair)))
(cdddar (lambda (pair))) (cddddr (lambda (pair)))
(caaar (lambda (pair))) (caadr (lambda (pair)))
(cadar (lambda (pair))) (caddr (lambda (pair)))
(cdaar (lambda (pair))) (cdadr (lambda (pair)))
(cddar (lambda (pair))) (cdddr (lambda (pair))))
((scheme eval)
(eval (lambda (expr env)))
(environment (lambda (list \.\.\.) env)))
((scheme file)
(call-with-input-file (lambda (path proc) input-port))
(call-with-output-file (lambda (path proc) output-port))
(delete-file (lambda (path) undefined))
(file-exists? (lambda (path) bool))
(open-input-file (lambda (path) input-port))
(open-output-file (lambda (path) output-port))
(open-binary-input-file (lambda (path) input-port))
(open-binary-output-file (lambda (path) output-port))
(with-input-from-file (lambda (path thunk) obj))
(with-output-to-file (lambda (path thunk) obj)))
((scheme inexact)
(acos (lambda (z) z) "arccosine function")
(asin (lambda (z) z) "arcsine function")
(atan (lambda (z) z) "arctangent function")
(cos (lambda (z) z) "cosine function")
(exp (lambda (z) z) "e^Z")
(finite? (lambda (z) bool))
(infinite? (lambda (z) bool))
(log (lambda (z) z) "natural logarithm of Z")
(nan? (lambda (z) bool))
(sin (lambda (z) z) "sine function")
(sqrt (lambda (z) z) "principal square root of Z")
(tan (lambda (z) z)))
((scheme lazy)
(delay (syntax (expr)) "create a promise to evaluate EXPR")
(delay-force (syntax (expr)))
(force (lambda (promise) obj) "force the delayed value of PROMISE")
(make-promise (lambda (obj) promise))
(promise? (lambda (obj) bool)))
((scheme load)
(load (lambda (path) undefined)))
((scheme process-context)
(get-environment-variable (lambda (str) (or str bool)))
(get-environment-variables (lambda () (list (pair str str))))
(command-line (lambda () (list str)))
(emergency-exit (lambda (:optional obj) undefined))
(exit (lambda (:optional obj) undefined)))
((scheme read)
(read (lambda (:optional input-port) obj)))
((scheme repl)
(interaction-environment (lambda () env)))
((scheme time)
(current-second (lambda () x1))
(current-jiffy (lambda () n))
(jiffies-per-second (lambda () n)))
((scheme write)
(write (lambda (obj :optional output-port) undefined) "write an object, handling cycles")
(write-shared (lambda (obj :optional output-port) undefined) "write an object showing all shared structure")
(write-simple (lambda (obj :optional output-port) undefined) "write a non-cyclic object")
(display (lambda (obj :optional output-port) undefined) "display an object"))
))
(defvar *scheme-r5rs-info*
nil)
(defvar *scheme-r5rs-bindings*
'(define set! let let* letrec lambda if cond
case delay and or begin do quote quasiquote unquote unquote-splicing
define-syntax let-syntax letrec-syntax syntax-rules eqv? eq? equal? not
boolean? number? complex? real? rational? integer? exact? inexact? = < >
<= >= zero? positive? negative? odd? even? max min + * - / abs quotient
remainder modulo gcd lcm numerator denominator floor ceiling truncate
round rationalize exp log sin cos tan asin acos atan sqrt expt
make-rectangular make-polar real-part imag-part magnitude angle
number->string string->number pair? cons car cdr set-car! set-cdr! caar
cadr cdar cddr caaar caadr cadar caddr cdaar cdadr cddar cdddr caaaar
caaadr caadar caaddr cadaar cadadr caddar cadddr cdaaar cdaadr cdadar
cdaddr cddaar cddadr cdddar cddddr null? list? list length append reverse
list-tail list-ref memq memv member assq assv assoc symbol? symbol->string
string->symbol char? char=? char<? char>? char<=? char>=? char-ci=?
char-ci<? char-ci>? char-ci<=? char-ci>=? char-alphabetic? char-numeric?
char-whitespace? char-upper-case? char-lower-case? char->integer
integer->char char-upcase char-downcase string? make-string string
string-length string-ref string-set! string=? string-ci=? string<?
string>? string<=? string>=? string-ci<? string-ci>? string-ci<=?
string-ci>=? substring string-append string->list list->string string-copy
string-fill! vector? make-vector vector vector-length vector-ref
vector-set! vector->list list->vector vector-fill! procedure? apply map
for-each force call-with-current-continuation values call-with-values
dynamic-wind scheme-report-environment null-environment
call-with-input-file call-with-output-file input-port? output-port?
current-input-port current-output-port with-input-from-file
with-output-to-file open-input-file open-output-file close-input-port
close-output-port read read-char peek-char eof-object? char-ready? write
display newline write-char load eval))
(defun scheme-r5rs-info ()
(unless *scheme-r5rs-info*
(setq *scheme-r5rs-info*
(append
'((exact->inexact (lambda (z) z))
(inexact->exact (lambda (z) z)))
(mapcar #'(lambda (x)
(scheme-env-lookup *scheme-r7rs-info* x))
*scheme-r5rs-bindings*))))
*scheme-r5rs-info*)
(defvar *scheme-srfi-info*
[
;; SRFI 0
("Feature-based conditional expansion construct"
(cond-expand (syntax (clause \.\.\.))))
;; SRFI 1
("List Library"
(xcons (lambda (object object) pair))
(cons* (lambda (object \.\.\.) pair))
(make-list (lambda (integer :optional object) list))
(list-tabulate (lambda (integer procedure) list))
(list-copy (lambda (list) list))
(circular-list (lambda (object \.\.\.) list))
(iota (lambda (integer :optional integer integer) list))
(proper-list? (lambda (object) bool))
(circular-list? (lambda (object) bool))
(dotted-list? (lambda (object) bool))
(not-pair? (lambda (object) bool))
(null-list? (lambda (object) bool))
(list= (lambda (procedure list \.\.\.) bool))
(first (lambda (pair)))
(second (lambda (pair)))
(third (lambda (pair)))
(fourth (lambda (pair)))
(fifth (lambda (pair)))
(sixth (lambda (pair)))
(seventh (lambda (pair)))
(eighth (lambda (pair)))
(ninth (lambda (pair)))
(tenth (lambda (pair)))
(car+cdr (lambda (pair)))
(take (lambda (pair integer) list))
(drop (lambda (pair integer) list))
(take-right (lambda (pair integer) list))
(drop-right (lambda (pair integer) list))
(take! (lambda (pair integer) list))
(drop-right! (lambda (pair integer) list))
(split-at (lambda (pair integer) list))
(split-at! (lambda (pair integer) list))
(last (lambda (pair) obj))
(last-pair (lambda (pair) pair))
(length+ (lambda (object) n))
(concatenate (lambda (list) list))
(append! (lambda (list \.\.\.) list))
(concatenate! (lambda (list) list))
(reverse! (lambda (list) list))
(append-reverse (lambda (list list) list))
(append-reverse! (lambda (list list) list))
(zip (lambda (list \.\.\.) list))
(unzip1 (lambda (list) list))
(unzip2 (lambda (list) list))
(unzip3 (lambda (list) list))
(unzip4 (lambda (list) list))
(unzip5 (lambda (list) list))
(count (lambda ((lambda (obj1 . obj2)) list \.\.\.) n))
(fold (lambda ((lambda (obj1 obj2 . obj3) a) object list \.\.\.) a))
(unfold (lambda (procedure procedure procedure object :optional procedure) obj))
(pair-fold (lambda ((lambda obj a) object list \.\.\.) a))
(reduce (lambda ((lambda (obj1 obj2 . obj3) a) object list \.\.\.) a))
(fold-right (lambda ((lambda (obj1 obj2 . obj3) a) object list \.\.\.) a))
(unfold-right (lambda (procedure procedure procedure object :optional object) obj))
(pair-fold-right (lambda ((lambda (obj1 obj2 . obj3) a) object list \.\.\.) a))
(reduce-right (lambda ((lambda (obj1 obj2 . obj3) a) object list \.\.\.) a))
(append-map (lambda ((lambda (obj1 . obj2)) list \.\.\.) list))
(append-map! (lambda ((lambda (obj1 . obj2)) list \.\.\.) list))
(map! (lambda ((lambda (obj1 . obj2)) list \.\.\.) list))
(pair-for-each (lambda ((lambda (obj1 . obj2)) list \.\.\.) undefined))
(filter-map (lambda ((lambda (obj1 . obj2)) list \.\.\.) list))
(map-in-order (lambda ((lambda (obj1 . obj2)) list \.\.\.) list))
(filter (lambda ((lambda (obj1 . obj2)) list) list))
(partition (lambda ((lambda (obj) bool) list) list))
(remove (lambda ((lambda (obj1) bool) list) list))
(filter! (lambda ((lambda (obj1) bool) list) list))
(partition! (lambda ((lambda (obj1) bool) list) list))
(remove! (lambda ((lambda (obj1) bool) list) list))
(find (lambda ((lambda (obj1) bool) list) obj))
(find-tail (lambda ((lambda (obj1) bool) list) obj))
(any (lambda ((lambda (obj1 . obj2) a) list \.\.\.) a))
(every (lambda ((lambda (obj1 . obj2) a) list \.\.\.) a))
(list-index (lambda ((lambda (obj1 . obj2)) list \.\.\.) (or bool integer)))
(take-while (lambda ((lambda (obj)) list) list))
(drop-while (lambda ((lambda (obj)) list) list))
(take-while! (lambda ((lambda (obj)) list) list))
(span (lambda ((lambda (obj)) list) list))
(break (lambda ((lambda (obj)) list) list))
(span! (lambda ((lambda (obj)) list) list))
(break! (lambda ((lambda (obj)) list) list))
(delete (lambda (object list :optional procedure) list))
(delete-duplicates (lambda (list :optional procedure) list))
(delete! (lambda (obj list :optional procedure) list))
(delete-duplicates! (lambda (list :optional procedure) list))
(alist-cons (lambda (obj1 obj2 alist) alist))
(alist-copy (lambda (alist) alist))
(alist-delete (lambda (obj alist) alist))
(alist-delete! (lambda (obj alist) alist))
(lset<= (lambda (procedure list \.\.\.) bool))
(lset= (lambda (procedure list \.\.\.) bool))
(lset-adjoin (lambda (procedure list object \.\.\.) list))
(lset-union (lambda (procedure list \.\.\.) list))
(lset-union! (lambda (procedure list \.\.\.) list))
(lset-intersection (lambda (procedure list \.\.\.) list))
(lset-intersection! (lambda (procedure list \.\.\.) list))
(lset-difference (lambda (procedure list \.\.\.) list))
(lset-difference! (lambda (procedure list \.\.\.) list))
(lset-xor (lambda (procedure list \.\.\.) list))
(lset-xor! (lambda (procedure list \.\.\.) list))
(lset-diff+intersection (lambda (procedure list \.\.\.) list))
(lset-diff+intersection! (lambda (procedure list \.\.\.) list))
)
;; SRFI 2
("AND-LET*: an AND with local bindings, a guarded LET* special form"
(and-let* (syntax (bindings body \.\.\.))))
()
;; SRFI 4
("Homogeneous numeric vector datatypes"
(u8vector? (lambda (obj) bool))
(make-u8vector (lambda (size integer) u8vector))
(u8vector (lambda (integer \.\.\.) u8vector))
(u8vector-length (lambda (u8vector) n))
(u8vector-ref (lambda (u8vector i) int))
(u8vector-set! (lambda (u8vector i u8value) undefined))
(u8vector->list (lambda (u8vector) list))
(list->u8vector (lambda (list) u8vector))
(s8vector? (lambda (obj) bool))
(make-s8vector (lambda (size integer) s8vector))
(s8vector (lambda (integer \.\.\.) s8vector))
(s8vector-length (lambda (s8vector) n))
(s8vector-ref (lambda (s8vector i) int))
(s8vector-set! (lambda (s8vector i s8value) undefined))
(s8vector->list (lambda (s8vector) list))
(list->s8vector (lambda (list) s8vector))
(u16vector? (lambda (obj) bool))
(make-u16vector (lambda (size integer) u16vector))
(u16vector (lambda (integer \.\.\.)))
(u16vector-length (lambda (u16vector) n))
(u16vector-ref (lambda (u16vector i) int))
(u16vector-set! (lambda (u16vector i u16value) undefined))
(u16vector->list (lambda (u16vector) list))
(list->u16vector (lambda (list) u16vector))
(s16vector? (lambda (obj) bool))
(make-s16vector (lambda (size integer) s16vector))
(s16vector (lambda (integer \.\.\.) s16vector))
(s16vector-length (lambda (s16vector) n))
(s16vector-ref (lambda (s16vector i) int))
(s16vector-set! (lambda (s16vector i s16value) undefined))
(s16vector->list (lambda (s16vector) list))
(list->s16vector (lambda (list) s16vector))
(u32vector? (lambda (obj) bool))
(make-u32vector (lambda (size integer) u32vector))
(u32vector (lambda (integer \.\.\.) u32vector))
(u32vector-length (lambda (u32vector) n))
(u32vector-ref (lambda (u32vector i) int))
(u32vector-set! (lambda (u32vector i u32value) undefined))
(u32vector->list (lambda (u32vector) list))
(list->u32vector (lambda (list) u32vector))
(s32vector? (lambda (obj) bool))
(make-s32vector (lambda (size integer) s32vector))
(s32vector (lambda (integer \.\.\.) s32vector))
(s32vector-length (lambda (s32vector) n))
(s32vector-ref (lambda (s32vector i) int))
(s32vector-set! (lambda (s32vector i s32value) undefined))
(s32vector->list (lambda (s32vector) list))
(list->s32vector (lambda (list) s32vector))
(u64vector? (lambda (obj) bool))
(make-u64vector (lambda (size integer) u64vector))
(u64vector (lambda (integer \.\.\.) u64vector))
(u64vector-length (lambda (u64vector) n))
(u64vector-ref (lambda (u64vector i) int))
(u64vector-set! (lambda (u64vector i u64value) undefined))
(u64vector->list (lambda (u64vector) list))
(list->u64vector (lambda (list) u64vector))
(s64vector? (lambda (obj) bool))
(make-s64vector (lambda (size integer) s64vector))
(s64vector (lambda (integer \.\.\.) s64vector))
(s64vector-length (lambda (s64vector) n))
(s64vector-ref (lambda (s64vector i) int))
(s64vector-set! (lambda (s64vector i s64value) undefined))
(s64vector->list (lambda (s64vector) list))
(list->s64vector (lambda (list) s64vector))
(f32vector? (lambda (obj) bool))
(make-f32vector (lambda (size integer) f32vector))
(f32vector (lambda (number \.\.\.) f32vector))
(f32vector-length (lambda (f32vector) n))
(f32vector-ref (lambda (f32vector i) int))
(f32vector-set! (lambda (f32vector i f32value) undefined))
(f32vector->list (lambda (f32vector) list))
(list->f32vector (lambda (list) f32vector))
(f64vector? (lambda (obj) bool))
(make-f64vector (lambda (size integer) f64vector))
(f64vector (lambda (number \.\.\.) f64vector))
(f64vector-length (lambda (f64vector) n))
(f64vector-ref (lambda (f64vector i) int))
(f64vector-set! (lambda (f64vector i f64value) undefined))
(f64vector->list (lambda (f64vector) list))
(list->f64vector (lambda (list) f64vector))
)
;; SRFI 5
("A compatible let form with signatures and rest arguments"
(let (syntax (bindings body \.\.\.))))
;; SRFI 6
("Basic String Ports"
(open-input-string (lambda (str) input-port))
(open-output-string (lambda () output-port))
(get-output-string (lambda (output-port) str)))
;; SRFI 7
("Feature-based program configuration language"
(program (syntax (clause \.\.\.)))
(feature-cond (syntax (clause))))
;; SRFI 8
("receive: Binding to multiple values"
(receive (syntax (identifiers producer body \.\.\.))))
;; SRFI 9
("Defining Record Types"
(define-record-type (syntax (name constructor-name pred-name fields \.\.\.))))
;; SRFI 10
("Sharp-Comma External Form"
(define-reader-ctor (syntax (name proc) undefined)))
;; SRFI 11
("Syntax for receiving multiple values"
(let-values (syntax (bindings body \.\.\.)))
(let-values* (syntax (bindings body \.\.\.))))
()
;; SRFI 13
("String Library"
(string-map (lambda (proc str :optional start end) str))
(string-map! (lambda (proc str :optional start end) undefined))
(string-fold (lambda (kons knil str :optional start end) obj))
(string-fold-right (lambda (kons knil str :optional start end) obj))
(string-unfold (lambda (p f g seed :optional base make-final) str))
(string-unfold-right (lambda (p f g seed :optional base make-final) str))
(string-tabulate (lambda (proc len) str))
(string-for-each (lambda (proc str :optional start end) undefined))
(string-for-each-index (lambda (proc str :optional start end) undefined))
(string-every (lambda (pred str :optional start end) obj))
(string-any (lambda (pred str :optional start end) obj))
(string-hash (lambda (str :optional bound start end) int))
(string-hash-ci (lambda (str :optional bound start end) int))
(string-compare (lambda (string1 string2 lt-proc eq-proc gt-proc :optional start end) obj))
(string-compare-ci (lambda (string1 string2 lt-proc eq-proc gt-proc :optional start end) obj))
(string= (lambda (string1 string2 :optional start1 end1 start2 end2) bool))
(string<> (lambda (string1 string2 :optional start1 end1 start2 end2) bool))
(string< (lambda (string1 string2 :optional start1 end1 start2 end2) bool))
(string> (lambda (string1 string2 :optional start1 end1 start2 end2) bool))
(string<= (lambda (string1 string2 :optional start1 end1 start2 end2) bool))
(string>= (lambda (string1 string2 :optional start1 end1 start2 end2) bool))
(string-ci= (lambda (string1 string2 :optional start1 end1 start2 end2) bool))
(string-ci<> (lambda (string1 string2 :optional start1 end1 start2 end2) bool))
(string-ci< (lambda (string1 string2 :optional start1 end1 start2 end2) bool))
(string-ci> (lambda (string1 string2 :optional start1 end1 start2 end2) bool))
(string-ci<= (lambda (string1 string2 :optional start1 end1 start2 end2) bool))
(string-ci>= (lambda (string1 string2 :optional start1 end1 start2 end2) bool))
(string-titlecase (lambda (string :optional start end) str))
(string-upcase (lambda (string :optional start end) str))
(string-downcase (lambda (string :optional start end) str))
(string-titlecase! (lambda (string :optional start end) undefined))
(string-upcase! (lambda (string :optional start end) undefined))
(string-downcase! (lambda (string :optional start end) undefined))
(string-take (lambda (string nchars) str))
(string-drop (lambda (string nchars) str))
(string-take-right (lambda (string nchars) str))
(string-drop-right (lambda (string nchars) str))
(string-pad (lambda (string k :optional char start end) str))
(string-pad-right (lambda (string k :optional char start end) str))
(string-trim (lambda (string :optional char/char-set/pred start end) str))
(string-trim-right (lambda (string :optional char/char-set/pred start end) str))
(string-trim-both (lambda (string :optional char/char-set/pred start end) str))
(string-filter (lambda (char/char-set/pred string :optional start end) str))
(string-delete (lambda (char/char-set/pred string :optional start end) str))
(string-index (lambda (string char/char-set/pred :optional start end) (or integer bool)))
(string-index-right (lambda (string char/char-set/pred :optional end start) (or integer bool)))
(string-skip (lambda (string char/char-set/pred :optional start end) (or integer bool)))
(string-skip-right (lambda (string char/char-set/pred :optional end start) (or integer bool)))
(string-count (lambda (string char/char-set/pred :optional start end) n))
(string-prefix-length (lambda (string1 string2 :optional start1 end1 start2 end2) n))
(string-suffix-length (lambda (string1 string2 :optional start1 end1 start2 end2) n))
(string-prefix-length-ci (lambda (string1 string2 :optional start1 end1 start2 end2) n))
(string-suffix-length-ci (lambda (string1 string2 :optional start1 end1 start2 end2) n))
(string-prefix? (lambda (string1 string2 :optional start1 end1 start2 end2) bool))
(string-suffix? (lambda (string1 string2 :optional start1 end1 start2 end2) bool))
(string-prefix-ci? (lambda (string1 string2 :optional start1 end1 start2 end2) bool))
(string-suffix-ci? (lambda (string1 string2 :optional start1 end1 start2 end2) bool))
(string-contains (lambda (string pattern :optional s-start s-end p-start p-end) obj))
(string-contains-ci (lambda (string pattern :optional s-start s-end p-start p-end) obj))
(string-fill! (lambda (string char :optional start end) undefined))
(string-copy! (lambda (to tstart from :optional fstart fend) undefined))
(string-copy (lambda (str :optional start end) str))
(substring/shared (lambda (str start :optional end) str))
(string-reverse (lambda (str :optional start end) str))
(string-reverse! (lambda (str :optional start end) undefined))
(reverse-list->string (lambda (char-list) str))
(string->list (lambda (str :optional start end) list))
(string-concatenate (lambda (string-list) str))
(string-concatenate/shared (lambda (string-list) str))
(string-append/shared (lambda (str \.\.\.) str))
(string-concatenate-reverse (lambda (string-list :optional final-string end) str))
(string-concatenate-reverse/shared (lambda (string-list :optional final-string end) str))
(xsubstring (lambda (str from :optional to start end) str))
(string-xcopy! (lambda (target tstart str from :optional to start end) undefined))
(string-null? (lambda (str) bool))
(string-join (lambda (string-list :optional delim grammar) str))
(string-tokenize (lambda (string :optional token-chars start end) str))
(string-replace (lambda (str1 str2 start1 end1 :optional start2 end2) str))
(string-kmp-partial-search (lambda (pat rv str i :optional c= p-start s-start s-end) n))
(make-kmp-restart-vector (lambda (str :optional c= start end) vec))
(kmp-step (lambda (pat rv c i c= p-start) n))
)
;; SRFI 14
("Character-Set Library"
(char-set? (lambda (cset) bool))
(char-set= (lambda (cset \.\.\.) bool))
(char-set<= (lambda (cset \.\.\.) bool))
(char-set-hash (lambda (cset :optional int) int))
(char-set-cursor (lambda (cset) cursor))
(char-set-ref (lambda (cset cursor) ch))
(char-set-cursor-next (lambda (cset cursor) int))
(end-of-char-set? (lambda (cursor) bool))
(char-set-fold (lambda (proc obj cset) obj))
(char-set-unfold (lambda (proc proc proc obj :optional obj) cset))
(char-set-unfold! (lambda (proc proc proc obj obj) cset))
(char-set-for-each (lambda (proc cset) undefined))
(char-set-map (lambda (proc cset) cset))
(char-set-copy (lambda (cset) cset))
(char-set (lambda (ch \.\.\.) cset))
(list->char-set (lambda (list :optional obj) cset))
(list->char-set! (lambda (list cset) cset))
(string->char-set (lambda (str :optional cset) cset))
(string->char-set! (lambda (str cset) cset))
(ucs-range->char-set (lambda (int int :optional bool cset) cset))
(ucs-range->char-set! (lambda (int int bool cset) cset))
(char-set-filter (lambda (proc cset :optional base-cset) cset))
(char-set-filter! (lambda (proc cset base-cset) cset))
(->char-set (lambda (obj) cset))
(char-set-size (lambda (cset) n))
(char-set-count (lambda (proc cset) n))
(char-set-contains? (lambda (cset ch) bool))
(char-set-every (lambda (proc cset) obj))
(char-set-any (lambda (proc cset) obj))
(char-set-adjoin (lambda (cset ch \.\.\.) cset))
(char-set-delete (lambda (cset ch \.\.\.) cset))
(char-set-adjoin! (lambda (cset ch \.\.\.) cset))
(char-set-delete! (lambda (cset ch \.\.\.) cset))