diff --git a/collects/lang/private/imageeq.ss b/collects/lang/private/imageeq.ss index 3bb66416ff..45f4aad475 100644 --- a/collects/lang/private/imageeq.ss +++ b/collects/lang/private/imageeq.ss @@ -12,132 +12,8 @@ (or (is-a? a image-snip%) (is-a? a cache-image-snip%))) - (define size-dc (delay (make-object bitmap-dc% (make-object bitmap% 1 1)))) - - (define (snip-size a) - (cond - [(is-a? a cache-image-snip%) - (send a get-size)] - [else - (let* ([dc (force size-dc)] - [wb (box 0)] - [hb (box 0)]) - (send a get-extent dc 0 0 wb hb #f #f #f #f) - (values (unbox wb) - (unbox hb)))])) - (define (image=? a-raw b-raw) (unless (image? a-raw) (raise-type-error 'image=? "image" 0 a-raw b-raw)) (unless (image? b-raw) (raise-type-error 'image=? "image" 1 a-raw b-raw)) - (let ([a (coerce-to-cache-image-snip a-raw)] - [b (coerce-to-cache-image-snip b-raw)]) - (let-values ([(aw ah) (snip-size a)] - [(bw bh) (snip-size b)] - [(apx apy) (send a get-pinhole)] - [(bpx bpy) (send b get-pinhole)]) - (and (= aw bw) - (= ah bh) - (= apx bpx) - (= apy bpy) - (same/alpha? (argb-vector (send a get-argb)) - (argb-vector (send b get-argb))))))) - - (define (same/alpha? v1 v2) - (let loop ([i (vector-length v1)]) - (or (zero? i) - (let ([a1 (vector-ref v1 (- i 4))] - [a2 (vector-ref v2 (- i 4))]) - (and (or (= a1 a2 255) - (and (= a1 a2) - (= (vector-ref v1 (- i 3)) (vector-ref v2 (- i 3))) - (= (vector-ref v1 (- i 2)) (vector-ref v2 (- i 2))) - (= (vector-ref v1 (- i 1)) (vector-ref v2 (- i 1))))) - (loop (- i 4))))))) - - - (define image-snip-cache (make-hash-table 'weak)) - ;; coerce-to-cache-image-snip : image -> (is-a?/c cache-image-snip%) - (define (coerce-to-cache-image-snip snp) - (cond - [(hash-table-get image-snip-cache snp (λ () #f)) => values] - [(is-a? snp image-snip%) - (let* ([bmp (send snp get-bitmap)] - [cis - (if bmp - (let ([bmp-mask (or (send bmp get-loaded-mask) - (send snp get-bitmap-mask) - (bitmap->mask bmp))]) - (bitmaps->cache-image-snip (copy-bitmap bmp) - (copy-bitmap bmp-mask) - (floor (/ (send bmp get-width) 2)) - (floor (/ (send bmp get-height) 2)))) - (let-values ([(w h) (snip-size snp)]) - (let* ([bmp (make-object bitmap% - (inexact->exact (floor w)) - (inexact->exact (floor h)))] - [bdc (make-object bitmap-dc% bmp)]) - (send snp draw bdc 0 0 0 0 w h 0 0 'no-caret) - (send bdc set-bitmap #f) - (bitmaps->cache-image-snip bmp - (bitmap->mask bmp) - (floor (/ w 2)) - (floor (/ h 2))))))]) - (hash-table-put! image-snip-cache snp cis) - cis)] - [else snp])) - - ;; copy-bitmap : bitmap -> bitmap - ;; does not copy the mask. - (define (copy-bitmap bitmap) - (let* ([w (send bitmap get-width)] - [h (send bitmap get-height)] - [copy (make-object bitmap% w h)] - [a-dc (make-object bitmap-dc% copy)]) - (send a-dc clear) - (send a-dc draw-bitmap bitmap 0 0) - (send a-dc set-bitmap #f) - copy)) - - ;; bitmap->mask : bitmap -> bitmap - (define (bitmap->mask bitmap) - (let* ([w (send bitmap get-width)] - [h (send bitmap get-height)] - [s (make-bytes (* 4 w h))] - [new-bitmap (make-object bitmap% w h)] - [dc (make-object bitmap-dc% new-bitmap)]) - (send dc clear) - (send dc draw-bitmap bitmap 0 0) - (send dc get-argb-pixels 0 0 w h s) - (let loop ([i (* 4 w h)]) - (unless (zero? i) - (let ([r (- i 3)] - [g (- i 2)] - [b (- i 1)]) - (unless (and (eq? 255 (bytes-ref s r)) - (eq? 255 (bytes-ref s g)) - (eq? 255 (bytes-ref s b))) - (bytes-set! s r 0) - (bytes-set! s g 0) - (bytes-set! s b 0)) - (loop (- i 4))))) - (send dc set-argb-pixels 0 0 w h s) - (begin0 - (send dc get-bitmap) - (send dc set-bitmap #f)))) - - (define (bitmaps->cache-image-snip color mask px py) - (let ([w (send color get-width)] - [h (send color get-height)]) - (new cache-image-snip% - [width w] - [height h] - [dc-proc - (lambda (dc dx dy) - (send dc draw-bitmap color dx dy 'solid - (send the-color-database find-color "black") - mask))] - [argb-proc - (lambda (argb-vector dx dy) - (overlay-bitmap argb-vector dx dy color mask))] - [px px] - [py py])))) + ;; Rely on image-snip% implementing equal<%>: + (equal? a-raw b-raw))) diff --git a/collects/lang/private/teachprims.ss b/collects/lang/private/teachprims.ss index 83f7d48c25..97a25505ca 100644 --- a/collects/lang/private/teachprims.ss +++ b/collects/lang/private/teachprims.ss @@ -10,8 +10,7 @@ namespace. |# (module teachprims mzscheme - (require "../imageeq.ss" - mzlib/list + (require mzlib/list mzlib/etc) (define-syntax (define-teach stx) @@ -202,68 +201,25 @@ namespace. (hash-table-put! ht a prev) (loop v)))) prev)))))] - [union-equal? (lambda (a b) - (let ([a (union-find a)] - [b (union-find b)]) - (if (eq? a b) - #t - (begin - (hash-table-put! ht b a) - #f))))]) + [union-equal!? (lambda (a b) + (let ([a (union-find a)] + [b (union-find b)]) + (if (eq? a b) + #t + (begin + (hash-table-put! ht b a) + #f))))]) (let ? ([a a][b b]) - (or (eqv? a b) - (cond - [(box? a) - (and (box? b) - (? (unbox a) (unbox b)))] - [(pair? a) - (and (pair? b) - (or (union-equal? a b) - (and (? (car a) (car b)) - (? (cdr a) (cdr b)))))] - [(vector? a) - (and (vector? b) - (= (vector-length a) (vector-length b)) - (or (union-equal? a b) - (andmap ? - (vector->list a) - (vector->list b))))] - [(image? a) - (and (image? b) - (image=? a b))] - [(real? a) - (and epsilon - (real? b) - (beginner-=~ a b epsilon))] - [(struct? a) - (and (struct? b) - (let-values ([(ta sa?) (struct-info a)] - [(tb sb?) (struct-info b)]) - (and (not sa?) - (not sb?) - (eq? ta tb) - (or (union-equal? a b) - (? (struct->vector a) - (struct->vector b))))))] - [(hash-table? a) - (and (hash-table? b) - (eq? (immutable? a) (immutable? b)) - (eq? (hash-table? a 'weak) (hash-table? b 'weak)) - (eq? (hash-table? a 'equal) (hash-table? b 'equal)) - (let ([al (hash-table-map a cons)] - [bl (hash-table-map b cons)]) - (and (= (length al) (length bl)) - (or (union-equal? a b) - (andmap - (lambda (ai) - (? (hash-table-get b (car ai) (lambda () (not (cdr ai)))) - (cdr ai))) - al)))))] - [else (equal? a b)]))))) + (cond + [(real? a) + (and (real? b) + (beginner-=~ a b epsilon))] + [(union-equal!? a b) #t] + [else (equal?/recur a b ?)])))) (define-teach beginner equal? (lambda (a b) - (tequal? a b #f))) + (equal? a b))) (define-teach beginner =~ (lambda (a b c) diff --git a/collects/mred/private/kernel.ss b/collects/mred/private/kernel.ss index 04518e9d96..e21bfd92ae 100644 --- a/collects/mred/private/kernel.ss +++ b/collects/mred/private/kernel.ss @@ -47,7 +47,7 @@ (let ([defined null]) (lambda (stx) (syntax-case stx () - [(_ name print-name super args id ...) + [(_ name print-name super (intf ...) args id ...) (let ([nm (syntax-e (syntax name))] [sn (syntax-e (syntax super))] [ids (map syntax-e (syntax->list (syntax (id ...))))]) @@ -78,11 +78,11 @@ (syntax (define name (let ([c (dynamic-require ''#%mred-kernel 'name)]) (make-primitive-class - (lambda (class prop:object preparer dispatcher) + (lambda (class prop:object preparer dispatcher more-props) (kernel:primitive-class-prepare-struct-type! - c prop:object class preparer dispatcher)) + c prop:object class preparer dispatcher more-props)) kernel:initialize-primitive-object - 'print-name super 'args + 'print-name super (list intf ...) 'args '(old ...) '(new ...) (list @@ -110,8 +110,8 @@ (define-a-class name intf super args id ...) (define intf (class->interface name)) (provide (protect intf))))]))) - (define-class object% #f #f) - (define-class window% object% #f + (define-class object% #f () #f) + (define-class window% object% () #f on-drop-file pre-on-event pre-on-char @@ -147,11 +147,11 @@ set-focus gets-focus? centre) - (define-class item% window% #f + (define-class item% window% () #f set-label get-label command) - (define-class message% item% #f + (define-class message% item% () #f get-font set-label on-drop-file @@ -160,7 +160,7 @@ on-size on-set-focus on-kill-focus) - (define-private-class editor% editor<%> object% #f + (define-private-class editor% editor<%> object% () #f dc-location-to-editor-location editor-location-to-dc-location set-inactive-caret-threshold @@ -300,7 +300,7 @@ (define-function write-editor-version) (define-function set-editor-print-margin) (define-function get-editor-print-margin) - (define-class bitmap% object% #f + (define-class bitmap% object% () #f get-argb-pixels get-gl-config set-gl-config @@ -313,7 +313,7 @@ get-width get-height get-depth) - (define-class button% item% #f + (define-class button% item% () #f set-border set-label on-drop-file @@ -322,7 +322,7 @@ on-size on-set-focus on-kill-focus) - (define-class choice% item% #f + (define-class choice% item% () #f set-selection get-selection number @@ -335,7 +335,7 @@ on-set-focus on-kill-focus) (define-function set-combo-box-font) - (define-class check-box% item% #f + (define-class check-box% item% () #f set-label set-value get-value @@ -345,7 +345,7 @@ on-size on-set-focus on-kill-focus) - (define-class canvas% window% #f + (define-class canvas% window% () #f on-drop-file pre-on-event pre-on-char @@ -373,7 +373,7 @@ on-char on-event on-paint) - (define-private-class dc% dc<%> object% #f + (define-private-class dc% dc<%> object% () #f get-alpha set-alpha glyph-exists? @@ -427,7 +427,7 @@ clear) (define-function draw-tab) (define-function draw-tab-base) - (define-class bitmap-dc% dc% () + (define-class bitmap-dc% dc% () () get-bitmap set-bitmap draw-bitmap-section-smooth @@ -435,13 +435,13 @@ get-argb-pixels set-pixel get-pixel) - (define-class post-script-dc% dc% ([interactive #t] [parent #f] [use-paper-bbox #f] [eps #t])) - (define-class printer-dc% dc% ([parent #f])) - (define-private-class gl-context% gl-context<%> object% #f + (define-class post-script-dc% dc% () ([interactive #t] [parent #f] [use-paper-bbox #f] [eps #t])) + (define-class printer-dc% dc% () ([parent #f])) + (define-private-class gl-context% gl-context<%> object% () #f call-as-current swap-buffers ok?) - (define-class gl-config% object% #f + (define-class gl-config% object% () #f get-double-buffered set-double-buffered get-stereo @@ -454,23 +454,23 @@ set-depth-size get-multisample-size set-multisample-size) - (define-class event% object% ([time-stamp 0]) + (define-class event% object% () ([time-stamp 0]) get-time-stamp set-time-stamp) - (define-class control-event% event% (event-type [time-stamp 0]) + (define-class control-event% event% () (event-type [time-stamp 0]) get-event-type set-event-type) - (define-class popup-event% control-event% #f + (define-class popup-event% control-event% () #f get-menu-id set-menu-id) - (define-class scroll-event% event% ([event-type thumb] [direction vertical] [position 0] [time-stamp 0]) + (define-class scroll-event% event% () ([event-type thumb] [direction vertical] [position 0] [time-stamp 0]) get-event-type set-event-type get-direction set-direction get-position set-position) - (define-class key-event% event% ([key-code #\nul] [shift-down #f] [control-down #f] [meta-down #f] [alt-down #f] [x 0] [y 0] [time-stamp 0] [caps-down #f]) + (define-class key-event% event% () ([key-code #\nul] [shift-down #f] [control-down #f] [meta-down #f] [alt-down #f] [x 0] [y 0] [time-stamp 0] [caps-down #f]) set-other-caps-key-code get-other-caps-key-code set-other-shift-altgr-key-code @@ -498,7 +498,7 @@ get-y set-y) (define-function key-symbol-to-integer) - (define-class mouse-event% event% (event-type [left-down #f] [middle-down #f] [right-down #f] [x 0] [y 0] [shift-down #f] [control-down #f] [meta-down #f] [alt-down #f] [time-stamp 0] [caps-down #f]) + (define-class mouse-event% event% () (event-type [left-down #f] [middle-down #f] [right-down #f] [x 0] [y 0] [shift-down #f] [control-down #f] [meta-down #f] [alt-down #f] [time-stamp 0] [caps-down #f]) moving? leaving? entering? @@ -528,7 +528,7 @@ set-x get-y set-y) - (define-class frame% window% #f + (define-class frame% window% () #f on-drop-file pre-on-event pre-on-char @@ -556,7 +556,7 @@ set-icon iconize set-title) - (define-class gauge% item% #f + (define-class gauge% item% () #f get-value set-value get-range @@ -567,7 +567,7 @@ on-size on-set-focus on-kill-focus) - (define-class font% object% #f + (define-class font% object% () #f screen-glyph-exists? get-font-id get-size-in-pixels @@ -578,32 +578,32 @@ get-style get-face get-family) - (define-class font-list% object% #f + (define-class font-list% object% () #f find-or-create-font) - (define-class color% object% #f + (define-class color% object% () #f blue green red set ok? copy-from) - (define-private-class color-database% color-database<%> object% #f + (define-private-class color-database% color-database<%> object% () #f find-color) - (define-class point% object% #f + (define-class point% object% () #f get-x set-x get-y set-y) - (define-class brush% object% #f + (define-class brush% object% () #f set-style get-style set-stipple get-stipple set-color get-color) - (define-class brush-list% object% #f + (define-class brush-list% object% () #f find-or-create-brush) - (define-class pen% object% #f + (define-class pen% object% () #f set-style get-style set-stipple @@ -616,11 +616,11 @@ get-cap set-width get-width) - (define-class pen-list% object% #f + (define-class pen-list% object% () #f find-or-create-pen) - (define-class cursor% object% #f + (define-class cursor% object% () #f ok?) - (define-class region% object% (dc) + (define-class region% object% () (dc) in-region? is-empty? get-bounding-box @@ -635,7 +635,7 @@ set-rounded-rectangle set-rectangle get-dc) - (define-class dc-path% object% #f + (define-class dc-path% object% () #f get-bounding-box append reverse @@ -653,7 +653,7 @@ open? close reset) - (define-private-class font-name-directory% font-name-directory<%> object% #f + (define-private-class font-name-directory% font-name-directory<%> object% () #f find-family-default-font-id find-or-create-font-id get-family @@ -686,7 +686,7 @@ (define-function get-display-depth) (define-function is-color-display?) (define-function file-selector) - (define-class list-box% item% #f + (define-class list-box% item% () #f get-label-font set-string set-first-visible-item @@ -710,7 +710,7 @@ on-size on-set-focus on-kill-focus) - (define-class editor-canvas% canvas% #f + (define-class editor-canvas% canvas% () #f on-char on-event on-paint @@ -741,7 +741,7 @@ set-editor get-wheel-step set-wheel-step) - (define-class editor-admin% object% #f + (define-class editor-admin% object% () #f modified refresh-delayed? popup-menu @@ -753,9 +753,9 @@ get-max-view get-view get-dc) - (define-private-class editor-snip-editor-admin% editor-snip-editor-admin<%> editor-admin% #f + (define-private-class editor-snip-editor-admin% editor-snip-editor-admin<%> editor-admin% () #f get-snip) - (define-class snip-admin% object% #f + (define-class snip-admin% object% () #f modified popup-menu update-cursor @@ -769,7 +769,7 @@ get-view-size get-dc get-editor) - (define-class snip-class% object% #f + (define-class snip-class% object% () #f reading-version write-header read-header @@ -778,13 +778,13 @@ set-classname get-version set-version) - (define-private-class snip-class-list% snip-class-list<%> object% #f + (define-private-class snip-class-list% snip-class-list<%> object% () #f nth number add find-position find) - (define-class keymap% object% #f + (define-class keymap% object% () #f remove-chained-keymap chain-to-keymap set-break-sequence-callback @@ -800,11 +800,11 @@ handle-key-event set-double-click-interval get-double-click-interval) - (define-class editor-wordbreak-map% object% #f + (define-class editor-wordbreak-map% object% () #f get-map set-map) (define-function get-the-editor-wordbreak-map) - (define-class text% editor% #f + (define-class text% editor% () #f call-clickback remove-clickback set-clickback @@ -958,7 +958,7 @@ on-event copy-self-to copy-self) - (define-class menu% object% #f + (define-class menu% object% () #f select get-font set-width @@ -973,30 +973,30 @@ delete-by-position delete append) - (define-class menu-bar% object% #f + (define-class menu-bar% object% () #f set-label-top number enable-top delete append) - (define-class menu-item% object% #f + (define-class menu-item% object% () #f id) (define-function id-to-menu-item) - (define-class editor-stream-in-base% object% #f + (define-class editor-stream-in-base% object% () #f read bad? skip seek tell) - (define-class editor-stream-out-base% object% #f + (define-class editor-stream-out-base% object% () #f write bad? seek tell) - (define-class editor-stream-in-bytes-base% editor-stream-in-base% #f) - (define-class editor-stream-out-bytes-base% editor-stream-out-base% #f + (define-class editor-stream-in-bytes-base% editor-stream-in-base% () #f) + (define-class editor-stream-out-bytes-base% editor-stream-out-base% () #f get-bytes) - (define-class editor-stream-in% object% #f + (define-class editor-stream-in% object% () #f ok? jump-to tell @@ -1009,19 +1009,19 @@ get-unterminated-bytes get-bytes get) - (define-class editor-stream-out% object% #f + (define-class editor-stream-out% object% () #f ok? pretty-finish jump-to tell put-fixed put) - (define-class timer% object% () + (define-class timer% object% () () stop start notify interval) - (define-private-class clipboard% clipboard<%> object% #f + (define-private-class clipboard% clipboard<%> object% () #f get-clipboard-bitmap set-clipboard-bitmap get-clipboard-data @@ -1030,12 +1030,12 @@ set-clipboard-client) (define-function get-the-x-selection) (define-function get-the-clipboard) - (define-class clipboard-client% object% () + (define-class clipboard-client% object% () () get-types add-type get-data on-replaced) - (define-class ps-setup% object% () + (define-class ps-setup% object% () () copy-from set-margin set-editor-margin @@ -1061,7 +1061,7 @@ get-command) (define-function show-print-setup) (define-function can-show-print-setup?) - (define-class pasteboard% editor% #f + (define-class pasteboard% editor% () #f set-scroll-step get-scroll-step set-selection-visible @@ -1177,7 +1177,7 @@ paste copy cut) - (define-class panel% window% #f + (define-class panel% window% () #f get-label-position set-label-position on-char @@ -1191,7 +1191,7 @@ on-kill-focus set-item-cursor get-item-cursor) - (define-class dialog% window% #f + (define-class dialog% window% () #f system-menu set-title on-drop-file @@ -1203,7 +1203,7 @@ enforce-size on-close on-activate) - (define-class radio-box% item% #f + (define-class radio-box% item% () #f button-focus enable set-selection @@ -1215,7 +1215,7 @@ on-size on-set-focus on-kill-focus) - (define-class slider% item% #f + (define-class slider% item% () #f set-value get-value on-drop-file @@ -1224,7 +1224,7 @@ on-size on-set-focus on-kill-focus) - (define-class snip% object% #f + (define-class snip% object% () #f previous next set-unmodified @@ -1262,7 +1262,7 @@ get-style get-snipclass set-snipclass) - (define-class string-snip% snip% #f + (define-class string-snip% snip% () #f read insert set-unmodified @@ -1289,7 +1289,7 @@ draw partial-offset get-extent) - (define-class tab-snip% string-snip% #f + (define-class tab-snip% string-snip% () #f set-unmodified get-scroll-step-offset find-scroll-step @@ -1314,7 +1314,11 @@ draw partial-offset get-extent) - (define-class image-snip% snip% #f + (define-class image-snip% snip% (equal<%>) #f + equal-secondary-hash-code-of + equal-hash-code-of + other-equal-to? + equal-to? set-offset get-bitmap-mask get-bitmap @@ -1346,7 +1350,7 @@ draw partial-offset get-extent) - (define-class editor-snip% snip% #f + (define-class editor-snip% snip% () #f get-inset set-inset get-margin @@ -1393,23 +1397,23 @@ get-extent set-editor get-editor) - (define-class editor-data-class% object% #f + (define-class editor-data-class% object% () #f read get-classname set-classname) - (define-private-class editor-data-class-list% editor-data-class-list<%> object% #f + (define-private-class editor-data-class-list% editor-data-class-list<%> object% () #f nth number add find-position find) - (define-class editor-data% object% #f + (define-class editor-data% object% () #f set-next write get-dataclass set-dataclass get-next) - (define-private-class mult-color% mult-color<%> object% #f + (define-private-class mult-color% mult-color<%> object% () #f set get get-r @@ -1418,7 +1422,7 @@ set-g get-b set-b) - (define-private-class add-color% add-color<%> object% #f + (define-private-class add-color% add-color<%> object% () #f set get get-r @@ -1427,7 +1431,7 @@ set-g get-b set-b) - (define-class style-delta% object% #f + (define-class style-delta% object% () #f copy collapse equal? @@ -1475,7 +1479,7 @@ set-alignment-on get-alignment-off set-alignment-off) - (define-private-class style% style<%> object% #f + (define-private-class style% style<%> object% () #f switch-to set-shift-style get-shift-style @@ -1502,7 +1506,7 @@ get-face get-family get-name) - (define-class style-list% object% #f + (define-class style-list% object% () #f forget-notification notify-on-change style-to-index @@ -1516,7 +1520,7 @@ number basic-style) (define-function get-the-style-list) - (define-class tab-group% item% #f + (define-class tab-group% item% () #f button-focus set set-label @@ -1532,7 +1536,7 @@ on-size on-set-focus on-kill-focus) - (define-class group-box% item% #f + (define-class group-box% item% () #f on-drop-file pre-on-event pre-on-char diff --git a/collects/mrlib/cache-image-snip.ss b/collects/mrlib/cache-image-snip.ss index 124561cf3b..2f2c083317 100644 --- a/collects/mrlib/cache-image-snip.ss +++ b/collects/mrlib/cache-image-snip.ss @@ -7,7 +7,11 @@ (provide cache-image-snip% cache-image-snip-class% - snip-class) + snip-class + + coerce-to-cache-image-snip + snip-size + bitmaps->cache-image-snip) ;; type argb = (make-argb (vectorof rational[between 0 & 255]) int int) (define-struct argb (vector width height)) @@ -38,9 +42,9 @@ an alpha of 1 means the pixel value is 0 an alpha of 0 means the pixel value is 255 |# - + (define cache-image-snip% - (class snip% + (class image-snip% ;; dc-proc : (union #f ((is-a?/c dc<%>) int[dx] int[dy] -> void)) ;; used for direct drawing @@ -85,7 +89,7 @@ ;; get-bitmap : -> bitmap or false ;; returns a bitmap showing what the image would look like, ;; if it were drawn - (define/public (get-bitmap) + (define/override (get-bitmap) (cond [(or (zero? width) (zero? height)) #f] @@ -141,6 +145,15 @@ (define/override (get-num-scroll-steps) (inexact->exact (+ (floor (/ height 20)) 1))) (define/override (find-scroll-step y) (inexact->exact (floor (/ y 20)))) (define/override (get-scroll-step-offset offset) (* offset 20)) + + (define/override (equal-to? snip recur) + (if (snip . is-a? . cache-image-snip%) + ;; Support extensions of cache-image-snip%: + (send snip other-equal-to? this recur) + ;; Use ths object's extension: + (other-equal-to? snip recur))) + (define/override (other-equal-to? snip recur) + (image=? this snip)) (super-new) (inherit set-snipclass) @@ -215,6 +228,138 @@ (lambda (argb dx dy) (overlay-bitmap argb size size dx dy bm bm))))) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; + ;; image equality + ;; + + (define size-dc (delay (make-object bitmap-dc% (make-object bitmap% 1 1)))) + + (define (snip-size a) + (cond + [(is-a? a cache-image-snip%) + (send a get-size)] + [else + (let* ([dc (force size-dc)] + [wb (box 0)] + [hb (box 0)]) + (send a get-extent dc 0 0 wb hb #f #f #f #f) + (values (unbox wb) + (unbox hb)))])) + + (define (image=? a-raw b-raw) + (let ([a (coerce-to-cache-image-snip a-raw)] + [b (coerce-to-cache-image-snip b-raw)]) + (let-values ([(aw ah) (snip-size a)] + [(bw bh) (snip-size b)] + [(apx apy) (send a get-pinhole)] + [(bpx bpy) (send b get-pinhole)]) + (and (= aw bw) + (= ah bh) + (= apx bpx) + (= apy bpy) + (same/alpha? (argb-vector (send a get-argb)) + (argb-vector (send b get-argb))))))) + + (define (same/alpha? v1 v2) + (let loop ([i (vector-length v1)]) + (or (zero? i) + (let ([a1 (vector-ref v1 (- i 4))] + [a2 (vector-ref v2 (- i 4))]) + (and (or (= a1 a2 255) + (and (= a1 a2) + (= (vector-ref v1 (- i 3)) (vector-ref v2 (- i 3))) + (= (vector-ref v1 (- i 2)) (vector-ref v2 (- i 2))) + (= (vector-ref v1 (- i 1)) (vector-ref v2 (- i 1))))) + (loop (- i 4))))))) + + (define image-snip-cache (make-hash-table 'weak)) + ;; coerce-to-cache-image-snip : image -> (is-a?/c cache-image-snip%) + (define (coerce-to-cache-image-snip snp) + (cond + [(hash-table-get image-snip-cache snp (λ () #f)) => values] + [(is-a? snp image-snip%) + (let* ([bmp (send snp get-bitmap)] + [cis + (if bmp + (let ([bmp-mask (or (send bmp get-loaded-mask) + (send snp get-bitmap-mask) + (bitmap->mask bmp))]) + (bitmaps->cache-image-snip (copy-bitmap bmp) + (copy-bitmap bmp-mask) + (floor (/ (send bmp get-width) 2)) + (floor (/ (send bmp get-height) 2)))) + (let-values ([(w h) (snip-size snp)]) + (let* ([bmp (make-object bitmap% + (inexact->exact (floor w)) + (inexact->exact (floor h)))] + [bdc (make-object bitmap-dc% bmp)]) + (send snp draw bdc 0 0 0 0 w h 0 0 'no-caret) + (send bdc set-bitmap #f) + (bitmaps->cache-image-snip bmp + (bitmap->mask bmp) + (floor (/ w 2)) + (floor (/ h 2))))))]) + (hash-table-put! image-snip-cache snp cis) + cis)] + [else snp])) + + ;; copy-bitmap : bitmap -> bitmap + ;; does not copy the mask. + (define (copy-bitmap bitmap) + (let* ([w (send bitmap get-width)] + [h (send bitmap get-height)] + [copy (make-object bitmap% w h)] + [a-dc (make-object bitmap-dc% copy)]) + (send a-dc clear) + (send a-dc draw-bitmap bitmap 0 0) + (send a-dc set-bitmap #f) + copy)) + + ;; bitmap->mask : bitmap -> bitmap + (define (bitmap->mask bitmap) + (let* ([w (send bitmap get-width)] + [h (send bitmap get-height)] + [s (make-bytes (* 4 w h))] + [new-bitmap (make-object bitmap% w h)] + [dc (make-object bitmap-dc% new-bitmap)]) + (send dc clear) + (send dc draw-bitmap bitmap 0 0) + (send dc get-argb-pixels 0 0 w h s) + (let loop ([i (* 4 w h)]) + (unless (zero? i) + (let ([r (- i 3)] + [g (- i 2)] + [b (- i 1)]) + (unless (and (eq? 255 (bytes-ref s r)) + (eq? 255 (bytes-ref s g)) + (eq? 255 (bytes-ref s b))) + (bytes-set! s r 0) + (bytes-set! s g 0) + (bytes-set! s b 0)) + (loop (- i 4))))) + (send dc set-argb-pixels 0 0 w h s) + (begin0 + (send dc get-bitmap) + (send dc set-bitmap #f)))) + + (define (bitmaps->cache-image-snip color mask px py) + (let ([w (send color get-width)] + [h (send color get-height)]) + (new cache-image-snip% + [width w] + [height h] + [dc-proc + (lambda (dc dx dy) + (send dc draw-bitmap color dx dy 'solid + (send the-color-database find-color "black") + mask))] + [argb-proc + (lambda (argb-vector dx dy) + (overlay-bitmap argb-vector dx dy color mask))] + [px px] + [py py]))) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; misc. utilities diff --git a/collects/mrlib/scribblings/cache-image-snip.scrbl b/collects/mrlib/scribblings/cache-image-snip.scrbl index 6013f3c297..245806c631 100644 --- a/collects/mrlib/scribblings/cache-image-snip.scrbl +++ b/collects/mrlib/scribblings/cache-image-snip.scrbl @@ -16,7 +16,22 @@ bitmap, but with alpha values. It has a maker, two selectors, and a predicate. -@defclass[cache-image-snip% snip% ()]{ +@defclass[cache-image-snip% image-snip% ()]{ + +The @scheme[cache-image-snip%] class is a subclass of +@scheme[image-snip%] simply so that its instances can be compared with +@scheme[image-snip%] using @scheme[equal?]. All @scheme[image-snip%] +functionality is overridden or ignored. + +@defmethod[#:mode overrride + (equal-to? [snip (is-a?/c image-snip%)] + [equal? (any/c any/c . -> . boolean?)]) + boolean?]{ + +Calls the @method[cache-image-snip% other-equal-to?] method of +@scheme[snip] if it is also a @scheme[cache-image-snip%] instance, +otherwise calls the @method[cache-image-snip% other-equal-to?] of +@this-obj[].} @defmethod[(get-argb) @@ -44,7 +59,8 @@ predicate. } -@defmethod[(get-bitmap) (or/c false/c (is-a?/c bitmap%))]{ +@defmethod[#:mode override + (get-bitmap) (or/c false/c (is-a?/c bitmap%))]{ Builds (if not yet built) a bitmap corresponding to this snip and returns it. @@ -75,7 +91,15 @@ predicate. Returns the width and height for the image. -}} +} + +@defmethod[#:mode override + (other-equal-to? [snip (is-a?/c image-snip%)] + [equal? (any/c any/c . -> . boolean?)]) + boolean?]{ + +Refines the comparison of @xmethod[image-snip% other-equal-to?] to +exactly match alpha channels.}} @; ---------------------------------------- @@ -83,6 +107,7 @@ predicate. This snipclass is used for saved cache image snips.} + @defproc[(make-argb [vectorof (integer-in 0 255)] [width exact-nonnegative-integer?] [height exact-nonnegative-integer?]) diff --git a/collects/scheme/private/class-internal.ss b/collects/scheme/private/class-internal.ss index 81300e1df6..3b92501f73 100644 --- a/collects/scheme/private/class-internal.ss +++ b/collects/scheme/private/class-internal.ss @@ -2050,7 +2050,7 @@ ;; --- Make the new object struct --- (let*-values ([(prim-object-make prim-object? struct:prim-object) (if make-struct:prim - (make-struct:prim c prop:object preparer dispatcher) + (make-struct:prim c prop:object preparer dispatcher (get-properties interfaces)) (values #f #f #f))] [(struct:object object-make object? object-field-ref object-field-set!) (if make-struct:prim @@ -2322,7 +2322,7 @@ (for-class name)))) syms))) - (define (add-properties struct-type intfs) + (define (get-properties intfs) (if (ormap (lambda (i) (pair? (interface-properties i))) intfs) @@ -2334,18 +2334,21 @@ (hash-set! ht (vector-ref p 0) p)) (interface-properties i))) intfs) + (hash-map ht (lambda (k v) (cons (vector-ref v 1) + (vector-ref v 2))))) + ;; No properties to add: + null)) + + (define (add-properties struct-type intfs) + (let ([props (get-properties intfs)]) + (if (null? props) + struct-type ;; Create a new structure type to house the properties, so ;; that they can't see any fields directly via guards: (let-values ([(struct: make- ? -ref -set!) - (make-struct-type 'props struct-type 0 0 #f - (hash-map ht (lambda (k v) - (cons (vector-ref v 1) - (vector-ref v 2)))) - #f)]) - struct:)) - ;; No properties to add: - struct-type)) - + (make-struct-type 'props struct-type 0 0 #f props #f)]) + struct:)))) + (define-values (prop:object object? object-ref) (make-struct-type-property 'object)) ;;-------------------------------------------------------------------- @@ -3428,6 +3431,7 @@ prim-init ; primitive initializer: takes obj and list of name-arg pairs name ; symbol super ; superclass + intfs ; interfaces init-arg-names ; #f or list of syms and sym--value lists override-names ; overridden method names new-names ; new (public) method names @@ -3435,7 +3439,7 @@ new-methods) ; list of methods ; The `make-struct:prim' function takes prop:object, a - ; class, a preparer, and a dispatcher function, and produces: + ; class, a preparer, a dispatcher function, and a property assoc list, and produces: ; * a struct constructor (must have prop:object) ; * a struct predicate ; * a struct type for derived classes (mustn't have prop:object) @@ -3450,7 +3454,7 @@ (compose-class name (or super object%) - null + intfs #f #f #f diff --git a/collects/scribblings/gui/image-snip-class.scrbl b/collects/scribblings/gui/image-snip-class.scrbl index ec80f69cca..d8cc0cf367 100644 --- a/collects/scribblings/gui/image-snip-class.scrbl +++ b/collects/scribblings/gui/image-snip-class.scrbl @@ -1,7 +1,7 @@ #lang scribble/doc @(require "common.ss") -@defclass/title[image-snip% snip% ()]{ +@defclass/title[image-snip% snip% (equal<%>)]{ An @scheme[image-snip%] is a snip that can display bitmap images (usually loaded from a file). When the image file cannot be found, a @@ -24,6 +24,38 @@ Creates an image snip, loading the image @scheme[filename] if } + +@defmethod[(equal-hash-code [hash-code (any/c . -> . exact-integer?)]) + exact-integer?]{ + +Returns an integer that can be used as a @scheme[equal?]-based hash +code for @this-obj[] (using the same notion of @scheme[equal?] as +@method[image-snip% other-equal-to?]). + +See also @scheme[equal<%>].} + +@defmethod[(equal-secondary-hash-code [hash-code (any/c . -> . exact-integer?)]) + exact-integer?]{ + +Returns an integer that can be used as a @scheme[equal?]-based +secondary hash code for @this-obj[] (using the same notion of +@scheme[equal?] as @method[image-snip% other-equal-to?]). + +See also @scheme[equal<%>].} + + +@defmethod[(equal-to? [snip (is-a?/c image-snip%)] + [equal? (any/c any/c . -> . boolean?)]) + boolean?]{ + +Calls the @method[image-snip% other-equal-to?] method of @scheme[snip] +(to simulate multi-method dispatch) in case @scheme[snip] provides a +more specific equivalence comparison. + +See also @scheme[equal<%>].} + + + @defmethod[(get-bitmap) (or/c (is-a?/c bitmap%) false/c)]{ @@ -105,6 +137,20 @@ If @scheme[inline?] is not @scheme[#f], the image data will be saved } +@defmethod[(other-equal-to? [snip (is-a?/c image-snip%)] + [equal? (any/c any/c . -> . boolean?)]) + boolean?]{ + +Returns @scheme[#t] if @this-obj[] and @scheme[snip] both have bitmaps +and the bitmaps are the same dimensions. If either has a mask bitmap +with the same dimensions as the main bitmap, then the masks must be +the same (or if only one mask is present, it must correspond to a +solid mask). + +The given @scheme[equal?] function (for recursive comparisons) is not +used.} + + @defmethod[#:mode override (resize [w (and/c real? (not/c negative?))] [h (and/c real? (not/c negative?))]) diff --git a/collects/scribblings/reference/booleans.scrbl b/collects/scribblings/reference/booleans.scrbl index 0e758c7638..60d36ac334 100644 --- a/collects/scribblings/reference/booleans.scrbl +++ b/collects/scribblings/reference/booleans.scrbl @@ -14,13 +14,24 @@ See also: @scheme[and], @scheme[or], @scheme[andmap], @scheme[ormap]. @defproc[(boolean? [v any/c]) boolean?]{ Returns @scheme[#t] if @scheme[v] is @scheme[#t] or @scheme[#f], -@scheme[#f] otherwise.} +@scheme[#f] otherwise. + +@examples[ +(boolean? #f) +(boolean? #t) +(boolean? 'true) +]} @defproc[(not [v any/c]) boolean?]{ Returns @scheme[#t] if @scheme[v] is @scheme[#f], @scheme[#f] otherwise. -} + +@examples[ +(not #f) +(not #t) +(not 'we-have-no-bananas) +]} @defproc[(equal? [v1 any/c] [v2 any/c]) boolean?]{ @@ -33,7 +44,15 @@ strings, byte strings, numbers, pairs, mutable pairs, vectors, hash tables, and inspectable structures. In the last five cases, equality is recursively defined; if both @scheme[v1] and @scheme[v2] contain reference cycles, they are equal when the infinite unfoldings of the -values would be equal. See also @scheme[prop:equal+hash].} +values would be equal. See also @scheme[prop:equal+hash]. + +@examples[ +(equal? 'yes 'yes) +(equal? 'yes 'no) +(equal? (expt 2 100) (expt 2 100)) +(equal? 2 2.0) +(equal? (make-string 3 #\z) (make-string 3 #\z)) +]} @defproc[(eqv? [v1 any/c] [v2 any/c]) boolean?]{ @@ -41,14 +60,47 @@ values would be equal. See also @scheme[prop:equal+hash].} Two values are @scheme[eqv?] if and only if they are @scheme[eq?], unless otherwise specified for a particular datatype. -The number and character datatypes are the only ones for which -@scheme[eqv?] differs from @scheme[eq?].} +The @tech{number} and @tech{character} datatypes are the only ones for which +@scheme[eqv?] differs from @scheme[eq?]. + +@examples[ +(eqv? 'yes 'yes) +(eqv? 'yes 'no) +(eqv? (expt 2 100) (expt 2 100)) +(eqv? 2 2.0) +(eqv? (integer->char #x3BB) (integer->char #x3BB)) +(eqv? (make-string 3 #\z) (make-string 3 #\z)) +]} @defproc[(eq? [v1 any/c] [v2 any/c]) boolean?]{ Return @scheme[#t] if @scheme[v1] and @scheme[v2] refer to the same -object, @scheme[#f] otherwise. See also @secref["model-eq"].} +object, @scheme[#f] otherwise. See also @secref["model-eq"]. + +@examples[ +(eq? 'yes 'yes) +(eq? 'yes 'no) +(let ([v (mcons 1 2)]) (eq? v v)) +(eq? (mcons 1 2) (mcons 1 2)) +(eq? (make-string 3 #\z) (make-string 3 #\z)) +]} + + +@defproc[(equal?/recur [v1 any/c] [v2 any/c] [recur-proc (any/c any/c -> any/c)]) boolean?]{ + +Like @scheme[equal?], but using @scheme[recur-proc] for recursive +comparisons (which means that reference cycles are not handled +automatically). Non-@scheme[#f] results from @scheme[recur-proc] are +converted to @scheme[#t] before being returned by +@scheme[equal?/recur]. + +@examples[ +(equal?/recur 1 1 (lambda (a b) #f)) +(equal?/recur '(1) '(1) (lambda (a b) #f)) +(equal?/recur '#(1 1 1) '#(1 1.2 3/4) + (lambda (a b) (<= (abs (- a b)) 0.25))) +]} @defproc[(immutable? [v any/c]) boolean?]{ @@ -74,7 +126,9 @@ type. The property value must be a list of three procedures: The third argument is an @scheme[equal?] predicate to use for recursive equality checks; use the given predicate instead of @scheme[equal?] to ensure that data cycles are handled - properly. + properly and to work with @scheme[equal?/recur] (but beware + that an arbitrary function can be provided to + @scheme[equal?/recur]). The @scheme[_equal-proc] is called for a pair of structures only when they are not @scheme[eq?], and only when they both diff --git a/collects/scribblings/reference/class.scrbl b/collects/scribblings/reference/class.scrbl index 7ec58e5756..08d555c8ee 100644 --- a/collects/scribblings/reference/class.scrbl +++ b/collects/scribblings/reference/class.scrbl @@ -1486,7 +1486,7 @@ To customize the way that a class instance is compared to other instances by @scheme[equal?], implement the @scheme[equal<%>] interface. -@defthing[equal<%> interface?]{ +@definterface[equal<%> ()]{} The @scheme[equal<%>] interface includes three methods, which are analogous to the functions provided for a structure type with @@ -1523,7 +1523,7 @@ classes whose most specific ancestor to explicitly implement See @scheme[prop:equal+hash] for more information on equality comparisons and hash codes. The @scheme[equal<%>] interface is -implemented with @scheme[interface*] and @scheme[prop:equal+hash].} +implemented with @scheme[interface*] and @scheme[prop:equal+hash]. @; ------------------------------------------------------------------------ @@ -1602,11 +1602,11 @@ Like @scheme[define-serializable-class*], but with not interface expressions (analogous to @scheme[class]).} -@defthing[externalizable<%> interface?]{ +@definterface[externalizable<%> ()]{} The @scheme[externalizable<%>] interface includes only the @scheme[externalize] and @scheme[internalize] methods. See -@scheme[define-serializable-class*] for more information.} +@scheme[define-serializable-class*] for more information. @; ------------------------------------------------------------------------ diff --git a/collects/scribblings/reference/exns.scrbl b/collects/scribblings/reference/exns.scrbl index 8fa05d1d29..37a1879cac 100644 --- a/collects/scribblings/reference/exns.scrbl +++ b/collects/scribblings/reference/exns.scrbl @@ -138,7 +138,8 @@ message.} @defproc[(raise-syntax-error [name (or/c symbol? #f)] [message string?] [expr any/c #f] - [sub-expr any/c #f]) + [sub-expr any/c #f] + [extra-sources (listof syntax?) null]) any]{ Creates an @scheme[exn:fail:syntax] value and @scheme[raise]s it as an @@ -151,12 +152,19 @@ is provided; it is described in more detail below. The The optional @scheme[expr] argument is the erroneous source syntax object or S-expression. The optional @scheme[sub-expr] argument is a syntax object or S-expression within @scheme[expr] that more precisely -locates the error. If @scheme[sub-expr] is provided, it is used (in -syntax form) for the @scheme[exprs] field of the generated exception -record, else the @scheme[expr] is used if provided, otherwise the -@scheme[exprs] field is the empty list. Source location information in -the error-message text is similarly extracted from @scheme[sub-expr] -or @scheme[expr], when at least one is a syntax object. +locates the error. Both may appear in the generated error-message +text if @scheme[error-print-source-location] is @scheme[#t]. Source +location information in the error-message text is similarly extracted +from @scheme[sub-expr] or @scheme[expr] when at least one is a syntax +object and @scheme[error-print-source-location] is @scheme[#t]. + +If @scheme[sub-expr] is provided, it is used (in syntax form) for the +@scheme[exprs] field of the generated exception record, else the +@scheme[expr] is used if provided. In either case, the syntax object +is @scheme[cons]ed onto @scheme[extra-sources] to produce the +@scheme[exprs] field, or @scheme[extra-sources] is used directly for +@scheme[exprs] if neither @scheme[expr] nor @scheme[sub-expr] is +provided. The form name used in the generated error message is determined through a combination of the @scheme[name], @scheme[expr], and @@ -177,9 +185,7 @@ through a combination of the @scheme[name], @scheme[expr], and @item{@scheme[symbol]: When @scheme[name] is a symbol, then the symbol is used as the form name in the generated error message.} -} - -See also @scheme[error-print-source-location].} +}} @;------------------------------------------------------------------------ @section{Handling Exceptions} diff --git a/collects/scribblings/reference/syntax.scrbl b/collects/scribblings/reference/syntax.scrbl index 365eb9ce7e..75baa630ce 100644 --- a/collects/scribblings/reference/syntax.scrbl +++ b/collects/scribblings/reference/syntax.scrbl @@ -1335,6 +1335,7 @@ position with respect to the @scheme[if] form. @mz-examples[ (if (positive? -5) (error "doesn't get here") 2) (if (positive? 5) 1 (error "doesn't get here")) +(if 'we-have-no-bananas "yes" "no") ]} @defform/subs[#:literals (else =>) diff --git a/collects/tests/drscheme/language-test.ss b/collects/tests/drscheme/language-test.ss index b5c28efa6e..13fe3d5e31 100644 --- a/collects/tests/drscheme/language-test.ss +++ b/collects/tests/drscheme/language-test.ss @@ -59,7 +59,7 @@ the settings above should match r5rs (test-expression "'|.|" "|.|") (test-expression '("(equal? (list " image ") (list " image "))") - "#f") + "#t") (test-expression "(define x 1)(define x 2)" "") (test-expression "(define-struct spider (legs))(make-spider 4)" "#") @@ -159,7 +159,7 @@ the settings above should match r5rs (test-expression "'|.|" "|.|") (test-expression '("(equal? (list " image ") (list " image "))") - "#f") + "#t") (test-expression "(define x 1)(define x 2)" "") (test-expression diff --git a/doc/release-notes/mzscheme/HISTORY.txt b/doc/release-notes/mzscheme/HISTORY.txt index ea4c3098fd..5373b6fd59 100644 --- a/doc/release-notes/mzscheme/HISTORY.txt +++ b/doc/release-notes/mzscheme/HISTORY.txt @@ -1,3 +1,7 @@ +Version 4.1.3.7 +Added `equal?/recur' +Added extra argument to `raise-syntax-error' + Version 4.1.3.6 Memory accounting changed to bias charges to parent instead of children diff --git a/src/mred/wxs/khead.ss b/src/mred/wxs/khead.ss index 6c0171f61b..6b8747b8e5 100644 --- a/src/mred/wxs/khead.ss +++ b/src/mred/wxs/khead.ss @@ -47,7 +47,7 @@ (let ([defined null]) (lambda (stx) (syntax-case stx () - [(_ name print-name super args id ...) + [(_ name print-name super (intf ...) args id ...) (let ([nm (syntax-e (syntax name))] [sn (syntax-e (syntax super))] [ids (map syntax-e (syntax->list (syntax (id ...))))]) @@ -78,11 +78,11 @@ (syntax (define name (let ([c (dynamic-require ''#%mred-kernel 'name)]) (make-primitive-class - (lambda (class prop:object preparer dispatcher) + (lambda (class prop:object preparer dispatcher more-props) (kernel:primitive-class-prepare-struct-type! - c prop:object class preparer dispatcher)) + c prop:object class preparer dispatcher more-props)) kernel:initialize-primitive-object - 'print-name super 'args + 'print-name super (list intf ...) 'args '(old ...) '(new ...) (list diff --git a/src/mred/wxs/wxs_snip.cxx b/src/mred/wxs/wxs_snip.cxx index 96a7b568fd..e4e21ff7f3 100644 --- a/src/mred/wxs/wxs_snip.cxx +++ b/src/mred/wxs/wxs_snip.cxx @@ -6583,6 +6583,92 @@ static Scheme_Object *bundle_symset_bitmapType(int v) { +extern void wxGetARGBPixels(wxBitmap *bm, double x, double y, int w, int h, char *s, Bool get_alpha); +static bool EqualTo(wxImageSnip* bm, wxImageSnip* bm2, void *recur); + +#ifdef MZ_PRECISE_GC +END_XFORM_SKIP; +#endif +static bool OtherEqualTo(wxImageSnip* snip, wxImageSnip* snip2, void *recur) +{ + int w, h; + char *s1, *s2; + wxBitmap *bm, *bm2, *mask; + + bm = snip->GetSnipBitmap(); + bm2 = snip2->GetSnipBitmap(); + + if (!bm || !bm->Ok()) return FALSE; + if (!bm2 || !bm2->Ok()) return FALSE; + if (bm->GetDepth() != bm2->GetDepth()) return FALSE; + w = bm->GetWidth(); + h = bm->GetHeight(); + if (w != bm2->GetWidth()) return FALSE; + if (h != bm2->GetHeight()) return FALSE; + + s1 = (char *)scheme_malloc_atomic(w * h * 4); + s2 = (char *)scheme_malloc_atomic(w * h * 4); + + memset(s1, 255, w * h * 4); + memset(s2, 255, w * h * 4); + + wxGetARGBPixels(bm, 0, 0, w, h, s1, 0); + wxGetARGBPixels(bm2, 0, 0, w, h, s2, 0); + + mask = snip->GetSnipBitmapMask(); + if (mask && mask->Ok() && (mask->GetWidth() == w) && (mask->GetHeight() == h)) { + wxGetARGBPixels(mask, 0, 0, w, h, s1, 1); + } + mask = snip2->GetSnipBitmapMask(); + if (mask && mask->Ok() && (mask->GetWidth() == w) && (mask->GetHeight() == h)) { + wxGetARGBPixels(mask, 0, 0, w, h, s2, 1); + } + + return !memcmp(s1, s2, w * h * 4); +} + +static long HashCodeOf(wxImageSnip *snip, void *recur) +{ + int w, h, i; + long hk = 0; + char *s1; + wxBitmap *bm; + + bm = snip->GetSnipBitmap(); + if (!bm) return 0; + + if (!bm->Ok()) return 0; + w = bm->GetWidth(); + h = bm->GetHeight(); + + s1 = (char *)scheme_malloc_atomic(w * h * 4); + + wxGetARGBPixels(bm, 0, 0, w, h, s1, 0); + + for (i = w * h * 4; i; i -= 4) { + hk += s1[i - 4] + s1[i - 3] + s1[i - 2]; + hk = (hk << 1) + hk; + } + + return hk; +} + +static long SecondaryHashCodeOf(wxImageSnip *snip, void *recur) +{ + wxBitmap *bm; + + bm = snip->GetSnipBitmap(); + if (!bm) return 0; + + return bm->GetWidth() + bm->GetHeight(); +} +#ifdef MZ_PRECISE_GC +START_XFORM_SKIP; +#endif + +#define UNKNOWN_OBJ void* + + @@ -6603,6 +6689,7 @@ static Scheme_Object *bundle_symset_bitmapType(int v) { + class os_wxImageSnip : public wxImageSnip { public: @@ -6611,6 +6698,8 @@ class os_wxImageSnip : public wxImageSnip { os_wxImageSnip CONSTRUCTOR_ARGS((class wxBitmap* x0, class wxBitmap* x1 = NULL)); #endif ~os_wxImageSnip(); + Bool OtherEqualTo_method(class wxImageSnip* x0, UNKNOWN_OBJ x1); + Bool EqualTo_method(class wxImageSnip* x0, UNKNOWN_OBJ x1); void SetUnmodified(); nndouble GetScrollStepOffset(nnlong x0); nnlong FindScrollStep(double x0); @@ -6669,6 +6758,92 @@ os_wxImageSnip::~os_wxImageSnip() objscheme_destroy(this, (Scheme_Object *) __gc_external); } +static Scheme_Object *os_wxImageSnipOtherEqualTo(int n, Scheme_Object *p[]); + +Bool os_wxImageSnip::OtherEqualTo_method(class wxImageSnip* x0, UNKNOWN_OBJ x1) +{ + Scheme_Object *p[POFFSET+2] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT }); + Scheme_Object *v; + Scheme_Object *method INIT_NULLED_OUT; +#ifdef MZ_PRECISE_GC + os_wxImageSnip *sElF = this; +#endif + static void *mcache = 0; + + SETUP_VAR_STACK(7); + VAR_STACK_PUSH(0, method); + VAR_STACK_PUSH(1, sElF); + VAR_STACK_PUSH_ARRAY(2, p, POFFSET+2); + VAR_STACK_PUSH(5, x0); + VAR_STACK_PUSH(6, x1); + SET_VAR_STACK(); + + method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxImageSnip_class, "other-equal-to?", &mcache); + if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxImageSnipOtherEqualTo)) { + SET_VAR_STACK(); + READY_TO_RETURN; return OtherEqualTo(SELF__, x0, x1); + } else { + + p[POFFSET+0] = WITH_VAR_STACK(objscheme_bundle_wxImageSnip(x0)); + p[POFFSET+1] = ((Scheme_Object *)x1); + + p[0] = (Scheme_Object *) ASSELF __gc_external; + + v = WITH_VAR_STACK(scheme_apply(method, POFFSET+2, p)); + + + { + Bool resval; + resval = WITH_VAR_STACK(objscheme_unbundle_bool(v, "other-equal-to? in image-snip%"", extracting return value")); + READY_TO_RETURN; + return resval; + } + } +} + +static Scheme_Object *os_wxImageSnipEqualTo(int n, Scheme_Object *p[]); + +Bool os_wxImageSnip::EqualTo_method(class wxImageSnip* x0, UNKNOWN_OBJ x1) +{ + Scheme_Object *p[POFFSET+2] INIT_NULLED_ARRAY({ NULLED_OUT INA_comma NULLED_OUT INA_comma NULLED_OUT }); + Scheme_Object *v; + Scheme_Object *method INIT_NULLED_OUT; +#ifdef MZ_PRECISE_GC + os_wxImageSnip *sElF = this; +#endif + static void *mcache = 0; + + SETUP_VAR_STACK(7); + VAR_STACK_PUSH(0, method); + VAR_STACK_PUSH(1, sElF); + VAR_STACK_PUSH_ARRAY(2, p, POFFSET+2); + VAR_STACK_PUSH(5, x0); + VAR_STACK_PUSH(6, x1); + SET_VAR_STACK(); + + method = objscheme_find_method((Scheme_Object *) ASSELF __gc_external, os_wxImageSnip_class, "equal-to?", &mcache); + if (!method || OBJSCHEME_PRIM_METHOD(method, os_wxImageSnipEqualTo)) { + SET_VAR_STACK(); + READY_TO_RETURN; return EqualTo(SELF__, x0, x1); + } else { + + p[POFFSET+0] = WITH_VAR_STACK(objscheme_bundle_wxImageSnip(x0)); + p[POFFSET+1] = ((Scheme_Object *)x1); + + p[0] = (Scheme_Object *) ASSELF __gc_external; + + v = WITH_VAR_STACK(scheme_apply(method, POFFSET+2, p)); + + + { + Bool resval; + resval = WITH_VAR_STACK(objscheme_unbundle_bool(v, "equal-to? in image-snip%"", extracting return value")); + READY_TO_RETURN; + return resval; + } + } +} + static Scheme_Object *os_wxImageSnipSetUnmodified(int n, Scheme_Object *p[]); void os_wxImageSnip::SetUnmodified() @@ -7641,6 +7816,108 @@ void os_wxImageSnip::GetExtent(class wxDC* x0, double x1, double x2, nndouble* x } } +static Scheme_Object *os_wxImageSnipSecondaryHashCodeOf(int n, Scheme_Object *p[]) +{ + WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p) + REMEMBER_VAR_STACK(); + long r; + objscheme_check_valid(os_wxImageSnip_class, "equal-secondary-hash-code-of in image-snip%", n, p); + UNKNOWN_OBJ x0 INIT_NULLED_OUT; + + SETUP_VAR_STACK_REMEMBERED(2); + VAR_STACK_PUSH(0, p); + VAR_STACK_PUSH(1, x0); + + + x0 = ((void *)p[POFFSET+0]); + + + r = WITH_VAR_STACK(SecondaryHashCodeOf(((wxImageSnip *)((Scheme_Class_Object *)p[0])->primdata), x0)); + + + + READY_TO_RETURN; + return scheme_make_integer(r); +} + +static Scheme_Object *os_wxImageSnipHashCodeOf(int n, Scheme_Object *p[]) +{ + WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p) + REMEMBER_VAR_STACK(); + long r; + objscheme_check_valid(os_wxImageSnip_class, "equal-hash-code-of in image-snip%", n, p); + UNKNOWN_OBJ x0 INIT_NULLED_OUT; + + SETUP_VAR_STACK_REMEMBERED(2); + VAR_STACK_PUSH(0, p); + VAR_STACK_PUSH(1, x0); + + + x0 = ((void *)p[POFFSET+0]); + + + r = WITH_VAR_STACK(HashCodeOf(((wxImageSnip *)((Scheme_Class_Object *)p[0])->primdata), x0)); + + + + READY_TO_RETURN; + return scheme_make_integer(r); +} + +static Scheme_Object *os_wxImageSnipOtherEqualTo(int n, Scheme_Object *p[]) +{ + WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p) + REMEMBER_VAR_STACK(); + Bool r; + objscheme_check_valid(os_wxImageSnip_class, "other-equal-to? in image-snip%", n, p); + class wxImageSnip* x0 INIT_NULLED_OUT; + UNKNOWN_OBJ x1 INIT_NULLED_OUT; + + SETUP_VAR_STACK_REMEMBERED(3); + VAR_STACK_PUSH(0, p); + VAR_STACK_PUSH(1, x0); + VAR_STACK_PUSH(2, x1); + + + x0 = WITH_VAR_STACK(objscheme_unbundle_wxImageSnip(p[POFFSET+0], "other-equal-to? in image-snip%", 1)); + x1 = ((void *)p[POFFSET+1]); + + + r = WITH_VAR_STACK(OtherEqualTo(((wxImageSnip *)((Scheme_Class_Object *)p[0])->primdata), x0, x1)); + + + + READY_TO_RETURN; + return (r ? scheme_true : scheme_false); +} + +static Scheme_Object *os_wxImageSnipEqualTo(int n, Scheme_Object *p[]) +{ + WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p) + REMEMBER_VAR_STACK(); + Bool r; + objscheme_check_valid(os_wxImageSnip_class, "equal-to? in image-snip%", n, p); + class wxImageSnip* x0 INIT_NULLED_OUT; + UNKNOWN_OBJ x1 INIT_NULLED_OUT; + + SETUP_VAR_STACK_REMEMBERED(3); + VAR_STACK_PUSH(0, p); + VAR_STACK_PUSH(1, x0); + VAR_STACK_PUSH(2, x1); + + + x0 = WITH_VAR_STACK(objscheme_unbundle_wxImageSnip(p[POFFSET+0], "equal-to? in image-snip%", 1)); + x1 = ((void *)p[POFFSET+1]); + + + r = WITH_VAR_STACK(EqualTo(((wxImageSnip *)((Scheme_Class_Object *)p[0])->primdata), x0, x1)); + + + + READY_TO_RETURN; + return (r ? scheme_true : scheme_false); +} + static Scheme_Object *os_wxImageSnipSetOffset(int n, Scheme_Object *p[]) { WXS_USE_ARGUMENT(n) WXS_USE_ARGUMENT(p) @@ -8707,8 +8984,12 @@ void objscheme_setup_wxImageSnip(Scheme_Env *env) wxREGGLOB(os_wxImageSnip_class); - os_wxImageSnip_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "image-snip%", "snip%", (Scheme_Method_Prim *)os_wxImageSnip_ConstructScheme, 31)); + os_wxImageSnip_class = WITH_VAR_STACK(objscheme_def_prim_class(env, "image-snip%", "snip%", (Scheme_Method_Prim *)os_wxImageSnip_ConstructScheme, 35)); + WITH_VAR_STACK(scheme_add_method_w_arity(os_wxImageSnip_class, "equal-secondary-hash-code-of" " method", (Scheme_Method_Prim *)os_wxImageSnipSecondaryHashCodeOf, 1, 1)); + WITH_VAR_STACK(scheme_add_method_w_arity(os_wxImageSnip_class, "equal-hash-code-of" " method", (Scheme_Method_Prim *)os_wxImageSnipHashCodeOf, 1, 1)); + WITH_VAR_STACK(scheme_add_method_w_arity(os_wxImageSnip_class, "other-equal-to?" " method", (Scheme_Method_Prim *)os_wxImageSnipOtherEqualTo, 2, 2)); + WITH_VAR_STACK(scheme_add_method_w_arity(os_wxImageSnip_class, "equal-to?" " method", (Scheme_Method_Prim *)os_wxImageSnipEqualTo, 2, 2)); WITH_VAR_STACK(scheme_add_method_w_arity(os_wxImageSnip_class, "set-offset" " method", (Scheme_Method_Prim *)os_wxImageSnipSetOffset, 2, 2)); WITH_VAR_STACK(scheme_add_method_w_arity(os_wxImageSnip_class, "get-bitmap-mask" " method", (Scheme_Method_Prim *)os_wxImageSnipGetSnipBitmapMask, 0, 0)); WITH_VAR_STACK(scheme_add_method_w_arity(os_wxImageSnip_class, "get-bitmap" " method", (Scheme_Method_Prim *)os_wxImageSnipGetSnipBitmap, 0, 0)); @@ -8805,6 +9086,15 @@ class wxImageSnip *objscheme_unbundle_wxImageSnip(Scheme_Object *obj, const char } +static bool EqualTo(wxImageSnip* bm, wxImageSnip* bm2, void *recur) +{ + /* Might redirect to Scheme. + We're relying on the cast succeeding because the method is + not virtual, but I doubt that this is guaranteed to work by the C++ + spec if wxImageSnip is instantiated instead of os_wxImageSnip */ + return ((os_wxImageSnip *)bm2)->OtherEqualTo_method(bm, recur); +} + diff --git a/src/mred/wxs/wxs_snip.h b/src/mred/wxs/wxs_snip.h index 8bd80e0f24..ae9b8f8391 100644 --- a/src/mred/wxs/wxs_snip.h +++ b/src/mred/wxs/wxs_snip.h @@ -151,6 +151,8 @@ void objscheme_setup_wxTabSnip(Scheme_Env *env); int objscheme_istype_wxTabSnip(Scheme_Object *obj, const char *stop, int nullOK); Scheme_Object *objscheme_bundle_wxTabSnip(class wxTabSnip *realobj); class wxTabSnip *objscheme_unbundle_wxTabSnip(Scheme_Object *obj, const char *where, int nullOK); +extern Scheme_Object *objscheme_bundle_wxImageSnip(class wxImageSnip *); +extern Scheme_Object *objscheme_bundle_wxImageSnip(class wxImageSnip *); extern Scheme_Object *objscheme_bundle_wxSnipAdmin(class wxSnipAdmin *); extern Scheme_Object *objscheme_bundle_wxMediaStreamOut(class wxMediaStreamOut *); extern Scheme_Object *objscheme_bundle_wxSnip(class wxSnip *); @@ -172,6 +174,8 @@ extern class wxSnip *objscheme_unbundle_wxSnip(Scheme_Object *, const char *, in extern Scheme_Object *objscheme_bundle_wxDC(class wxDC *); extern Scheme_Object *objscheme_bundle_wxDC(class wxDC *); extern Scheme_Object *objscheme_bundle_wxDC(class wxDC *); +extern class wxImageSnip *objscheme_unbundle_wxImageSnip(Scheme_Object *, const char *, int); +extern class wxImageSnip *objscheme_unbundle_wxImageSnip(Scheme_Object *, const char *, int); extern Scheme_Object *objscheme_bundle_wxBitmap(class wxBitmap *); extern Scheme_Object *objscheme_bundle_wxBitmap(class wxBitmap *); extern class wxBitmap *objscheme_unbundle_wxBitmap(Scheme_Object *, const char *, int); diff --git a/src/mred/wxs/wxs_snip.xc b/src/mred/wxs/wxs_snip.xc index bdc4a5ce8b..b186aa3560 100644 --- a/src/mred/wxs/wxs_snip.xc +++ b/src/mred/wxs/wxs_snip.xc @@ -88,8 +88,97 @@ @INCLUDE wxs_bmt.xci +extern void wxGetARGBPixels(wxBitmap *bm, double x, double y, int w, int h, char *s, Bool get_alpha); +static bool EqualTo(wxImageSnip* bm, wxImageSnip* bm2, void *recur); + +#ifdef MZ_PRECISE_GC +END_XFORM_SKIP; +#endif +static bool OtherEqualTo(wxImageSnip* snip, wxImageSnip* snip2, void *recur) +{ + int w, h; + char *s1, *s2; + wxBitmap *bm, *bm2, *mask; + + bm = snip->GetSnipBitmap(); + bm2 = snip2->GetSnipBitmap(); + + if (!bm || !bm->Ok()) return FALSE; + if (!bm2 || !bm2->Ok()) return FALSE; + if (bm->GetDepth() != bm2->GetDepth()) return FALSE; + w = bm->GetWidth(); + h = bm->GetHeight(); + if (w != bm2->GetWidth()) return FALSE; + if (h != bm2->GetHeight()) return FALSE; + + s1 = (char *)scheme_malloc_atomic(w * h * 4); + s2 = (char *)scheme_malloc_atomic(w * h * 4); + + memset(s1, 255, w * h * 4); + memset(s2, 255, w * h * 4); + + wxGetARGBPixels(bm, 0, 0, w, h, s1, 0); + wxGetARGBPixels(bm2, 0, 0, w, h, s2, 0); + + mask = snip->GetSnipBitmapMask(); + if (mask && mask->Ok() && (mask->GetWidth() == w) && (mask->GetHeight() == h)) { + wxGetARGBPixels(mask, 0, 0, w, h, s1, 1); + } + mask = snip2->GetSnipBitmapMask(); + if (mask && mask->Ok() && (mask->GetWidth() == w) && (mask->GetHeight() == h)) { + wxGetARGBPixels(mask, 0, 0, w, h, s2, 1); + } + + return !memcmp(s1, s2, w * h * 4); +} + +static long HashCodeOf(wxImageSnip *snip, void *recur) +{ + int w, h, i; + long hk = 0; + char *s1; + wxBitmap *bm; + + bm = snip->GetSnipBitmap(); + if (!bm) return 0; + + if (!bm->Ok()) return 0; + w = bm->GetWidth(); + h = bm->GetHeight(); + + s1 = (char *)scheme_malloc_atomic(w * h * 4); + + wxGetARGBPixels(bm, 0, 0, w, h, s1, 0); + + for (i = w * h * 4; i; i -= 4) { + hk += s1[i - 4] + s1[i - 3] + s1[i - 2]; + hk = (hk << 1) + hk; + } + + return hk; +} + +static long SecondaryHashCodeOf(wxImageSnip *snip, void *recur) +{ + wxBitmap *bm; + + bm = snip->GetSnipBitmap(); + if (!bm) return 0; + + return bm->GetWidth() + bm->GetHeight(); +} +#ifdef MZ_PRECISE_GC +START_XFORM_SKIP; +#endif + +#define UNKNOWN_OBJ void* +@MACRO bundleAny = ((Scheme_Object *){x}) +@MACRO unbundleAny = ((void *){x}) + @CLASSBASE wxImageSnip "image-snip":"snip" / nofnl +@IMPLEMENTS equal<%> + @CREATOR (nxpathname=NULL,SYM[bitmapType]=0,bool=FALSE,bool=TRUE); : : //USEALLFUEL[x0] <> filename @CREATOR (wxBitmap!,wxBitmap^=NULL) : : /CheckBW[1.METHODNAME("image-snip%","initialization")]|CHECKOK[0.METHODNAME("image-snip%","initialization")]|CHECKOK[1.METHODNAME("image-snip%","initialization")]|CheckSizes[0.1.METHODNAME("image-snip%","initialization")] <> bitmap @@ -111,8 +200,22 @@ @ "set-offset" : void SetOffset(double, double); +@ M "equal-to?" : bool EqualTo(wxImageSnip^,UNKNOWN_OBJ/bundleAny/unbundleAny////push); +@ M "other-equal-to?" : bool OtherEqualTo(wxImageSnip^,UNKNOWN_OBJ/bundleAny/unbundleAny////push); +@ m "equal-hash-code-of" : long HashCodeOf(UNKNOWN_OBJ/bundleAny/unbundleAny////push); +@ m "equal-secondary-hash-code-of" : long SecondaryHashCodeOf(UNKNOWN_OBJ/bundleAny/unbundleAny////push); + @END +static bool EqualTo(wxImageSnip* bm, wxImageSnip* bm2, void *recur) +{ + /* Might redirect to Scheme. + We're relying on the cast succeeding because the method is + not virtual, but I doubt that this is guaranteed to work by the C++ + spec if wxImageSnip is instantiated instead of os_wxImageSnip */ + return ((os_wxImageSnip *)bm2)->OtherEqualTo_method(bm, recur); +} + @CLASSBASE wxMediaSnip "editor-snip" : "snip" / nofnl @CREATOR (wxMediaBuffer^=NULL,bool=TRUE,nnint=wxMSNIPBOX_XMARGIN,nnint=wxMSNIPBOX_YMARGIN,nnint=wxMSNIPBOX_XMARGIN,nnint=wxMSNIPBOX_YMARGIN,nnint=wxMSNIPBOX_XINSET,nnint=wxMSNIPBOX_YINSET,nnint=wxMSNIPBOX_XINSET,nnint=wxMSNIPBOX_YINSET,nnfs[none]=-1,nnfs[none]=-1,nnfs[none]=-1,nnfs[none]=-1); diff --git a/src/mzscheme/src/bool.c b/src/mzscheme/src/bool.c index 714836f502..9598f26687 100644 --- a/src/mzscheme/src/bool.c +++ b/src/mzscheme/src/bool.c @@ -48,12 +48,14 @@ static Scheme_Object *boolean_p_prim (int argc, Scheme_Object *argv[]); static Scheme_Object *eq_prim (int argc, Scheme_Object *argv[]); static Scheme_Object *eqv_prim (int argc, Scheme_Object *argv[]); static Scheme_Object *equal_prim (int argc, Scheme_Object *argv[]); +static Scheme_Object *equalish_prim (int argc, Scheme_Object *argv[]); typedef struct Equal_Info { - long depth; /* always odd */ - long car_depth; /* always odd */ + long depth; /* always odd, so it looks like a fixnum */ + long car_depth; /* always odd => fixnum */ Scheme_Hash_Table *ht; Scheme_Object *recur; + Scheme_Object *next, *next_next; } Equal_Info; static int is_equal (Scheme_Object *obj1, Scheme_Object *obj2, Equal_Info *eql); @@ -95,6 +97,10 @@ void scheme_init_bool (Scheme_Env *env) scheme_equal_prim = scheme_make_prim_w_arity(equal_prim, "equal?", 2, 2); scheme_add_global_constant("equal?", scheme_equal_prim, env); + + scheme_add_global_constant("equal?/recur", + scheme_make_prim_w_arity(equalish_prim, "equal?/recur", 3, 3), + env); } static Scheme_Object * @@ -130,6 +136,25 @@ equal_prim (int argc, Scheme_Object *argv[]) eql.car_depth = 1; eql.ht = NULL; eql.recur = NULL; + eql.next = NULL; + eql.next_next = NULL; + + return (is_equal(argv[0], argv[1], &eql) ? scheme_true : scheme_false); +} + +static Scheme_Object * +equalish_prim (int argc, Scheme_Object *argv[]) +{ + Equal_Info eql; + + scheme_check_proc_arity("equal?/recur", 2, 2, argc, argv); + + eql.depth = 1; + eql.car_depth = 1; + eql.ht = NULL; + eql.recur = NULL; + eql.next = NULL; + eql.next_next = argv[2]; return (is_equal(argv[0], argv[1], &eql) ? scheme_true : scheme_false); } @@ -222,6 +247,8 @@ int scheme_equal (Scheme_Object *obj1, Scheme_Object *obj2) eql.car_depth = 1; eql.ht = NULL; eql.recur = NULL; + eql.next_next = NULL; + eql.next = NULL; return is_equal(obj1, obj2, &eql); } @@ -252,7 +279,8 @@ static Scheme_Object *union_find(Scheme_Object *obj1, Scheme_Hash_Table *ht) static int union_check(Scheme_Object *obj1, Scheme_Object *obj2, Equal_Info *eql) { if (eql->depth < 50) { - eql->depth += 2; + if (!eql->next_next) + eql->depth += 2; return 0; } else { Scheme_Hash_Table *ht = eql->ht; @@ -324,6 +352,17 @@ int is_equal (Scheme_Object *obj1, Scheme_Object *obj2, Equal_Info *eql) static int equal_counter = EQUAL_COUNT_START; top: + if (eql->next_next) { + if (eql->next) { + Scheme_Object *a[2]; + a[0] = obj1; + a[1] = obj2; + obj1 = _scheme_apply(eql->next, 2, a); + return SCHEME_TRUEP(obj1); + } + eql->next = eql->next_next; + } + if (scheme_eqv(obj1, obj2)) return 1; else if (NOT_SAME_TYPE(SCHEME_TYPE(obj1), SCHEME_TYPE(obj2))) { diff --git a/src/mzscheme/src/cstartup.inc b/src/mzscheme/src/cstartup.inc index 85845e9172..d9ccda9ef8 100644 --- a/src/mzscheme/src/cstartup.inc +++ b/src/mzscheme/src/cstartup.inc @@ -1,22 +1,22 @@ { - static MZCOMPILED_STRING_FAR unsigned char expr[] = {35,126,7,52,46,49,46,51,46,54,50,0,0,0,1,0,0,3,0,12,0, -16,0,23,0,26,0,31,0,38,0,43,0,48,0,55,0,68,0,72,0,78, + static MZCOMPILED_STRING_FAR unsigned char expr[] = {35,126,7,52,46,49,46,51,46,55,50,0,0,0,1,0,0,3,0,12,0, +19,0,23,0,28,0,41,0,44,0,49,0,56,0,63,0,67,0,72,0,78, 0,92,0,106,0,109,0,115,0,119,0,121,0,132,0,134,0,148,0,155,0, 177,0,179,0,193,0,253,0,23,1,32,1,41,1,51,1,87,1,126,1,165, 1,234,1,42,2,130,2,194,2,199,2,219,2,110,3,130,3,181,3,247,3, 132,4,34,5,84,5,107,5,186,5,0,0,132,7,0,0,29,11,11,68,104, -101,114,101,45,115,116,120,63,108,101,116,66,100,101,102,105,110,101,62,111,114, -64,108,101,116,42,66,117,110,108,101,115,115,64,99,111,110,100,64,119,104,101, -110,66,108,101,116,114,101,99,72,112,97,114,97,109,101,116,101,114,105,122,101, -63,97,110,100,65,113,117,111,116,101,29,94,2,13,68,35,37,107,101,114,110, +101,114,101,45,115,116,120,66,100,101,102,105,110,101,63,97,110,100,64,108,101, +116,42,72,112,97,114,97,109,101,116,101,114,105,122,101,62,111,114,64,99,111, +110,100,66,108,101,116,114,101,99,66,117,110,108,101,115,115,63,108,101,116,64, +119,104,101,110,65,113,117,111,116,101,29,94,2,13,68,35,37,107,101,114,110, 101,108,11,29,94,2,13,68,35,37,112,97,114,97,109,122,11,62,105,102,65, 98,101,103,105,110,63,115,116,120,61,115,70,108,101,116,45,118,97,108,117,101, 115,61,120,73,108,101,116,114,101,99,45,118,97,108,117,101,115,66,108,97,109, 98,100,97,1,20,112,97,114,97,109,101,116,101,114,105,122,97,116,105,111,110, 45,107,101,121,61,118,73,100,101,102,105,110,101,45,118,97,108,117,101,115,98, 10,35,11,8,180,243,94,159,2,15,35,35,159,2,14,35,35,16,20,2,3, -2,1,2,4,2,1,2,10,2,1,2,5,2,1,2,6,2,1,2,7,2, -1,2,8,2,1,2,9,2,1,2,11,2,1,2,12,2,1,97,36,11,8, +2,1,2,7,2,1,2,4,2,1,2,5,2,1,2,6,2,1,2,9,2, +1,2,8,2,1,2,10,2,1,2,11,2,1,2,12,2,1,97,36,11,8, 180,243,93,159,2,14,35,36,16,2,2,2,161,2,1,36,2,2,2,1,2, 2,97,10,11,11,8,180,243,16,0,97,10,37,11,8,180,243,16,0,13,16, 4,35,29,11,11,2,1,11,18,16,2,99,64,104,101,114,101,8,31,8,30, @@ -27,7 +27,7 @@ 22,89,23,200,2,249,22,64,2,17,248,22,91,23,202,1,12,27,248,22,66, 248,22,133,4,23,197,1,28,248,22,72,23,194,2,20,15,159,36,35,36,28, 248,22,72,248,22,66,23,195,2,248,22,65,193,249,22,190,3,80,158,38,35, -251,22,74,2,16,248,22,65,23,200,2,249,22,64,2,12,248,22,66,23,202, +251,22,74,2,16,248,22,65,23,200,2,249,22,64,2,4,248,22,66,23,202, 1,11,18,16,2,101,10,8,31,8,30,8,29,8,28,8,27,16,4,11,11, 2,18,3,1,7,101,110,118,57,55,57,51,16,4,11,11,2,19,3,1,7, 101,110,118,57,55,57,52,93,8,224,252,60,0,0,95,9,8,224,252,60,0, @@ -35,7 +35,7 @@ 20,15,159,36,35,36,28,248,22,72,248,22,66,23,195,2,248,22,65,193,249, 22,190,3,80,158,38,35,250,22,74,2,20,248,22,74,249,22,74,248,22,74, 2,21,248,22,65,23,202,2,251,22,74,2,16,2,21,2,21,249,22,64,2, -5,248,22,66,23,205,1,18,16,2,101,11,8,31,8,30,8,29,8,28,8, +7,248,22,66,23,205,1,18,16,2,101,11,8,31,8,30,8,29,8,28,8, 27,16,4,11,11,2,18,3,1,7,101,110,118,57,55,57,54,16,4,11,11, 2,19,3,1,7,101,110,118,57,55,57,55,93,8,224,253,60,0,0,95,9, 8,224,253,60,0,0,2,1,248,22,133,4,193,27,248,22,133,4,194,249,22, @@ -52,7 +52,7 @@ 8,44,36,46,9,222,33,42,248,22,133,4,248,22,65,201,248,22,66,198,27, 248,22,66,248,22,133,4,196,27,248,22,133,4,248,22,65,195,249,22,190,3, 80,158,39,35,28,248,22,72,195,250,22,75,2,20,9,248,22,66,199,250,22, -74,2,3,248,22,74,248,22,65,199,250,22,75,2,6,248,22,66,201,248,22, +74,2,11,248,22,74,248,22,65,199,250,22,75,2,5,248,22,66,201,248,22, 66,202,27,248,22,66,248,22,133,4,23,197,1,27,249,22,1,22,78,249,22, 2,22,133,4,248,22,133,4,248,22,65,199,249,22,190,3,80,158,39,35,251, 22,74,1,22,119,105,116,104,45,99,111,110,116,105,110,117,97,116,105,111,110, @@ -82,31 +82,31 @@ 11,11,11,11,11,11,16,10,2,3,2,4,2,5,2,6,2,7,2,8,2, 9,2,10,2,11,2,12,35,45,36,11,11,16,0,16,0,16,0,35,35,11, 11,11,16,0,16,0,16,0,35,35,16,11,16,5,2,2,20,15,159,35,35, -35,35,20,103,159,35,16,0,16,1,33,32,10,16,5,2,7,89,162,8,44, +35,35,20,103,159,35,16,0,16,1,33,32,10,16,5,2,10,89,162,8,44, 36,52,9,223,0,33,33,35,20,103,159,35,16,1,2,2,16,0,11,16,5, -2,9,89,162,8,44,36,52,9,223,0,33,34,35,20,103,159,35,16,1,2, -2,16,0,11,16,5,2,12,89,162,8,44,36,52,9,223,0,33,35,35,20, -103,159,35,16,1,2,2,16,1,33,36,11,16,5,2,5,89,162,8,44,36, +2,12,89,162,8,44,36,52,9,223,0,33,34,35,20,103,159,35,16,1,2, +2,16,0,11,16,5,2,4,89,162,8,44,36,52,9,223,0,33,35,35,20, +103,159,35,16,1,2,2,16,1,33,36,11,16,5,2,7,89,162,8,44,36, 55,9,223,0,33,37,35,20,103,159,35,16,1,2,2,16,1,33,38,11,16, -5,2,3,89,162,8,44,36,57,9,223,0,33,41,35,20,103,159,35,16,1, -2,2,16,0,11,16,5,2,10,89,162,8,44,36,52,9,223,0,33,43,35, -20,103,159,35,16,1,2,2,16,0,11,16,5,2,6,89,162,8,44,36,53, -9,223,0,33,44,35,20,103,159,35,16,1,2,2,16,0,11,16,5,2,11, +5,2,11,89,162,8,44,36,57,9,223,0,33,41,35,20,103,159,35,16,1, +2,2,16,0,11,16,5,2,9,89,162,8,44,36,52,9,223,0,33,43,35, +20,103,159,35,16,1,2,2,16,0,11,16,5,2,5,89,162,8,44,36,53, +9,223,0,33,44,35,20,103,159,35,16,1,2,2,16,0,11,16,5,2,6, 89,162,8,44,36,54,9,223,0,33,45,35,20,103,159,35,16,1,2,2,16, 0,11,16,5,2,8,89,162,8,44,36,57,9,223,0,33,46,35,20,103,159, -35,16,1,2,2,16,1,33,48,11,16,5,2,4,89,162,8,44,36,53,9, +35,16,1,2,2,16,1,33,48,11,16,5,2,3,89,162,8,44,36,53,9, 223,0,33,49,35,20,103,159,35,16,1,2,2,16,0,11,16,0,94,2,14, 2,15,93,2,14,9,9,35,0}; EVAL_ONE_SIZED_STR((char *)expr, 2045); } { - static MZCOMPILED_STRING_FAR unsigned char expr[] = {35,126,7,52,46,49,46,51,46,54,59,0,0,0,1,0,0,13,0,18,0, + static MZCOMPILED_STRING_FAR unsigned char expr[] = {35,126,7,52,46,49,46,51,46,55,59,0,0,0,1,0,0,13,0,18,0, 35,0,50,0,68,0,84,0,94,0,112,0,132,0,148,0,166,0,197,0,226, 0,248,0,6,1,12,1,26,1,31,1,41,1,49,1,77,1,109,1,154,1, -199,1,223,1,6,2,8,2,65,2,155,3,196,3,30,5,134,5,238,5,99, -6,113,6,147,6,163,6,13,8,27,8,190,8,191,9,191,10,198,10,205,10, -212,10,87,11,100,11,55,12,157,12,170,12,192,12,144,13,48,14,119,15,127, -15,135,15,161,15,15,16,0,0,3,19,0,0,72,112,97,116,104,45,115,116, +199,1,223,1,6,2,8,2,65,2,155,3,196,3,31,5,135,5,239,5,100, +6,114,6,148,6,164,6,14,8,28,8,191,8,192,9,192,10,199,10,206,10, +213,10,88,11,101,11,56,12,158,12,171,12,193,12,145,13,49,14,121,15,129, +15,137,15,163,15,18,16,0,0,6,19,0,0,72,112,97,116,104,45,115,116, 114,105,110,103,63,64,98,115,98,115,76,110,111,114,109,97,108,45,99,97,115, 101,45,112,97,116,104,74,45,99,104,101,99,107,45,114,101,108,112,97,116,104, 77,45,99,104,101,99,107,45,99,111,108,108,101,99,116,105,111,110,75,99,111, @@ -132,217 +132,217 @@ 116,101,32,115,116,114,105,110,103,6,36,36,99,97,110,110,111,116,32,97,100, 100,32,97,32,115,117,102,102,105,120,32,116,111,32,97,32,114,111,111,116,32, 112,97,116,104,58,32,5,0,27,20,14,159,80,158,36,50,250,80,158,39,51, -249,22,27,11,80,158,41,50,22,179,12,10,248,22,155,5,23,196,2,28,248, -22,152,6,23,194,2,12,87,94,248,22,165,8,23,194,1,248,80,159,37,53, +249,22,27,11,80,158,41,50,22,180,12,10,248,22,155,5,23,196,2,28,248, +22,152,6,23,194,2,12,87,94,248,22,166,8,23,194,1,248,80,159,37,53, 36,195,28,248,22,72,23,195,2,9,27,248,22,65,23,196,2,27,28,248,22, -160,13,23,195,2,23,194,1,28,248,22,159,13,23,195,2,249,22,161,13,23, -196,1,250,80,158,42,48,248,22,175,13,2,19,11,10,250,80,158,40,48,248, -22,175,13,2,19,23,197,1,10,28,23,193,2,249,22,64,248,22,163,13,249, -22,161,13,23,198,1,247,22,176,13,27,248,22,66,23,200,1,28,248,22,72, -23,194,2,9,27,248,22,65,23,195,2,27,28,248,22,160,13,23,195,2,23, -194,1,28,248,22,159,13,23,195,2,249,22,161,13,23,196,1,250,80,158,47, -48,248,22,175,13,2,19,11,10,250,80,158,45,48,248,22,175,13,2,19,23, -197,1,10,28,23,193,2,249,22,64,248,22,163,13,249,22,161,13,23,198,1, -247,22,176,13,248,80,159,45,52,36,248,22,66,23,199,1,87,94,23,193,1, +161,13,23,195,2,23,194,1,28,248,22,160,13,23,195,2,249,22,162,13,23, +196,1,250,80,158,42,48,248,22,176,13,2,19,11,10,250,80,158,40,48,248, +22,176,13,2,19,23,197,1,10,28,23,193,2,249,22,64,248,22,164,13,249, +22,162,13,23,198,1,247,22,177,13,27,248,22,66,23,200,1,28,248,22,72, +23,194,2,9,27,248,22,65,23,195,2,27,28,248,22,161,13,23,195,2,23, +194,1,28,248,22,160,13,23,195,2,249,22,162,13,23,196,1,250,80,158,47, +48,248,22,176,13,2,19,11,10,250,80,158,45,48,248,22,176,13,2,19,23, +197,1,10,28,23,193,2,249,22,64,248,22,164,13,249,22,162,13,23,198,1, +247,22,177,13,248,80,159,45,52,36,248,22,66,23,199,1,87,94,23,193,1, 248,80,159,43,52,36,248,22,66,23,197,1,87,94,23,193,1,27,248,22,66, 23,198,1,28,248,22,72,23,194,2,9,27,248,22,65,23,195,2,27,28,248, -22,160,13,23,195,2,23,194,1,28,248,22,159,13,23,195,2,249,22,161,13, -23,196,1,250,80,158,45,48,248,22,175,13,2,19,11,10,250,80,158,43,48, -248,22,175,13,2,19,23,197,1,10,28,23,193,2,249,22,64,248,22,163,13, -249,22,161,13,23,198,1,247,22,176,13,248,80,159,43,52,36,248,22,66,23, -199,1,248,80,159,41,52,36,248,22,66,196,27,248,22,136,13,23,195,2,28, -23,193,2,192,87,94,23,193,1,28,248,22,157,6,23,195,2,27,248,22,158, -13,195,28,192,192,248,22,159,13,195,11,87,94,28,28,248,22,137,13,23,195, -2,10,27,248,22,136,13,23,196,2,28,23,193,2,192,87,94,23,193,1,28, -248,22,157,6,23,196,2,27,248,22,158,13,23,197,2,28,23,193,2,192,87, -94,23,193,1,248,22,159,13,23,197,2,11,12,250,22,129,9,76,110,111,114, +22,161,13,23,195,2,23,194,1,28,248,22,160,13,23,195,2,249,22,162,13, +23,196,1,250,80,158,45,48,248,22,176,13,2,19,11,10,250,80,158,43,48, +248,22,176,13,2,19,23,197,1,10,28,23,193,2,249,22,64,248,22,164,13, +249,22,162,13,23,198,1,247,22,177,13,248,80,159,43,52,36,248,22,66,23, +199,1,248,80,159,41,52,36,248,22,66,196,27,248,22,137,13,23,195,2,28, +23,193,2,192,87,94,23,193,1,28,248,22,157,6,23,195,2,27,248,22,159, +13,195,28,192,192,248,22,160,13,195,11,87,94,28,28,248,22,138,13,23,195, +2,10,27,248,22,137,13,23,196,2,28,23,193,2,192,87,94,23,193,1,28, +248,22,157,6,23,196,2,27,248,22,159,13,23,197,2,28,23,193,2,192,87, +94,23,193,1,248,22,160,13,23,197,2,11,12,250,22,130,9,76,110,111,114, 109,97,108,45,112,97,116,104,45,99,97,115,101,6,42,42,112,97,116,104,32, 40,102,111,114,32,97,110,121,32,115,121,115,116,101,109,41,32,111,114,32,118, 97,108,105,100,45,112,97,116,104,32,115,116,114,105,110,103,23,197,2,28,28, -248,22,137,13,23,195,2,249,22,162,8,248,22,138,13,23,197,2,2,20,249, +248,22,138,13,23,195,2,249,22,162,8,248,22,139,13,23,197,2,2,20,249, 22,162,8,247,22,176,7,2,20,27,28,248,22,157,6,23,196,2,23,195,2, -248,22,166,7,248,22,141,13,23,197,2,28,249,22,188,13,0,21,35,114,120, +248,22,166,7,248,22,142,13,23,197,2,28,249,22,189,13,0,21,35,114,120, 34,94,91,92,92,93,91,92,92,93,91,63,93,91,92,92,93,34,23,195,2, -28,248,22,157,6,195,248,22,144,13,195,194,27,248,22,132,7,23,195,1,249, -22,145,13,248,22,169,7,250,22,130,14,0,6,35,114,120,34,47,34,28,249, -22,188,13,0,22,35,114,120,34,91,47,92,92,93,91,46,32,93,43,91,47, -92,92,93,42,36,34,23,201,2,23,199,1,250,22,130,14,0,19,35,114,120, +28,248,22,157,6,195,248,22,145,13,195,194,27,248,22,132,7,23,195,1,249, +22,146,13,248,22,169,7,250,22,131,14,0,6,35,114,120,34,47,34,28,249, +22,189,13,0,22,35,114,120,34,91,47,92,92,93,91,46,32,93,43,91,47, +92,92,93,42,36,34,23,201,2,23,199,1,250,22,131,14,0,19,35,114,120, 34,91,32,46,93,43,40,91,47,92,92,93,42,41,36,34,23,202,1,6,2, -2,92,49,80,158,43,36,2,20,28,248,22,157,6,194,248,22,144,13,194,193, -87,94,28,27,248,22,136,13,23,196,2,28,23,193,2,192,87,94,23,193,1, -28,248,22,157,6,23,196,2,27,248,22,158,13,23,197,2,28,23,193,2,192, -87,94,23,193,1,248,22,159,13,23,197,2,11,12,250,22,129,9,23,196,2, -2,21,23,197,2,28,248,22,158,13,23,195,2,12,248,22,155,11,249,22,164, +2,92,49,80,159,43,36,37,2,20,28,248,22,157,6,194,248,22,145,13,194, +193,87,94,28,27,248,22,137,13,23,196,2,28,23,193,2,192,87,94,23,193, +1,28,248,22,157,6,23,196,2,27,248,22,159,13,23,197,2,28,23,193,2, +192,87,94,23,193,1,248,22,160,13,23,197,2,11,12,250,22,130,9,23,196, +2,2,21,23,197,2,28,248,22,159,13,23,195,2,12,248,22,156,11,249,22, +165,10,248,22,186,6,250,22,141,7,2,22,23,200,1,23,201,1,247,22,23, +87,94,28,27,248,22,137,13,23,196,2,28,23,193,2,192,87,94,23,193,1, +28,248,22,157,6,23,196,2,27,248,22,159,13,23,197,2,28,23,193,2,192, +87,94,23,193,1,248,22,160,13,23,197,2,11,12,250,22,130,9,23,196,2, +2,21,23,197,2,28,248,22,159,13,23,195,2,12,248,22,156,11,249,22,165, 10,248,22,186,6,250,22,141,7,2,22,23,200,1,23,201,1,247,22,23,87, -94,28,27,248,22,136,13,23,196,2,28,23,193,2,192,87,94,23,193,1,28, -248,22,157,6,23,196,2,27,248,22,158,13,23,197,2,28,23,193,2,192,87, -94,23,193,1,248,22,159,13,23,197,2,11,12,250,22,129,9,23,196,2,2, -21,23,197,2,28,248,22,158,13,23,195,2,12,248,22,155,11,249,22,164,10, -248,22,186,6,250,22,141,7,2,22,23,200,1,23,201,1,247,22,23,87,94, -87,94,28,27,248,22,136,13,23,196,2,28,23,193,2,192,87,94,23,193,1, -28,248,22,157,6,23,196,2,27,248,22,158,13,23,197,2,28,23,193,2,192, -87,94,23,193,1,248,22,159,13,23,197,2,11,12,250,22,129,9,195,2,21, -23,197,2,28,248,22,158,13,23,195,2,12,248,22,155,11,249,22,164,10,248, -22,186,6,250,22,141,7,2,22,199,23,201,1,247,22,23,249,22,3,89,162, -8,44,36,49,9,223,2,33,33,196,248,22,155,11,249,22,130,11,23,196,1, -247,22,23,87,94,250,80,159,38,39,36,2,6,196,197,251,80,159,39,41,36, -2,6,32,0,89,162,8,44,36,44,9,222,33,35,197,198,32,37,89,162,43, -41,58,65,99,108,111,111,112,222,33,38,28,248,22,72,23,199,2,87,94,23, -198,1,248,23,196,1,251,22,141,7,2,23,23,199,1,28,248,22,72,23,203, -2,87,94,23,202,1,23,201,1,250,22,1,22,154,13,23,204,1,23,205,1, -23,198,1,27,249,22,154,13,248,22,65,23,202,2,23,199,2,28,248,22,149, -13,23,194,2,27,250,22,1,22,154,13,23,197,1,23,202,2,28,248,22,149, -13,23,194,2,192,87,94,23,193,1,27,248,22,66,23,202,1,28,248,22,72, -23,194,2,87,94,23,193,1,248,23,199,1,251,22,141,7,2,23,23,202,1, -28,248,22,72,23,206,2,87,94,23,205,1,23,204,1,250,22,1,22,154,13, -23,207,1,23,208,1,23,201,1,27,249,22,154,13,248,22,65,23,197,2,23, -202,2,28,248,22,149,13,23,194,2,27,250,22,1,22,154,13,23,197,1,204, -28,248,22,149,13,193,192,253,2,37,203,204,205,206,23,15,248,22,66,201,253, -2,37,202,203,204,205,206,248,22,66,200,87,94,23,193,1,27,248,22,66,23, -201,1,28,248,22,72,23,194,2,87,94,23,193,1,248,23,198,1,251,22,141, -7,2,23,23,201,1,28,248,22,72,23,205,2,87,94,23,204,1,23,203,1, -250,22,1,22,154,13,23,206,1,23,207,1,23,200,1,27,249,22,154,13,248, -22,65,23,197,2,23,201,2,28,248,22,149,13,23,194,2,27,250,22,1,22, -154,13,23,197,1,203,28,248,22,149,13,193,192,253,2,37,202,203,204,205,206, -248,22,66,201,253,2,37,201,202,203,204,205,248,22,66,200,27,247,22,177,13, -253,2,37,198,199,200,201,202,198,87,95,28,28,248,22,137,13,23,194,2,10, -27,248,22,136,13,23,195,2,28,23,193,2,192,87,94,23,193,1,28,248,22, -157,6,23,195,2,27,248,22,158,13,23,196,2,28,23,193,2,192,87,94,23, -193,1,248,22,159,13,23,196,2,11,12,252,22,129,9,23,200,2,2,24,35, -23,198,2,23,199,2,28,28,248,22,157,6,23,195,2,10,248,22,145,7,23, -195,2,87,94,23,194,1,12,252,22,129,9,23,200,2,2,25,36,23,198,2, -23,199,1,91,159,38,11,90,161,38,35,11,248,22,157,13,23,197,2,87,94, -23,195,1,87,94,28,192,12,250,22,130,9,23,201,1,2,26,23,199,1,249, -22,7,194,195,91,159,37,11,90,161,37,35,11,87,95,28,28,248,22,137,13, -23,196,2,10,27,248,22,136,13,23,197,2,28,23,193,2,192,87,94,23,193, -1,28,248,22,157,6,23,197,2,27,248,22,158,13,23,198,2,28,23,193,2, -192,87,94,23,193,1,248,22,159,13,23,198,2,11,12,252,22,129,9,2,9, -2,24,35,23,200,2,23,201,2,28,28,248,22,157,6,23,197,2,10,248,22, -145,7,23,197,2,12,252,22,129,9,2,9,2,25,36,23,200,2,23,201,2, -91,159,38,11,90,161,38,35,11,248,22,157,13,23,199,2,87,94,23,195,1, -87,94,28,192,12,250,22,130,9,2,9,2,26,23,201,2,249,22,7,194,195, -27,249,22,146,13,250,22,129,14,0,18,35,114,120,35,34,40,91,46,93,91, -94,46,93,42,124,41,36,34,248,22,142,13,23,201,1,28,248,22,157,6,23, -203,2,249,22,169,7,23,204,1,8,63,23,202,1,28,248,22,137,13,23,199, -2,248,22,138,13,23,199,1,87,94,23,198,1,247,22,139,13,28,248,22,136, -13,194,249,22,154,13,195,194,192,91,159,37,11,90,161,37,35,11,87,95,28, -28,248,22,137,13,23,196,2,10,27,248,22,136,13,23,197,2,28,23,193,2, -192,87,94,23,193,1,28,248,22,157,6,23,197,2,27,248,22,158,13,23,198, -2,28,23,193,2,192,87,94,23,193,1,248,22,159,13,23,198,2,11,12,252, -22,129,9,2,10,2,24,35,23,200,2,23,201,2,28,28,248,22,157,6,23, -197,2,10,248,22,145,7,23,197,2,12,252,22,129,9,2,10,2,25,36,23, -200,2,23,201,2,91,159,38,11,90,161,38,35,11,248,22,157,13,23,199,2, -87,94,23,195,1,87,94,28,192,12,250,22,130,9,2,10,2,26,23,201,2, -249,22,7,194,195,27,249,22,146,13,249,22,155,7,250,22,130,14,0,9,35, -114,120,35,34,91,46,93,34,248,22,142,13,23,203,1,6,1,1,95,28,248, -22,157,6,23,202,2,249,22,169,7,23,203,1,8,63,23,201,1,28,248,22, -137,13,23,199,2,248,22,138,13,23,199,1,87,94,23,198,1,247,22,139,13, -28,248,22,136,13,194,249,22,154,13,195,194,192,249,247,22,188,4,194,11,249, -80,158,37,46,9,9,249,80,158,37,46,195,9,27,247,22,179,13,249,80,158, -38,47,28,23,195,2,27,248,22,174,7,6,11,11,80,76,84,67,79,76,76, -69,67,84,83,28,192,192,6,0,0,6,0,0,27,28,23,196,1,250,22,154, -13,248,22,175,13,69,97,100,100,111,110,45,100,105,114,247,22,172,7,6,8, -8,99,111,108,108,101,99,116,115,11,27,248,80,159,41,52,36,250,22,78,23, -203,1,248,22,74,248,22,175,13,72,99,111,108,108,101,99,116,115,45,100,105, -114,23,204,1,28,23,194,2,249,22,64,23,196,1,23,195,1,192,32,47,89, -162,8,44,38,54,2,18,222,33,48,27,249,22,186,13,23,197,2,23,198,2, -28,23,193,2,87,94,23,196,1,27,248,22,89,23,195,2,27,27,248,22,98, -23,197,1,27,249,22,186,13,23,201,2,23,196,2,28,23,193,2,87,94,23, -194,1,27,248,22,89,23,195,2,27,250,2,47,23,203,2,23,204,1,248,22, -98,23,199,1,28,249,22,151,7,23,196,2,2,27,249,22,78,23,202,2,194, -249,22,64,248,22,145,13,23,197,1,23,195,1,87,95,23,199,1,23,193,1, -28,249,22,151,7,23,196,2,2,27,249,22,78,23,200,2,9,249,22,64,248, -22,145,13,23,197,1,9,28,249,22,151,7,23,196,2,2,27,249,22,78,197, -194,87,94,23,196,1,249,22,64,248,22,145,13,23,197,1,194,87,94,23,193, -1,28,249,22,151,7,23,198,2,2,27,249,22,78,195,9,87,94,23,194,1, -249,22,64,248,22,145,13,23,199,1,9,87,95,28,28,248,22,145,7,194,10, -248,22,157,6,194,12,250,22,129,9,2,13,6,21,21,98,121,116,101,32,115, -116,114,105,110,103,32,111,114,32,115,116,114,105,110,103,196,28,28,248,22,73, -195,249,22,4,22,136,13,196,11,12,250,22,129,9,2,13,6,13,13,108,105, -115,116,32,111,102,32,112,97,116,104,115,197,250,2,47,197,195,28,248,22,157, -6,197,248,22,168,7,197,196,32,50,89,162,8,44,39,57,2,18,222,33,53, -32,51,89,162,8,44,38,54,70,102,111,117,110,100,45,101,120,101,99,222,33, -52,28,23,193,2,91,159,38,11,90,161,38,35,11,248,22,157,13,23,199,2, -87,95,23,195,1,23,194,1,27,28,23,198,2,27,248,22,162,13,23,201,2, -28,249,22,164,8,23,195,2,23,202,2,11,28,248,22,158,13,23,194,2,250, -2,51,23,201,2,23,202,2,249,22,154,13,23,200,2,23,198,1,250,2,51, -23,201,2,23,202,2,23,196,1,11,28,23,193,2,192,87,94,23,193,1,27, -28,248,22,136,13,23,196,2,27,249,22,154,13,23,198,2,23,201,2,28,28, -248,22,149,13,193,10,248,22,148,13,193,192,11,11,28,23,193,2,192,87,94, -23,193,1,28,23,199,2,11,27,248,22,162,13,23,202,2,28,249,22,164,8, -23,195,2,23,203,1,11,28,248,22,158,13,23,194,2,250,2,51,23,202,1, -23,203,1,249,22,154,13,23,201,1,23,198,1,250,2,51,201,202,195,194,28, -248,22,72,23,197,2,11,27,248,22,161,13,248,22,65,23,199,2,27,249,22, -154,13,23,196,1,23,197,2,28,248,22,148,13,23,194,2,250,2,51,198,199, -195,87,94,23,193,1,27,248,22,66,23,200,1,28,248,22,72,23,194,2,11, -27,248,22,161,13,248,22,65,23,196,2,27,249,22,154,13,23,196,1,23,200, -2,28,248,22,148,13,23,194,2,250,2,51,201,202,195,87,94,23,193,1,27, -248,22,66,23,197,1,28,248,22,72,23,194,2,11,27,248,22,161,13,248,22, -65,195,27,249,22,154,13,23,196,1,202,28,248,22,148,13,193,250,2,51,204, -205,195,251,2,50,204,205,206,248,22,66,199,87,95,28,27,248,22,136,13,23, -196,2,28,23,193,2,192,87,94,23,193,1,28,248,22,157,6,23,196,2,27, -248,22,158,13,23,197,2,28,23,193,2,192,87,94,23,193,1,248,22,159,13, -23,197,2,11,12,250,22,129,9,2,14,6,25,25,112,97,116,104,32,111,114, -32,115,116,114,105,110,103,32,40,115,97,110,115,32,110,117,108,41,23,197,2, -28,28,23,195,2,28,27,248,22,136,13,23,197,2,28,23,193,2,192,87,94, -23,193,1,28,248,22,157,6,23,197,2,27,248,22,158,13,23,198,2,28,23, -193,2,192,87,94,23,193,1,248,22,159,13,23,198,2,11,248,22,158,13,23, -196,2,11,10,12,250,22,129,9,2,14,6,29,29,35,102,32,111,114,32,114, -101,108,97,116,105,118,101,32,112,97,116,104,32,111,114,32,115,116,114,105,110, -103,23,198,2,28,28,248,22,158,13,23,195,2,91,159,38,11,90,161,38,35, -11,248,22,157,13,23,198,2,249,22,162,8,194,68,114,101,108,97,116,105,118, -101,11,27,248,22,174,7,6,4,4,80,65,84,72,251,2,50,23,199,1,23, -200,1,23,201,1,28,23,197,2,27,249,80,158,43,47,23,200,1,9,28,249, -22,162,8,247,22,176,7,2,20,249,22,64,248,22,145,13,5,1,46,23,195, -1,192,9,27,248,22,161,13,23,196,1,28,248,22,148,13,193,250,2,51,198, -199,195,11,250,80,158,38,48,196,197,11,250,80,158,38,48,196,11,11,87,94, -249,22,148,6,247,22,184,4,195,248,22,174,5,249,22,170,3,35,249,22,154, -3,197,198,27,28,23,197,2,87,95,23,196,1,23,195,1,23,197,1,87,94, -23,197,1,27,248,22,175,13,2,19,27,249,80,158,40,48,23,196,1,11,27, -27,248,22,173,3,23,200,1,28,192,192,35,27,27,248,22,173,3,23,202,1, -28,192,192,35,249,22,151,5,23,197,1,83,158,39,20,97,95,89,162,8,44, -35,47,9,224,3,2,33,57,23,195,1,23,196,1,27,248,22,136,5,23,195, -1,248,80,159,38,53,36,193,159,35,20,103,159,35,16,1,11,16,0,83,158, -41,20,100,143,67,35,37,117,116,105,108,115,29,11,11,11,11,10,10,42,80, -158,35,35,20,103,159,37,16,17,2,1,2,2,2,3,2,4,2,5,2,6, -2,7,2,8,2,9,2,10,2,11,2,12,2,13,2,14,2,15,30,2,17, -1,20,112,97,114,97,109,101,116,101,114,105,122,97,116,105,111,110,45,107,101, -121,4,30,2,17,1,23,101,120,116,101,110,100,45,112,97,114,97,109,101,116, -101,114,105,122,97,116,105,111,110,3,16,0,11,11,16,0,35,16,0,35,16, -4,2,5,2,4,2,2,2,8,39,11,11,38,35,11,11,16,11,2,7,2, -6,2,15,2,14,2,12,2,11,2,3,2,10,2,13,2,9,2,1,16,11, -11,11,11,11,11,11,11,11,11,11,11,16,11,2,7,2,6,2,15,2,14, -2,12,2,11,2,3,2,10,2,13,2,9,2,1,46,46,36,11,11,16,0, -16,0,16,0,35,35,11,11,11,16,0,16,0,16,0,35,35,16,0,16,17, -83,158,35,16,2,89,162,43,36,48,2,18,223,0,33,28,80,159,35,53,36, -83,158,35,16,2,89,162,8,44,36,55,2,18,223,0,33,29,80,159,35,52, -36,83,158,35,16,2,32,0,89,162,43,36,44,2,1,222,33,30,80,159,35, -35,36,83,158,35,16,2,249,22,159,6,7,92,7,92,80,159,35,36,36,83, -158,35,16,2,89,162,43,36,53,2,3,223,0,33,31,80,159,35,37,36,83, -158,35,16,2,32,0,89,162,8,44,37,49,2,4,222,33,32,80,159,35,38, -36,83,158,35,16,2,32,0,89,162,8,44,38,50,2,5,222,33,34,80,159, -35,39,36,83,158,35,16,2,89,162,8,45,37,47,2,6,223,0,33,36,80, -159,35,40,36,83,158,35,16,2,32,0,89,162,43,39,51,2,7,222,33,39, -80,159,35,41,36,83,158,35,16,2,32,0,89,162,43,38,49,2,8,222,33, -40,80,159,35,42,36,83,158,35,16,2,32,0,89,162,43,37,52,2,9,222, -33,41,80,159,35,43,36,83,158,35,16,2,32,0,89,162,43,37,53,2,10, -222,33,42,80,159,35,44,36,83,158,35,16,2,32,0,89,162,43,36,43,2, -11,222,33,43,80,159,35,45,36,83,158,35,16,2,83,158,38,20,96,96,2, -12,89,162,43,35,43,9,223,0,33,44,89,162,43,36,44,9,223,0,33,45, -89,162,43,37,54,9,223,0,33,46,80,159,35,46,36,83,158,35,16,2,27, -248,22,182,13,248,22,168,7,27,28,249,22,162,8,247,22,176,7,2,20,6, -1,1,59,6,1,1,58,250,22,141,7,6,14,14,40,91,94,126,97,93,42, -41,126,97,40,46,42,41,23,196,2,23,196,1,89,162,8,44,37,47,2,13, -223,0,33,49,80,159,35,47,36,83,158,35,16,2,83,158,38,20,96,96,2, -14,89,162,8,44,38,53,9,223,0,33,54,89,162,43,37,46,9,223,0,33, -55,89,162,43,36,45,9,223,0,33,56,80,159,35,48,36,83,158,35,16,2, -89,162,43,38,51,2,15,223,0,33,58,80,159,35,49,36,94,29,94,2,16, -68,35,37,107,101,114,110,101,108,11,29,94,2,16,69,35,37,109,105,110,45, -115,116,120,11,9,9,9,35,0}; - EVAL_ONE_SIZED_STR((char *)expr, 5006); +94,87,94,28,27,248,22,137,13,23,196,2,28,23,193,2,192,87,94,23,193, +1,28,248,22,157,6,23,196,2,27,248,22,159,13,23,197,2,28,23,193,2, +192,87,94,23,193,1,248,22,160,13,23,197,2,11,12,250,22,130,9,195,2, +21,23,197,2,28,248,22,159,13,23,195,2,12,248,22,156,11,249,22,165,10, +248,22,186,6,250,22,141,7,2,22,199,23,201,1,247,22,23,249,22,3,89, +162,8,44,36,49,9,223,2,33,33,196,248,22,156,11,249,22,131,11,23,196, +1,247,22,23,87,94,250,80,159,38,39,36,2,6,196,197,251,80,159,39,41, +36,2,6,32,0,89,162,8,44,36,44,9,222,33,35,197,198,32,37,89,162, +43,41,58,65,99,108,111,111,112,222,33,38,28,248,22,72,23,199,2,87,94, +23,198,1,248,23,196,1,251,22,141,7,2,23,23,199,1,28,248,22,72,23, +203,2,87,94,23,202,1,23,201,1,250,22,1,22,155,13,23,204,1,23,205, +1,23,198,1,27,249,22,155,13,248,22,65,23,202,2,23,199,2,28,248,22, +150,13,23,194,2,27,250,22,1,22,155,13,23,197,1,23,202,2,28,248,22, +150,13,23,194,2,192,87,94,23,193,1,27,248,22,66,23,202,1,28,248,22, +72,23,194,2,87,94,23,193,1,248,23,199,1,251,22,141,7,2,23,23,202, +1,28,248,22,72,23,206,2,87,94,23,205,1,23,204,1,250,22,1,22,155, +13,23,207,1,23,208,1,23,201,1,27,249,22,155,13,248,22,65,23,197,2, +23,202,2,28,248,22,150,13,23,194,2,27,250,22,1,22,155,13,23,197,1, +204,28,248,22,150,13,193,192,253,2,37,203,204,205,206,23,15,248,22,66,201, +253,2,37,202,203,204,205,206,248,22,66,200,87,94,23,193,1,27,248,22,66, +23,201,1,28,248,22,72,23,194,2,87,94,23,193,1,248,23,198,1,251,22, +141,7,2,23,23,201,1,28,248,22,72,23,205,2,87,94,23,204,1,23,203, +1,250,22,1,22,155,13,23,206,1,23,207,1,23,200,1,27,249,22,155,13, +248,22,65,23,197,2,23,201,2,28,248,22,150,13,23,194,2,27,250,22,1, +22,155,13,23,197,1,203,28,248,22,150,13,193,192,253,2,37,202,203,204,205, +206,248,22,66,201,253,2,37,201,202,203,204,205,248,22,66,200,27,247,22,178, +13,253,2,37,198,199,200,201,202,198,87,95,28,28,248,22,138,13,23,194,2, +10,27,248,22,137,13,23,195,2,28,23,193,2,192,87,94,23,193,1,28,248, +22,157,6,23,195,2,27,248,22,159,13,23,196,2,28,23,193,2,192,87,94, +23,193,1,248,22,160,13,23,196,2,11,12,252,22,130,9,23,200,2,2,24, +35,23,198,2,23,199,2,28,28,248,22,157,6,23,195,2,10,248,22,145,7, +23,195,2,87,94,23,194,1,12,252,22,130,9,23,200,2,2,25,36,23,198, +2,23,199,1,91,159,38,11,90,161,38,35,11,248,22,158,13,23,197,2,87, +94,23,195,1,87,94,28,192,12,250,22,131,9,23,201,1,2,26,23,199,1, +249,22,7,194,195,91,159,37,11,90,161,37,35,11,87,95,28,28,248,22,138, +13,23,196,2,10,27,248,22,137,13,23,197,2,28,23,193,2,192,87,94,23, +193,1,28,248,22,157,6,23,197,2,27,248,22,159,13,23,198,2,28,23,193, +2,192,87,94,23,193,1,248,22,160,13,23,198,2,11,12,252,22,130,9,2, +9,2,24,35,23,200,2,23,201,2,28,28,248,22,157,6,23,197,2,10,248, +22,145,7,23,197,2,12,252,22,130,9,2,9,2,25,36,23,200,2,23,201, +2,91,159,38,11,90,161,38,35,11,248,22,158,13,23,199,2,87,94,23,195, +1,87,94,28,192,12,250,22,131,9,2,9,2,26,23,201,2,249,22,7,194, +195,27,249,22,147,13,250,22,130,14,0,18,35,114,120,35,34,40,91,46,93, +91,94,46,93,42,124,41,36,34,248,22,143,13,23,201,1,28,248,22,157,6, +23,203,2,249,22,169,7,23,204,1,8,63,23,202,1,28,248,22,138,13,23, +199,2,248,22,139,13,23,199,1,87,94,23,198,1,247,22,140,13,28,248,22, +137,13,194,249,22,155,13,195,194,192,91,159,37,11,90,161,37,35,11,87,95, +28,28,248,22,138,13,23,196,2,10,27,248,22,137,13,23,197,2,28,23,193, +2,192,87,94,23,193,1,28,248,22,157,6,23,197,2,27,248,22,159,13,23, +198,2,28,23,193,2,192,87,94,23,193,1,248,22,160,13,23,198,2,11,12, +252,22,130,9,2,10,2,24,35,23,200,2,23,201,2,28,28,248,22,157,6, +23,197,2,10,248,22,145,7,23,197,2,12,252,22,130,9,2,10,2,25,36, +23,200,2,23,201,2,91,159,38,11,90,161,38,35,11,248,22,158,13,23,199, +2,87,94,23,195,1,87,94,28,192,12,250,22,131,9,2,10,2,26,23,201, +2,249,22,7,194,195,27,249,22,147,13,249,22,155,7,250,22,131,14,0,9, +35,114,120,35,34,91,46,93,34,248,22,143,13,23,203,1,6,1,1,95,28, +248,22,157,6,23,202,2,249,22,169,7,23,203,1,8,63,23,201,1,28,248, +22,138,13,23,199,2,248,22,139,13,23,199,1,87,94,23,198,1,247,22,140, +13,28,248,22,137,13,194,249,22,155,13,195,194,192,249,247,22,188,4,194,11, +249,80,158,37,46,9,9,249,80,158,37,46,195,9,27,247,22,180,13,249,80, +158,38,47,28,23,195,2,27,248,22,174,7,6,11,11,80,76,84,67,79,76, +76,69,67,84,83,28,192,192,6,0,0,6,0,0,27,28,23,196,1,250,22, +155,13,248,22,176,13,69,97,100,100,111,110,45,100,105,114,247,22,172,7,6, +8,8,99,111,108,108,101,99,116,115,11,27,248,80,159,41,52,36,250,22,78, +23,203,1,248,22,74,248,22,176,13,72,99,111,108,108,101,99,116,115,45,100, +105,114,23,204,1,28,23,194,2,249,22,64,23,196,1,23,195,1,192,32,47, +89,162,8,44,38,54,2,18,222,33,48,27,249,22,187,13,23,197,2,23,198, +2,28,23,193,2,87,94,23,196,1,27,248,22,89,23,195,2,27,27,248,22, +98,23,197,1,27,249,22,187,13,23,201,2,23,196,2,28,23,193,2,87,94, +23,194,1,27,248,22,89,23,195,2,27,250,2,47,23,203,2,23,204,1,248, +22,98,23,199,1,28,249,22,151,7,23,196,2,2,27,249,22,78,23,202,2, +194,249,22,64,248,22,146,13,23,197,1,23,195,1,87,95,23,199,1,23,193, +1,28,249,22,151,7,23,196,2,2,27,249,22,78,23,200,2,9,249,22,64, +248,22,146,13,23,197,1,9,28,249,22,151,7,23,196,2,2,27,249,22,78, +197,194,87,94,23,196,1,249,22,64,248,22,146,13,23,197,1,194,87,94,23, +193,1,28,249,22,151,7,23,198,2,2,27,249,22,78,195,9,87,94,23,194, +1,249,22,64,248,22,146,13,23,199,1,9,87,95,28,28,248,22,145,7,194, +10,248,22,157,6,194,12,250,22,130,9,2,13,6,21,21,98,121,116,101,32, +115,116,114,105,110,103,32,111,114,32,115,116,114,105,110,103,196,28,28,248,22, +73,195,249,22,4,22,137,13,196,11,12,250,22,130,9,2,13,6,13,13,108, +105,115,116,32,111,102,32,112,97,116,104,115,197,250,2,47,197,195,28,248,22, +157,6,197,248,22,168,7,197,196,32,50,89,162,8,44,39,57,2,18,222,33, +53,32,51,89,162,8,44,38,54,70,102,111,117,110,100,45,101,120,101,99,222, +33,52,28,23,193,2,91,159,38,11,90,161,38,35,11,248,22,158,13,23,199, +2,87,95,23,195,1,23,194,1,27,28,23,198,2,27,248,22,163,13,23,201, +2,28,249,22,164,8,23,195,2,23,202,2,11,28,248,22,159,13,23,194,2, +250,2,51,23,201,2,23,202,2,249,22,155,13,23,200,2,23,198,1,250,2, +51,23,201,2,23,202,2,23,196,1,11,28,23,193,2,192,87,94,23,193,1, +27,28,248,22,137,13,23,196,2,27,249,22,155,13,23,198,2,23,201,2,28, +28,248,22,150,13,193,10,248,22,149,13,193,192,11,11,28,23,193,2,192,87, +94,23,193,1,28,23,199,2,11,27,248,22,163,13,23,202,2,28,249,22,164, +8,23,195,2,23,203,1,11,28,248,22,159,13,23,194,2,250,2,51,23,202, +1,23,203,1,249,22,155,13,23,201,1,23,198,1,250,2,51,201,202,195,194, +28,248,22,72,23,197,2,11,27,248,22,162,13,248,22,65,23,199,2,27,249, +22,155,13,23,196,1,23,197,2,28,248,22,149,13,23,194,2,250,2,51,198, +199,195,87,94,23,193,1,27,248,22,66,23,200,1,28,248,22,72,23,194,2, +11,27,248,22,162,13,248,22,65,23,196,2,27,249,22,155,13,23,196,1,23, +200,2,28,248,22,149,13,23,194,2,250,2,51,201,202,195,87,94,23,193,1, +27,248,22,66,23,197,1,28,248,22,72,23,194,2,11,27,248,22,162,13,248, +22,65,195,27,249,22,155,13,23,196,1,202,28,248,22,149,13,193,250,2,51, +204,205,195,251,2,50,204,205,206,248,22,66,199,87,95,28,27,248,22,137,13, +23,196,2,28,23,193,2,192,87,94,23,193,1,28,248,22,157,6,23,196,2, +27,248,22,159,13,23,197,2,28,23,193,2,192,87,94,23,193,1,248,22,160, +13,23,197,2,11,12,250,22,130,9,2,14,6,25,25,112,97,116,104,32,111, +114,32,115,116,114,105,110,103,32,40,115,97,110,115,32,110,117,108,41,23,197, +2,28,28,23,195,2,28,27,248,22,137,13,23,197,2,28,23,193,2,192,87, +94,23,193,1,28,248,22,157,6,23,197,2,27,248,22,159,13,23,198,2,28, +23,193,2,192,87,94,23,193,1,248,22,160,13,23,198,2,11,248,22,159,13, +23,196,2,11,10,12,250,22,130,9,2,14,6,29,29,35,102,32,111,114,32, +114,101,108,97,116,105,118,101,32,112,97,116,104,32,111,114,32,115,116,114,105, +110,103,23,198,2,28,28,248,22,159,13,23,195,2,91,159,38,11,90,161,38, +35,11,248,22,158,13,23,198,2,249,22,162,8,194,68,114,101,108,97,116,105, +118,101,11,27,248,22,174,7,6,4,4,80,65,84,72,251,2,50,23,199,1, +23,200,1,23,201,1,28,23,197,2,27,249,80,159,43,47,37,23,200,1,9, +28,249,22,162,8,247,22,176,7,2,20,249,22,64,248,22,146,13,5,1,46, +23,195,1,192,9,27,248,22,162,13,23,196,1,28,248,22,149,13,193,250,2, +51,198,199,195,11,250,80,158,38,48,196,197,11,250,80,158,38,48,196,11,11, +87,94,249,22,148,6,247,22,184,4,195,248,22,174,5,249,22,170,3,35,249, +22,154,3,197,198,27,28,23,197,2,87,95,23,196,1,23,195,1,23,197,1, +87,94,23,197,1,27,248,22,176,13,2,19,27,249,80,159,40,48,37,23,196, +1,11,27,27,248,22,173,3,23,200,1,28,192,192,35,27,27,248,22,173,3, +23,202,1,28,192,192,35,249,22,151,5,23,197,1,83,158,39,20,97,95,89, +162,8,44,35,47,9,224,3,2,33,57,23,195,1,23,196,1,27,248,22,136, +5,23,195,1,248,80,159,38,53,36,193,159,35,20,103,159,35,16,1,11,16, +0,83,158,41,20,100,143,67,35,37,117,116,105,108,115,29,11,11,11,11,10, +10,42,80,158,35,35,20,103,159,37,16,17,2,1,2,2,2,3,2,4,2, +5,2,6,2,7,2,8,2,9,2,10,2,11,2,12,2,13,2,14,2,15, +30,2,17,1,20,112,97,114,97,109,101,116,101,114,105,122,97,116,105,111,110, +45,107,101,121,4,30,2,17,1,23,101,120,116,101,110,100,45,112,97,114,97, +109,101,116,101,114,105,122,97,116,105,111,110,3,16,0,11,11,16,0,35,16, +0,35,16,4,2,5,2,4,2,2,2,8,39,11,11,38,35,11,11,16,11, +2,7,2,6,2,15,2,14,2,12,2,11,2,3,2,10,2,13,2,9,2, +1,16,11,11,11,11,11,11,11,11,11,11,11,11,16,11,2,7,2,6,2, +15,2,14,2,12,2,11,2,3,2,10,2,13,2,9,2,1,46,46,36,11, +11,16,0,16,0,16,0,35,35,11,11,11,16,0,16,0,16,0,35,35,16, +0,16,17,83,158,35,16,2,89,162,43,36,48,2,18,223,0,33,28,80,159, +35,53,36,83,158,35,16,2,89,162,8,44,36,55,2,18,223,0,33,29,80, +159,35,52,36,83,158,35,16,2,32,0,89,162,43,36,44,2,1,222,33,30, +80,159,35,35,36,83,158,35,16,2,249,22,159,6,7,92,7,92,80,159,35, +36,36,83,158,35,16,2,89,162,43,36,53,2,3,223,0,33,31,80,159,35, +37,36,83,158,35,16,2,32,0,89,162,8,44,37,49,2,4,222,33,32,80, +159,35,38,36,83,158,35,16,2,32,0,89,162,8,44,38,50,2,5,222,33, +34,80,159,35,39,36,83,158,35,16,2,89,162,8,45,37,47,2,6,223,0, +33,36,80,159,35,40,36,83,158,35,16,2,32,0,89,162,43,39,51,2,7, +222,33,39,80,159,35,41,36,83,158,35,16,2,32,0,89,162,43,38,49,2, +8,222,33,40,80,159,35,42,36,83,158,35,16,2,32,0,89,162,43,37,52, +2,9,222,33,41,80,159,35,43,36,83,158,35,16,2,32,0,89,162,43,37, +53,2,10,222,33,42,80,159,35,44,36,83,158,35,16,2,32,0,89,162,43, +36,43,2,11,222,33,43,80,159,35,45,36,83,158,35,16,2,83,158,38,20, +96,96,2,12,89,162,43,35,43,9,223,0,33,44,89,162,43,36,44,9,223, +0,33,45,89,162,43,37,54,9,223,0,33,46,80,159,35,46,36,83,158,35, +16,2,27,248,22,183,13,248,22,168,7,27,28,249,22,162,8,247,22,176,7, +2,20,6,1,1,59,6,1,1,58,250,22,141,7,6,14,14,40,91,94,126, +97,93,42,41,126,97,40,46,42,41,23,196,2,23,196,1,89,162,8,44,37, +47,2,13,223,0,33,49,80,159,35,47,36,83,158,35,16,2,83,158,38,20, +96,96,2,14,89,162,8,44,38,53,9,223,0,33,54,89,162,43,37,46,9, +223,0,33,55,89,162,43,36,45,9,223,0,33,56,80,159,35,48,36,83,158, +35,16,2,89,162,43,38,51,2,15,223,0,33,58,80,159,35,49,36,94,29, +94,2,16,68,35,37,107,101,114,110,101,108,11,29,94,2,16,69,35,37,109, +105,110,45,115,116,120,11,9,9,9,35,0}; + EVAL_ONE_SIZED_STR((char *)expr, 5009); } { - static MZCOMPILED_STRING_FAR unsigned char expr[] = {35,126,7,52,46,49,46,51,46,54,8,0,0,0,1,0,0,6,0,19,0, + static MZCOMPILED_STRING_FAR unsigned char expr[] = {35,126,7,52,46,49,46,51,46,55,8,0,0,0,1,0,0,6,0,19,0, 34,0,48,0,62,0,76,0,111,0,0,0,1,1,0,0,65,113,117,111,116, 101,29,94,2,1,67,35,37,117,116,105,108,115,11,29,94,2,1,69,35,37, 110,101,116,119,111,114,107,11,29,94,2,1,68,35,37,112,97,114,97,109,122, @@ -360,12 +360,12 @@ EVAL_ONE_SIZED_STR((char *)expr, 294); } { - static MZCOMPILED_STRING_FAR unsigned char expr[] = {35,126,7,52,46,49,46,51,46,54,52,0,0,0,1,0,0,11,0,38,0, + static MZCOMPILED_STRING_FAR unsigned char expr[] = {35,126,7,52,46,49,46,51,46,55,52,0,0,0,1,0,0,11,0,38,0, 44,0,57,0,71,0,93,0,119,0,131,0,149,0,169,0,181,0,197,0,220, -0,0,1,5,1,10,1,15,1,24,1,29,1,60,1,64,1,72,1,80,1, -88,1,191,1,236,1,0,2,28,2,59,2,114,2,124,2,171,2,181,2,188, -2,75,4,88,4,107,4,226,4,238,4,134,5,148,5,12,6,18,6,32,6, -59,6,144,6,146,6,211,6,146,12,205,12,237,12,0,0,116,15,0,0,70, +0,0,1,5,1,10,1,15,1,24,1,29,1,60,1,64,1,72,1,81,1, +89,1,196,1,241,1,5,2,34,2,65,2,121,2,131,2,178,2,188,2,195, +2,82,4,95,4,114,4,233,4,245,4,141,5,155,5,21,6,27,6,41,6, +68,6,153,6,155,6,221,6,166,12,225,12,3,13,0,0,138,15,0,0,70, 100,108,108,45,115,117,102,102,105,120,1,25,100,101,102,97,117,108,116,45,108, 111,97,100,47,117,115,101,45,99,111,109,112,105,108,101,100,65,113,117,111,116, 101,29,94,2,3,67,35,37,117,116,105,108,115,11,29,94,2,3,68,35,37, @@ -381,179 +381,180 @@ 118,101,114,64,98,111,111,116,64,115,97,109,101,5,3,46,122,111,6,6,6, 110,97,116,105,118,101,64,108,111,111,112,1,29,115,116,97,110,100,97,114,100, 45,109,111,100,117,108,101,45,110,97,109,101,45,114,101,115,111,108,118,101,114, -63,108,105,98,67,105,103,110,111,114,101,100,249,22,14,195,80,158,37,45,249, -80,159,37,48,36,195,10,27,28,23,195,2,28,249,22,162,8,23,197,2,80, -158,38,46,87,94,23,195,1,80,158,36,47,27,248,22,171,4,23,197,2,28, -248,22,136,13,23,194,2,91,159,38,11,90,161,38,35,11,248,22,157,13,23, -197,1,87,95,83,160,37,11,80,158,40,46,198,83,160,37,11,80,158,40,47, -192,192,11,11,28,23,193,2,192,87,94,23,193,1,27,247,22,189,4,28,192, -192,247,22,176,13,20,14,159,80,158,35,39,250,80,158,38,40,249,22,27,11, -80,158,40,39,22,189,4,28,248,22,136,13,23,198,2,23,197,1,87,94,23, -197,1,247,22,176,13,247,194,250,22,154,13,23,197,1,23,199,1,249,80,158, -42,38,23,198,1,2,17,252,22,154,13,23,199,1,23,201,1,2,18,247,22, -177,7,249,80,158,44,38,23,200,1,80,158,44,35,87,94,23,194,1,27,250, -22,171,13,196,11,32,0,89,162,8,44,35,40,9,222,11,28,192,249,22,64, -195,194,11,27,252,22,154,13,23,200,1,23,202,1,2,18,247,22,177,7,249, -80,158,45,38,23,201,1,80,158,45,35,27,250,22,171,13,196,11,32,0,89, -162,8,44,35,40,9,222,11,28,192,249,22,64,195,194,11,249,247,22,181,13, -248,22,65,195,195,27,250,22,154,13,23,198,1,23,200,1,249,80,158,43,38, -23,199,1,2,17,27,250,22,171,13,196,11,32,0,89,162,8,44,35,40,9, -222,11,28,192,249,22,64,195,194,11,249,247,22,187,4,248,22,65,195,195,249, -247,22,187,4,194,195,87,94,28,248,80,158,36,37,23,195,2,12,250,22,129, -9,77,108,111,97,100,47,117,115,101,45,99,111,109,112,105,108,101,100,6,25, -25,112,97,116,104,32,111,114,32,118,97,108,105,100,45,112,97,116,104,32,115, -116,114,105,110,103,23,197,2,91,159,41,11,90,161,36,35,11,28,248,22,160, -13,23,201,2,23,200,1,27,247,22,189,4,28,23,193,2,249,22,161,13,23, -203,1,23,195,1,200,90,161,38,36,11,248,22,157,13,23,194,2,87,94,23, -196,1,90,161,36,39,11,28,249,22,162,8,23,196,2,68,114,101,108,97,116, -105,118,101,87,94,23,194,1,2,16,23,194,1,90,161,36,40,11,247,22,178, -13,27,89,162,43,36,49,62,122,111,225,7,5,3,33,27,27,89,162,43,36, -51,9,225,8,6,4,33,28,27,249,22,5,89,162,8,44,36,46,9,223,5, -33,29,23,203,2,27,28,23,195,1,27,249,22,5,89,162,8,44,36,52,9, -225,13,11,9,33,30,23,205,2,27,28,23,196,2,11,193,28,192,192,28,193, -28,23,196,2,28,249,22,166,3,248,22,66,196,248,22,66,23,199,2,193,11, -11,11,11,28,23,193,2,249,80,159,47,54,36,202,89,162,43,35,45,9,224, -14,2,33,31,87,94,23,193,1,27,28,23,197,1,27,249,22,5,83,158,39, -20,97,94,89,162,8,44,36,50,9,225,14,12,10,33,32,23,203,1,23,206, -1,27,28,196,11,193,28,192,192,28,193,28,196,28,249,22,166,3,248,22,66, -196,248,22,66,199,193,11,11,11,11,28,192,249,80,159,48,54,36,203,89,162, -43,35,45,9,224,15,2,33,33,249,80,159,48,54,36,203,89,162,43,35,44, -9,224,15,7,33,34,32,36,89,162,8,44,36,54,2,19,222,33,38,0,17, -35,114,120,34,94,40,46,42,63,41,47,40,46,42,41,36,34,27,249,22,186, +63,108,105,98,67,105,103,110,111,114,101,100,249,22,14,195,80,159,37,45,37, +249,80,159,37,48,36,195,10,27,28,23,195,2,28,249,22,162,8,23,197,2, +80,159,38,46,37,87,94,23,195,1,80,159,36,47,37,27,248,22,171,4,23, +197,2,28,248,22,137,13,23,194,2,91,159,38,11,90,161,38,35,11,248,22, +158,13,23,197,1,87,95,83,160,37,11,80,159,40,46,37,198,83,160,37,11, +80,159,40,47,37,192,192,11,11,28,23,193,2,192,87,94,23,193,1,27,247, +22,189,4,28,192,192,247,22,177,13,20,14,159,80,158,35,39,250,80,158,38, +40,249,22,27,11,80,158,40,39,22,189,4,28,248,22,137,13,23,198,2,23, +197,1,87,94,23,197,1,247,22,177,13,247,194,250,22,155,13,23,197,1,23, +199,1,249,80,158,42,38,23,198,1,2,17,252,22,155,13,23,199,1,23,201, +1,2,18,247,22,177,7,249,80,158,44,38,23,200,1,80,159,44,35,37,87, +94,23,194,1,27,250,22,172,13,196,11,32,0,89,162,8,44,35,40,9,222, +11,28,192,249,22,64,195,194,11,27,252,22,155,13,23,200,1,23,202,1,2, +18,247,22,177,7,249,80,158,45,38,23,201,1,80,159,45,35,37,27,250,22, +172,13,196,11,32,0,89,162,8,44,35,40,9,222,11,28,192,249,22,64,195, +194,11,249,247,22,182,13,248,22,65,195,195,27,250,22,155,13,23,198,1,23, +200,1,249,80,158,43,38,23,199,1,2,17,27,250,22,172,13,196,11,32,0, +89,162,8,44,35,40,9,222,11,28,192,249,22,64,195,194,11,249,247,22,187, +4,248,22,65,195,195,249,247,22,187,4,194,195,87,94,28,248,80,158,36,37, +23,195,2,12,250,22,130,9,77,108,111,97,100,47,117,115,101,45,99,111,109, +112,105,108,101,100,6,25,25,112,97,116,104,32,111,114,32,118,97,108,105,100, +45,112,97,116,104,32,115,116,114,105,110,103,23,197,2,91,159,41,11,90,161, +36,35,11,28,248,22,161,13,23,201,2,23,200,1,27,247,22,189,4,28,23, +193,2,249,22,162,13,23,203,1,23,195,1,200,90,161,38,36,11,248,22,158, +13,23,194,2,87,94,23,196,1,90,161,36,39,11,28,249,22,162,8,23,196, +2,68,114,101,108,97,116,105,118,101,87,94,23,194,1,2,16,23,194,1,90, +161,36,40,11,247,22,179,13,27,89,162,43,36,49,62,122,111,225,7,5,3, +33,27,27,89,162,43,36,51,9,225,8,6,4,33,28,27,249,22,5,89,162, +8,44,36,46,9,223,5,33,29,23,203,2,27,28,23,195,1,27,249,22,5, +89,162,8,44,36,52,9,225,13,11,9,33,30,23,205,2,27,28,23,196,2, +11,193,28,192,192,28,193,28,23,196,2,28,249,22,166,3,248,22,66,196,248, +22,66,23,199,2,193,11,11,11,11,28,23,193,2,249,80,159,47,54,36,202, +89,162,43,35,45,9,224,14,2,33,31,87,94,23,193,1,27,28,23,197,1, +27,249,22,5,83,158,39,20,97,94,89,162,8,44,36,50,9,225,14,12,10, +33,32,23,203,1,23,206,1,27,28,196,11,193,28,192,192,28,193,28,196,28, +249,22,166,3,248,22,66,196,248,22,66,199,193,11,11,11,11,28,192,249,80, +159,48,54,36,203,89,162,43,35,45,9,224,15,2,33,33,249,80,159,48,54, +36,203,89,162,43,35,44,9,224,15,7,33,34,32,36,89,162,8,44,36,54, +2,19,222,33,38,0,17,35,114,120,34,94,40,46,42,63,41,47,40,46,42, +41,36,34,27,249,22,187,13,2,37,23,196,2,28,23,193,2,87,94,23,194, +1,249,22,64,248,22,89,23,196,2,27,248,22,98,23,197,1,27,249,22,187, 13,2,37,23,196,2,28,23,193,2,87,94,23,194,1,249,22,64,248,22,89, -23,196,2,27,248,22,98,23,197,1,27,249,22,186,13,2,37,23,196,2,28, -23,193,2,87,94,23,194,1,249,22,64,248,22,89,23,196,2,27,248,22,98, -23,197,1,27,249,22,186,13,2,37,23,196,2,28,23,193,2,87,94,23,194, -1,249,22,64,248,22,89,23,196,2,248,2,36,248,22,98,23,197,1,248,22, -74,194,248,22,74,194,248,22,74,194,32,39,89,162,43,36,54,2,19,222,33, -40,28,248,22,72,248,22,66,23,195,2,249,22,7,9,248,22,65,195,91,159, -37,11,90,161,37,35,11,27,248,22,66,23,197,2,28,248,22,72,248,22,66, -23,195,2,249,22,7,9,248,22,65,195,91,159,37,11,90,161,37,35,11,27, -248,22,66,23,197,2,28,248,22,72,248,22,66,23,195,2,249,22,7,9,248, -22,65,195,91,159,37,11,90,161,37,35,11,248,2,39,248,22,66,23,197,2, -249,22,7,249,22,64,248,22,65,23,200,1,23,197,1,195,249,22,7,249,22, -64,248,22,65,23,200,1,23,197,1,195,249,22,7,249,22,64,248,22,65,23, -200,1,23,197,1,195,27,248,2,36,23,195,1,28,194,192,248,2,39,193,87, -95,28,248,22,169,4,195,12,250,22,129,9,2,20,6,20,20,114,101,115,111, -108,118,101,100,45,109,111,100,117,108,101,45,112,97,116,104,197,28,24,193,2, -248,24,194,1,195,87,94,23,193,1,12,27,27,250,22,138,2,80,158,41,42, -248,22,142,14,247,22,183,11,11,28,23,193,2,192,87,94,23,193,1,27,247, -22,122,87,94,250,22,136,2,80,158,42,42,248,22,142,14,247,22,183,11,195, -192,250,22,136,2,195,198,66,97,116,116,97,99,104,251,211,197,198,199,10,28, -192,250,22,128,9,11,196,195,248,22,190,8,194,28,249,22,163,6,194,6,1, -1,46,2,16,28,249,22,163,6,194,6,2,2,46,46,62,117,112,192,28,249, -22,164,8,248,22,66,23,200,2,23,197,1,28,249,22,162,8,248,22,65,23, -200,2,23,196,1,251,22,190,8,2,20,6,26,26,99,121,99,108,101,32,105, -110,32,108,111,97,100,105,110,103,32,97,116,32,126,101,58,32,126,101,23,200, -1,249,22,2,22,66,248,22,79,249,22,64,23,206,1,23,202,1,12,12,247, -192,20,14,159,80,158,39,44,249,22,64,248,22,142,14,247,22,183,11,23,197, -1,20,14,159,80,158,39,39,250,80,158,42,40,249,22,27,11,80,158,44,39, -22,151,4,23,196,1,249,247,22,188,4,23,198,1,248,22,53,248,22,140,13, -23,198,1,87,94,28,28,248,22,136,13,23,197,2,10,248,22,175,4,23,197, -2,12,28,23,198,2,250,22,128,9,11,6,15,15,98,97,100,32,109,111,100, -117,108,101,32,112,97,116,104,23,201,2,250,22,129,9,2,20,6,19,19,109, -111,100,117,108,101,45,112,97,116,104,32,111,114,32,112,97,116,104,23,199,2, -28,28,248,22,62,23,197,2,249,22,162,8,248,22,65,23,199,2,2,3,11, -248,22,170,4,248,22,89,197,28,28,248,22,62,23,197,2,249,22,162,8,248, -22,65,23,199,2,66,112,108,97,110,101,116,11,87,94,28,207,12,20,14,159, -80,158,37,39,250,80,158,40,40,249,22,27,11,80,158,42,39,22,183,11,23, -197,1,90,161,36,35,10,249,22,152,4,21,94,2,21,6,18,18,112,108,97, -110,101,116,47,114,101,115,111,108,118,101,114,46,115,115,1,27,112,108,97,110, -101,116,45,109,111,100,117,108,101,45,110,97,109,101,45,114,101,115,111,108,118, -101,114,12,251,211,199,200,201,202,87,94,23,193,1,27,89,162,8,44,36,45, -79,115,104,111,119,45,99,111,108,108,101,99,116,105,111,110,45,101,114,114,223, -6,33,44,27,28,248,22,52,23,199,2,27,250,22,138,2,80,158,43,43,249, -22,64,23,204,2,247,22,177,13,11,28,23,193,2,192,87,94,23,193,1,91, -159,37,11,90,161,37,35,11,249,80,159,44,48,36,248,22,55,23,204,2,11, -27,251,80,158,47,50,2,20,23,202,1,28,248,22,72,23,199,2,23,199,2, -248,22,65,23,199,2,28,248,22,72,23,199,2,9,248,22,66,23,199,2,249, -22,154,13,23,195,1,28,248,22,72,23,197,1,87,94,23,197,1,6,7,7, -109,97,105,110,46,115,115,249,22,180,6,23,199,1,6,3,3,46,115,115,28, -248,22,157,6,23,199,2,87,94,23,194,1,27,248,80,159,41,55,36,23,201, -2,27,250,22,138,2,80,158,44,43,249,22,64,23,205,2,23,199,2,11,28, -23,193,2,192,87,94,23,193,1,91,159,37,11,90,161,37,35,11,249,80,159, -45,48,36,23,204,2,11,250,22,1,22,154,13,23,199,1,249,22,78,249,22, -2,32,0,89,162,8,44,36,43,9,222,33,45,23,200,1,248,22,74,23,200, -1,28,248,22,136,13,23,199,2,87,94,23,194,1,28,248,22,159,13,23,199, -2,23,198,2,248,22,74,6,26,26,32,40,97,32,112,97,116,104,32,109,117, -115,116,32,98,101,32,97,98,115,111,108,117,116,101,41,28,249,22,162,8,248, -22,65,23,201,2,2,21,27,250,22,138,2,80,158,43,43,249,22,64,23,204, -2,247,22,177,13,11,28,23,193,2,192,87,94,23,193,1,91,159,38,11,90, -161,37,35,11,249,80,159,45,48,36,248,22,89,23,205,2,11,90,161,36,37, -11,28,248,22,72,248,22,91,23,204,2,28,248,22,72,23,194,2,249,22,188, -13,0,8,35,114,120,34,91,46,93,34,23,196,2,11,10,27,27,28,23,197, -2,249,22,78,28,248,22,72,248,22,91,23,208,2,21,93,6,5,5,109,122, -108,105,98,249,22,1,22,78,249,22,2,80,159,51,56,36,248,22,91,23,211, -2,23,197,2,28,248,22,72,23,196,2,248,22,74,23,197,2,23,195,2,251, -80,158,49,50,2,20,23,204,1,248,22,65,23,198,2,248,22,66,23,198,1, -249,22,154,13,23,195,1,28,23,198,1,87,94,23,196,1,23,197,1,28,248, -22,72,23,197,1,87,94,23,197,1,6,7,7,109,97,105,110,46,115,115,28, -249,22,188,13,0,8,35,114,120,34,91,46,93,34,23,199,2,23,197,1,249, -22,180,6,23,199,1,6,3,3,46,115,115,28,249,22,162,8,248,22,65,23, -201,2,64,102,105,108,101,249,22,161,13,248,22,165,13,248,22,89,23,202,2, -248,80,159,42,55,36,23,202,2,12,87,94,28,28,248,22,136,13,23,194,2, -10,248,22,179,7,23,194,2,87,94,23,200,1,12,28,23,200,2,250,22,128, -9,67,114,101,113,117,105,114,101,249,22,141,7,6,17,17,98,97,100,32,109, -111,100,117,108,101,32,112,97,116,104,126,97,28,23,198,2,248,22,65,23,199, -2,6,0,0,23,203,1,87,94,23,200,1,250,22,129,9,2,20,249,22,141, -7,6,13,13,109,111,100,117,108,101,32,112,97,116,104,126,97,28,23,198,2, -248,22,65,23,199,2,6,0,0,23,201,2,27,28,248,22,179,7,23,195,2, -249,22,184,7,23,196,2,35,249,22,163,13,248,22,164,13,23,197,2,11,27, -28,248,22,179,7,23,196,2,249,22,184,7,23,197,2,36,248,80,158,42,51, -23,195,2,91,159,38,11,90,161,38,35,11,28,248,22,179,7,23,199,2,250, -22,7,2,22,249,22,184,7,23,203,2,37,2,22,248,22,157,13,23,198,2, -87,95,23,195,1,23,193,1,27,28,248,22,179,7,23,200,2,249,22,184,7, -23,201,2,38,249,80,158,47,52,23,197,2,5,0,27,28,248,22,179,7,23, -201,2,249,22,184,7,23,202,2,39,248,22,170,4,23,200,2,27,27,250,22, -138,2,80,158,51,42,248,22,142,14,247,22,183,11,11,28,23,193,2,192,87, -94,23,193,1,27,247,22,122,87,94,250,22,136,2,80,158,52,42,248,22,142, -14,247,22,183,11,195,192,87,95,28,23,209,1,27,250,22,138,2,23,197,2, -197,11,28,23,193,1,12,87,95,27,27,28,248,22,17,80,158,51,45,80,158, -50,45,247,22,19,250,22,25,248,22,23,23,197,2,80,158,53,44,23,196,1, -27,248,22,142,14,247,22,183,11,249,22,3,83,158,39,20,97,94,89,162,8, -44,36,54,9,226,12,11,2,3,33,46,23,195,1,23,196,1,248,28,248,22, -17,80,158,50,45,32,0,89,162,43,36,41,9,222,33,47,80,159,49,57,36, -89,162,43,35,50,9,227,14,9,8,4,3,33,48,250,22,136,2,23,197,1, -197,10,12,28,28,248,22,179,7,23,202,1,11,27,248,22,157,6,23,208,2, -28,192,192,28,248,22,62,23,208,2,249,22,162,8,248,22,65,23,210,2,2, -21,11,250,22,136,2,80,158,50,43,28,248,22,157,6,23,210,2,249,22,64, -23,211,1,248,80,159,53,55,36,23,213,1,87,94,23,210,1,249,22,64,23, -211,1,247,22,177,13,252,22,181,7,23,208,1,23,207,1,23,205,1,23,203, -1,201,12,193,91,159,37,10,90,161,36,35,10,11,90,161,36,36,10,83,158, -38,20,96,96,2,20,89,162,8,44,36,50,9,224,2,0,33,42,89,162,43, -38,48,9,223,1,33,43,89,162,43,39,8,30,9,225,2,3,0,33,49,208, -87,95,248,22,150,4,248,80,158,37,49,247,22,183,11,248,22,188,4,80,158, -36,36,248,22,174,12,80,159,36,41,36,159,35,20,103,159,35,16,1,11,16, -0,83,158,41,20,100,143,66,35,37,98,111,111,116,29,11,11,11,11,10,10, -36,80,158,35,35,20,103,159,39,16,19,2,1,2,2,30,2,4,72,112,97, -116,104,45,115,116,114,105,110,103,63,10,30,2,4,75,112,97,116,104,45,97, -100,100,45,115,117,102,102,105,120,7,30,2,5,1,20,112,97,114,97,109,101, -116,101,114,105,122,97,116,105,111,110,45,107,101,121,4,30,2,5,1,23,101, -120,116,101,110,100,45,112,97,114,97,109,101,116,101,114,105,122,97,116,105,111, -110,3,2,6,2,7,2,8,2,9,2,10,2,11,2,12,2,13,2,14,30, -2,4,69,45,102,105,110,100,45,99,111,108,0,30,2,4,76,110,111,114,109, -97,108,45,99,97,115,101,45,112,97,116,104,6,30,2,4,79,112,97,116,104, -45,114,101,112,108,97,99,101,45,115,117,102,102,105,120,9,2,15,16,0,11, -11,16,0,35,16,0,35,16,11,2,9,2,10,2,7,2,8,2,11,2,12, -2,2,2,6,2,1,2,14,2,13,46,11,11,38,35,11,11,16,1,2,15, -16,1,11,16,1,2,15,36,36,36,11,11,16,0,16,0,16,0,35,35,11, -11,11,16,0,16,0,16,0,35,35,16,0,16,16,83,158,35,16,2,89,162, -43,36,44,9,223,0,33,23,80,159,35,57,36,83,158,35,16,2,89,162,43, -36,44,9,223,0,33,24,80,159,35,56,36,83,158,35,16,2,89,162,43,36, -48,67,103,101,116,45,100,105,114,223,0,33,25,80,159,35,55,36,83,158,35, -16,2,89,162,43,37,48,68,119,105,116,104,45,100,105,114,223,0,33,26,80, -159,35,54,36,83,158,35,16,2,248,22,176,7,69,115,111,45,115,117,102,102, -105,120,80,159,35,35,36,83,158,35,16,2,89,162,43,37,59,2,2,223,0, -33,35,80,159,35,36,36,83,158,35,16,2,32,0,89,162,8,44,36,41,2, -6,222,192,80,159,35,41,36,83,158,35,16,2,247,22,125,80,159,35,42,36, -83,158,35,16,2,247,22,124,80,159,35,43,36,83,158,35,16,2,247,22,60, -80,159,35,44,36,83,158,35,16,2,248,22,18,74,109,111,100,117,108,101,45, -108,111,97,100,105,110,103,80,159,35,45,36,83,158,35,16,2,11,80,158,35, -46,83,158,35,16,2,11,80,158,35,47,83,158,35,16,2,32,0,89,162,43, -37,44,2,13,222,33,41,80,159,35,48,36,83,158,35,16,2,89,162,8,44, -36,44,2,14,223,0,33,50,80,159,35,49,36,83,158,35,16,2,89,162,43, -35,43,2,15,223,0,33,51,80,159,35,53,36,95,29,94,2,3,68,35,37, -107,101,114,110,101,108,11,29,94,2,3,69,35,37,109,105,110,45,115,116,120, -11,2,4,9,9,9,35,0}; - EVAL_ONE_SIZED_STR((char *)expr, 4081); +23,196,2,27,248,22,98,23,197,1,27,249,22,187,13,2,37,23,196,2,28, +23,193,2,87,94,23,194,1,249,22,64,248,22,89,23,196,2,248,2,36,248, +22,98,23,197,1,248,22,74,194,248,22,74,194,248,22,74,194,32,39,89,162, +43,36,54,2,19,222,33,40,28,248,22,72,248,22,66,23,195,2,249,22,7, +9,248,22,65,195,91,159,37,11,90,161,37,35,11,27,248,22,66,23,197,2, +28,248,22,72,248,22,66,23,195,2,249,22,7,9,248,22,65,195,91,159,37, +11,90,161,37,35,11,27,248,22,66,23,197,2,28,248,22,72,248,22,66,23, +195,2,249,22,7,9,248,22,65,195,91,159,37,11,90,161,37,35,11,248,2, +39,248,22,66,23,197,2,249,22,7,249,22,64,248,22,65,23,200,1,23,197, +1,195,249,22,7,249,22,64,248,22,65,23,200,1,23,197,1,195,249,22,7, +249,22,64,248,22,65,23,200,1,23,197,1,195,27,248,2,36,23,195,1,28, +194,192,248,2,39,193,87,95,28,248,22,169,4,195,12,250,22,130,9,2,20, +6,20,20,114,101,115,111,108,118,101,100,45,109,111,100,117,108,101,45,112,97, +116,104,197,28,24,193,2,248,24,194,1,195,87,94,23,193,1,12,27,27,250, +22,138,2,80,159,41,42,37,248,22,143,14,247,22,184,11,11,28,23,193,2, +192,87,94,23,193,1,27,247,22,122,87,94,250,22,136,2,80,159,42,42,37, +248,22,143,14,247,22,184,11,195,192,250,22,136,2,195,198,66,97,116,116,97, +99,104,251,211,197,198,199,10,28,192,250,22,129,9,11,196,195,248,22,191,8, +194,28,249,22,163,6,194,6,1,1,46,2,16,28,249,22,163,6,194,6,2, +2,46,46,62,117,112,192,28,249,22,164,8,248,22,66,23,200,2,23,197,1, +28,249,22,162,8,248,22,65,23,200,2,23,196,1,251,22,191,8,2,20,6, +26,26,99,121,99,108,101,32,105,110,32,108,111,97,100,105,110,103,32,97,116, +32,126,101,58,32,126,101,23,200,1,249,22,2,22,66,248,22,79,249,22,64, +23,206,1,23,202,1,12,12,247,192,20,14,159,80,159,39,44,37,249,22,64, +248,22,143,14,247,22,184,11,23,197,1,20,14,159,80,158,39,39,250,80,158, +42,40,249,22,27,11,80,158,44,39,22,151,4,23,196,1,249,247,22,188,4, +23,198,1,248,22,53,248,22,141,13,23,198,1,87,94,28,28,248,22,137,13, +23,197,2,10,248,22,175,4,23,197,2,12,28,23,198,2,250,22,129,9,11, +6,15,15,98,97,100,32,109,111,100,117,108,101,32,112,97,116,104,23,201,2, +250,22,130,9,2,20,6,19,19,109,111,100,117,108,101,45,112,97,116,104,32, +111,114,32,112,97,116,104,23,199,2,28,28,248,22,62,23,197,2,249,22,162, +8,248,22,65,23,199,2,2,3,11,248,22,170,4,248,22,89,197,28,28,248, +22,62,23,197,2,249,22,162,8,248,22,65,23,199,2,66,112,108,97,110,101, +116,11,87,94,28,207,12,20,14,159,80,158,37,39,250,80,158,40,40,249,22, +27,11,80,158,42,39,22,184,11,23,197,1,90,161,36,35,10,249,22,152,4, +21,94,2,21,6,18,18,112,108,97,110,101,116,47,114,101,115,111,108,118,101, +114,46,115,115,1,27,112,108,97,110,101,116,45,109,111,100,117,108,101,45,110, +97,109,101,45,114,101,115,111,108,118,101,114,12,251,211,199,200,201,202,87,94, +23,193,1,27,89,162,8,44,36,45,79,115,104,111,119,45,99,111,108,108,101, +99,116,105,111,110,45,101,114,114,223,6,33,44,27,28,248,22,52,23,199,2, +27,250,22,138,2,80,159,43,43,37,249,22,64,23,204,2,247,22,178,13,11, +28,23,193,2,192,87,94,23,193,1,91,159,37,11,90,161,37,35,11,249,80, +159,44,48,36,248,22,55,23,204,2,11,27,251,80,158,47,50,2,20,23,202, +1,28,248,22,72,23,199,2,23,199,2,248,22,65,23,199,2,28,248,22,72, +23,199,2,9,248,22,66,23,199,2,249,22,155,13,23,195,1,28,248,22,72, +23,197,1,87,94,23,197,1,6,7,7,109,97,105,110,46,115,115,249,22,180, +6,23,199,1,6,3,3,46,115,115,28,248,22,157,6,23,199,2,87,94,23, +194,1,27,248,80,159,41,55,36,23,201,2,27,250,22,138,2,80,159,44,43, +37,249,22,64,23,205,2,23,199,2,11,28,23,193,2,192,87,94,23,193,1, +91,159,37,11,90,161,37,35,11,249,80,159,45,48,36,23,204,2,11,250,22, +1,22,155,13,23,199,1,249,22,78,249,22,2,32,0,89,162,8,44,36,43, +9,222,33,45,23,200,1,248,22,74,23,200,1,28,248,22,137,13,23,199,2, +87,94,23,194,1,28,248,22,160,13,23,199,2,23,198,2,248,22,74,6,26, +26,32,40,97,32,112,97,116,104,32,109,117,115,116,32,98,101,32,97,98,115, +111,108,117,116,101,41,28,249,22,162,8,248,22,65,23,201,2,2,21,27,250, +22,138,2,80,159,43,43,37,249,22,64,23,204,2,247,22,178,13,11,28,23, +193,2,192,87,94,23,193,1,91,159,38,11,90,161,37,35,11,249,80,159,45, +48,36,248,22,89,23,205,2,11,90,161,36,37,11,28,248,22,72,248,22,91, +23,204,2,28,248,22,72,23,194,2,249,22,189,13,0,8,35,114,120,34,91, +46,93,34,23,196,2,11,10,27,27,28,23,197,2,249,22,78,28,248,22,72, +248,22,91,23,208,2,21,93,6,5,5,109,122,108,105,98,249,22,1,22,78, +249,22,2,80,159,51,56,36,248,22,91,23,211,2,23,197,2,28,248,22,72, +23,196,2,248,22,74,23,197,2,23,195,2,251,80,158,49,50,2,20,23,204, +1,248,22,65,23,198,2,248,22,66,23,198,1,249,22,155,13,23,195,1,28, +23,198,1,87,94,23,196,1,23,197,1,28,248,22,72,23,197,1,87,94,23, +197,1,6,7,7,109,97,105,110,46,115,115,28,249,22,189,13,0,8,35,114, +120,34,91,46,93,34,23,199,2,23,197,1,249,22,180,6,23,199,1,6,3, +3,46,115,115,28,249,22,162,8,248,22,65,23,201,2,64,102,105,108,101,249, +22,162,13,248,22,166,13,248,22,89,23,202,2,248,80,159,42,55,36,23,202, +2,12,87,94,28,28,248,22,137,13,23,194,2,10,248,22,179,7,23,194,2, +87,94,23,200,1,12,28,23,200,2,250,22,129,9,67,114,101,113,117,105,114, +101,249,22,141,7,6,17,17,98,97,100,32,109,111,100,117,108,101,32,112,97, +116,104,126,97,28,23,198,2,248,22,65,23,199,2,6,0,0,23,203,1,87, +94,23,200,1,250,22,130,9,2,20,249,22,141,7,6,13,13,109,111,100,117, +108,101,32,112,97,116,104,126,97,28,23,198,2,248,22,65,23,199,2,6,0, +0,23,201,2,27,28,248,22,179,7,23,195,2,249,22,184,7,23,196,2,35, +249,22,164,13,248,22,165,13,23,197,2,11,27,28,248,22,179,7,23,196,2, +249,22,184,7,23,197,2,36,248,80,158,42,51,23,195,2,91,159,38,11,90, +161,38,35,11,28,248,22,179,7,23,199,2,250,22,7,2,22,249,22,184,7, +23,203,2,37,2,22,248,22,158,13,23,198,2,87,95,23,195,1,23,193,1, +27,28,248,22,179,7,23,200,2,249,22,184,7,23,201,2,38,249,80,158,47, +52,23,197,2,5,0,27,28,248,22,179,7,23,201,2,249,22,184,7,23,202, +2,39,248,22,170,4,23,200,2,27,27,250,22,138,2,80,159,51,42,37,248, +22,143,14,247,22,184,11,11,28,23,193,2,192,87,94,23,193,1,27,247,22, +122,87,94,250,22,136,2,80,159,52,42,37,248,22,143,14,247,22,184,11,195, +192,87,95,28,23,209,1,27,250,22,138,2,23,197,2,197,11,28,23,193,1, +12,87,95,27,27,28,248,22,17,80,159,51,45,37,80,159,50,45,37,247,22, +19,250,22,25,248,22,23,23,197,2,80,159,53,44,37,23,196,1,27,248,22, +143,14,247,22,184,11,249,22,3,83,158,39,20,97,94,89,162,8,44,36,54, +9,226,12,11,2,3,33,46,23,195,1,23,196,1,248,28,248,22,17,80,159, +50,45,37,32,0,89,162,43,36,41,9,222,33,47,80,159,49,57,36,89,162, +43,35,50,9,227,14,9,8,4,3,33,48,250,22,136,2,23,197,1,197,10, +12,28,28,248,22,179,7,23,202,1,11,27,248,22,157,6,23,208,2,28,192, +192,28,248,22,62,23,208,2,249,22,162,8,248,22,65,23,210,2,2,21,11, +250,22,136,2,80,159,50,43,37,28,248,22,157,6,23,210,2,249,22,64,23, +211,1,248,80,159,53,55,36,23,213,1,87,94,23,210,1,249,22,64,23,211, +1,247,22,178,13,252,22,181,7,23,208,1,23,207,1,23,205,1,23,203,1, +201,12,193,91,159,37,10,90,161,36,35,10,11,90,161,36,36,10,83,158,38, +20,96,96,2,20,89,162,8,44,36,50,9,224,2,0,33,42,89,162,43,38, +48,9,223,1,33,43,89,162,43,39,8,30,9,225,2,3,0,33,49,208,87, +95,248,22,150,4,248,80,159,37,49,37,247,22,184,11,248,22,188,4,80,159, +36,36,37,248,22,175,12,80,159,36,41,36,159,35,20,103,159,35,16,1,11, +16,0,83,158,41,20,100,143,66,35,37,98,111,111,116,29,11,11,11,11,10, +10,36,80,158,35,35,20,103,159,39,16,19,2,1,2,2,30,2,4,72,112, +97,116,104,45,115,116,114,105,110,103,63,10,30,2,4,75,112,97,116,104,45, +97,100,100,45,115,117,102,102,105,120,7,30,2,5,1,20,112,97,114,97,109, +101,116,101,114,105,122,97,116,105,111,110,45,107,101,121,4,30,2,5,1,23, +101,120,116,101,110,100,45,112,97,114,97,109,101,116,101,114,105,122,97,116,105, +111,110,3,2,6,2,7,2,8,2,9,2,10,2,11,2,12,2,13,2,14, +30,2,4,69,45,102,105,110,100,45,99,111,108,0,30,2,4,76,110,111,114, +109,97,108,45,99,97,115,101,45,112,97,116,104,6,30,2,4,79,112,97,116, +104,45,114,101,112,108,97,99,101,45,115,117,102,102,105,120,9,2,15,16,0, +11,11,16,0,35,16,0,35,16,11,2,9,2,10,2,7,2,8,2,11,2, +12,2,2,2,6,2,1,2,14,2,13,46,11,11,38,35,11,11,16,1,2, +15,16,1,11,16,1,2,15,36,36,36,11,11,16,0,16,0,16,0,35,35, +11,11,11,16,0,16,0,16,0,35,35,16,0,16,16,83,158,35,16,2,89, +162,43,36,44,9,223,0,33,23,80,159,35,57,36,83,158,35,16,2,89,162, +43,36,44,9,223,0,33,24,80,159,35,56,36,83,158,35,16,2,89,162,43, +36,48,67,103,101,116,45,100,105,114,223,0,33,25,80,159,35,55,36,83,158, +35,16,2,89,162,43,37,48,68,119,105,116,104,45,100,105,114,223,0,33,26, +80,159,35,54,36,83,158,35,16,2,248,22,176,7,69,115,111,45,115,117,102, +102,105,120,80,159,35,35,36,83,158,35,16,2,89,162,43,37,59,2,2,223, +0,33,35,80,159,35,36,36,83,158,35,16,2,32,0,89,162,8,44,36,41, +2,6,222,192,80,159,35,41,36,83,158,35,16,2,247,22,125,80,159,35,42, +36,83,158,35,16,2,247,22,124,80,159,35,43,36,83,158,35,16,2,247,22, +60,80,159,35,44,36,83,158,35,16,2,248,22,18,74,109,111,100,117,108,101, +45,108,111,97,100,105,110,103,80,159,35,45,36,83,158,35,16,2,11,80,158, +35,46,83,158,35,16,2,11,80,158,35,47,83,158,35,16,2,32,0,89,162, +43,37,44,2,13,222,33,41,80,159,35,48,36,83,158,35,16,2,89,162,8, +44,36,44,2,14,223,0,33,50,80,159,35,49,36,83,158,35,16,2,89,162, +43,35,43,2,15,223,0,33,51,80,159,35,53,36,95,29,94,2,3,68,35, +37,107,101,114,110,101,108,11,29,94,2,3,69,35,37,109,105,110,45,115,116, +120,11,2,4,9,9,9,35,0}; + EVAL_ONE_SIZED_STR((char *)expr, 4103); } diff --git a/src/mzscheme/src/error.c b/src/mzscheme/src/error.c index bb4b052258..86f70f09f2 100644 --- a/src/mzscheme/src/error.c +++ b/src/mzscheme/src/error.c @@ -544,7 +544,7 @@ void scheme_init_error(Scheme_Env *env) /* errors */ GLOBAL_NONCM_PRIM("error", error, 1, -1, env); GLOBAL_NONCM_PRIM("raise-user-error", raise_user_error, 1, -1, env); - GLOBAL_NONCM_PRIM("raise-syntax-error", raise_syntax_error, 2, 4, env); + GLOBAL_NONCM_PRIM("raise-syntax-error", raise_syntax_error, 2, 5, env); GLOBAL_NONCM_PRIM("raise-type-error", raise_type_error, 3, -1, env); GLOBAL_NONCM_PRIM("raise-mismatch-error", raise_mismatch_error, 3, 3, env); @@ -2007,7 +2007,7 @@ static Scheme_Object *raise_user_error(int argc, Scheme_Object *argv[]) static Scheme_Object *raise_syntax_error(int argc, Scheme_Object *argv[]) { const char *who; - Scheme_Object *str; + Scheme_Object *str, *extra_sources = scheme_null; if (!SCHEME_FALSEP(argv[0]) && !SCHEME_SYMBOLP(argv[0])) scheme_wrong_type("raise-syntax-error", "symbol or #f", 0, argc, argv); @@ -2026,10 +2026,24 @@ static Scheme_Object *raise_syntax_error(int argc, Scheme_Object *argv[]) 1); } - scheme_wrong_syntax(who, - (argc > 3) ? argv[3] : NULL, - (argc > 2) ? argv[2] : NULL, - "%T", str); + if (argc > 4) { + extra_sources = argv[4]; + while (SCHEME_PAIRP(extra_sources)) { + if (!SCHEME_STXP(SCHEME_CAR(extra_sources))) + break; + } + if (!SCHEME_NULLP(extra_sources)) { + scheme_wrong_type("raise-syntax-error", "list of syntax", 4, argc, argv); + return NULL; + } + extra_sources = argv[4]; + } + + scheme_wrong_syntax_with_more_sources(who, + (argc > 3) ? argv[3] : NULL, + (argc > 2) ? argv[2] : NULL, + extra_sources, + "%T", str); return NULL; } diff --git a/src/mzscheme/src/schminc.h b/src/mzscheme/src/schminc.h index 61f22b0fa8..c08c0bf47e 100644 --- a/src/mzscheme/src/schminc.h +++ b/src/mzscheme/src/schminc.h @@ -13,7 +13,7 @@ #define USE_COMPILED_STARTUP 1 -#define EXPECTED_PRIM_COUNT 943 +#define EXPECTED_PRIM_COUNT 944 #ifdef MZSCHEME_SOMETHING_OMITTED # undef USE_COMPILED_STARTUP diff --git a/src/mzscheme/src/schvers.h b/src/mzscheme/src/schvers.h index d46f0d5598..6b859d4f99 100644 --- a/src/mzscheme/src/schvers.h +++ b/src/mzscheme/src/schvers.h @@ -13,12 +13,12 @@ consistently.) */ -#define MZSCHEME_VERSION "4.1.3.6" +#define MZSCHEME_VERSION "4.1.3.7" #define MZSCHEME_VERSION_X 4 #define MZSCHEME_VERSION_Y 1 #define MZSCHEME_VERSION_Z 3 -#define MZSCHEME_VERSION_W 6 +#define MZSCHEME_VERSION_W 7 #define MZSCHEME_VERSION_MAJOR ((MZSCHEME_VERSION_X * 100) + MZSCHEME_VERSION_Y) #define MZSCHEME_VERSION_MINOR ((MZSCHEME_VERSION_Z * 1000) + MZSCHEME_VERSION_W) diff --git a/src/mzscheme/utils/xcglue.c b/src/mzscheme/utils/xcglue.c index c4276797b7..3ce6103a36 100644 --- a/src/mzscheme/utils/xcglue.c +++ b/src/mzscheme/utils/xcglue.c @@ -18,9 +18,9 @@ arguments v... (primitive-class-prepare-struct-type! prim-class gen-property - gen-value preparer dispatcher) - prepares a class's struct-type for - objects generated C-side; returns a constructor, predicate, - and a struct:type for derived classes. The constructor and + gen-value preparer dispatcher extra-props) - prepares a class's + struct-type for objects generated C-side; returns a constructor, + predicate, and a struct:type for derived classes. The constructor and struct:type map the given dispatcher to the class. The preparer takes a symbol naming the method. It returns a @@ -30,6 +30,8 @@ method-specific value produced by the prepaper. It returns a method procedure. + The extra-props argument is a list of property--value pairs. + (primitive-class-find-method prim-class sym) - gets the method for the given symbol. @@ -169,6 +171,19 @@ static Scheme_Object *class_prepare_struct_type(int argc, Scheme_Object **argv) scheme_check_proc_arity("primitive-class-prepare-struct-type!", 1, 3, argc, argv); scheme_check_proc_arity("primitive-class-prepare-struct-type!", 2, 4, argc, argv); + props = argv[5]; + while (SCHEME_PAIRP(props)) { + name = SCHEME_CAR(props); + if (!SCHEME_PAIRP(name)) + break; + if (SCHEME_TYPE(SCHEME_CAR(name)) != scheme_struct_property_type) + break; + props = SCHEME_CDR(props); + } + if (!SCHEME_NULLP(props)) + scheme_wrong_type("primitive-class-prepare-struct-type!", "list of struct-type-property--value pairs", 5, argc, argv); + props = argv[5]; + objscheme_something_prepared = 1; c = ((Scheme_Class *)argv[0]); @@ -197,7 +212,7 @@ static Scheme_Object *class_prepare_struct_type(int argc, Scheme_Object **argv) (c->sup ? ((Scheme_Class *)c->sup)->base_struct_type : object_struct), NULL, 0, 0, NULL, - NULL, NULL); + props, NULL); c->base_struct_type = base_stype; /* Type to use when instantiating from C: */ @@ -522,7 +537,7 @@ void objscheme_init(Scheme_Env *env) scheme_install_xc_global("primitive-class-prepare-struct-type!", scheme_make_prim_w_arity(class_prepare_struct_type, "primitive-class-prepare-struct-type!", - 5, 5), + 6, 6), env); scheme_install_xc_global("primitive-class-find-method", diff --git a/src/mzscheme/utils/xcglue.h b/src/mzscheme/utils/xcglue.h index 43a123d1f0..7c046608b7 100644 --- a/src/mzscheme/utils/xcglue.h +++ b/src/mzscheme/utils/xcglue.h @@ -264,6 +264,7 @@ typedef double nndouble; # define CONSTRUCTOR_ARGS(x) () # define CONSTRUCTOR_INIT(x) /* empty */ # define ASSELF sElF-> +# define SELF__ sElF # define INIT_NULLED_OUT = NULLED_OUT # define INIT_NULLED_ARRAY(x) = x # define INA_comma , @@ -284,6 +285,7 @@ typedef double nndouble; # define CONSTRUCTOR_ARGS(x) x # define CONSTRUCTOR_INIT(x) x # define ASSELF /* empty */ +# define SELF__ this # define INIT_NULLED_OUT /* empty */ # define INIT_NULLED_ARRAY(x) /* empty */ # define INA_comma /* empty */ diff --git a/src/mzscheme/utils/xctocc b/src/mzscheme/utils/xctocc index 64b65a2b04..753a5f3e6d 100755 --- a/src/mzscheme/utils/xctocc +++ b/src/mzscheme/utils/xctocc @@ -20,6 +20,7 @@ $key_include = '@INCLUDE '; $key_boolean = '@BOOLEAN '; $key_classbase = '@CLASSBASE '; $key_interface = '@INTERFACE '; +$key_implements = '@IMPLEMENTS '; $key_classid = '@CLASSID '; $key_global = '@GLOBAL '; $key_header = '@HEADER '; @@ -61,6 +62,7 @@ sub ResetObjParams $global = 0; $implementor = ""; $interfacestring = ""; + $implements = ""; } &ResetObjParams(); @@ -85,6 +87,7 @@ sub ReadFile { $marks{'H'} = 'H'; $marks{'v'} = 'v'; $marks{'m'} = 'm'; + $marks{'M'} = 'M'; $ifzero = 0; open(SOUT, ">${file}.ss"); @@ -168,8 +171,11 @@ sub ReadFile { $oldclassmk = $mkbase; $newclass = 'os_' . $base; } elsif (&StartsWithKey($_, $key_interface)) { - $_ = &Wash(&SkipKey($_, $key_classbase)); + $_ = &Wash(&SkipKey($_, $key_interface)); $interfacestring =$_; + } elsif (&StartsWithKey($_, $key_implements)) { + $_ = &Wash(&SkipKey($_, $key_implements)); + $implements =$_; } elsif (&StartsWithKey($_, $key_global)) { &ResetObjParams(); $global = 1; @@ -347,6 +353,9 @@ sub ReadFields { $virtual = 1; } elsif ($mark eq 'm') { $externalmethod = 1; + } elsif ($mark eq 'M') { + $externalmethod = 1; + $virtual = 1; } ($s, $casename) = split(/<>/, $s); @@ -805,7 +814,11 @@ sub DoPrintClass if ($virtual) { &OIStart; print " " . &NormalType($returntype) - . " ${globalname}${func}("; + . " ${globalname}${func}"; + if ($externalmethod) { + print "_method"; + } + print "("; &PrintParams(1); print ");\n"; &OIEnd; @@ -1076,6 +1089,7 @@ sub DoPrintClass } else { print SOUT "#f"; } + print SOUT " ($implements)"; if ($iargnames ne 'BYPOS') { print SOUT " ($iargnames)"; } else { @@ -1333,7 +1347,13 @@ sub PrintFailureHandling if ($callback) { print "obj->"; } - print "ASSELF ${oldclass}::${func}("; + if (!$externalmethod) { + print "ASSELF ${oldclass}::"; + } + print "${func}("; + if ($externalmethod) { + printf("SELF__, "); + } &PrintArgs(1); print ");"; } elsif ($exception ne '' && $exception ne 'SUPER') { @@ -1367,7 +1387,11 @@ sub PrintMethod print $func; print "(int n, Scheme_Object *p[]);\n\n"; - print &NormalType($returntype) . " ${methodfuncname}("; + print &NormalType($returntype) . " ${methodfuncname}"; + if ($externalmethod) { + print "_method"; + } + print "("; &PrintParams(0); $pcount = $paramnum; @@ -1875,7 +1899,7 @@ sub PrintCallRealMethod print "));\n\n"; } else { print "$prefix "; - if ($virtual) { + if ($virtual && !$externalmethod) { print "if (((Scheme_Class_Object *)p[0])->primflag)\n"; print "$prefix "; print $ret_val if ($returntype ne 'void'); @@ -2205,7 +2229,7 @@ sub PrintBundleVar $symtype = $1; print "$wvs(bundle_symset_${symtype}($var))"; } else { - print STDERR "Unknown type ${paramtype} in $func.\n"; + print STDERR "Unknown type ${paramtype} in $func [for bundle].\n"; } } @@ -2436,7 +2460,7 @@ sub PrintUnbundleVar $symtype = $1; print "WITH_VAR_STACK(unbundle_symset_${symtype}($var, $stop))"; } else { - print STDERR "Unknown type ${paramtype} in $func.\n"; + print STDERR "Unknown type ${paramtype} in $func [for unbundle].\n"; } } @@ -2806,7 +2830,7 @@ sub PrintTypecheck $symtype = $1; print "WITH_REMEMBERED_STACK(istype_symset_${symtype}($var, $stop))"; } else { - print STDERR "Unknown type ${paramtype} in $func.\n"; + print STDERR "Unknown type ${paramtype} in $func [for typecheck].\n"; } }