Changeset 14609 in project


Ignore:
Timestamp:
05/12/09 17:58:06 (11 years ago)
Author:
Kon Lovett
Message:

Better errmsg (the original) for nary stream procs.

Location:
release/4/srfi-41/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • release/4/srfi-41/trunk/streams-derived.scm

    r14571 r14609  
    313313  (stream-scan$ base streem) )
    314314
    315 (define (stream-fold function base streem . streems)
     315(define (stream-fold function base . streems)
    316316
    317317  (define (stream-folder base strms)
     
    321321
    322322  (%check-procedure 'stream-fold function 'function)
    323   (let ((streems (%cons streem streems)))
    324     (%check-streams 'stream-fold streems 'stream)
    325     (stream-folder base streems) ) )
    326 
    327 (define (stream-for-each procedure streem . streems)
     323  (%check-streams 'stream-fold streems 'stream)
     324  (stream-folder base streems) )
     325
     326(define (stream-for-each procedure . streems)
    328327
    329328  (define (stream-for-eacher strms)
     
    333332
    334333  (%check-procedure 'stream-for-each procedure 'procedure)
    335   (let ((streems (%cons streem streems)))
    336     (%check-streams 'stream-for-each streems 'stream)
    337     (stream-for-eacher streems) ) )
    338 
    339 (define (stream-map function streem . streems)
     334  (%check-streams 'stream-for-each streems 'stream)
     335  (stream-for-eacher streems) )
     336
     337(define (stream-map function . streems)
    340338
    341339  ; not tail-recursive to avoid `stream-reverse'
     
    346344
    347345  (%check-procedure 'stream-map function 'function)
    348   (let ((streems (%cons streem streems)))
    349     (%check-streams 'stream-map streems 'stream)
    350     (stream-map$ streems) ) )
     346  (%check-streams 'stream-map streems 'stream)
     347  (stream-map$ streems) )
    351348
    352349(define (stream-from first . step)
     
    425422  (result-stream->output-streams (unfold-result-stream seed)) )
    426423
    427 (define (stream-zip streem . streems)
     424(define (stream-zip . streems)
    428425
    429426  (define-stream (stream-zip$ strms)
     
    432429                     (stream-zip$ (%list-map/1 stream-cdr strms))) ) )
    433430
    434   (let ((streems (%cons streem streems)))
    435     (%check-streams 'stream-zip streems 'stream)
    436     (stream-zip$ streems) ) )
     431  (%check-streams 'stream-zip streems 'stream)
     432  (stream-zip$ streems) )
    437433
    438434) ;module streams-derived
  • release/4/srfi-41/trunk/streams-inlines.scm

    r14571 r14609  
    88
    99(define-inline (%check-stream loc obj #!optional argnam)
    10   (unless (%stream? obj)
    11     (error-stream loc obj argnam) ) )
     10  (unless (%stream? obj) (error-stream loc obj argnam)) )
    1211
    1312(define-inline (%check-streams loc strms #!optional argnam)
    14   (when (%any/1 not-stream? strms)
    15     (error-stream loc strms argnam) ) )
     13  (when (%null? strms) (error loc "no stream arguments" argnam))
     14  (when (%any/1 not-stream? strms) (error-stream loc strms argnam)) )
  • release/4/srfi-41/trunk/streams-utils.scm

    r14566 r14609  
    152152  (stream-of (%car x)
    153153             (x in (stream-zip (stream-from 0) strm))
    154              (eql? obj (%cadr x))) )
     154             (eql? obj (cadr x))) )
    155155
    156156(define (stream-find eql? obj strm)
  • release/4/srfi-41/trunk/tests/run.scm

    r14566 r14609  
    184184  ; stream-for-each
    185185  (tester (stream-for-each "four" strm123) "stream-for-each: bad `procedure' argument type - not a procedure")
    186   #;(tester (stream-for-each display) "stream-for-each: no stream arguments")
     186  (tester (stream-for-each display) "stream-for-each: no stream arguments")
    187187  (tester (stream-for-each display "four") "stream-for-each: bad `stream' argument type - not a stream")
    188188  (tester (let ((sum 0)) (stream-for-each (lambda (x) (set! sum (+ sum x))) strm123) sum) 6)
     
    216216  ; stream-map
    217217  (tester (stream-map "four" strm123) "stream-map: bad `function' argument type - not a procedure")
    218   #;(tester (stream-map odd?) "stream-map: no stream arguments")
     218  (tester (stream-map odd?) "stream-map: no stream arguments")
    219219  (tester (stream-map odd? "four") "stream-map: bad `stream' argument type - not a stream")
    220220  (tester (stream->list (stream-map - strm123)) '(-1 -2 -3))
     
    322322
    323323  ; stream-zip
    324   #;(tester (stream-zip) "stream-zip: no stream arguments")
     324  (tester (stream-zip) "stream-zip: no stream arguments")
    325325  (tester (stream-zip "four") "stream-zip: bad `stream' argument type - not a stream")
    326326  (tester (stream-zip strm123 "four") "stream-zip: bad `stream' argument type - not a stream")
Note: See TracChangeset for help on using the changeset viewer.