Changeset 4340 in project for chicken/extras.scm


Ignore:
Timestamp:
05/28/07 16:01:34 (13 years ago)
Author:
felix winkelmann
Message:

fp updates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chicken/extras.scm

    r4232 r4340  
    281281  ;; this should really shadow SORT! and RANDOM...
    282282  (lambda (l)
    283     (map cdr
    284          (sort! (map (lambda (x) (cons (random 10000) x)) l)
    285                 (lambda (x y) (< (car x) (car y)))) ) ) )
     283    (let ((len (length l)))
     284      (map cdr
     285           (sort! (map (lambda (x) (cons (random len) x)) l)
     286                  (lambda (x y) (< (car x) (car y)))) ) ) ) )
    286287
    287288
     
    493494      (##sys#check-string s 'write-string)
    494495      (let-optionals more ([n #f] [port ##sys#standard-output])
    495         (##sys#check-port port 'read-string)
     496        (##sys#check-port port 'write-string)
    496497        (when n (##sys#check-exact n 'write-string))
    497498        (display
     
    725726              ((##core#inline "C_undefinedp" obj) (out "#<unspecified>" col))
    726727              ((##core#inline "C_anypointerp" obj) (out (##sys#pointer->string obj) col))
     728              ((eq? obj (##sys#slot '##sys#arbitrary-unbound-symbol 0))
     729               (out "#<unbound value>" col) )
    727730              ((##sys#generic-structure? obj)
    728731               (let ([o (open-output-string)])
     
    730733                 (out (get-output-string o) col) ) )
    731734              ((port? obj) (out (string-append "#<port " (##sys#slot obj 3) ">") col))
     735              ((##core#inline "C_bytevectorp" obj)
     736               (if (##core#inline "C_permanentp" obj)
     737                   (out "#<static blob of size" col)
     738                   (out "#<blob of size " col) )
     739               (out (number->string (##core#inline "C_block_size" obj)) col)
     740               (out ">" col) )
    732741              ((##core#inline "C_lambdainfop" obj)
    733742               (out "#<lambda info " col)
    734743               (out (##sys#lambda-info->string obj) col)
    735744               (out "#>" col) )
    736               ((eq? obj (##sys#slot '##sys#arbitrary-unbound-symbol 0))
    737                (out "#<unbound value>" col) )
    738745              (else               (out "#<unprintable object>" col)) ) )
    739746
Note: See TracChangeset for help on using the changeset viewer.