Changeset 15701 in project
 Timestamp:
 09/01/09 14:41:48 (10 years ago)
 Location:
 release/4/srfi42/trunk
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

release/4/srfi42/trunk/srfi42.scm
r15407 r15701 491 491 (syntaxrules (index) 492 492 ((:integers cc var (index i)) 493 (:do cc ((var 0) (i 0)) #t (( + var 1) (+ i 1))) )493 (:do cc ((var 0) (i 0)) #t ((fx+ var 1) (fx+ i 1))) ) 494 494 ((:integers cc var) 495 (:do cc ((var 0)) #t (( + var 1))) )))495 (:do cc ((var 0)) #t ((fx+ var 1))) ))) 496 496 497 497 … … 512 512 (:do cc 513 513 (let ((b arg2)) 514 (if (not ( and (integer? b) (exact? b)))514 (if (not (fixnum? b)) 515 515 (error 516 516 "arguments of :range are not exact integer " 517 517 "(use :realrange?)" 0 b 1 ))) 518 518 ((var 0)) 519 ( < var b)519 (fx< var b) 520 520 (let ()) 521 521 #t 522 (( + var 1)) ))522 ((fx+ var 1)) )) 523 523 524 524 ((:range cc var 0 arg2 1) 525 525 (:do cc 526 526 (let ((b arg2)) 527 (if (not ( and (integer? b) (exact? b)))527 (if (not (fixnum? b)) 528 528 (error 529 529 "arguments of :range are not exact integer " 530 530 "(use :realrange?)" 0 b 1 ))) 531 531 ((var 0)) 532 ( > var b)532 (fx> var b) 533 533 (let ()) 534 534 #t 535 ((  var 1)) ))535 ((fx var 1)) )) 536 536 537 537 ((:range cc var arg1 arg2 1) 538 538 (:do cc 539 539 (let ((a arg1) (b arg2)) 540 (if (not (and (integer? a) (exact? a) 541 (integer? b) (exact? b) )) 540 (if (not (and (fixnum? a) (fixnum? b))) 542 541 (error 543 542 "arguments of :range are not exact integer " 544 543 "(use :realrange?)" a b 1 )) ) 545 544 ((var a)) 546 ( < var b)545 (fx< var b) 547 546 (let ()) 548 547 #t 549 (( + var 1)) ))548 ((fx+ var 1)) )) 550 549 551 550 ((:range cc var arg1 arg2 1) 552 551 (:do cc 553 552 (let ((a arg1) (b arg2) (s 1) (stop 0)) 554 (if (not (and (integer? a) (exact? a) 555 (integer? b) (exact? b) )) 553 (if (not (and (fixnum? a) (fixnum? b))) 556 554 (error 557 555 "arguments of :range are not exact integer " 558 556 "(use :realrange?)" a b 1 )) ) 559 557 ((var a)) 560 ( > var b)558 (fx> var b) 561 559 (let ()) 562 560 #t 563 ((  var 1)) ))561 ((fx var 1)) )) 564 562 565 563 ; the general case … … 568 566 (:do cc 569 567 (let ((a arg1) (b arg2) (s arg3) (stop 0)) 570 (if (not (and (integer? a) (exact? a) 571 (integer? b) (exact? b) 572 (integer? s) (exact? s) )) 568 (if (not (and (fixnum? a) (fixnum? b) (fixnum? s))) 573 569 (error 574 570 "arguments of :range are not exact integer " … … 576 572 (if (zero? s) 577 573 (error "step size must not be zero in :range") ) 578 (set! stop ( + a (* (max 0 (ceiling (/ ( b a) s))) s))) )574 (set! stop (fx+ a (fx* (fxmax 0 (fx/ (fx b a) s)) s))) ) 579 575 ((var a)) 580 (not ( =var stop))576 (not (eq? var stop)) 581 577 (let ()) 582 578 #t 583 (( + var s)) ))))579 ((fx+ var s)) )))) 584 580 585 581 ; Comment: The macro :range inserts some code to make sure the values … … 939 935 (i 0) ) 940 936 (doec qualifier 941 (if ( < i len)937 (if (fx< i len) 942 938 (begin (vectorset! vec i expression) 943 (set! i ( + i 1)) )939 (set! i (fx+ i 1)) ) 944 940 (error "vector is too short for the comprehension") )) 945 (if ( =i len)941 (if (eq? i len) 946 942 vec 947 943 (error "vector is too long for the comprehension") )))))) 
release/4/srfi42/trunk/srfi42.setup
r14549 r15701 1 1 ;;; srfi42.setup * Scheme * 2 2 3 (define (dynldname fn) 4 (makepathname #f fn ##sys#loaddynamicextension)) 5 6 (compile s O2 d0 srfi42.scm j srfi42) 3 (compile s O2 d1 srfi42.scm j srfi42) 7 4 (compile s O2 d0 srfi42.import.scm) 8 5 9 6 (installextension 10 7 'srfi42 11 `(,(dynldname "srfi42") ,(dynldname "srfi42.import"))8 '("srfi42.so" "srfi42.import.so") 12 9 '((syntax) 13 10 (version 1.6)
Note: See TracChangeset
for help on using the changeset viewer.