Changeset 37915 in project


Ignore:
Timestamp:
09/28/19 05:06:19 (3 weeks ago)
Author:
Kon Lovett
Message:

let the compiler do the work, reflow, add tests

Location:
release/5/coops-utils/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • release/5/coops-utils/trunk/coops-describe.scm

    r36627 r37915  
    1616(import scheme
    1717  (chicken base)
    18   (chicken fixnum)
    1918  (chicken type)
    2019  (only (chicken format) fprintf)
     
    117116      idx (closure-C-address (check-closure 'print-closure proc)))
    118117    (let ((size (##sys#size proc)))
    119       (do ((i (fx+ idx 1) (fx+ i 1)))
    120           ((fx= i size))
     118      (do ((i (add1 idx) (add1 i)))
     119          ((= i size))
    121120        (fprintf out "~A: ~S~%" i (##sys#slot proc i)) ) ) ) )
    122121
  • release/5/coops-utils/trunk/coops-extras.scm

    r37868 r37915  
    2727
    2828(: *class-slots (coops-class -> list))
    29 ;
    30 (define (*class-slots class)
    31   (slot-value class 'slots) )
     29(define (*class-slots class) (slot-value class 'slots))
    3230
    3331;;; Helpers
     
    4846
    4947(: plist-cons (symbol * plist -> plist))
    50 ;
    5148(define (plist-cons key val ls) (cons* key val ls))
    5249
     
    5552;memq is not specific enough
    5653(: initslot? (symbol list -> boolean))
    57 ;
    5854(define (initslot? slot initforms) (plist-key? slot initforms))
    5955
  • release/5/coops-utils/trunk/tests/coops-utils-test.scm

    r37388 r37915  
    44(import test)
    55
    6 (test-begin "Coops Utils")
    7 
    8 ;;;
    9 
    106(import
    117  (chicken syntax)
    128  (srfi 1)
    139  (srfi 13)
    14   coops
    15   coops-utils)
     10  coops)
    1611
    17 ;;
     12;;;
     13
     14(import coops-utils)
     15
     16(test-begin "Coops Utils")
     17
     18;
    1819
    1920(test-assert (class? <standard-class>))
     
    163164|#
    164165
    165 ;;;
     166;
    166167
    167168(test-end "Coops Utils")
    168169
     170;;
     171
     172(import coops-describe)
     173
     174(test-begin "Coops Describe")
     175
     176(describe-object <third>)
     177(newline)
     178(describe-object s1xy-inst)
     179(newline)
     180(describe-object describe-object)
     181(newline)
     182(print-closure describe-object)
     183
     184(test-end "Coops Describe")
     185
     186;;
     187
     188(import coops-introspection)
     189
     190(test-begin "Coops Introspection")
     191
     192(generic-name describe-object)
     193
     194(test-end "Coops Introspection")
     195
     196;;;
     197
    169198(test-exit)
Note: See TracChangeset for help on using the changeset viewer.