Skip to content

Commit

Permalink
Merge pull request #2 from larcenists/master
Browse files Browse the repository at this point in the history
Pull from upstream
  • Loading branch information
jkoser authored Jun 26, 2017
2 parents b8f3be6 + 5af5135 commit d1b4ef2
Show file tree
Hide file tree
Showing 102 changed files with 25,158 additions and 417 deletions.
3 changes: 1 addition & 2 deletions lib/Base/std-ffi.sch
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,7 @@
" is not a character.")))

(define (flonum-check x name)
(if (and (rational? x)
(inexact? x))
(if (flonum? x)
x
(error "Foreign-procedure " name ": " x
" is not a floating-point number.")))
Expand Down
5 changes: 4 additions & 1 deletion lib/Experimental/unix.sch
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
(macosx
(foreign-file "/usr/lib/libresolv.dylib"))
(linux
(foreign-file "/usr/lib/libresolv.so"))
(find-foreign-file '("/usr/lib/" "/lib32/")
'("libresolv.")
'("so")
'("" ".5" ".4" ".3" ".2")))
(solaris
(foreign-file "/lib/libsocket.so")
(foreign-file "/lib/libxnet.so")))
Expand Down
435 changes: 273 additions & 162 deletions lib/R6RS/r6rs-expander.sch

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions lib/R7RS/scheme/box.sld
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
;;; (scheme box)
;;;
;;; R7RS Red Edition

(define-library (scheme box)
(export box box? unbox set-box!)
(import (srfi 111)))
46 changes: 46 additions & 0 deletions lib/R7RS/scheme/charset.sld
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
;;; (scheme charset)
;;;
;;; R7RS Red Edition

(define-library (scheme charset)

(export

char-set? char-set= char-set<=
char-set-hash
char-set-cursor char-set-ref char-set-cursor-next end-of-char-set?
char-set-fold char-set-unfold char-set-unfold!
char-set-for-each char-set-map
char-set-copy char-set

list->char-set string->char-set
list->char-set! string->char-set!

char-set-filter
char-set-filter!
ucs-range->char-set
ucs-range->char-set!
->char-set

char-set->list char-set->string

char-set-size char-set-count char-set-contains?
char-set-every char-set-any

char-set-adjoin char-set-delete
char-set-adjoin! char-set-delete!

char-set-complement char-set-union char-set-intersection
char-set-complement! char-set-union! char-set-intersection!

char-set-difference char-set-xor char-set-diff+intersection
char-set-difference! char-set-xor! char-set-diff+intersection!

char-set:lower-case char-set:upper-case char-set:title-case
char-set:letter char-set:digit char-set:letter+digit
char-set:graphic char-set:printing char-set:whitespace
char-set:iso-control char-set:punctuation char-set:symbol
char-set:hex-digit char-set:blank char-set:ascii
char-set:empty char-set:full)

(import (srfi 14 char-sets)))
20 changes: 20 additions & 0 deletions lib/R7RS/scheme/comparator.sld
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
;;; (scheme comparator)
;;;
;;; R7RS Red Edition

(define-library (scheme comparator)
(export comparator? comparator-ordered? comparator-hashable?
make-comparator
make-pair-comparator make-list-comparator make-vector-comparator
make-eq-comparator make-eqv-comparator make-equal-comparator
boolean-hash char-hash char-ci-hash
string-hash string-ci-hash symbol-hash number-hash
make-default-comparator default-hash comparator-register-default!
comparator-type-test-predicate comparator-equality-predicate
comparator-ordering-predicate comparator-hash-function
comparator-test-type comparator-check-type comparator-hash
hash-bound hash-salt
=? <? >? <=? >=?
comparator-if<=>
)
(import (srfi 128)))
13 changes: 13 additions & 0 deletions lib/R7RS/scheme/ephemeron.sld
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
;;; (scheme ephemeron)
;;;
;;; R7RS Red Edition

(define-library (scheme ephemeron)
(export ephemeron?
make-ephemeron
ephemeron-broken?
ephemeron-key
ephemeron-datum
reference-barrier
)
(import (srfi 124)))
19 changes: 19 additions & 0 deletions lib/R7RS/scheme/generator.sld
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
;;; (scheme generator)
;;;
;;; R7RS Red Edition

(define-library (scheme generator)
(export generator make-iota-generator make-range-generator
make-coroutine-generator list->generator vector->generator
reverse-vector->generator string->generator
bytevector->generator
make-for-each-generator make-unfold-generator
gcons* gappend gcombine gfilter gremove
gtake gdrop gtake-while gdrop-while
gdelete gdelete-neighbor-dups gindex gselect
generator->list generator->reverse-list
generator->vector generator->vector! generator->string
generator-fold generator-for-each generator-find
generator-count generator-any generator-every generator-unfold
)
(import (srfi 121)))
69 changes: 69 additions & 0 deletions lib/R7RS/scheme/hash-table.sld
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
;;; (scheme hash-table)
;;;
;;; R7RS Red Edition

(define-library (scheme hash-table)

(export

make-hash-table
hash-table
hash-table-unfold
alist->hash-table

hash-table?
hash-table-contains?
hash-table-empty?
hash-table=?
hash-table-mutable?

hash-table-ref
hash-table-ref/default

hash-table-set!
hash-table-delete!
hash-table-intern!
hash-table-update!
hash-table-update!/default
hash-table-pop!
hash-table-clear!

hash-table-size
hash-table-keys
hash-table-values
hash-table-entries
hash-table-find
hash-table-count

hash-table-map
hash-table-for-each
hash-table-map!
hash-table-map->list
hash-table-fold
hash-table-prune!

hash-table-copy
hash-table-empty-copy
hash-table->alist

hash-table-union!
hash-table-intersection!
hash-table-difference!
hash-table-xor!

;; The following procedures are deprecated by SRFI 125:

hash
string-hash
string-ci-hash
hash-by-identity

hash-table-equivalence-function
hash-table-hash-function
hash-table-exists?
hash-table-walk
hash-table-merge!

)

(import (srfi 125)))
37 changes: 37 additions & 0 deletions lib/R7RS/scheme/ideque.sld
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
;;; (scheme ideque)
;;;
;;; R7RS Red Edition

(define-library (scheme ideque)

(export ideque ideque-tabulate ideque-unfold ideque-unfold-right
ideque? ideque-empty? ideque= ideque-any ideque-every

ideque-front ideque-add-front ideque-remove-front
ideque-back ideque-add-back ideque-remove-back

ideque-ref
ideque-take ideque-take-right ideque-drop ideque-drop-right
ideque-split-at

ideque-length ideque-append ideque-reverse
ideque-count ideque-zip

ideque-map ideque-filter-map
ideque-for-each ideque-for-each-right
ideque-fold ideque-fold-right
ideque-append-map

ideque-filter ideque-remove ideque-partition

ideque-find ideque-find-right
ideque-take-while ideque-take-while-right
ideque-drop-while ideque-drop-while-right
ideque-span ideque-break

list->ideque ideque->list
generator->ideque ideque->generator
)

(import (srfi 134 ideque)))

43 changes: 43 additions & 0 deletions lib/R7RS/scheme/ilist.sld
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
;;; (scheme ilist)
;;;
;;; R7RS Red Edition

(define-library (scheme ilist)
(export
iq
ipair ilist xipair ipair* make-ilist ilist-tabulate iiota
ipair?
proper-ilist? ilist? dotted-ilist? not-ipair? null-ilist? ilist=
icar icdr ilist-ref
ifirst isecond ithird ifourth ififth isixth iseventh ieighth ininth itenth
icaar icadr icdar icddr
icaaar icaadr icadar icaddr icdaar icdadr icddar icdddr
icaaaar icaaadr icaadar icaaddr icadaar icadadr icaddar icadddr
icdaaar icdaadr icdadar icdaddr icddaar icddadr icdddar icddddr
icar+icdr itake idrop ilist-tail
itake-right idrop-right isplit-at ilast last-ipair
ilength iappend iconcatenate ireverse iappend-reverse
izip iunzip1 iunzip2 iunzip3 iunzip4 iunzip5
icount imap ifor-each ifold iunfold ipair-fold ireduce
ifold-right iunfold-right ipair-fold-right ireduce-right
iappend-map ipair-for-each ifilter-map imap-in-order
ifilter ipartition iremove imember imemq imemv
ifind ifind-tail iany ievery
ilist-index itake-while idrop-while ispan ibreak
idelete idelete-duplicates
iassoc iassq iassv ialist-cons ialist-delete
replace-icar replace-icdr
pair->ipair ipair->pair list->ilist ilist->list
tree->itree itree->tree gtree->itree gtree->tree
iapply

ipair-comparator
ilist-comparator
make-ipair-comparator
make-ilist-comparator
make-improper-ilist-comparator
make-icar-comparator
make-icdr-comparator
)

(import (srfi 116)))
18 changes: 18 additions & 0 deletions lib/R7RS/scheme/list-queue.sld
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
;;; (scheme list-queue)
;;;
;;; R7RS Red Edition

(define-library (scheme list-queue)

(export make-list-queue list-queue list-queue-copy
list-queue-unfold list-queue-unfold-right
list-queue? list-queue-empty?
list-queue-front list-queue-back list-queue-list list-queue-first-last
list-queue-add-front! list-queue-add-back!
list-queue-remove-front! list-queue-remove-back!
list-queue-remove-all! list-queue-set-list!
list-queue-append list-queue-append! list-queue-concatenate
list-queue-map list-queue-map! list-queue-for-each
)

(import (srfi 117)))
79 changes: 79 additions & 0 deletions lib/R7RS/scheme/list.sld
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
;;; (scheme list) -*- Scheme -*-
;;;
;;; R7RS Red Edition
;;; SRFI-1: list-processing library
;;;
;;; $Id$
;;;
;;; Conflicts with (rnrs base):
;;; map, for-each: allow list arguments of different lengths
;;; Conflicts with (rnrs lists):
;;; member, assoc: accept an optional third argument
;;; fold-right: different arguments, different semantics
;;;

(define-library (scheme list)

(export cons list
xcons cons* make-list list-tabulate
list-copy circular-list iota

pair? null?
proper-list? circular-list? dotted-list?
not-pair? null-list?
list=

car 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
list-ref
first second third fourth fifth sixth seventh eighth ninth tenth
car+cdr
take drop
take-right drop-right
take! drop-right!
split-at split-at!
last last-pair

length length+
append concatenate reverse
append! concatenate! reverse!
append-reverse append-reverse!
zip unzip1 unzip2 unzip3 unzip4 unzip5
count

map for-each
fold unfold pair-fold reduce
fold-right unfold-right pair-fold-right reduce-right
append-map append-map!
map! pair-for-each filter-map map-in-order

filter partition remove
filter! partition! remove!

member memq memv
find find-tail
any every
list-index
take-while drop-while take-while!
span break span! break!

delete delete-duplicates
delete! delete-duplicates!

assoc assq assv
alist-cons alist-copy
alist-delete alist-delete!

lset<= lset= lset-adjoin
lset-union lset-union!
lset-intersection lset-intersection!
lset-difference lset-difference!
lset-xor lset-xor!
lset-diff+intersection lset-diff+intersection!

set-car! set-cdr!)

(import (srfi 1 lists)))
13 changes: 13 additions & 0 deletions lib/R7RS/scheme/lseq.sld
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
;;; (scheme lseq)
;;;
;;; R7RS Red Edition

(define-library (scheme lseq)
(export generator->lseq lseq? lseq=?
lseq-car lseq-first lseq-cdr lseq-rest lseq-ref lseq-take lseq-drop
lseq-realize lseq->generator lseq-length lseq-append lseq-zip
lseq-map lseq-for-each lseq-filter lseq-remove
lseq-find lseq-find-tail lseq-take-while lseq-drop-while
lseq-any lseq-every lseq-index lseq-member lseq-memq lseq-memv
)
(import (srfi 127)))
Loading

0 comments on commit d1b4ef2

Please sign in to comment.