Skip to content

Commit b96c0a7

Browse files
committed
adjust uses of eq? that should be object=? or object-or-false=?
1 parent 6a94ebb commit b96c0a7

File tree

7 files changed

+90
-82
lines changed

7 files changed

+90
-82
lines changed

gui-lib/mred/private/wxme/editor-canvas.rkt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,12 +350,12 @@
350350

351351
(define-syntax-rule (using-admin body ...)
352352
(let ([oldadmin (send media get-admin)])
353-
(unless (eq? admin oldadmin)
353+
(unless (object-or-false=? admin oldadmin)
354354
(send media set-admin admin))
355355
(begin0
356356
(begin body ...)
357357
(when media
358-
(unless (eq? admin oldadmin)
358+
(unless (object-or-false=? admin oldadmin)
359359
;; FIXME: how do we know that this adminstrator
360360
;; still wants the editor?
361361
(send media set-admin oldadmin))))))
@@ -1104,7 +1104,7 @@
11041104
(define/public (get-editor) media)
11051105

11061106
(define/public (set-editor m [update? #t])
1107-
(unless (eq? media m)
1107+
(unless (object-or-false=? media m)
11081108
(when media
11091109
(when (object/bool=? admin (send media get-admin))
11101110
(send media set-admin

gui-lib/mred/private/wxme/editor-snip.rkt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999

100100
(def/override (set-admin [(make-or-false snip-admin%) a])
101101

102-
(when (not (eq? a s-admin))
102+
(unless (object-or-false=? a s-admin)
103103
(super set-admin a)
104104
(when editor
105105
(if a
@@ -125,7 +125,7 @@
125125
(void))
126126

127127
(def/public (set-editor [editor<%> b])
128-
(unless (eq? editor b)
128+
(unless (object-or-false=? editor b)
129129
(when (and editor s-admin)
130130
(send editor set-admin #f))
131131
(set! editor b)

gui-lib/mred/private/wxme/editor.rkt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@
294294
#t)
295295

296296
(def/public (do-set-caret-owner [(make-or-false snip%) snip] [symbol? dist])
297-
(let ([same? (eq? snip s-caret-snip)])
297+
(let ([same? (object-or-false=? snip s-caret-snip)])
298298
(if (and same?
299299
(or (not s-admin) (eq? dist 'immediate)))
300300
#f
@@ -610,7 +610,7 @@
610610
[new-list (read-styles-from-file s-style-list f overwritestylename? list-id)])
611611
(and new-list
612612
(begin
613-
(unless (eq? new-list s-style-list)
613+
(unless (object=? new-list s-style-list)
614614
(set-style-list new-list))
615615
(let-boxes ([num-headers 0])
616616
(send f get-fixed num-headers)
@@ -1232,7 +1232,7 @@
12321232
(define/public (do-own-x-selection on? force?)
12331233
(if on?
12341234
(if (and (not force?)
1235-
(not (eq? editor-x-selection-allowed this)))
1235+
(not (object-or-false=? editor-x-selection-allowed this)))
12361236
#f
12371237
(begin
12381238
(when editor-x-selection-owner
@@ -1243,7 +1243,7 @@
12431243
(set! editor-x-selection-owner this)
12441244
#t))
12451245
(begin
1246-
(when (eq? this editor-x-selection-owner)
1246+
(when (object-or-false=? this editor-x-selection-owner)
12471247
(set! editor-x-selection-owner #f)
12481248
(when (and (not x-selection-copied?)
12491249
(send the-x-selection-clipboard same-clipboard-client?
@@ -1252,7 +1252,7 @@
12521252
#t)))
12531253

12541254
(define/public (copy-out-x-selection)
1255-
(when (eq? this editor-x-selection-owner)
1255+
(when (object-or-false=? this editor-x-selection-owner)
12561256
(copy-into-selection)
12571257
(set! x-selection-copied? #t)))
12581258

@@ -1472,7 +1472,7 @@
14721472
(reverse snip-list)
14731473
(let loop ([snip start-snip])
14741474
(if (and snip
1475-
(not (eq? snip end-snip)))
1475+
(not (object-or-false=? snip end-snip)))
14761476
(cons snip (loop (snip->next snip)))
14771477
null)))])
14781478

gui-lib/mred/private/wxme/keymap.rkt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -760,12 +760,12 @@
760760

761761
(define/public (cycle-check km)
762762
(ormap (lambda (c)
763-
(or (eq? km c)
763+
(or (object=? km c)
764764
(send c cycle-check km)))
765765
chain-to))
766766

767767
(def/public (chain-to-keymap [keymap% km] [any? prefix?])
768-
(unless (or (eq? km this)
768+
(unless (or (object=? km this)
769769
(cycle-check km)
770770
(send km cycle-check this))
771771
(set! chain-to (if prefix?

gui-lib/mred/private/wxme/standard-snip-admin.rkt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,28 +65,28 @@
6565
[nonnegative-real? w] [nonnegative-real? h]
6666
[any? [refresh? #t]]
6767
[(symbol-in start end none) [bias 'none]])
68-
(and (eq? (send s get-admin) this)
68+
(and (object-or-false=? (send s get-admin) this)
6969
(send editor scroll-to s localx localy w h refresh? bias)))
7070

7171
(def/override (set-caret-owner [snip% s] [(symbol-in imeditorte display global) dist])
72-
(when (eq? (send s get-admin) this)
72+
(when (object-or-false=? (send s get-admin) this)
7373
(send editor set-caret-owner s dist)))
7474

7575
(def/override (resized [snip% s] [any? redraw?])
76-
(when (eq? (send s get-admin) this)
76+
(when (object-or-false=? (send s get-admin) this)
7777
(send editor resized s redraw?)))
7878

7979
(def/override (recounted [snip% s] [any? redraw?])
80-
(when (eq? (send s get-admin) this)
80+
(when (object-or-false=? (send s get-admin) this)
8181
(send editor recounted s redraw?)))
8282

8383
(def/override (needs-update [snip% s] [real? localx] [real? localy]
8484
[nonnegative-real? w] [nonnegative-real? h])
85-
(when (eq? (send s get-admin) this)
85+
(when (object-or-false=? (send s get-admin) this)
8686
(send editor needs-update s localx localy w h)))
8787

8888
(def/override (release-snip [snip% s])
89-
(and (eq? (send s get-admin) this)
89+
(and (object-or-false=? (send s get-admin) this)
9090
(send editor release-snip s)))
9191

9292
(def/override (update-cursor)
@@ -105,7 +105,7 @@
105105
(send admin popup-menu m (+ x sl) (+ y st)))))))
106106

107107
(def/override (modified [snip% s] [any? modified?])
108-
(when (eq? (send s get-admin) this)
108+
(when (object-or-false=? (send s get-admin) this)
109109
(send editor on-snip-modified s modified?)))
110110

111111
(def/override (get-line-spacing)

gui-lib/mred/private/wxme/stream.rkt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050

5151
(define/public (do-reading-version sclass)
5252
(or (ormap (lambda (scl)
53-
(and (eq? (snip-class-link-c scl) sclass)
53+
(and (object-or-false=? (snip-class-link-c scl) sclass)
5454
(snip-class-link-reading-version scl)))
5555
sl)
5656
;; Class didn't show up in the header?
@@ -60,26 +60,26 @@
6060
(define/public (do-map-position sclass-or-dclass)
6161
(if (sclass-or-dclass . is-a? . snip-class%)
6262
(or (ormap (lambda (scl)
63-
(and (eq? (snip-class-link-c scl) sclass-or-dclass)
63+
(and (object=? (snip-class-link-c scl) sclass-or-dclass)
6464
(snip-class-link-map-position scl)))
6565
sl)
6666
-1)
6767
(or (ormap (lambda (dcl)
68-
(and (eq? (editor-data-class-link-c dcl) sclass-or-dclass)
68+
(and (object=? (editor-data-class-link-c dcl) sclass-or-dclass)
6969
(editor-data-class-link-map-position dcl)))
7070
dl)
7171
-1)))
7272

7373
(define/public (do-get-header-flag sclass)
7474
(or (ormap (lambda (scl)
75-
(and (eq? (snip-class-link-c scl) sclass)
75+
(and (object=? (snip-class-link-c scl) sclass)
7676
(snip-class-link-header-flag scl)))
7777
sl)
7878
0))
7979

8080
(define/public (do-set-header-flag sclass)
8181
(ormap (lambda (scl)
82-
(and (eq? (snip-class-link-c scl) sclass)
82+
(and (object=? (snip-class-link-c scl) sclass)
8383
(begin
8484
(set-snip-class-link-header-flag! scl #t)
8585
#t)))

0 commit comments

Comments
 (0)