-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathclnames.cl
237 lines (214 loc) · 5.32 KB
/
clnames.cl
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
;name conversions
;last change 2017-01-03
(defvar *scm2cl-fns-named-same*
'(
+
-
*
/
<
=
>
<=
>=
apply
caaar
caadr
caar
cadar
caddr
cadr
car
cdaar
cdadr
cdar
cddar
cdddr
cddr
cdr
cons
;eval
list
write-char
))
(defvar *scm2cl-fns-named-diff*
'(
add1 1+
andmap every
append! nconc
assoc scheme-assoc
assq assoc
assv assoc
boolean? scheme-boolean?
call-with-current-continuation scheme-not-quite-call/cc
call-with-input-file scheme-call-with-input-file
call-with-input-string scheme-call-with-input-string
call-with-output-file scheme-call-with-output-file
call-with-output-string scheme-call-with-output-string
char->integer char-code
char? characterp
char=? char=
char<? char<
char>? char>
char<=? char<=
char>=? char>=
char-ci=? char-equal
char-ci<? char-lessp
char-ci>? char-greaterp
char-ci<=? char-not-greaterp
char-ci>=? char-not-lessp
char-lower-case? lower-case-p
char-upper-case? upper-case-p
char-alphabetic? alpha-char-p
char-numeric? digit-char-p
char-whitespace? scheme-char-whitespace?
close-input-port close
close-output-port close
complex? complexp
current-input-port scheme-current-input-port
current-output-port scheme-current-output-port
display princ
eof-object? scheme-eof-object?
eq? eq
equal? equal
eqv? eql
eval scheme-eval
even? evenp
file-exists? probe-file
;file-or-directory-modify-seconds file-write-date
flush-output force-output
for-each mapc
get-output-string get-output-stream-string
#+allegro getenv
#+allegro system::getenv
#+ecl getenv
#+ecl si:getenv
#+mkcl getenv
#+mkcl mkcl:getenv
#+clisp getenv
#+clisp ext:getenv
#+sbcl getenv
#+sbcl sb-ext:posix-getenv
#+clozure getenv
#+clozure ccl::getenv
#+abcl getenv
#+abcl ext:getenv
inexact->exact identity
input-port? input-stream-p
integer? integerp
integer->char code-char
length list-length
list? scheme-list?
list-ref elt
list-tail subseq
list->string scheme-list->string
list->vector scheme-list->vector
load-relative scheme-load-relative
make-string scheme-make-string
make-vector scheme-make-vector
map mapcar
member scheme-member
memq member
memv member
modulo mod
negative? minusp
newline terpri
null? null
number? numberp
number->string scheme-number->string
odd? oddp
open-input-file scheme-open-input-file
open-input-string make-string-input-stream
open-output-file scheme-open-output-file
open-output-string make-string-output-stream
ormap some
pair? consp
peek-char scheme-peek-char
positive? plusp
procedure? functionp;;really?
quotient floor
read scheme-read
read-char scheme-read-char
read-line scheme-read-line
real? realp
reverse! nreverse
set-car! rplaca
set-cdr! rplacd
sort! sort
string scheme-string
string? stringp
string=? string=
string<? string<
string>? string>
string<=? string<=
string>=? string>=
string-ci=? string-equal
string-ci<? string-lessp
string-ci>? string-greaterp
string-ci<=? string-not-greaterp
string-ci>=? string-not-lessp
string-append scheme-string-append
;string-index scheme-string-index
string-length length
string->list scheme-string->list
string->number scheme-string->number
string-ref char
;string-reverse-index scheme-string-reverse-index
string-set! scheme-string-set!
string->symbol scheme-string->symbol
sub1 1-
substring subseq
symbol? scheme-symbol?
symbol->string scheme-symbol->string
#+(and unix (or allegro clisp)) system
#+(and unix (or allegro clisp)) shell
#+(and unix clozure) system
#+(and unix clozure) ccl::os-command
#+(and (or unix darwin) ecl) system
#+(and (or unix darwin) ecl) si:system
#+abcl system
#+abcl ext:run-shell-command
transcript-on dribble
transcript-off dribble
vector? vectorp
vector->list scheme-vector->list
vector-ref svref
vector-set! scheme-vector-set
void values
with-input-from-file scheme-with-input-from-file
with-input-from-port scheme-with-input-from-port
with-output-to-file scheme-with-output-to-file
with-output-to-port scheme-with-output-to-port
write prin1
zero? zerop
))
(defvar *scm2cl-kwds-named-diff*
'(
begin progn
cond scm2cl-cond
define-syntax scheme-define-syntax
defstruct scheme-defstruct
else t
fluid-let let
lambda scm2cl-lambda
let scm2cl-let
;let* scm2cl-let*
let-syntax scheme-let-syntax
letrec-syntax scheme-letrec-syntax
;loop is a common variable in Scheme.
;we don't want it to clash with CL's loop macro
loop loop!
set! setq
false nil
null nil
true t
))
(defvar *predefined-aliases* '())
(dolist (x *scm2cl-fns-named-same*)
(push (cons x `(function ,x)) *predefined-aliases*))
(do ((s *scm2cl-fns-named-diff* (cddr s)))
((null s))
(push (cons (car s) `(function ,(cadr s))) *predefined-aliases*))
(do ((s *scm2cl-kwds-named-diff* (cddr s)))
((null s))
(push (cons (car s) (cadr s)) *predefined-aliases*))