rnrs.scm 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. ;;; rnrs.scm --- The R6RS composite library
  2. ;; Copyright (C) 2010, 2011 Free Software Foundation, Inc.
  3. ;;
  4. ;; This library is free software; you can redistribute it and/or
  5. ;; modify it under the terms of the GNU Lesser General Public
  6. ;; License as published by the Free Software Foundation; either
  7. ;; version 3 of the License, or (at your option) any later version.
  8. ;;
  9. ;; This library is distributed in the hope that it will be useful,
  10. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. ;; Lesser General Public License for more details.
  13. ;;
  14. ;; You should have received a copy of the GNU Lesser General Public
  15. ;; License along with this library; if not, write to the Free Software
  16. ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  17. (library (rnrs (6))
  18. (export ;; (rnrs arithmetic bitwise)
  19. bitwise-not bitwise-and bitwise-ior bitwise-xor bitwise-if
  20. bitwise-bit-count bitwise-length bitwise-first-bit-set
  21. bitwise-bit-set? bitwise-copy-bit bitwise-bit-field
  22. bitwise-copy-bit-field bitwise-arithmetic-shift
  23. bitwise-arithmetic-shift-left bitwise-arithmetic-shift-right
  24. bitwise-rotate-bit-field bitwise-reverse-bit-field
  25. ;; (rnrs arithmetic fixnums)
  26. fixnum? fixnum-width least-fixnum greatest-fixnum fx=? fx>? fx<? fx>=?
  27. fx<=? fxzero? fxpositive? fxnegative? fxodd? fxeven? fxmax fxmin fx+
  28. fx* fx- fxdiv-and-mod fxdiv fxmod fxdiv0-and-mod0 fxdiv0 fxmod0
  29. fx+/carry fx-/carry fx*/carry fxnot fxand fxior fxxor fxif fxbit-count
  30. fxlength fxfirst-bit-set fxbit-set? fxcopy-bit fxbit-field
  31. fxcopy-bit-field fxarithmetic-shift fxarithmetic-shift-left
  32. fxarithmetic-shift-right fxrotate-bit-field fxreverse-bit-field
  33. ;; (rnrs arithmetic flonums)
  34. flonum? real->flonum fl=? fl<? fl<=? fl>? fl>=? flinteger? flzero?
  35. flpositive? flnegative? flodd? fleven? flfinite? flinfinite? flnan?
  36. flmax flmin fl+ fl* fl- fl/ flabs fldiv-and-mod fldiv flmod
  37. fldiv0-and-mod0 fldiv0 flmod0 flnumerator fldenominator flfloor
  38. flceiling fltruncate flround flexp fllog flsin flcos fltan flacos
  39. flasin flatan flsqrt flexpt &no-infinities
  40. make-no-infinities-violation no-infinities-violation? &no-nans
  41. make-no-nans-violation no-nans-violation? fixnum->flonum
  42. ;; (rnrs base)
  43. boolean? symbol? char? vector? null? pair? number? string? procedure?
  44. define define-syntax syntax-rules lambda let let* let-values
  45. let*-values letrec letrec* begin quote lambda if set! cond case or
  46. and not eqv? equal? eq? + - * / max min abs numerator denominator gcd
  47. lcm floor ceiling truncate round rationalize real-part imag-part
  48. make-rectangular angle div mod div-and-mod div0 mod0 div0-and-mod0
  49. expt exact-integer-sqrt sqrt exp log sin cos tan asin acos atan
  50. make-polar magnitude angle complex? real? rational? integer? exact?
  51. inexact? real-valued? rational-valued? integer-valued? zero?
  52. positive? negative? odd? even? nan? finite? infinite? exact inexact =
  53. < > <= >= number->string string->number boolean=? cons car cdr caar
  54. cadr cdar cddr caaar caadr cadar cdaar caddr cdadr cddar cdddr caaaar
  55. caaadr caadar cadaar cdaaar cddaar cdadar cdaadr cadadr caaddr caddar
  56. cadddr cdaddr cddadr cdddar cddddr list? list length append reverse
  57. list-tail list-ref map for-each symbol->string string->symbol symbol=?
  58. char->integer integer->char char=? char<? char>? char<=? char>=?
  59. make-string string string-length string-ref string=? string<? string>?
  60. string<=? string>=? substring string-append string->list list->string
  61. string-for-each string-copy vector? make-vector vector vector-length
  62. vector-ref vector-set! vector->list list->vector vector-fill!
  63. vector-map vector-for-each error assertion-violation assert
  64. call-with-current-continuation call/cc call-with-values dynamic-wind
  65. values apply quasiquote unquote unquote-splicing let-syntax
  66. letrec-syntax syntax-rules identifier-syntax
  67. ;; (rnrs bytevectors)
  68. endianness native-endianness bytevector? make-bytevector
  69. bytevector-length bytevector=? bytevector-fill! bytevector-copy!
  70. bytevector-copy uniform-array->bytevector bytevector-u8-ref
  71. bytevector-s8-ref bytevector-u8-set! bytevector-s8-set!
  72. bytevector->u8-list u8-list->bytevector bytevector-uint-ref
  73. bytevector-uint-set! bytevector-sint-ref bytevector-sint-set!
  74. bytevector->sint-list bytevector->uint-list uint-list->bytevector
  75. sint-list->bytevector bytevector-u16-ref bytevector-s16-ref
  76. bytevector-u16-set! bytevector-s16-set! bytevector-u16-native-ref
  77. bytevector-s16-native-ref bytevector-u16-native-set!
  78. bytevector-s16-native-set! bytevector-u32-ref bytevector-s32-ref
  79. bytevector-u32-set! bytevector-s32-set! bytevector-u32-native-ref
  80. bytevector-s32-native-ref bytevector-u32-native-set!
  81. bytevector-s32-native-set! bytevector-u64-ref bytevector-s64-ref
  82. bytevector-u64-set! bytevector-s64-set! bytevector-u64-native-ref
  83. bytevector-s64-native-ref bytevector-u64-native-set!
  84. bytevector-s64-native-set! bytevector-ieee-single-ref
  85. bytevector-ieee-single-set! bytevector-ieee-single-native-ref
  86. bytevector-ieee-single-native-set! bytevector-ieee-double-ref
  87. bytevector-ieee-double-set! bytevector-ieee-double-native-ref
  88. bytevector-ieee-double-native-set! string->utf8 string->utf16
  89. string->utf32 utf8->string utf16->string utf32->string
  90. ;; (rnrs conditions)
  91. &condition condition simple-conditions condition? condition-predicate
  92. condition-accessor define-condition-type &message
  93. make-message-condition message-condition? condition-message &warning
  94. make-warning warning? &serious make-serious-condition
  95. serious-condition? &error make-error error? &violation make-violation
  96. violation? &assertion make-assertion-violation assertion-violation?
  97. &irritants make-irritants-condition irritants-condition?
  98. condition-irritants &who make-who-condition who-condition?
  99. condition-who &non-continuable make-non-continuable-violation
  100. non-continuable-violation? &implementation-restriction
  101. make-implementation-restriction-violation
  102. implementation-restriction-violation? &lexical make-lexical-violation
  103. lexical-violation? &syntax make-syntax-violation syntax-violation?
  104. syntax-violation-form syntax-violation-subform &undefined
  105. make-undefined-violation undefined-violation?
  106. ;; (rnrs control)
  107. when unless do case-lambda
  108. ;; (rnrs enums)
  109. make-enumeration enum-set-universe enum-set-indexer
  110. enum-set-constructor enum-set->list enum-set-member? enum-set-subset?
  111. enum-set=? enum-set-union enum-set-intersection enum-set-difference
  112. enum-set-complement enum-set-projection define-enumeration
  113. ;; (rnrs exceptions)
  114. guard with-exception-handler raise raise-continuable
  115. ;; (rnrs files)
  116. file-exists? delete-file &i/o make-i/o-error i/o-error? &i/o-read
  117. make-i/o-read-error i/o-read-error? &i/o-write make-i/o-write-error
  118. i/o-write-error? &i/o-invalid-position
  119. make-i/o-invalid-position-error i/o-invalid-position-error?
  120. i/o-error-position &i/o-filename make-i/o-filename-error
  121. i/o-filename-error? i/o-error-filename &i/o-file-protection
  122. make-i/o-file-protection-error i/o-file-protection-error?
  123. &i/o-file-is-read-only make-i/o-file-is-read-only-error
  124. i/o-file-is-read-only-error? &i/o-file-already-exists
  125. make-i/o-file-already-exists-error i/o-file-already-exists-error?
  126. &i/o-file-does-not-exist make-i/o-file-does-not-exist-error
  127. i/o-file-does-not-exist-error? &i/o-port make-i/o-port-error
  128. i/o-port-error? i/o-error-port
  129. ;; (rnrs hashtables)
  130. make-eq-hashtable make-eqv-hashtable make-hashtable hashtable?
  131. hashtable-size hashtable-ref hashtable-set! hashtable-delete!
  132. hashtable-contains? hashtable-update! hashtable-copy hashtable-clear!
  133. hashtable-keys hashtable-entries hashtable-equivalence-function
  134. hashtable-hash-function hashtable-mutable? equal-hash string-hash
  135. string-ci-hash symbol-hash
  136. ;; (rnrs io ports)
  137. file-options buffer-mode buffer-mode?
  138. eol-style native-eol-style error-handling-mode
  139. make-transcoder transcoder-codec transcoder-eol-style
  140. transcoder-error-handling-mode native-transcoder
  141. latin-1-codec utf-8-codec utf-16-codec
  142. eof-object? port? input-port? output-port? eof-object port-eof?
  143. port-transcoder
  144. binary-port? textual-port? transcoded-port
  145. port-position set-port-position!
  146. port-has-port-position? port-has-set-port-position!?
  147. close-port call-with-port
  148. open-bytevector-input-port make-custom-binary-input-port get-u8
  149. lookahead-u8 get-bytevector-n get-bytevector-n! get-bytevector-some
  150. get-bytevector-all open-bytevector-output-port
  151. make-custom-binary-output-port put-u8 put-bytevector
  152. open-string-input-port open-string-output-port
  153. call-with-bytevector-output-port
  154. call-with-string-output-port
  155. latin-1-codec utf-8-codec utf-16-codec
  156. open-file-input-port open-file-output-port open-file-input/output-port
  157. make-custom-textual-output-port
  158. call-with-string-output-port
  159. flush-output-port put-string
  160. get-char get-datum get-line get-string-all get-string-n get-string-n!
  161. lookahead-char
  162. put-char put-datum put-string
  163. standard-input-port standard-output-port standard-error-port
  164. ;; (rnrs io simple)
  165. call-with-input-file call-with-output-file current-input-port
  166. current-output-port current-error-port with-input-from-file
  167. with-output-to-file open-input-file open-output-file close-input-port
  168. close-output-port read-char peek-char read write-char newline display
  169. write
  170. ;; (rnrs lists)
  171. find for-all exists filter partition fold-left fold-right remp remove
  172. remv remq memp member memv memq assp assoc assv assq cons*
  173. ;; (rnrs programs)
  174. command-line exit
  175. ;; (rnrs records inspection)
  176. record? record-rtd record-type-name record-type-parent
  177. record-type-uid record-type-generative? record-type-sealed?
  178. record-type-opaque? record-type-field-names record-field-mutable?
  179. ;; (rnrs records procedural)
  180. make-record-type-descriptor record-type-descriptor?
  181. make-record-constructor-descriptor record-constructor record-predicate
  182. record-accessor record-mutator
  183. ;; (rnrs records syntactic)
  184. define-record-type record-type-descriptor
  185. record-constructor-descriptor
  186. ;; (rnrs sorting)
  187. list-sort vector-sort vector-sort!
  188. ;; (rnrs syntax-case)
  189. make-variable-transformer syntax
  190. ;; Until the deprecated support for a unified modules and
  191. ;; bindings namespace is removed, we need to manually resolve
  192. ;; a conflict between two bindings: that of the (rnrs
  193. ;; syntax-case) module, and the imported `syntax-case'
  194. ;; binding. We do so here and below by renaming the macro
  195. ;; import.
  196. (rename (syntax-case-hack syntax-case))
  197. identifier? bound-identifier=? free-identifier=?
  198. syntax->datum datum->syntax generate-temporaries with-syntax
  199. quasisyntax unsyntax unsyntax-splicing syntax-violation
  200. ;; (rnrs unicode)
  201. char-upcase char-downcase char-titlecase char-foldcase
  202. char-ci=? char-ci<? char-ci>? char-ci<=? char-ci>=?
  203. char-alphabetic? char-numeric? char-whitespace? char-upper-case?
  204. char-lower-case? char-title-case? char-general-category
  205. string-upcase string-downcase string-titlecase string-foldcase
  206. string-ci=? string-ci<? string-ci>? string-ci<=? string-ci>=?
  207. string-normalize-nfd string-normalize-nfkd string-normalize-nfc
  208. string-normalize-nfkc)
  209. (import (rnrs arithmetic bitwise (6))
  210. (rnrs arithmetic fixnums (6))
  211. (rnrs arithmetic flonums (6))
  212. (rnrs base (6))
  213. (rnrs bytevectors (6))
  214. (rnrs conditions (6))
  215. (rnrs control (6))
  216. (rnrs enums (6))
  217. (rnrs exceptions (6))
  218. (rnrs files (6))
  219. (rnrs hashtables (6))
  220. (rnrs io ports (6))
  221. (rnrs io simple (6))
  222. (rnrs lists (6))
  223. (rnrs programs (6))
  224. (rnrs records inspection (6))
  225. (rnrs records procedural (6))
  226. (rnrs records syntactic (6))
  227. (rnrs sorting (6))
  228. ;; See note above on exporting syntax-case.
  229. (rename (rnrs syntax-case (6))
  230. (syntax-case syntax-case-hack))
  231. (rnrs unicode (6))))