-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
180 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
|
||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
;; | ||
;; MODULE : r7rs-keyword.scm | ||
;; DESCRIPTION : the Scheme Keyword defined in R7RS | ||
;; COPYRIGHT : (C) 2024 Darcy Shen | ||
;; | ||
;; This software falls under the GNU general public license version 3 or later. | ||
;; It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE | ||
;; in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>. | ||
;; | ||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
|
||
(texmacs-module (code r7rs-keyword)) | ||
|
||
(define (r7rs-scheme-base) | ||
(map symbol->string | ||
'(abs and append assoc assq assv binary-port? boolean=? boolean? bytevector bytevector-append bytevector-copy bytevector-copy! bytevector-length bytevector-u8-ref bytevector-u8-set! bytevector? caar cadr call-with-current-continuation call-with-port call-with-values call/cc car case cdar cddr cdr ceiling char->integer char-ready? char<=? char<? char=? char>=? char>? char? close-input-port close-output-port close-port complex? cond cond-expand cons current-error-port current-input-port current-output-port denominator do dynamic-wind else eof-object eof-object? eq? equal? eqv? error-object-irritants error-object-message error-object? even? exact exact-integer-sqrt exact-integer? exact? expt features file-error? floor floor-quotient floor-remainder floor/ flush-output-port for-each gcd get-output-bytevector get-output-string include include-ci inexact inexact? input-port-open? input-port? integer->char integer? lambda lcm length let*-values let-syntax let-values letrec letrec* letrec-syntax list list->string list->vector list-copy list-ref list-set! list-tail list? make-bytevector make-list make-parameter make-string make-vector map max member memq memv min modulo negative? newline not null? number->string number? numerator odd? open-input-bytevector open-input-string open-output-bytevector open-output-string or output-port-open? output-port? pair? parameterize peek-char peek-u8 port? positive? procedure? quasiquote quote quotient raise raise-continuable rational? rationalize read-bytevector read-bytevector! read-char read-error? read-line read-string read-u8 real? remainder reverse round set-car! set-cdr! sin sqrt string string->list string->number string->symbol string->utf8 string->vector string-append string-copy string-copy! string-fill! string-for-each string-length string-map string-ref string-set! string<=? string<? string=? string>=? string>? string? substring symbol->string symbol=? symbol? syntax-error syntax-rules textual-port? truncate truncate-quotient truncate-remainder truncate/ u8-ready? unless unquote unquote-splicing utf8->string vector vector->list vector->string vector-append vector-copy vector-copy! vector-fill! vector-for-each vector-length vector-map vector-ref vector-set! vector? write-bytevector write-char write-string write-u8 zero?))) | ||
|
||
(define (r7rs-scheme-case-lambda) | ||
(map symbol->string '(case-lambda))) | ||
|
||
(define (r7rs-scheme-char) | ||
(map symbol->string | ||
'(char-alphabetic? char-ci<=? char-ci<? char-ci=? char-ci>=? char-ci>? char-downcase char-foldcase char-lower-case? char-numeric? char-upcase char-upper-case? char-whitespace? digit-value string-ci<=? string-ci<? string-ci=? string-ci>=? string-ci>? string-downcase string-foldcase string-upcase))) | ||
|
||
(define (r7rs-scheme-complex) | ||
(map symbol->string | ||
'(angle imag-part magnitude make-polar make-rectangular real-part))) | ||
|
||
(define (r7rs-scheme-CxR) | ||
(map symbol->string | ||
'(caaaar caaadr caaar caadar caaddr caadr cadaar cadadr cadar caddar cadddr caddr cdaaar cdaadr cdaar cdadar cdaddr cdadr cddaar cddadr cddar cdddar cddddr cdddr))) | ||
|
||
(define (r7rs-scheme-file) | ||
(map symbol->string | ||
'(call-with-input-file call-with-output-file delete-file file-exists? open-binary-input-file open-binary-output-file open-input-file open-output-file with-input-from-file with-output-to-file))) | ||
|
||
(define (r7rs-scheme-inexact) | ||
(map symbol->string '(acos asin atan cos exp finite? infinite? log nan? sin sqrt tan))) | ||
|
||
(define (r7rs-scheme-lazy) | ||
(map symbol->string '(delay delay-force force make-promise promise?))) | ||
|
||
(define (r7rs-scheme-process-context) | ||
(map symbol->string | ||
'(command-line emergency-exit exit get-environment-variable get-environment-variables))) | ||
|
||
(define (r7rs-scheme-read) | ||
(map symbol->string '(read))) | ||
|
||
(define (r7rs-scheme-repl) | ||
(map symbol->string | ||
'(interaction-environment))) | ||
|
||
(define (r7rs-scheme-time) | ||
(map symbol->string | ||
'(current-jiffy current-second jiffies-per-second))) | ||
|
||
(define (r7rs-scheme-write) | ||
(map symbol->string | ||
'(display write write-shared write-simple))) | ||
|
||
(tm-define (r7rs-keywords-others) | ||
`(,@(r7rs-scheme-base) ,@(r7rs-scheme-case-lambda) ,@(r7rs-scheme-char) ,@(r7rs-scheme-complex) ,@(r7rs-scheme-CxR) ,@(r7rs-scheme-file) ,@(r7rs-scheme-inexact) ,@(r7rs-scheme-lazy) ,@(r7rs-scheme-process-context) ,@(r7rs-scheme-read) ,@(r7rs-scheme-repl) ,@(r7rs-scheme-time) ,@(r7rs-scheme-write))) | ||
|
||
(tm-define (r7rs-keywords-constant) | ||
(list "+inf.0" "-inf.0" "+nan.0" "-nan.0" "#t" "#true" "#f" "#false")) | ||
|
||
(tm-define (r7rs-keywords-branch) | ||
(list "if" "cond" "else" "case" "when")) | ||
|
||
(tm-define (r7rs-keywords-define) | ||
(list "define" "define-record-type" "define-syntax" "define-values" "set!" "lambda" "let" "let*" "apply" "eval" "environment" "load" "values" "begin")) | ||
|
||
(tm-define (r7rs-keywords-exception) | ||
(list "error" "guard" "with-exception-handler")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
|
||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
;; | ||
;; MODULE : srfi-keyword.scm | ||
;; DESCRIPTION : the Scheme Keyword defined in R7RS | ||
;; COPYRIGHT : (C) 2024 Darcy Shen | ||
;; | ||
;; This software falls under the GNU general public license version 3 or later. | ||
;; It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE | ||
;; in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>. | ||
;; | ||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
|
||
(texmacs-module (code srfi-keyword)) | ||
|
||
(tm-define (srfi-1-keywords) | ||
(list | ||
"srfi-1" ; List Library | ||
; SRFI-1: List constructors | ||
"list" "cons" "xcons" "cons*" "make-list" | ||
"list-tabulate" "list-copy" "circular-list" "iota" | ||
; SRFI-1: List predicates | ||
"pair?" "null?" "proper-list?" "circular-list?" "dotted-list?" | ||
"not-pair?" "null-list?" "list=" "list?" | ||
; SRFI-1: List selectors | ||
"car" "caar" "cdar" "cadr" "caddr" "cadddr" | ||
"cdr" "cddr" "cdddr" "cddddr" | ||
"list-ref" | ||
"first" "second" "third" "fourth" "fifth" | ||
"sixth" "seventh" "eighth" "ninth" "tenth" | ||
"take" "drop" "take-right" "drop-right" "last" | ||
; SRFI-1: MISC | ||
"concatenate" "reverse" "append-reverse" "zip" "count" | ||
; SRFI-1: fold, unfold, map | ||
"fold" "fold-right" "reduce" "reduce-right" "map" | ||
"unfold" "unfold-right" "for-each" "map-in-order" | ||
; SRFI-1: Filtering & Parititioning | ||
"filter" "partition" "remove" | ||
; SRFI-1: Searching | ||
"find" "find-tail" "take-while" "drop-while" "span" | ||
"any" "every" "list-index" "member" "memq" "memv" | ||
; SRFI-1: Deletion | ||
"delete" "delete-duplicates")) | ||
|
||
(tm-define (srfi-8-keywords) | ||
(list | ||
"srfi-8" | ||
"call-with-values" "receive")) | ||
|
||
(tm-define (srfi-13-keywords) | ||
(list | ||
"srfi-13" ; String Library | ||
; SRFI-13: String predicates | ||
"string?" "string-null?" "string-every" "string-any" | ||
; SRFI-13: String constructors | ||
"make-string" "string" "string-tabulate" | ||
; SRFI-13: List & String Conversion | ||
"string->list" "list->string" "reverse-list->string" "string-join" | ||
; SRFI-13: String selection | ||
"string-length" "string-ref" "string-copy" "substring" "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" | ||
; SRFI-13: String comparison | ||
"string-compare" "string=" "string<>" | ||
; SRFI-13: String Prefixes & Suffixes | ||
"string-prefix?" "string-suffix?" | ||
; SRFI-13: String searching | ||
"string-index" "string-index-right" "string-skip" "string-skip-right" "string-count" | ||
"string-contains" | ||
"string-reverse" "string-append" | ||
; SRFI-13: Functional programming | ||
"string-map" "string-fold" "string-fold-right" "string-for-each" "string-for-each-index" | ||
; SRFI-13: String insertion and parsing | ||
"string-replace" "string-tokenize" | ||
; SRFI-13: Filtering & Deleting | ||
"string-filter" "string-delete")) | ||
|
||
(tm-define (srfi-70-keywords) | ||
(list | ||
"srfi-70" ; Numbers | ||
"number?" "complex?" "real?" "rational?" "integer?" | ||
"exact?" "inexact?" "finite?" "infinite?" "zero?" | ||
"positive?" "negative?" "odd?" "even?" "floor?" | ||
"max" "min" "abs" "quotient" "remainder" "modulo" | ||
"gcd" "lcm" "numerator" "denominator" "floor" | ||
"ceiling" "truncate" "round" "rationalize" | ||
"expt" "log" "complex" "real-part" "imag-part" | ||
"sin" "cos" "tan" "asin" "acos" "atan" | ||
"sinh" "cosh" "tanh" "asinh" "acosh" "atanh" | ||
"sqrt" "expt" "make-rectangular" "make-polar" "magnitude" | ||
"angle" "exact->inexact" "inexact->exact" "string->number" "number->string")) | ||
|
||
(tm-define (srfi-78-keywords) | ||
(list | ||
"srfi-78" ; Light-weighted Test framework | ||
"check" "check-set-mode!" "check-report" "check-reset!")) |