Changeset 14193 in project


Ignore:
Timestamp:
04/08/09 18:57:23 (11 years ago)
Author:
Kon Lovett
Message:

Update.

Location:
release/4/srfi-45
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • release/4/srfi-45/tags/2.0.0/chicken-primitive-object-inlines.scm

    r14080 r14193  
    690690      (loop (%cdr ls)) ) ) )
    691691
     692(define-inline (%list/1 obj) (%cons obj '()))
     693
     694(define-inline (%list . objs)
     695  (let loop ((objs objs))
     696    (if (%null? objs) '()
     697        (%cons (%car objs) (loop (%cdr objs)) ) ) ) )
     698
    692699(define-inline (%make-list n e)
    693700  (let loop ((n n) (ls '()))
     
    704711    (if (%fxzero? n) ls
    705712        (loop (%cdr ls) (%fxsub1 n)) ) ) )
     713
     714(define-inline (%any/1 pred? ls)
     715  (let loop ((ls ls))
     716    (and (not (%null? ls))
     717         (or (pred? (%car ls))
     718             (loop (%cdr ls)) ) ) ) )
     719
     720(define-inline (%list-length ls0)
     721  (let loop ((ls ls0) (n 0))
     722    (if (%null? ls) n
     723        (loop (%cdr ls) (%fxadd1 n)) ) ) )
    706724
    707725;; Structure (wordblock)
     
    738756
    739757(define-inline (%port-filep port) (%peek-unsigned-integer port 0))
    740 (define-inline (%port-input-mode? port) (%wordblock-ref? port 1))
    741 (define-inline (%port-class port) (%wordblock-ref? port 2))
    742 (define-inline (%port-name port) (%wordblock-ref? port 3))
    743 (define-inline (%port-row port) (%wordblock-ref? port 4))
    744 (define-inline (%port-column port) (%wordblock-ref? port 5))
    745 (define-inline (%port-eof? port) (%wordblock-ref? port 6))
    746 (define-inline (%port-type port) (%wordblock-ref? port 7))
    747 (define-inline (%port-closed? port) (%wordblock-ref? port 8))
    748 (define-inline (%port-data port) (%wordblock-ref? port 9))
    749 
    750 (define-inline (%input-port? x) (and (%port x) (%port-input-mode? x)))
    751 (define-inline (%output-port? x) (and (%port x) (not (%port-input-mode? x))))
     758(define-inline (%port-input-mode? port) (%wordblock-ref port 1))
     759(define-inline (%port-class port) (%wordblock-ref port 2))
     760(define-inline (%port-name port) (%wordblock-ref port 3))
     761(define-inline (%port-row port) (%wordblock-ref port 4))
     762(define-inline (%port-column port) (%wordblock-ref port 5))
     763(define-inline (%port-eof? port) (%wordblock-ref port 6))
     764(define-inline (%port-type port) (%wordblock-ref port 7))
     765(define-inline (%port-closed? port) (%wordblock-ref port 8))
     766(define-inline (%port-data port) (%wordblock-ref port 9))
     767
     768(define-inline (%input-port? x) (and (%port? x) (%port-input-mode? x)))
     769(define-inline (%output-port? x) (and (%port? x) (not (%port-input-mode? x))))
    752770
    753771(define-inline (%port-filep-set! port fp) (%poke-integer port 0 fp))
  • release/4/srfi-45/tags/2.0.1/chicken-primitive-object-inlines.scm

    r14080 r14193  
    690690      (loop (%cdr ls)) ) ) )
    691691
     692(define-inline (%list/1 obj) (%cons obj '()))
     693
     694(define-inline (%list . objs)
     695  (let loop ((objs objs))
     696    (if (%null? objs) '()
     697        (%cons (%car objs) (loop (%cdr objs)) ) ) ) )
     698
    692699(define-inline (%make-list n e)
    693700  (let loop ((n n) (ls '()))
     
    704711    (if (%fxzero? n) ls
    705712        (loop (%cdr ls) (%fxsub1 n)) ) ) )
     713
     714(define-inline (%any/1 pred? ls)
     715  (let loop ((ls ls))
     716    (and (not (%null? ls))
     717         (or (pred? (%car ls))
     718             (loop (%cdr ls)) ) ) ) )
     719
     720(define-inline (%list-length ls0)
     721  (let loop ((ls ls0) (n 0))
     722    (if (%null? ls) n
     723        (loop (%cdr ls) (%fxadd1 n)) ) ) )
    706724
    707725;; Structure (wordblock)
     
    738756
    739757(define-inline (%port-filep port) (%peek-unsigned-integer port 0))
    740 (define-inline (%port-input-mode? port) (%wordblock-ref? port 1))
    741 (define-inline (%port-class port) (%wordblock-ref? port 2))
    742 (define-inline (%port-name port) (%wordblock-ref? port 3))
    743 (define-inline (%port-row port) (%wordblock-ref? port 4))
    744 (define-inline (%port-column port) (%wordblock-ref? port 5))
    745 (define-inline (%port-eof? port) (%wordblock-ref? port 6))
    746 (define-inline (%port-type port) (%wordblock-ref? port 7))
    747 (define-inline (%port-closed? port) (%wordblock-ref? port 8))
    748 (define-inline (%port-data port) (%wordblock-ref? port 9))
    749 
    750 (define-inline (%input-port? x) (and (%port x) (%port-input-mode? x)))
    751 (define-inline (%output-port? x) (and (%port x) (not (%port-input-mode? x))))
     758(define-inline (%port-input-mode? port) (%wordblock-ref port 1))
     759(define-inline (%port-class port) (%wordblock-ref port 2))
     760(define-inline (%port-name port) (%wordblock-ref port 3))
     761(define-inline (%port-row port) (%wordblock-ref port 4))
     762(define-inline (%port-column port) (%wordblock-ref port 5))
     763(define-inline (%port-eof? port) (%wordblock-ref port 6))
     764(define-inline (%port-type port) (%wordblock-ref port 7))
     765(define-inline (%port-closed? port) (%wordblock-ref port 8))
     766(define-inline (%port-data port) (%wordblock-ref port 9))
     767
     768(define-inline (%input-port? x) (and (%port? x) (%port-input-mode? x)))
     769(define-inline (%output-port? x) (and (%port? x) (not (%port-input-mode? x))))
    752770
    753771(define-inline (%port-filep-set! port fp) (%poke-integer port 0 fp))
  • release/4/srfi-45/tags/2.1.0/chicken-primitive-object-inlines.scm

    r14080 r14193  
    690690      (loop (%cdr ls)) ) ) )
    691691
     692(define-inline (%list/1 obj) (%cons obj '()))
     693
     694(define-inline (%list . objs)
     695  (let loop ((objs objs))
     696    (if (%null? objs) '()
     697        (%cons (%car objs) (loop (%cdr objs)) ) ) ) )
     698
    692699(define-inline (%make-list n e)
    693700  (let loop ((n n) (ls '()))
     
    704711    (if (%fxzero? n) ls
    705712        (loop (%cdr ls) (%fxsub1 n)) ) ) )
     713
     714(define-inline (%any/1 pred? ls)
     715  (let loop ((ls ls))
     716    (and (not (%null? ls))
     717         (or (pred? (%car ls))
     718             (loop (%cdr ls)) ) ) ) )
     719
     720(define-inline (%list-length ls0)
     721  (let loop ((ls ls0) (n 0))
     722    (if (%null? ls) n
     723        (loop (%cdr ls) (%fxadd1 n)) ) ) )
    706724
    707725;; Structure (wordblock)
     
    738756
    739757(define-inline (%port-filep port) (%peek-unsigned-integer port 0))
    740 (define-inline (%port-input-mode? port) (%wordblock-ref? port 1))
    741 (define-inline (%port-class port) (%wordblock-ref? port 2))
    742 (define-inline (%port-name port) (%wordblock-ref? port 3))
    743 (define-inline (%port-row port) (%wordblock-ref? port 4))
    744 (define-inline (%port-column port) (%wordblock-ref? port 5))
    745 (define-inline (%port-eof? port) (%wordblock-ref? port 6))
    746 (define-inline (%port-type port) (%wordblock-ref? port 7))
    747 (define-inline (%port-closed? port) (%wordblock-ref? port 8))
    748 (define-inline (%port-data port) (%wordblock-ref? port 9))
    749 
    750 (define-inline (%input-port? x) (and (%port x) (%port-input-mode? x)))
    751 (define-inline (%output-port? x) (and (%port x) (not (%port-input-mode? x))))
     758(define-inline (%port-input-mode? port) (%wordblock-ref port 1))
     759(define-inline (%port-class port) (%wordblock-ref port 2))
     760(define-inline (%port-name port) (%wordblock-ref port 3))
     761(define-inline (%port-row port) (%wordblock-ref port 4))
     762(define-inline (%port-column port) (%wordblock-ref port 5))
     763(define-inline (%port-eof? port) (%wordblock-ref port 6))
     764(define-inline (%port-type port) (%wordblock-ref port 7))
     765(define-inline (%port-closed? port) (%wordblock-ref port 8))
     766(define-inline (%port-data port) (%wordblock-ref port 9))
     767
     768(define-inline (%input-port? x) (and (%port? x) (%port-input-mode? x)))
     769(define-inline (%output-port? x) (and (%port? x) (not (%port-input-mode? x))))
    752770
    753771(define-inline (%port-filep-set! port fp) (%poke-integer port 0 fp))
  • release/4/srfi-45/trunk/chicken-primitive-object-inlines.scm

    r14080 r14193  
    690690      (loop (%cdr ls)) ) ) )
    691691
     692(define-inline (%list/1 obj) (%cons obj '()))
     693
     694(define-inline (%list . objs)
     695  (let loop ((objs objs))
     696    (if (%null? objs) '()
     697        (%cons (%car objs) (loop (%cdr objs)) ) ) ) )
     698
    692699(define-inline (%make-list n e)
    693700  (let loop ((n n) (ls '()))
     
    704711    (if (%fxzero? n) ls
    705712        (loop (%cdr ls) (%fxsub1 n)) ) ) )
     713
     714(define-inline (%any/1 pred? ls)
     715  (let loop ((ls ls))
     716    (and (not (%null? ls))
     717         (or (pred? (%car ls))
     718             (loop (%cdr ls)) ) ) ) )
     719
     720(define-inline (%list-length ls0)
     721  (let loop ((ls ls0) (n 0))
     722    (if (%null? ls) n
     723        (loop (%cdr ls) (%fxadd1 n)) ) ) )
    706724
    707725;; Structure (wordblock)
     
    738756
    739757(define-inline (%port-filep port) (%peek-unsigned-integer port 0))
    740 (define-inline (%port-input-mode? port) (%wordblock-ref? port 1))
    741 (define-inline (%port-class port) (%wordblock-ref? port 2))
    742 (define-inline (%port-name port) (%wordblock-ref? port 3))
    743 (define-inline (%port-row port) (%wordblock-ref? port 4))
    744 (define-inline (%port-column port) (%wordblock-ref? port 5))
    745 (define-inline (%port-eof? port) (%wordblock-ref? port 6))
    746 (define-inline (%port-type port) (%wordblock-ref? port 7))
    747 (define-inline (%port-closed? port) (%wordblock-ref? port 8))
    748 (define-inline (%port-data port) (%wordblock-ref? port 9))
    749 
    750 (define-inline (%input-port? x) (and (%port x) (%port-input-mode? x)))
    751 (define-inline (%output-port? x) (and (%port x) (not (%port-input-mode? x))))
     758(define-inline (%port-input-mode? port) (%wordblock-ref port 1))
     759(define-inline (%port-class port) (%wordblock-ref port 2))
     760(define-inline (%port-name port) (%wordblock-ref port 3))
     761(define-inline (%port-row port) (%wordblock-ref port 4))
     762(define-inline (%port-column port) (%wordblock-ref port 5))
     763(define-inline (%port-eof? port) (%wordblock-ref port 6))
     764(define-inline (%port-type port) (%wordblock-ref port 7))
     765(define-inline (%port-closed? port) (%wordblock-ref port 8))
     766(define-inline (%port-data port) (%wordblock-ref port 9))
     767
     768(define-inline (%input-port? x) (and (%port? x) (%port-input-mode? x)))
     769(define-inline (%output-port? x) (and (%port? x) (not (%port-input-mode? x))))
    752770
    753771(define-inline (%port-filep-set! port fp) (%poke-integer port 0 fp))
Note: See TracChangeset for help on using the changeset viewer.