-
Notifications
You must be signed in to change notification settings - Fork 1
/
symbol.c
4737 lines (4345 loc) · 170 KB
/
symbol.c
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
/*
symbols.c --- defines the symbols of ISLisp processor KISS.
Copyright (C) 2017, 2018, 2019 Yuji Minejima <yuji@minejima.jp>
This file is part of ISLisp processor KISS.
KISS is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
KISS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
#include "kiss.h"
#define KISS_SYMBOL_MAX 1024
size_t Kiss_Symbol_Number = 0;
kiss_symbol_t* Kiss_Symbols[KISS_SYMBOL_MAX];
kiss_hash_table_t* Kiss_Symbol_Hash_Table = NULL;
size_t Kiss_Gensym_Count = 0;
kiss_symbol_t KISS_Sstring_eq;
kiss_symbol_t KISS_Ss_pi_s;
void kiss_init_symbols(void) {
size_t i;
for (i = 0; i < KISS_SYMBOL_MAX; i++) { if (Kiss_Symbols[i] == NULL) break; }
assert(i < KISS_SYMBOL_MAX);
Kiss_Symbol_Number = i;
Kiss_Symbol_Hash_Table = (kiss_hash_table_t*)
kiss_make_hash_table(kiss_make_fixnum(2347),
kiss_function((kiss_obj*)&KISS_Sstring_eq),
KISS_NIL,
(kiss_obj*)kiss_make_float(1.5),
(kiss_obj*)kiss_make_float(0.8));
}
static kiss_symbol_t* kiss_make_symbol(const wchar_t* const name) {
kiss_symbol_t* p = Kiss_GC_Malloc(sizeof(kiss_symbol_t));
p->type = KISS_SYMBOL;
p->name = wcscpy(Kiss_Malloc(sizeof(wchar_t) * (wcslen(name) + 1)), name);
p->flags = 0;
p->var = name[0] == L':' ? (kiss_obj*)p : NULL;
p->fun = NULL;
p->plist = KISS_NIL;
return p;
}
extern inline
kiss_obj* kiss_symbol(const wchar_t* const name);
/* function: (symbolp obj) -> boolean
Returns t if obj is a symbol; otherwise, returns nil. The obj may
be any LISP object */
kiss_obj* kiss_symbolp(const kiss_obj* const obj) {
return KISS_IS_SYMBOL(obj) ? KISS_T : KISS_NIL;
}
kiss_obj* kiss_gensym(void) {
wchar_t name[30];
if (swprintf(name, 30, L"#:%x", Kiss_Gensym_Count++) < 0) {
fwprintf(stderr, L"kiss_gensym: swprintf error\n");
exit(EXIT_FAILURE);
}
return (kiss_obj*)kiss_make_symbol(name);
}
/* kiss function: (symbol-function obj) => <function> */
kiss_obj* kiss_symbol_function (const kiss_obj* const obj) {
kiss_symbol_t* symbol = Kiss_Symbol(obj);
if (symbol->fun == NULL) {
Kiss_Err(L"Unbound function ~S", obj);
}
return (kiss_obj*)symbol->fun;
}
/* kiss function: (fboundp obj) => t or nil */
kiss_obj* kiss_fboundp (const kiss_obj* const obj) {
return Kiss_Symbol(obj)->fun == NULL ? KISS_NIL : KISS_T;
}
/* kiss function: (fmakunbound obj) => obj */
kiss_obj* kiss_fmakunbound (kiss_obj* const obj) {
Kiss_Symbol(obj)->fun = NULL;
return obj;
}
/* kiss function: (set-symbol-function definition symbol) => definition */
kiss_obj* kiss_set_symbol_function (const kiss_obj* const definition, kiss_obj* const sym) {
Kiss_Symbol(sym)->fun = (kiss_obj*)definition;
return (kiss_obj*)definition;
}
int kiss_is_interned(const kiss_symbol_t* const p) {
kiss_obj* q = kiss_c_gethash((kiss_obj*)kiss_make_string(p->name),
Kiss_Symbol_Hash_Table,
KISS_DUMMY);
if (q != KISS_DUMMY)
return 1;
else {
for (size_t i = 0; i < Kiss_Symbol_Number; i++) {
if (p == Kiss_Symbols[i]) return 1;
}
return 0;
}
}
kiss_obj* kiss_intern(const kiss_obj* const name) {
kiss_string_t* str = Kiss_String(name);
kiss_obj* q = kiss_c_gethash(name, Kiss_Symbol_Hash_Table, KISS_DUMMY);
if (q != KISS_DUMMY) {
return q;
}
size_t i;
kiss_symbol_t* p;
for (i = 0; i < Kiss_Symbol_Number; i++) {
if (wcscmp(Kiss_Symbols[i]->name, str->str) == 0) {
return (kiss_obj*)Kiss_Symbols[i];
}
}
p = kiss_make_symbol(str->str);
kiss_puthash(name, (kiss_obj*)p, (kiss_obj*)Kiss_Symbol_Hash_Table);
//assert(Kiss_Symbol_Number < KISS_SYMBOL_MAX);
//p = kiss_make_symbol(str->str);
//Kiss_Symbols[Kiss_Symbol_Number] = p;
//++Kiss_Symbol_Number;
return (kiss_obj*)p;
}
// function: (property symbol property-name [obj]) -> <object>
kiss_obj* kiss_property(const kiss_obj* const symbol, const kiss_obj* const property, const kiss_obj* const rest)
{
const kiss_symbol_t* const s = Kiss_Symbol(symbol);
const kiss_obj* const p = kiss_plist_member(s->plist, (kiss_obj*)Kiss_Symbol(property));
if (KISS_IS_CONS(p)) {
return kiss_car(KISS_CDR(p));
} else {
return rest == KISS_NIL ? KISS_NIL : kiss_car(rest);
}
}
// function: (set-property obj symbol property-name) -> <object>
kiss_obj* kiss_set_property(const kiss_obj* const obj, kiss_obj* const symbol, const kiss_obj* const property)
{
kiss_symbol_t* const s = Kiss_Symbol(symbol);
s->plist = kiss_plist_put(s->plist, (kiss_obj*)Kiss_Symbol(property), obj);
return (kiss_obj*)obj;
}
// function: (remove-property symbol property-name) -> <object>
kiss_obj* kiss_remove_property(kiss_obj* const symbol, const kiss_obj* const property) {
kiss_symbol_t* const s = Kiss_Symbol(symbol);
const kiss_obj* const obj = kiss_plist_get(s->plist, property);
s->plist = kiss_plist_remove(s->plist, (kiss_obj*)Kiss_Symbol(property));
return (kiss_obj*)obj;
}
/************************** Symbol definitions *******************************/
kiss_symbol_t KISS_Snil = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"nil", /* name */
KISS_SYSTEM_CONSTANT_VAR, /* flags */
KISS_NIL, /* var */
NULL, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_St = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"t", /* name */
KISS_SYSTEM_CONSTANT_VAR, /* flags */
KISS_T, /* var */
NULL, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Skw_rest;
kiss_symbol_t KISS_Skw_rest = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L":rest", /* name */
0, /* flags */
(kiss_obj*)&KISS_Skw_rest, /* var */
NULL, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Samp_rest;
kiss_symbol_t KISS_Samp_rest = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"&rest", /* name */
0, /* flags */
(kiss_obj*)&KISS_Samp_rest, /* var */
NULL, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Skw_size;
kiss_symbol_t KISS_Skw_size = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L":size", /* name */
0, /* flags */
(kiss_obj*)&KISS_Skw_size, /* var */
NULL, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Skw_test;
kiss_symbol_t KISS_Skw_test = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L":test", /* name */
0, /* flags */
(kiss_obj*)&KISS_Skw_test, /* var */
NULL, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Skw_weakness;
kiss_symbol_t KISS_Skw_weakness = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L":weakness", /* name */
0, /* flags */
(kiss_obj*)&KISS_Skw_weakness, /* var */
NULL, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Skw_rehash_size;
kiss_symbol_t KISS_Skw_rehash_size = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L":rehash-size", /* name */
0, /* flags */
(kiss_obj*)&KISS_Skw_rehash_size, /* var */
NULL, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Skw_rehash_threshold;
kiss_symbol_t KISS_Skw_rehash_threshold = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L":rehash-threshold", /* name */
0, /* flags */
(kiss_obj*)&KISS_Skw_rehash_threshold, /* var */
NULL, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Skw_name;
kiss_symbol_t KISS_Skw_name = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L":name", /* name */
0, /* flags */
(kiss_obj*)&KISS_Skw_name, /* var */
NULL, /* fun */
KISS_NIL, /* plist */
};
/*** condition.lisp ***/
kiss_symbol_t KISS_Ssignal_condition = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"signal-condition", /* name */
KISS_SYSTEM_FUNCTION, /* flags */
NULL, /* var */
NULL, /* fun */
KISS_NIL, /* plist */
};
/*** cons.c ***/
kiss_symbol_t KISS_Scons;
kiss_cfunction_t KISS_CFcons = {
KISS_CFUNCTION, /* type */
&KISS_Scons, /* name */
(kiss_cf_t*)kiss_cons, /* C function name */
2, /* minimum argument number */
2, /* maximum argument number */
};
kiss_symbol_t KISS_Scons = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"cons", /* name */
KISS_SYSTEM_FUNCTION, /* flags */
NULL, /* var */
(kiss_obj*)&KISS_CFcons, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Scar;
kiss_cfunction_t KISS_CFcar = {
KISS_CFUNCTION, /* type */
&KISS_Scar, /* name */
(kiss_cf_t*)kiss_car, /* C function name */
1, /* minimum argument number */
1, /* maximum argument number */
};
kiss_symbol_t KISS_Scar = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"car", /* name */
KISS_SYSTEM_FUNCTION, /* flags */
NULL, /* var */
(kiss_obj*)&KISS_CFcar, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Scdr;
kiss_cfunction_t KISS_CFcdr = {
KISS_CFUNCTION, /* type */
&KISS_Scdr, /* name */
(kiss_cf_t*)kiss_cdr, /* C function name */
1, /* minimum argument number */
1, /* maximum argument number */
};
kiss_symbol_t KISS_Scdr = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"cdr", /* name */
KISS_SYSTEM_FUNCTION, /* flags */
NULL, /* var */
(kiss_obj*)&KISS_CFcdr, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Scadr;
kiss_cfunction_t KISS_CFcadr = {
KISS_CFUNCTION, /* type */
&KISS_Scadr, /* name */
(kiss_cf_t*)kiss_cadr, /* C function name */
1, /* minimum argument number */
1, /* maximum argument number */
};
kiss_symbol_t KISS_Scadr = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"cadr", /* name */
KISS_SYSTEM_FUNCTION, /* flags */
NULL, /* var */
(kiss_obj*)&KISS_CFcadr, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Scddr;
kiss_cfunction_t KISS_CFcddr = {
KISS_CFUNCTION, /* type */
&KISS_Scddr, /* name */
(kiss_cf_t*)kiss_cddr, /* C function name */
1, /* minimum argument number */
1, /* maximum argument number */
};
kiss_symbol_t KISS_Scddr = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"cddr", /* name */
KISS_SYSTEM_FUNCTION, /* flags */
NULL, /* var */
(kiss_obj*)&KISS_CFcddr, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Scaddr;
kiss_cfunction_t KISS_CFcaddr = {
KISS_CFUNCTION, /* type */
&KISS_Scaddr, /* name */
(kiss_cf_t*)kiss_caddr, /* C function name */
1, /* minimum argument number */
1, /* maximum argument number */
};
kiss_symbol_t KISS_Scaddr = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"caddr", /* name */
KISS_SYSTEM_FUNCTION, /* flags */
NULL, /* var */
(kiss_obj*)&KISS_CFcaddr, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Sconsp;
kiss_cfunction_t KISS_CFconsp = {
KISS_CFUNCTION, /* type */
&KISS_Sconsp, /* name */
(kiss_cf_t*)kiss_consp, /* C function name */
1, /* minimum argument number */
1, /* maximum argument number */
};
kiss_symbol_t KISS_Sconsp = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"consp", /* name */
KISS_SYSTEM_FUNCTION, /* flags */
NULL, /* var */
(kiss_obj*)&KISS_CFconsp, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Sset_car;
kiss_cfunction_t KISS_CFset_car = {
KISS_CFUNCTION, /* type */
&KISS_Sset_car, /* name */
(kiss_cf_t*)kiss_set_car, /* C function name */
2, /* minimum argument number */
2, /* maximum argument number */
};
kiss_symbol_t KISS_Sset_car = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"set-car", /* name */
KISS_SYSTEM_FUNCTION, /* flags */
NULL, /* var */
(kiss_obj*)&KISS_CFset_car, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Sset_cdr;
kiss_cfunction_t KISS_CFset_cdr = {
KISS_CFUNCTION, /* type */
&KISS_Sset_cdr, /* name */
(kiss_cf_t*)kiss_set_cdr, /* C function name */
2, /* minimum argument number */
2, /* maximum argument number */
};
kiss_symbol_t KISS_Sset_cdr = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"set-cdr", /* name */
KISS_SYSTEM_FUNCTION, /* flags */
NULL, /* var */
(kiss_obj*)&KISS_CFset_cdr, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Snull;
kiss_cfunction_t KISS_CFnull = {
KISS_CFUNCTION, /* type */
&KISS_Snull, /* name */
(kiss_cf_t*)kiss_null, /* C function name */
1, /* minimum argument number */
1, /* maximum argument number */
};
kiss_symbol_t KISS_Snull = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"null", /* name */
KISS_SYSTEM_FUNCTION, /* flags */
NULL, /* var */
(kiss_obj*)&KISS_CFnull, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Slistp;
kiss_cfunction_t KISS_CFlistp = {
KISS_CFUNCTION, /* type */
&KISS_Slistp, /* name */
(kiss_cf_t*)kiss_listp, /* C function name */
1, /* minimum argument number */
1, /* maximum argument number */
};
kiss_symbol_t KISS_Slistp = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"listp", /* name */
KISS_SYSTEM_FUNCTION, /* flags */
NULL, /* var */
(kiss_obj*)&KISS_CFlistp, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Screate_list;
kiss_cfunction_t KISS_CFcreate_list = {
KISS_CFUNCTION, /* type */
&KISS_Screate_list, /* name */
(kiss_cf_t*)kiss_create_list, /* C function name */
1, /* minimum argument number */
2, /* maximum argument number */
};
kiss_symbol_t KISS_Screate_list = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"create-list", /* name */
KISS_SYSTEM_FUNCTION, /* flags */
NULL, /* var */
(kiss_obj*)&KISS_CFcreate_list, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Slist;
kiss_cfunction_t KISS_CFlist = {
KISS_CFUNCTION, /* type */
&KISS_Slist, /* name */
(kiss_cf_t*)kiss_list, /* C function name */
0, /* minimum argument number */
-1, /* maximum argument number */
};
kiss_symbol_t KISS_Slist = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"list", /* name */
KISS_SYSTEM_FUNCTION, /* flags */
NULL, /* var */
(kiss_obj*)&KISS_CFlist, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Sappend;
kiss_cfunction_t KISS_CFappend = {
KISS_CFUNCTION, /* type */
&KISS_Sappend, /* name */
(kiss_cf_t*)kiss_append, /* C function name */
0, /* minimum argument number */
-1, /* maximum argument number */
};
kiss_symbol_t KISS_Sappend = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"append", /* name */
KISS_SYSTEM_FUNCTION, /* flags */
NULL, /* var */
(kiss_obj*)&KISS_CFappend, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Sappend_s;
kiss_cfunction_t KISS_CFappend_s = {
KISS_CFUNCTION, /* type */
&KISS_Sappend_s, /* name */
(kiss_cf_t*)kiss_append_s, /* C function name */
0, /* minimum argument number */
-1, /* maximum argument number */
};
kiss_symbol_t KISS_Sappend_s = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"append*", /* name */
KISS_SYSTEM_FUNCTION, /* flags */
NULL, /* var */
(kiss_obj*)&KISS_CFappend_s, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Sreverse;
kiss_cfunction_t KISS_CFreverse = {
KISS_CFUNCTION, /* type */
&KISS_Sreverse, /* name */
(kiss_cf_t*)kiss_reverse, /* C function name */
1, /* minimum argument number */
1, /* maximum argument number */
};
kiss_symbol_t KISS_Sreverse = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"reverse", /* name */
KISS_SYSTEM_FUNCTION, /* flags */
NULL, /* var */
(kiss_obj*)&KISS_CFreverse, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Snreverse;
kiss_cfunction_t KISS_CFnreverse = {
KISS_CFUNCTION, /* type */
&KISS_Snreverse, /* name */
(kiss_cf_t*)kiss_nreverse, /* C function name */
1, /* minimum argument number */
1, /* maximum argument number */
};
kiss_symbol_t KISS_Snreverse = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"nreverse", /* name */
KISS_SYSTEM_FUNCTION, /* flags */
NULL, /* var */
(kiss_obj*)&KISS_CFnreverse, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Smember;
kiss_cfunction_t KISS_CFmember = {
KISS_CFUNCTION, /* type */
&KISS_Smember, /* name */
(kiss_cf_t*)kiss_member, /* C function name */
2, /* minimum argument number */
2, /* maximum argument number */
};
kiss_symbol_t KISS_Smember = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"member", /* name */
KISS_SYSTEM_FUNCTION, /* flags */
NULL, /* var */
(kiss_obj*)&KISS_CFmember, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Smember_using;
kiss_cfunction_t KISS_CFmember_using = {
KISS_CFUNCTION, /* type */
&KISS_Smember_using, /* name */
(kiss_cf_t*)kiss_member_using, /* C function name */
3, /* minimum argument number */
3, /* maximum argument number */
};
kiss_symbol_t KISS_Smember_using = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"member-using", /* name */
KISS_SYSTEM_FUNCTION, /* flags */
NULL, /* var */
(kiss_obj*)&KISS_CFmember_using, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Smapcar;
kiss_cfunction_t KISS_CFmapcar = {
KISS_CFUNCTION, /* type */
&KISS_Smapcar, /* name */
(kiss_cf_t*)kiss_mapcar, /* C function name */
2, /* minimum argument number */
-1, /* maximum argument number */
};
kiss_symbol_t KISS_Smapcar = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"mapcar", /* name */
KISS_SYSTEM_FUNCTION, /* flags */
NULL, /* var */
(kiss_obj*)&KISS_CFmapcar, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Smapcan;
kiss_cfunction_t KISS_CFmapcan = {
KISS_CFUNCTION, /* type */
&KISS_Smapcan, /* name */
(kiss_cf_t*)kiss_mapcan, /* C function name */
2, /* minimum argument number */
-1, /* maximum argument number */
};
kiss_symbol_t KISS_Smapcan = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"mapcan", /* name */
KISS_SYSTEM_FUNCTION, /* flags */
NULL, /* var */
(kiss_obj*)&KISS_CFmapcan, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Smapc;
kiss_cfunction_t KISS_CFmapc = {
KISS_CFUNCTION, /* type */
&KISS_Smapc, /* name */
(kiss_cf_t*)kiss_mapc, /* C function name */
2, /* minimum argument number */
-1, /* maximum argument number */
};
kiss_symbol_t KISS_Smapc = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"mapc", /* name */
KISS_SYSTEM_FUNCTION, /* flags */
NULL, /* var */
(kiss_obj*)&KISS_CFmapc, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Smaplist;
kiss_cfunction_t KISS_CFmaplist = {
KISS_CFUNCTION, /* type */
&KISS_Smaplist, /* name */
(kiss_cf_t*)kiss_maplist, /* C function name */
2, /* minimum argument number */
-1, /* maximum argument number */
};
kiss_symbol_t KISS_Smaplist = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"maplist", /* name */
KISS_SYSTEM_FUNCTION, /* flags */
NULL, /* var */
(kiss_obj*)&KISS_CFmaplist, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Smapcon;
kiss_cfunction_t KISS_CFmapcon = {
KISS_CFUNCTION, /* type */
&KISS_Smapcon, /* name */
(kiss_cf_t*)kiss_mapcon, /* C function name */
2, /* minimum argument number */
-1, /* maximum argument number */
};
kiss_symbol_t KISS_Smapcon = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"mapcon", /* name */
KISS_SYSTEM_FUNCTION, /* flags */
NULL, /* var */
(kiss_obj*)&KISS_CFmapcon, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Smapl;
kiss_cfunction_t KISS_CFmapl = {
KISS_CFUNCTION, /* type */
&KISS_Smapl, /* name */
(kiss_cf_t*)kiss_mapl, /* C function name */
2, /* minimum argument number */
-1, /* maximum argument number */
};
kiss_symbol_t KISS_Smapl = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"mapl", /* name */
KISS_SYSTEM_FUNCTION, /* flags */
NULL, /* var */
(kiss_obj*)&KISS_CFmapl, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Sassoc;
kiss_cfunction_t KISS_CFassoc = {
KISS_CFUNCTION, /* type */
&KISS_Sassoc, /* name */
(kiss_cf_t*)kiss_assoc, /* C function name */
2, /* minimum argument number */
2, /* maximum argument number */
};
kiss_symbol_t KISS_Sassoc = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"assoc", /* name */
KISS_SYSTEM_FUNCTION, /* flags */
NULL, /* var */
(kiss_obj*)&KISS_CFassoc, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Sassoc_using;
kiss_cfunction_t KISS_CFassoc_using = {
KISS_CFUNCTION, /* type */
&KISS_Sassoc_using, /* name */
(kiss_cf_t*)kiss_assoc_using, /* C function name */
3, /* minimum argument number */
3, /* maximum argument number */
};
kiss_symbol_t KISS_Sassoc_using = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"assoc-using", /* name */
KISS_SYSTEM_FUNCTION, /* flags */
NULL, /* var */
(kiss_obj*)&KISS_CFassoc_using, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Slast;
kiss_cfunction_t KISS_CFlast = {
KISS_CFUNCTION, /* type */
&KISS_Slast, /* name */
(kiss_cf_t*)kiss_last, /* C function name */
1, /* minimum argument number */
2, /* maximum argument number */
};
kiss_symbol_t KISS_Slast = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"last", /* name */
KISS_SYSTEM_FUNCTION, /* flags */
NULL, /* var */
(kiss_obj*)&KISS_CFlast, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Snconc;
kiss_cfunction_t KISS_CFnconc = {
KISS_CFUNCTION, /* type */
&KISS_Snconc, /* name */
(kiss_cf_t*)kiss_nconc, /* C function name */
0, /* minimum argument number */
-1, /* maximum argument number */
};
kiss_symbol_t KISS_Snconc = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"nconc", /* name */
KISS_SYSTEM_FUNCTION, /* flags */
NULL, /* var */
(kiss_obj*)&KISS_CFnconc, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Scopy_list;
kiss_cfunction_t KISS_CFcopy_list = {
KISS_CFUNCTION, /* type */
&KISS_Scopy_list, /* name */
(kiss_cf_t*)kiss_copy_list, /* C function name */
1, /* minimum argument number */
1, /* maximum argument number */
};
kiss_symbol_t KISS_Scopy_list = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"copy-list", /* name */
KISS_SYSTEM_FUNCTION, /* flags */
NULL, /* var */
(kiss_obj*)&KISS_CFcopy_list, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Splist_member;
kiss_cfunction_t KISS_CFplist_member = {
KISS_CFUNCTION, /* type */
&KISS_Splist_member, /* name */
(kiss_cf_t*)kiss_plist_member, /* C function name */
2, /* minimum argument number */
2, /* maximum argument number */
};
kiss_symbol_t KISS_Splist_member = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"plist-member", /* name */
KISS_SYSTEM_FUNCTION, /* flags */
NULL, /* var */
(kiss_obj*)&KISS_CFplist_member, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Splist_get;
kiss_cfunction_t KISS_CFplist_get = {
KISS_CFUNCTION, /* type */
&KISS_Splist_get, /* name */
(kiss_cf_t*)kiss_plist_get, /* C function name */
2, /* minimum argument number */
2, /* maximum argument number */
};
kiss_symbol_t KISS_Splist_get = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"plist-get", /* name */
KISS_SYSTEM_FUNCTION, /* flags */
NULL, /* var */
(kiss_obj*)&KISS_CFplist_get, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Splist_put;
kiss_cfunction_t KISS_CFplist_put = {
KISS_CFUNCTION, /* type */
&KISS_Splist_put, /* name */
(kiss_cf_t*)kiss_plist_put, /* C function name */
3, /* minimum argument number */
3, /* maximum argument number */
};
kiss_symbol_t KISS_Splist_put = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"plist-put", /* name */
KISS_SYSTEM_FUNCTION, /* flags */
NULL, /* var */
(kiss_obj*)&KISS_CFplist_put, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Splist_mapc;
kiss_cfunction_t KISS_CFplist_mapc = {
KISS_CFUNCTION, /* type */
&KISS_Splist_mapc, /* name */
(kiss_cf_t*)kiss_plist_mapc, /* C function name */
2, /* minimum argument number */
2, /* maximum argument number */
};
kiss_symbol_t KISS_Splist_mapc = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"plist-mapc", /* name */
KISS_SYSTEM_FUNCTION, /* flags */
NULL, /* var */
(kiss_obj*)&KISS_CFplist_mapc, /* fun */
KISS_NIL, /* plist */
};
/*** array.c ***/
kiss_symbol_t KISS_Screate_array;
kiss_cfunction_t KISS_CFcreate_array = {
KISS_CFUNCTION, /* type */
&KISS_Screate_array, /* name */
(kiss_cf_t*)kiss_create_array, /* C function name */
1, /* minimum argument number */
2, /* maximum argument number */
};
kiss_symbol_t KISS_Screate_array = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"create-array", /* name */
KISS_SYSTEM_FUNCTION, /* flags */
NULL, /* var */
(kiss_obj*)&KISS_CFcreate_array, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Sgaref;
kiss_cfunction_t KISS_CFgaref = {
KISS_CFUNCTION, /* type */
&KISS_Sgaref, /* name */
(kiss_cf_t*)kiss_garef, /* C function name */
1, /* minimum argument number */
-1, /* maximum argument number */
};
kiss_symbol_t KISS_Sgaref = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"garef", /* name */
KISS_SYSTEM_FUNCTION, /* flags */
NULL, /* var */
(kiss_obj*)&KISS_CFgaref, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Saref;
kiss_cfunction_t KISS_CFaref = {
KISS_CFUNCTION, /* type */
&KISS_Saref, /* name */
(kiss_cf_t*)kiss_aref, /* C function name */
1, /* minimum argument number */
-1, /* maximum argument number */
};
kiss_symbol_t KISS_Saref = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"aref", /* name */
KISS_SYSTEM_FUNCTION, /* flags */
NULL, /* var */
(kiss_obj*)&KISS_CFaref, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Sset_garef;
kiss_cfunction_t KISS_CFset_garef = {
KISS_CFUNCTION, /* type */
&KISS_Sset_garef, /* name */
(kiss_cf_t*)kiss_set_garef, /* C function name */
2, /* minimum argument number */
-1, /* maximum argument number */
};
kiss_symbol_t KISS_Sset_garef = {
KISS_SYMBOL, /* type */
NULL, /* gc_ptr */
L"set-garef", /* name */
KISS_SYSTEM_FUNCTION, /* flags */
NULL, /* var */
(kiss_obj*)&KISS_CFset_garef, /* fun */
KISS_NIL, /* plist */
};
kiss_symbol_t KISS_Sset_aref;
kiss_cfunction_t KISS_CFset_aref = {
KISS_CFUNCTION, /* type */
&KISS_Sset_aref, /* name */