export all symbols defined in built-in.scm
This commit is contained in:
parent
db9de51d07
commit
6958730fa4
|
@ -300,6 +300,9 @@
|
||||||
(apply consumer (cdr res))
|
(apply consumer (cdr res))
|
||||||
(consumer res))))
|
(consumer res))))
|
||||||
|
|
||||||
|
(export values
|
||||||
|
call-with-values)
|
||||||
|
|
||||||
;;; 6.2. Numbers
|
;;; 6.2. Numbers
|
||||||
|
|
||||||
(define (zero? n)
|
(define (zero? n)
|
||||||
|
@ -361,12 +364,20 @@
|
||||||
(define (lcm n m)
|
(define (lcm n m)
|
||||||
(/ (* n m) (gcd n m)))
|
(/ (* n m) (gcd n m)))
|
||||||
|
|
||||||
|
(export zero? positive? negative?
|
||||||
|
odd? even? min max
|
||||||
|
floor/ truncate/
|
||||||
|
exact-integer-sqrt
|
||||||
|
gcd lcm)
|
||||||
|
|
||||||
;;; 6.3 Booleans
|
;;; 6.3 Booleans
|
||||||
|
|
||||||
(define (boolean=? . objs)
|
(define (boolean=? . objs)
|
||||||
(or (every (lambda (x) (eq? x #t)) objs)
|
(or (every (lambda (x) (eq? x #t)) objs)
|
||||||
(every (lambda (x) (eq? x #f)) objs)))
|
(every (lambda (x) (eq? x #f)) objs)))
|
||||||
|
|
||||||
|
(export boolean=?)
|
||||||
|
|
||||||
;;; 6.4 Pairs and lists
|
;;; 6.4 Pairs and lists
|
||||||
|
|
||||||
(define (list? obj)
|
(define (list? obj)
|
||||||
|
@ -429,6 +440,12 @@
|
||||||
(define (list-set! list k obj)
|
(define (list-set! list k obj)
|
||||||
(set-car! (list-tail list k) obj))
|
(set-car! (list-tail list k) obj))
|
||||||
|
|
||||||
|
(define (list-copy obj)
|
||||||
|
(if (null? obj)
|
||||||
|
obj
|
||||||
|
(cons (car obj)
|
||||||
|
(list-copy (cdr obj)))))
|
||||||
|
|
||||||
(define (memq obj list)
|
(define (memq obj list)
|
||||||
(if (null? list)
|
(if (null? list)
|
||||||
#f
|
#f
|
||||||
|
@ -457,12 +474,6 @@
|
||||||
(car list)
|
(car list)
|
||||||
(assq obj (cdr list)))))
|
(assq obj (cdr list)))))
|
||||||
|
|
||||||
(define (list-copy obj)
|
|
||||||
(if (null? obj)
|
|
||||||
obj
|
|
||||||
(cons (car obj)
|
|
||||||
(list-copy (cdr obj)))))
|
|
||||||
|
|
||||||
(define (member obj list . opts)
|
(define (member obj list . opts)
|
||||||
(let ((compare (if (null? opts) equal? (car opts))))
|
(let ((compare (if (null? opts) equal? (car opts))))
|
||||||
(if (null? list)
|
(if (null? list)
|
||||||
|
@ -479,6 +490,12 @@
|
||||||
(car list)
|
(car list)
|
||||||
(assoc obj (cdr list) compare)))))
|
(assoc obj (cdr list) compare)))))
|
||||||
|
|
||||||
|
(export list? list caar cadr cdar cddr
|
||||||
|
make-list length append reverse
|
||||||
|
list-tail list-ref list-set! list-copy
|
||||||
|
memq memv member
|
||||||
|
assq assv assoc)
|
||||||
|
|
||||||
;;; 6.5. Symbols
|
;;; 6.5. Symbols
|
||||||
|
|
||||||
(define (symbol=? . objs)
|
(define (symbol=? . objs)
|
||||||
|
@ -490,6 +507,8 @@
|
||||||
(cdr objs))
|
(cdr objs))
|
||||||
#f)))
|
#f)))
|
||||||
|
|
||||||
|
(export symbol=?)
|
||||||
|
|
||||||
;;; 6.6 Characters
|
;;; 6.6 Characters
|
||||||
|
|
||||||
(define-macro (define-char-transitive-predicate name op)
|
(define-macro (define-char-transitive-predicate name op)
|
||||||
|
@ -506,6 +525,12 @@
|
||||||
(define-char-transitive-predicate char<=? <=)
|
(define-char-transitive-predicate char<=? <=)
|
||||||
(define-char-transitive-predicate char>=? >=)
|
(define-char-transitive-predicate char>=? >=)
|
||||||
|
|
||||||
|
(export char=?
|
||||||
|
char<?
|
||||||
|
char>?
|
||||||
|
char<=?
|
||||||
|
char>=?)
|
||||||
|
|
||||||
;;; 6.7 String
|
;;; 6.7 String
|
||||||
|
|
||||||
(define (string . objs)
|
(define (string . objs)
|
||||||
|
@ -568,6 +593,10 @@
|
||||||
#f)
|
#f)
|
||||||
(string-set! v i fill))))
|
(string-set! v i fill))))
|
||||||
|
|
||||||
|
(export string string->list list->string
|
||||||
|
string-copy! string-copy
|
||||||
|
string-append string-fill!)
|
||||||
|
|
||||||
;;; 6.8. Vector
|
;;; 6.8. Vector
|
||||||
|
|
||||||
(define (vector . objs)
|
(define (vector . objs)
|
||||||
|
@ -636,6 +665,11 @@
|
||||||
(define (string->vector . args)
|
(define (string->vector . args)
|
||||||
(list->vector (apply string->list args)))
|
(list->vector (apply string->list args)))
|
||||||
|
|
||||||
|
(export vector vector->list list->vector
|
||||||
|
vector-copy! vector-copy
|
||||||
|
vector-append vector-fill!
|
||||||
|
vector->string string->vector)
|
||||||
|
|
||||||
;;; 6.9 bytevector
|
;;; 6.9 bytevector
|
||||||
|
|
||||||
(define (bytevector . objs)
|
(define (bytevector . objs)
|
||||||
|
@ -674,6 +708,11 @@
|
||||||
res))
|
res))
|
||||||
(fold bytevector-append-2-inv #() vs))
|
(fold bytevector-append-2-inv #() vs))
|
||||||
|
|
||||||
|
(export bytevector
|
||||||
|
bytevector-copy!
|
||||||
|
bytevector-copy
|
||||||
|
bytevector-append)
|
||||||
|
|
||||||
;;; 6.10 control features
|
;;; 6.10 control features
|
||||||
|
|
||||||
(define (map f list . lists)
|
(define (map f list . lists)
|
||||||
|
@ -746,6 +785,10 @@
|
||||||
(map (lambda (v) (vector-ref v n)) vs))
|
(map (lambda (v) (vector-ref v n)) vs))
|
||||||
(loop (+ n 1))))))
|
(loop (+ n 1))))))
|
||||||
|
|
||||||
|
(export map for-each
|
||||||
|
string-map string-for-each
|
||||||
|
vector-map vector-for-each)
|
||||||
|
|
||||||
;;; 6.13. Input and output
|
;;; 6.13. Input and output
|
||||||
|
|
||||||
(define (call-with-port port proc)
|
(define (call-with-port port proc)
|
||||||
|
@ -753,3 +796,5 @@
|
||||||
(lambda () #f)
|
(lambda () #f)
|
||||||
(lambda () (proc port))
|
(lambda () (proc port))
|
||||||
(lambda () (close-port port))))
|
(lambda () (close-port port))))
|
||||||
|
|
||||||
|
(export call-with-port)
|
||||||
|
|
Loading…
Reference in New Issue