Changeset 13689 in project


Ignore:
Timestamp:
03/12/09 06:36:07 (11 years ago)
Author:
Kon Lovett
Message:

Use of core immutable.

Location:
release/4/box
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release/4/box/tags/2.0.0/box.scm

    r13655 r13689  
    3939(define-inline (%box-structure-immutable? obj) (%structure-instance? obj 'box))
    4040
    41 (define-inline (%box-structure? obj
    42   (or (%box-structure-mutable? obj) (%box-structure-immutable? obj)))
     41(define-inline (%box-structure? obj)
     42  (and (%fx= 2 (%structure-length obj)
     43       (or (%box-structure-mutable? obj) (%box-structure-immutable? obj)))))
    4344
    4445(define-inline (%box-structure-tag obj) (and (%box-structure? obj) (%structure-tag obj)))
     
    4647(define-inline (%box-structure-ref box) (%structure-ref box 1))
    4748
    48 (define-inline (%box-structure-set! box obj) (%structure-set!/maybe-immediate box 1 obj))
    49 
     49(define-inline (%box-structure-set! box obj) (%structure-set! box 1 obj))
    5050
    5151;;; Box Procedure Support
     
    108108(define-inline (%box? obj) (or (%box-structure? obj) (%box-procedure? obj)))
    109109
    110 
    111110;;; Errors
    112111
    113112(define-inline (%box-immutable-error loc box . args)
    114   (apply ##sys#signal-hook #:type-error loc "bad argument type - not a mutable box" box args))
     113  (apply ##sys#signal-hook #:type-error loc (##core#immutable '"bad argument type - not a mutable box") box args))
    115114
    116115(define-inline (%box-type-error loc obj . args)
    117   (apply ##sys#signal-hook #:type-error loc "bad argument type - not a box" obj args))
     116  (apply ##sys#signal-hook #:type-error loc (##core#immutable '"bad argument type - not a box") obj args))
    118117
    119118
     
    122121(define-inline (%box-print box)
    123122  (let ((val (cond ((%box-structure? box)  (%box-structure-ref box))
    124                    ((%box-procedure? box)  (%box-procedure-ref box)))))
     123                   ((%box-procedure? box)  (%box-procedure-ref box))
     124                   (else
     125                    (%box-type-error 'box-print box)))))
    125126          (display "#&") (write val)))
    126127
  • release/4/box/trunk/box.scm

    r13663 r13689  
    111111
    112112(define-inline (%box-immutable-error loc box . args)
    113   (apply ##sys#signal-hook #:type-error loc "bad argument type - not a mutable box" box args))
     113  (apply ##sys#signal-hook #:type-error loc (##core#immutable '"bad argument type - not a mutable box") box args))
    114114
    115115(define-inline (%box-type-error loc obj . args)
    116   (apply ##sys#signal-hook #:type-error loc "bad argument type - not a box" obj args))
     116  (apply ##sys#signal-hook #:type-error loc (##core#immutable '"bad argument type - not a box") obj args))
    117117
    118118
Note: See TracChangeset for help on using the changeset viewer.