1(library (rnrs base (6)) 2 3 (export 4 5 ;; Macros defined in core expander: 6 7 begin if lambda quote set! and or 8 define define-syntax let-syntax letrec-syntax 9 _ ... 10 11 ;; Derived syntax: 12 13 let let* letrec letrec* let-values let*-values 14 case cond else => 15 assert 16 quasiquote unquote unquote-splicing 17 syntax-rules 18 identifier-syntax 19 20 ;; R5RS primitives: 21 22 * + - / < <= = > >= abs acos append apply asin atan 23 boolean? call-with-current-continuation 24 call-with-values car cdr caar cadr cdar cddr 25 caaar caadr cadar caddr cdaar cdadr cddar cdddr caaaar caaadr caadar caaddr cadaar 26 cadadr caddar cadddr cdaaar cdaadr cdadar cdaddr cddaar cddadr cdddar cddddr 27 ceiling char? char->integer 28 complex? cons cos 29 denominator dynamic-wind 30 eq? equal? eqv? even? exact? exp expt floor for-each 31 gcd imag-part inexact? integer->char integer? 32 lcm length list list->string 33 list->vector list-ref list-tail list? log magnitude make-polar 34 make-rectangular make-string make-vector map max min 35 negative? not null? number->string number? numerator 36 odd? pair? 37 positive? procedure? rational? rationalize 38 real-part real? reverse round 39 sin sqrt string string->list string->number string->symbol 40 string-append 41 string-copy string-length string-ref string<=? string<? 42 string=? string>=? string>? string? substring symbol->string symbol? tan 43 truncate values vector vector->list 44 vector-fill! vector-length vector-ref vector-set! zero? vector? 45 46 ;; R6RS additional procedures: 47 48 real-valued? rational-valued? integer-valued? exact inexact finite? infinite? 49 nan? div mod div-and-mod div0 mod0 div0-and-mod0 exact-integer-sqrt boolean=? 50 symbol=? string-for-each vector-map vector-for-each error assertion-violation 51 (rename (call-with-current-continuation call/cc)) 52 53 ;; MOSH 54 char>=? 55 char<=? 56 char<? 57 char>? 58 char=? 59 angle 60 ) 61 62 (import (except (core primitives) _ ...) 63 (core let) 64 (core derived) 65 (core quasiquote) 66 (core let-values) 67 (for (core syntax-rules) expand) 68 (for (core identifier-syntax) expand) 69 (for (only (core primitives) _ ... set!) expand) 70 (primitives 71 72 ;; R5RS primitives: 73 74 * + - / < <= = > >= abs acos append apply asin atan 75 boolean? call-with-current-continuation 76 call-with-values car cdr caar cadr cdar cddr 77 caaar caadr cadar caddr cdaar cdadr cddar cdddr caaaar caaadr caadar caaddr cadaar 78 cadadr caddar cadddr cdaaar cdaadr cdadar cdaddr cddaar cddadr cdddar cddddr 79 ceiling char? char->integer 80 complex? cons cos 81 denominator dynamic-wind 82 eq? equal? eqv? even? exact? exp expt floor for-each 83 gcd imag-part inexact? integer->char integer? 84 lcm length list list->string 85 list->vector list-ref list-tail list? log magnitude make-polar 86 make-rectangular make-string make-vector map max min 87 negative? not null? number->string number? numerator 88 odd? pair? 89 positive? procedure? rational? rationalize 90 real-part real? reverse round 91 sin sqrt string string->list string->number string->symbol 92 string-append 93 string-copy string-length string-ref string<=? string<? 94 string=? string>=? string>? string? substring symbol->string symbol? tan 95 truncate values vector vector->list 96 vector-fill! vector-length vector-ref vector-set! zero? ;MOSH: vector? 97 98 ;; R6RS additional procedures: 99 100 real-valued? rational-valued? integer-valued? exact inexact finite? infinite? 101 nan? div mod div-and-mod div0 mod0 div0-and-mod0 exact-integer-sqrt boolean=? 102 symbol=? string-for-each vector-map vector-for-each error assertion-violation 103 ;call/cc 104 105 char>=? 106 char<=? 107 char<? 108 char>? 109 char=? 110 angle 111 112 ;MOSH: FIXME! 113 vector? 114 )) 115 116 (define-syntax assert 117 (syntax-rules () 118 ((_ expression) 119 (let ((p expression)) 120 (if p 121 p 122 (assertion-violation #f "assertion failed" 'expression)))))) 123 ) ;; rnrs base 124 125