mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-11 22:31:12 +02:00
* README: Update, document available SRFIs.
* srfi-19.scm, srfi-17.scm, srfi-16.scm, srfi-14.scm, srfi-13.scm, srfi-11.scm, srfi-10.scm, srfi-9.scm, srfi-8.scm, srfi-6.scm, srfi-2.scm: Use `cond-expand-provide' for providing features to `cond-expand'.
This commit is contained in:
parent
d579d1652d
commit
1b2f40b9f1
13 changed files with 84 additions and 117 deletions
|
@ -1,3 +1,14 @@
|
||||||
|
2001-05-22 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
|
||||||
|
|
||||||
|
* README: Update, document available SRFIs.
|
||||||
|
|
||||||
|
2001-05-21 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
|
||||||
|
|
||||||
|
* srfi-19.scm, srfi-17.scm, srfi-16.scm, srfi-14.scm, srfi-13.scm,
|
||||||
|
srfi-11.scm, srfi-10.scm, srfi-9.scm, srfi-8.scm, srfi-6.scm,
|
||||||
|
srfi-2.scm: Use `cond-expand-provide' for providing features to
|
||||||
|
`cond-expand'.
|
||||||
|
|
||||||
2001-05-20 Marius Vollmer <mvo@zagadka.ping.de>
|
2001-05-20 Marius Vollmer <mvo@zagadka.ping.de>
|
||||||
|
|
||||||
* srfi-14.c (scm_c_init_srfi_14): Added "int" to declaration of
|
* srfi-14.c (scm_c_init_srfi_14): Added "int" to declaration of
|
||||||
|
|
167
srfi/README
167
srfi/README
|
@ -1,141 +1,74 @@
|
||||||
This is the integration of guile-srfi into the core. -*- text -*-
|
This directory includes most of Guile's SRFI support. -*- text -*-
|
||||||
|
|
||||||
[ this is the README from guile-srfi 0.0.3, slightly modified for the
|
For more details about what SRFI means, and what the various numbers
|
||||||
integration into the Guile core
|
stand for, please refer to the SRFI homepage at
|
||||||
|
|
||||||
'martin -- 2001-04-23 ]
|
http://srfi.schemers.org
|
||||||
|
|
||||||
This is a compiled Guile module that provides the string procedures
|
The following SRFIs are supported (as of 2001-05-22 -- 'martin):
|
||||||
defined in SRFI-13 (string library), and the character set procedures
|
|
||||||
defined in SRFI-14 (character-set library).
|
|
||||||
|
|
||||||
Getting Started ======================================================
|
SRFI-0: cond-expand
|
||||||
|
|
||||||
1. Type
|
Supported by default, no module needs to get used.
|
||||||
|
|
||||||
guile
|
SRFI-2: and-let*
|
||||||
|
|
||||||
You should now be at the Guile prompt ("guile> ").
|
(use-modules (srfi srfi-2)) to make and-let* available.
|
||||||
|
|
||||||
2. Type
|
SRFI-6: open-input-string, open-output-string and get-output-string
|
||||||
|
|
||||||
(use-modules (srfi srfi-13))
|
(use-modules (srfi srfi-6)) to make these available. (Currently,
|
||||||
|
these procedures are available without using the module, but the
|
||||||
|
procedures might be factored out of the core library in the
|
||||||
|
future.)
|
||||||
|
|
||||||
so that the srfi-13 module gets loaded.
|
SRFI-8: receive
|
||||||
|
|
||||||
3. We're now ready to try some basic srfi-13/14 functionality.
|
(use-modules (srfi srfi-8)) to make receive available.
|
||||||
|
|
||||||
$ guile
|
SRFI-9: define-record-type
|
||||||
guile> (use-modules (srfi srfi-13))
|
|
||||||
guile> (string-concatenate '("Hello" " " "World"))
|
|
||||||
"Hello World"
|
|
||||||
guile>
|
|
||||||
|
|
||||||
Check out the SRFI-14 (character-set library) procedures, too:
|
A mechanism for defining record types. (use-modules (srfi srfi-9))
|
||||||
|
makes this syntactic form available.
|
||||||
|
|
||||||
$ guile
|
SRFI-10: #,()
|
||||||
guile> (use-modules (srfi srfi-14))
|
|
||||||
guile> (char-set-union (char-set #\f #\o #\o) (string->char-set "bar"))
|
|
||||||
#<charset {#\a #\b #\f #\o #\r}>
|
|
||||||
guile>
|
|
||||||
|
|
||||||
What Is Included =====================================================
|
The hash-comma reader extension. (use-modules (srfi srfi-10))
|
||||||
|
activates the extension.
|
||||||
|
|
||||||
All SRFI-13 procedures which are not already compatibly defined in
|
SRFI-11: let-values and let-values*
|
||||||
the Guile core are implemented. These are:
|
|
||||||
|
|
||||||
string-any string-every
|
Syntactic extensions for handling multiple values. (use-modules
|
||||||
string-tabulate
|
(srfi srfi-11)) makes these syntactic forms available.
|
||||||
string->list
|
|
||||||
reverse-list->string
|
|
||||||
string-join
|
|
||||||
string-copy
|
|
||||||
substring/shared string-copy!
|
|
||||||
string-take string-take-right
|
|
||||||
string-drop string-drop-right
|
|
||||||
string-pad string-pad-right
|
|
||||||
string-trim string-trim-right string-trim-both
|
|
||||||
string-fill!
|
|
||||||
string-compare string-compare-ci
|
|
||||||
string= string<>
|
|
||||||
string< string>
|
|
||||||
string<= string>=
|
|
||||||
string-ci= string-ci<>
|
|
||||||
string-ci< string-ci>
|
|
||||||
string-ci<= string-ci>=
|
|
||||||
string-hash string-hash-ci
|
|
||||||
string-prefix-length string-prefix-length-ci
|
|
||||||
string-suffix-length string-suffix-length-ci
|
|
||||||
string-prefix? string-prefix-ci?
|
|
||||||
string-suffix? string-suffix-ci?
|
|
||||||
string-index string-index-right
|
|
||||||
string-skip string-skip-right
|
|
||||||
string-count
|
|
||||||
string-contains string-contains-ci
|
|
||||||
string-upcase string-upcase!
|
|
||||||
string-downcase string-downcase!
|
|
||||||
string-titlecase string-titlecase!
|
|
||||||
string-reverse string-reverse!
|
|
||||||
string-append/shared
|
|
||||||
string-concatenate
|
|
||||||
reverse-string-concatenate
|
|
||||||
string-concatenate/shared
|
|
||||||
reverse-string-concatenate/shared
|
|
||||||
string-map string-map!
|
|
||||||
string-fold string-fold-right
|
|
||||||
string-unfold string-unfold-right
|
|
||||||
string-for-each
|
|
||||||
xsubstring string-xcopy!
|
|
||||||
string-replace string-tokenize
|
|
||||||
string-filter string-delete
|
|
||||||
|
|
||||||
|
SRFI-13: string library
|
||||||
|
|
||||||
All procedures and variables defined in SRFI-14 are implemented.
|
A lot of (more or less) useful string processing procedures.
|
||||||
Thes complete list is:
|
(use-modules (srfi srfi-13)) loads the procedures.
|
||||||
|
|
||||||
char-set? char-set= char-set<=
|
SRFI-14: character-set library
|
||||||
char-set-hash
|
|
||||||
char-set-fold char-set-unfold char-set-unfold!
|
|
||||||
char-set-for-each char-set-map
|
|
||||||
char-set-copy
|
|
||||||
char-set
|
|
||||||
list->char-set list->char-set!
|
|
||||||
string->char-set string-char-set!
|
|
||||||
predicate->char-set predicate->char-set!
|
|
||||||
ucs-range->char-set ucs-range->char-set!
|
|
||||||
->char-set ->char-set!
|
|
||||||
char-set-size char-set-count
|
|
||||||
char-set-members char-set-contains?
|
|
||||||
char-set-every char-set-any
|
|
||||||
char-set-adjoin char-set-adjoin!
|
|
||||||
char-set-delete char-set-delete!
|
|
||||||
char-set-invert char-set-invert!
|
|
||||||
char-set-union char-set-union!
|
|
||||||
char-set-intersection char-set-intersection!
|
|
||||||
char-set-difference char-set-difference!
|
|
||||||
char-set-xor char-set-xor!
|
|
||||||
char-set-diff+intersection 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
|
|
||||||
|
|
||||||
|
Character-set library. (use-modules (srfi srfi-14)) loads the
|
||||||
|
procedures and standard variables.
|
||||||
|
|
||||||
What Is Not Included =================================================
|
SRFI-16: case-lambda
|
||||||
|
|
||||||
The following low-level procedures and syntax defined in SRFI-13
|
Syntactic form which permits writing functions acting different
|
||||||
are currently not supported.
|
according to the number of arguments passed. (use-modules (srfi
|
||||||
|
srfi-16)) makes this syntactic form available.
|
||||||
|
|
||||||
string-parse-start+end
|
SRFI-17: Generalized set!
|
||||||
string-parse-final-start+end
|
|
||||||
let-string-start+end
|
Guile supports generalized set! by default, but this module makes it
|
||||||
check-substring-spec
|
fully compliant to the SRFI. (use-modules (srfi srfi-17)) loads the
|
||||||
substring-spec-ok?
|
procedures.
|
||||||
make-kmp-restart-vector
|
|
||||||
kmp-step
|
SRFI-19: Time Data Types and Procedures
|
||||||
string-search-kmp
|
|
||||||
|
A lot of data types and procedures for dealing with times and
|
||||||
|
dates. (use-modules (srfi srfi-19)) loads the procedures.
|
||||||
|
|
||||||
|
SRFI-23: Error reporting mechanism (draft)
|
||||||
|
|
||||||
|
This SRFI is still in draft status, but Guile fully supports it
|
||||||
|
already. No need to load any module.
|
||||||
|
|
|
@ -49,6 +49,8 @@
|
||||||
|
|
||||||
(export define-reader-ctor)
|
(export define-reader-ctor)
|
||||||
|
|
||||||
|
(cond-expand-provide (current-module) '(srfi-10))
|
||||||
|
|
||||||
;; This hash table stores the association between comma-hash tags and
|
;; This hash table stores the association between comma-hash tags and
|
||||||
;; the corresponding constructor procedures.
|
;; the corresponding constructor procedures.
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
(define-module (srfi srfi-11)
|
(define-module (srfi srfi-11)
|
||||||
:use-module (ice-9 syncase))
|
:use-module (ice-9 syncase))
|
||||||
|
|
||||||
|
(cond-expand-provide (current-module) '(srfi-11))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;
|
||||||
;; let-values
|
;; let-values
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -110,6 +110,8 @@
|
||||||
string-delete
|
string-delete
|
||||||
)
|
)
|
||||||
|
|
||||||
|
(cond-expand-provide (current-module) '(srfi-13))
|
||||||
|
|
||||||
(dynamic-call "scm_init_srfi_13" (dynamic-link "libguile-srfi-srfi-13-14"))
|
(dynamic-call "scm_init_srfi_13" (dynamic-link "libguile-srfi-srfi-13-14"))
|
||||||
|
|
||||||
(define string-hash
|
(define string-hash
|
||||||
|
@ -139,3 +141,4 @@
|
||||||
(caddr rest)
|
(caddr rest)
|
||||||
(string-length s))))
|
(string-length s))))
|
||||||
(hash (string-upcase (substring/shared s start end)) bound))))
|
(hash (string-upcase (substring/shared s start end)) bound))))
|
||||||
|
|
||||||
|
|
|
@ -90,6 +90,8 @@
|
||||||
char-set:full
|
char-set:full
|
||||||
)
|
)
|
||||||
|
|
||||||
|
(cond-expand-provide (current-module) '(srfi-14))
|
||||||
|
|
||||||
(dynamic-call "scm_init_srfi_14" (dynamic-link "libguile-srfi-srfi-13-14"))
|
(dynamic-call "scm_init_srfi_14" (dynamic-link "libguile-srfi-srfi-13-14"))
|
||||||
|
|
||||||
(define (->char-set x)
|
(define (->char-set x)
|
||||||
|
|
|
@ -49,6 +49,8 @@
|
||||||
|
|
||||||
(export-syntax case-lambda)
|
(export-syntax case-lambda)
|
||||||
|
|
||||||
|
(cond-expand-provide (current-module) '(srfi-16))
|
||||||
|
|
||||||
(define-macro (case-lambda . clauses)
|
(define-macro (case-lambda . clauses)
|
||||||
|
|
||||||
;; Return the length of the list @var{l}, but allow dotted list.
|
;; Return the length of the list @var{l}, but allow dotted list.
|
||||||
|
|
|
@ -49,6 +49,8 @@
|
||||||
caddar cadddr cdaaar cdaadr cdadar cdaddr cddaar cddadr
|
caddar cadddr cdaaar cdaadr cdadar cdaddr cddaar cddadr
|
||||||
cdddar cddddr string-ref vector-ref))
|
cdddar cddddr string-ref vector-ref))
|
||||||
|
|
||||||
|
(cond-expand-provide (current-module) '(srfi-17))
|
||||||
|
|
||||||
;;; Procedures
|
;;; Procedures
|
||||||
|
|
||||||
(define getter-with-setter make-procedure-with-setter)
|
(define getter-with-setter make-procedure-with-setter)
|
||||||
|
|
|
@ -119,6 +119,8 @@
|
||||||
date->string
|
date->string
|
||||||
string->date))
|
string->date))
|
||||||
|
|
||||||
|
(cond-expand-provide (current-module) '(srfi-19))
|
||||||
|
|
||||||
;; :OPTIONAL is nice
|
;; :OPTIONAL is nice
|
||||||
|
|
||||||
(define-syntax :optional
|
(define-syntax :optional
|
||||||
|
|
|
@ -21,3 +21,5 @@
|
||||||
:use-module (ice-9 and-let-star))
|
:use-module (ice-9 and-let-star))
|
||||||
|
|
||||||
(export-syntax and-let*)
|
(export-syntax and-let*)
|
||||||
|
|
||||||
|
(cond-expand-provide (current-module) '(srfi-2))
|
||||||
|
|
|
@ -21,3 +21,5 @@
|
||||||
|
|
||||||
;; Currently, guile provides these functions by default, so no action
|
;; Currently, guile provides these functions by default, so no action
|
||||||
;; is needed, and this file is just a placeholder.
|
;; is needed, and this file is just a placeholder.
|
||||||
|
|
||||||
|
(cond-expand-provide (current-module) '(srfi-6))
|
||||||
|
|
|
@ -21,3 +21,5 @@
|
||||||
:use-module (ice-9 receive))
|
:use-module (ice-9 receive))
|
||||||
|
|
||||||
(export-syntax receive)
|
(export-syntax receive)
|
||||||
|
|
||||||
|
(cond-expand-provide (current-module) '(srfi-8))
|
||||||
|
|
|
@ -63,6 +63,8 @@
|
||||||
|
|
||||||
(export-syntax define-record-type)
|
(export-syntax define-record-type)
|
||||||
|
|
||||||
|
(cond-expand-provide (current-module) '(srfi-9))
|
||||||
|
|
||||||
(define-macro (define-record-type type-name constructor/field-tag
|
(define-macro (define-record-type type-name constructor/field-tag
|
||||||
predicate-name . field-specs)
|
predicate-name . field-specs)
|
||||||
`(begin
|
`(begin
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue