Changeset 14610 in project


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

Renamed obj to item to escape define-inline "coloring" issue.

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

Legend:

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

    r14609 r14610  
    6262;;;
    6363
    64 (define (not-stream? obj) (%not-stream? obj))
    65 
    66 ;;;
    67 
    6864(define-syntax define-stream
    6965  (syntax-rules ()
  • release/4/srfi-41/trunk/streams-inlines.scm

    r14609 r14610  
    55
    66(define-inline (%stream? obj) (%structure-instance? obj 'stream))
    7 (define-inline (%not-stream? obj) (not (%stream? obj)))
    87
    98(define-inline (%check-stream loc obj #!optional argnam)
     
    1110
    1211(define-inline (%check-streams loc strms #!optional argnam)
    13   (when (%null? strms) (error loc "no stream arguments" argnam))
    14   (when (%any/1 not-stream? strms) (error-stream loc strms argnam)) )
     12  (when (%null? strms) (error loc "no stream arguments"))
     13  (when (%any/1 (lambda (x) (not (%stream? x))) strms) (error-stream loc strms argnam)) )
  • release/4/srfi-41/trunk/streams-utils.scm

    r14609 r14610  
    2121  (inline)
    2222  (local)
    23   (no-procedure-checks) ) 
     23  (no-procedure-checks) )
    2424
    2525(include "chicken-primitive-object-inlines")
     
    6363;;;
    6464
    65 (define (not-stream? obj) (%not-stream? obj))
    66 
    67 ;;;
    68 
    6965(define-stream (stream-intersperse yy x)
    7066  (%check-stream 'stream-intersperse yy 'stream)
     
    8682  (%check-procedure 'file->streams reader 'reader)
    8783  (let ((port (open-input-file filename)))
    88     (stream-let loop ((obj (reader port)))
    89       (if (eof-object? obj) (begin (close-input-port port) stream-null)
    90           (stream-cons obj (loop (reader port))) ) ) ) )
     84    (stream-let loop ((item (reader port)))
     85      (if (eof-object? item) (begin (close-input-port port) stream-null)
     86          (stream-cons item (loop (reader port))) ) ) ) )
    9187
    9288(define (stream-split count strm)
     
    108104  (stream-fold func (stream-car strm) (stream-cdr strm)) )
    109105
    110 (define-stream (stream-member eql? obj strm)
     106(define-stream (stream-member eql? item strm)
    111107  (%check-stream 'stream-member strm 'stream)
    112108  (%check-procedure 'stream-member eql? 'equivalence)
    113109  (stream-let loop ((strm strm))
    114110    (cond ((stream-null? strm)          #f)
    115           ((eql? obj (stream-car strm)) strm)
     111          ((eql? item (stream-car strm)) strm)
    116112          (else (loop (stream-cdr strm)) ) ) ) )
    117113
     
    147143   strm) )
    148144
    149 (define-stream (stream-finds eql? obj strm)
     145(define-stream (stream-finds eql? item strm)
    150146  (%check-stream 'stream-finds strm 'stream)
    151147  (%check-procedure 'stream-finds eql? 'equivalence)
    152148  (stream-of (%car x)
    153149             (x in (stream-zip (stream-from 0) strm))
    154              (eql? obj (cadr x))) )
    155 
    156 (define (stream-find eql? obj strm)
     150             (eql? item (%cadr x))) )
     151
     152(define (stream-find eql? item strm)
    157153  (%check-stream 'stream-find strm 'stream)
    158154  (%check-procedure 'stream-find eql? 'equivalence)
    159   (stream-car (stream-append (stream-finds eql? obj strm) (stream #f))) )
     155  (stream-car (stream-append (stream-finds eql? item strm) (stream #f))) )
    160156
    161157(define-stream (stream-remove pred? strm)
Note: See TracChangeset for help on using the changeset viewer.