Skip to content

Commit

Permalink
Significant all-around clean-up. Use the reference implementations as…
Browse files Browse the repository at this point in the history
… unaltered as possible (good for future maintenance) while still adapting them via tricks. Use the framework's facilities consistently. Bug fixes for (srfi :2 and-let*), (srfi :19 time), (srfi :42 eager-comprehensions).
  • Loading branch information
DerickEddington committed Mar 5, 2010
1 parent 4ad5d03 commit a555280
Show file tree
Hide file tree
Showing 75 changed files with 6,712 additions and 7,268 deletions.
14 changes: 7 additions & 7 deletions %3a0/cond-expand.sls
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
;; LICENSE from the original collection this file is distributed with.

(library (srfi :0 cond-expand)
(export
(export
cond-expand)
(import
(rnrs)
(for (srfi private registry) expand))
(for (only (srfi private registry) expand-time-features) expand))

(define-syntax cond-expand
(lambda (stx)
(syntax-case stx (and or not else)
((_)
(syntax-violation #F "Unfulfilled cond-expand" stx))
((_)
(syntax-violation #F "unfulfilled cond-expand" stx))
((_ (else body ...))
#'(begin body ...))
((_ ((and) body ...) more-clauses ...)
Expand Down Expand Up @@ -41,8 +41,8 @@
(cond-expand more-clauses ...))
(else body ...)))
((_ (feature-id body ...) more-clauses ...)
(if (member (syntax->datum #'feature-id) available-features)
(if (member (syntax->datum #'feature-id) expand-time-features)
#'(begin body ...)
#'(cond-expand more-clauses ...))))))

)
1,725 changes: 38 additions & 1,687 deletions %3a1/lists.sls

Large diffs are not rendered by default.

1,600 changes: 1,600 additions & 0 deletions %3a1/srfi-1-reference.scm

Large diffs are not rendered by default.

30 changes: 11 additions & 19 deletions %3a13/strings.sls
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
#!r6rs
;; Copyright 2009 Derick Eddington. My MIT-style license is in the file named
;; Copyright 2010 Derick Eddington. My MIT-style license is in the file named
;; LICENSE from the original collection this file is distributed with.

(library (srfi :13 strings)
(export
string-map string-map!
string-fold string-unfold
string-fold-right string-unfold-right
string-fold-right string-unfold-right
string-tabulate string-for-each string-for-each-index
string-every string-any
string-hash string-hash-ci
string-compare string-compare-ci
string= string< string> string<= string>= string<>
string-ci= string-ci< string-ci> string-ci<= string-ci>= string-ci<>
string-downcase string-upcase string-titlecase
string-downcase! string-upcase! string-titlecase!
string-ci= string-ci< string-ci> string-ci<= string-ci>= string-ci<>
string-downcase string-upcase string-titlecase
string-downcase! string-upcase! string-titlecase!
string-take string-take-right
string-drop string-drop-right
string-pad string-pad-right
string-trim string-trim-right string-trim-both
string-filter string-delete
string-index string-index-right
string-index string-index-right
string-skip string-skip-right
string-count
string-prefix-length string-prefix-length-ci
Expand All @@ -39,9 +39,9 @@
string-tokenize
string-replace
; R5RS extended:
string->list string-copy string-fill!
string->list string-copy string-fill!
; R5RS re-exports:
string? make-string string-length string-ref string-set!
string? make-string string-length string-ref string-set!
string string-append list->string
; Low-level routines:
#;(make-kmp-restart-vector string-kmp-partial-search kmp-step
Expand All @@ -59,21 +59,13 @@
(srfi :23 error tricks)
(srfi :8 receive)
(srfi :14 char-sets)
(srfi private check-arg)
(srfi private let-opt)
(srfi private include))


(define-syntax check-arg
(lambda (stx)
(syntax-case stx ()
((_ pred val caller)
(and (identifier? #'val) (identifier? #'caller))
#'(unless (pred val)
(assertion-violation 'caller "check-arg failed" val))))))


(define (char-cased? c)
(char-upper-case? (char-upcase c)))

(SRFI-23-error->R6RS "(library (srfi :13 strings))"
(include/resolve ("srfi" "%3a13") "srfi-13.scm"))
)
24 changes: 10 additions & 14 deletions %3a14/char-sets.sls
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
#!r6rs
;; Copyright 2009 Derick Eddington. My MIT-style license is in the file named
;; Copyright 2010 Derick Eddington. My MIT-style license is in the file named
;; LICENSE from the original collection this file is distributed with.

;; TODO: Are there any issues w.r.t. R6RS Unicode support when using the
;; pre-R6RS reference implementation? I suspect there are.

(library (srfi :14 char-sets)
(export
; Predicates & comparison
char-set? char-set= char-set<= char-set-hash
; Iterating over character sets
char-set-cursor char-set-ref char-set-cursor-next end-of-char-set?
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
; Creating character sets
char-set-copy char-set
list->char-set string->char-set
list->char-set! string->char-set!
char-set-filter ucs-range->char-set
char-set-filter ucs-range->char-set
char-set-filter! ucs-range->char-set!
->char-set
; Querying character sets
Expand Down Expand Up @@ -42,23 +45,16 @@
(rnrs r5rs)
(srfi :23 error tricks)
(srfi :9 records)
(srfi private check-arg)
(srfi private let-opt)
(srfi private include))


;; TODO: FIXME: These two seem incorrect.
(define (%latin1->char i)
(integer->char i))

(define (%char->latin1 c)
(char->integer c))

(define-syntax check-arg
(lambda (stx)
(syntax-case stx ()
((_ pred val caller)
(identifier? #'val)
#'(unless (pred val)
(assertion-violation caller "check-arg failed" val))))))


(SRFI-23-error->R6RS "(library (srfi :14 char-sets))"
(include/resolve ("srfi" "%3a14") "srfi-14.scm"))
)
Loading

0 comments on commit a555280

Please sign in to comment.