File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 146146 (pad-stack)
147147 (Call 'is_char_alphabetic )
148148 (unpad-stack))]
149+ ['char-whitespace?
150+ (seq (assert-char rax)
151+ (Sar rax char-shift)
152+ (Mov rdi rax)
153+ (pad-stack)
154+ (Call 'is_char_whitespace )
155+ (unpad-stack))]
149156
150157 ;; Op2
151158 ['+
Original file line number Diff line number Diff line change 8080 string->uninterned-symbol
8181 open-input-file
8282 write-char error integer?
83- eq-hash-code char-alphabetic?
83+ eq-hash-code char-alphabetic? char-whitespace?
8484 ;; Op2
8585 + - < = cons eq? make-vector vector-ref
8686 make-string string-ref string-append
103103 read_byte_port
104104 peek_byte_port
105105 is_char_alphabetic
106+ is_char_whitespace
106107 system_type)))
107108
108109(define cons-function
Original file line number Diff line number Diff line change 291291 [(? symbol? xs)
292292 (LamRest (gensym 'lamrest ) '() xs (parse-e e))]
293293 [_
294- (eprintf "xs: ~a e: ~a\n " xs e)
295294 (error "parse parameter list error " )]))
296295
297296;; Datum -> Datum
337336 write-char
338337 error integer?
339338 eq-hash-code
340- char-alphabetic?))
339+ char-alphabetic? char-whitespace? ))
341340(define op2
342341 '(+ - < = cons eq? make-vector vector-ref make-string string-ref
343342 string-append set-box! quotient remainder
Original file line number Diff line number Diff line change @@ -19,7 +19,9 @@ val_t is_char_alphabetic(val_char_t c) {
1919 return val_wrap_bool (uc_is_property_alphabetic (c ));
2020}
2121
22-
22+ val_t is_char_whitespace (val_char_t c ) {
23+ return val_wrap_bool (uc_is_property_white_space (c ));
24+ }
2325
2426void print_result (val_t x )
2527{
Original file line number Diff line number Diff line change 1313 not
1414 findf
1515 read-line
16- char-alphabetic?
16+ char-alphabetic? char-whitespace?
1717 ; unimplemented
1818 exact->inexact / expt string->keyword
1919 ;; Op0
553553 (read-line/a (cons c cs)))))
554554
555555(define (char-alphabetic? x) (%char-alphabetic? x))
556+ (define (char-whitespace? x) (%char-whitespace? x))
556557
557558(define (exact->inexact x)
558559 (error "exact->inexact not implemented " ))
Original file line number Diff line number Diff line change 594594 (check-equal? (run '(findf odd? '(2 4 3 7 ))) 3 )
595595 (check-equal? (run '(char-alphabetic? #\a )) #t )
596596 (check-equal? (run '(char-alphabetic? #\space )) #f )
597+ (check-equal? (run '(char-whitespace? #\a )) #f )
598+ (check-equal? (run '(char-whitespace? #\space )) #t )
597599 (check-equal? (run '(begin 1 )) 1 )
598600 (check-equal? (run '(begin 1 2 )) 2 )
599601 (check-equal? (run '(begin 1 2 3 )) 3 )
You can’t perform that action at this time.
0 commit comments