Changeset 36642 in project


Ignore:
Timestamp:
09/19/18 23:51:33 (4 weeks ago)
Author:
kon
Message:

save include form as branch, use inline form

Location:
release/5/fx-utils
Files:
8 added
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • release/5/fx-utils/trunk/fx-inlines.scm

    r36574 r36642  
    11;;;; fx-inlines.scm  -*- Scheme -*-
    22;;;; Kon Lovett, Jul '18
    3 ;;;; Kon Lovett, May '17
     3
     4(module fx-inlines
     5
     6(;export
     7  fxzero?
     8  fxpositive?
     9  fxnatural?
     10  fxnegative?
     11  fxnon-positive?
     12  fxclosed-right? fxclosed? fxclosed-left?
     13  fxclosedr? fxclosedl?
     14  fxabs
     15  fxadd1 fxsub1
     16  fxsqr fxcub)
    417
    518(import scheme
     19  (chicken base)
    620  (chicken fixnum)
    721  (chicken type))
     
    1327(: fxzero? (fixnum --> boolean))
    1428;
    15 (define-inline (fxzero? n) (fx= 0 n))
     29(define (fxzero? n) (fx= 0 n))
    1630
    1731(: fxpositive? (fixnum --> boolean))
    1832;
    19 (define-inline (fxpositive? n) (fx< 0 n))
     33(define (fxpositive? n) (fx< 0 n))
    2034
    2135(: fxnatural? (fixnum --> boolean))
    2236;
    23 (define-inline (fxnatural? n) (fx<= 0 n))
     37(define (fxnatural? n) (fx<= 0 n))
    2438
    2539(: fxnegative? (fixnum --> boolean))
    2640;
    27 (define-inline (fxnegative? n) (fx> 0 n))
     41(define (fxnegative? n) (fx> 0 n))
    2842
    2943(: fxnon-positive? (fixnum --> boolean))
    3044;
    31 (define-inline (fxnon-positive? n) (fx>= 0 n))
     45(define (fxnon-positive? n) (fx>= 0 n))
    3246
    3347;;
     
    3549(: fxclosed-right? (fixnum fixnum fixnum --> boolean))
    3650;
    37 (define-inline (fxclosed-right? l x h) (and (fx< l x) (fx<= x h)))
     51(define (fxclosed-right? l x h) (and (fx< l x) (fx<= x h)))
    3852
    3953(: fxclosed? (fixnum fixnum fixnum --> boolean))
    4054;
    41 (define-inline (fxclosed? l x h) (and (fx<= l x) (fx<= x h)))
     55(define (fxclosed? l x h) (and (fx<= l x) (fx<= x h)))
    4256
    4357(: fxclosed-left? (fixnum fixnum fixnum --> boolean))
    4458;
    45 (define-inline (fxclosed-left? l x h) (and (fx<= l x) (fx< x h)))
     59(define (fxclosed-left? l x h) (and (fx<= l x) (fx< x h)))
    4660
    4761;
    48 (define-inline (fxclosedr? l x h) (fxclosed-right? l x h))
    49 (define-inline (fxclosedl? l x h) (fxclosed-left? l x h))
    50 
    51 ;;;
     62(define (fxclosedr? l x h) (fxclosed-right? l x h))
     63(define (fxclosedl? l x h) (fxclosed-left? l x h))
    5264
    5365;;
     
    5567(: fxabs (fixnum --> fixnum))
    5668;
    57 (define-inline (fxabs n) (if (fxnegative? n) (fxneg n) n))
     69(define (fxabs n) (if (fxnegative? n) (fxneg n) n))
    5870
    5971;;
     
    6173(: fxadd1 (fixnum --> fixnum))
    6274;
    63 (define-inline (fxadd1 n) (fx+ n 1))
     75(define (fxadd1 n) (fx+ n 1))
    6476
    6577(: fxsub1 (fixnum --> fixnum))
    6678;
    67 (define-inline (fxsub1 n) (fx- n 1))
     79(define (fxsub1 n) (fx- n 1))
    6880
    6981(: fxsqr (fixnum --> fixnum))
    7082;
    71 (define-inline (fxsqr n) (fx* n n))
     83(define (fxsqr n) (fx* n n))
    7284
    7385(: fxcub (fixnum --> fixnum))
    7486;
    75 (define-inline (fxcub n) (fx* n (fx* n n)))
     87(define (fxcub n) (fx* n (fx* n n)))
     88
     89) ;fx-inlines
     90
  • release/5/fx-utils/trunk/fx-utils.egg

    r36574 r36642  
    99 (test-dependencies test)
    1010 (components
    11   (scheme-include fx-inlines
    12     (files "fx-inlines.scm"))
     11  (extension fx-inlines
     12    (inline-file)
     13    (types-file)
     14    (csc-options "-O3" "-d1" "-local" "-no-procedure-checks") )
    1315  (extension fx-utils
    1416    #;(inline-file)
    1517    (types-file)
    16     ;FIXME Error: (apply) bad argument type: #f
    17     #;(component-dependencies fx-inlines)
     18    (component-dependencies fx-inlines)
    1819    (csc-options "-O3" "-d1" "-local" "-no-procedure-checks") ) ) )
  • release/5/fx-utils/trunk/fx-utils.scm

    r36572 r36642  
    6565  (chicken fixnum)
    6666  (chicken foreign)
    67   (chicken type))
    68 
    69 ;;;
    70 
    71 (include "fx-inlines")  ;(chicken base) 7 not scheme?
     67  (chicken type)
     68  fx-inlines)
    7269
    7370;;;
Note: See TracChangeset for help on using the changeset viewer.