Changeset 14076 in project for chicken


Ignore:
Timestamp:
04/04/09 18:54:06 (10 years ago)
Author:
Kon Lovett
Message:

Added i/o-port?, proc?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chicken/trunk/chicken-primitive-object-inlines.scm

    r14026 r14076  
    748748(define-inline (%port-data port) (%wordblock-ref? port 9))
    749749
     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))))
     752
    750753(define-inline (%port-filep-set! port fp) (%poke-integer port 0 fp))
    751754(define-inline (%port-input-mode-set! port f) (%wordblock-set!/immediate port 1 f))
     
    833836    (##core#inline "C_vector_to_closure" v)
    834837    v ) )
     838
     839(define-inline (%procedure? x) (%closure? x))
    835840
    836841(define-inline (%vector->closure! v a)
     
    992997(define-inline (%positive? n) (##core#inline "C_i_positivep" n))
    993998(define-inline (%negative? n) (##core#inline "C_i_negativep" n))
     999(define-inline (%cardinal? fx) (%<= 0 fx))
     1000
    9941001(define-inline (%odd? n) (##core#inline "C_i_oddp" n))
    9951002(define-inline (%even? n) (##core#inline "C_i_evenp" n))
    996 (define-inline (%cardinal? n) (and (%integer? n) (%<= 0 n)))
    9971003
    9981004(define-inline (%+ x y) ((##core#primitive "C_plus") x y))
Note: See TracChangeset for help on using the changeset viewer.