<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>Hi Marcel,</p>
<p><br>
</p>
<p>I am sending pictures and sounds to a server that only accepts mutually different items. However, if multiple of these items are generated using the same code, e.g. Morph new imageForm, there is no chance to identify this duplicate at the moment.</p>
<div id="Signature">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div>
<div class="_rp_T4" id="Item.MessagePartBody">
<div class="_rp_U4 ms-font-weight-regular ms-font-color-neutralDark rpHighlightAllClass rpHighlightBodyClass" id="Item.MessageUniqueBody" style="font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont">
<div dir="ltr">
<div id="divtagdefaultwrapper"><font face="Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols">
<div id="Signature">
<div style="margin:0px"><font style="font-family:Calibri,Arial,Helvetica,sans-serif,serif,EmojiFont">
<div><font size="3" color="black"><span style="font-size:12pt"><a href="http://www.hpi.de/" target="_blank" rel="noopener noreferrer" id="LPNoLP"><font size="2"><span id="LPlnk909538"><font color="#757B80"></font></span></font></a></span></font></div>
</font></div>
</div>
</font></div>
</div>
</div>
</div>
<div class="_rp_T4" id="Item.MessagePartBody"><br>
</div>
<div class="_rp_T4" id="Item.MessagePartBody">Thanks for the hints, this sounds indeed too complex for my use case. For now, I decided to simply catch and ignore the server errors about the duplicates. <span>It's easier to ask for forgiveness than permission. :-)</span></div>
<div class="_rp_T4" id="Item.MessagePartBody"><span><br>
</span></div>
<div class="_rp_T4" id="Item.MessagePartBody"><span>Best,</span></div>
<div class="_rp_T4" id="Item.MessagePartBody"><span>Christoph</span></div>
</div>
<div><font size="2" color="#808080"></font></div>
</div>
</div>
</div>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Taeumel, Marcel<br>
<b>Gesendet:</b> Donnerstag, 1. Oktober 2020 14:43:38<br>
<b>An:</b> squeak-dev<br>
<b>Betreff:</b> Re: [squeak-dev] Overriding #= in Graphics and Sounds</font>
<div> </div>
</div>
<div>
<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000">
Hi Christoph.
<div><br>
</div>
<div>Hmmm... maybe it is not straightforward to implement? Especially whether #class (or #species) should match or not. Reminds me of SequenceableCollection >> #= and #hasEqualElements:. I keep on using #hasEqualElements: in tests because I don't care about
 Array-vs-OrderedCollection in several places.</div>
<div><br>
</div>
<div><img id="27ec1fcd-080d-4c9e-90e0-6c0e00e4088c" width="509" height="388" src="cid:aa12d832-9f5e-4b25-ba80-37b31d0c2dba"><!-- </img> --><br>
</div>
<div><br>
</div>
<div>And Form has also a non-trivial hierarchy of variations:</div>
<div><br>
</div>
<div><img id="ece3310c-1dab-46e4-a972-5b1289fa528d" width="345" height="252" src="cid:3ca1fe29-c01e-4821-91ee-d30a841a9712"><!-- </img> --><br>
</div>
<div><br>
</div>
<div>For example, would you ignore the #depth if it is black and white anyway?</div>
<div>Or would you break uses of Dictionaries that are virtually IdentityDictionaries because of their current keys and the missing #=?</div>
<div><br>
</div>
<div>It can be hard. Maybe it needs to be maintined afterwards. So, YAGNI? :-)</div>
<div><br>
</div>
<div>Best,</div>
<div>Marcel</div>
<div><br>
</div>
<div class="mb_sig"></div>
<blockquote class="history_container" type="cite" style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px">
<p style="color: #AAAAAA; margin-top: 10px;">Am 01.10.2020 14:23:37 schrieb Thiede, Christoph <christoph.thiede@student.hpi.uni-potsdam.de>:</p>
<div style="font-family:Arial,Helvetica,sans-serif">
<div id="divtagdefaultwrapper" style="font-size: 12pt;color: #000000;font-family: Calibri,Helvetica,sans-serif" dir="ltr">
<p>Hi all,</p>
<p><br>
</p>
<p>for a current project, I need to compare form or sound objects with each other, but I found out that they do not override #=, so for example, we get:</p>
<p><br>
</p>
<blockquote style="margin: 0 0 0 40px;border: none;padding: 0px;min-width: 500px">
<p><span>(ColorForm extent: 1 @ 1) = (ColorForm extent: 1 @ 1) --> false</span></p>
</blockquote>
<p></p>
<p><span><br>
</span></p>
<p><span>Wasn't this implemented</span></p>
<p><span>a) simply because it looked like YAGNI?</span></p>
<p><span></span></p>
<p style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;font-size: 16px">
b) for design reasons? For example, should (Form extent: 1 @ 1) be equal to (ColorForm extent: 1 @ 1) or not?</p>
c) for performance reasons? I don't know if there any guidelines for implement #= (except that you need to implement #hash as well), but is an equality comparison generally allowed to be an expensive operation if two objects are equal? If two large forms have
 a different resolution or a different bitmap hash, comparison will be fast, but if they are equal, we will need to compare every single bit. Would this be okay or a no-go?
<p></p>
<p><br>
</p>
<p><span>If implementing #= as proposed is not possible, how would you think about implementing it as a keyword message on Form, e.g. #sameAs:?</span></p>
<p><span><br>
</span></p>
<p><span>The same questions apply to the AbstractSound hierarchy, too, where I'm not sure whether two sounds being played for different duration should equal or not.</span></p>
<p><span>For a similar discussion, see also this thread: </span><a href="http://forum.world.st/FormInspector-or-also-Text-gt-gt-and-its-consequences-td5121599.html" class="OWAAutoLink"><span>[squeak-dev] </span><span style="font-size: 12pt">FormInspector, or
 also: Text>>#= and its consequences</span></a><span style="font-size: 12pt">.</span><span></span></p>
<div><br>
</div>
<div>Best,</div>
<div>Christoph</div>
<p></p>
<div id="Signature">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt;color: rgb(0, 0, 0);font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols">
<div name="divtagdefaultwrapper" style="font-family: Calibri,Arial,Helvetica,sans-serif;font-size: ;margin: 0">
<div>
<div class="_rp_T4" id="Item.MessagePartBody">
<div class="_rp_U4 ms-font-weight-regular ms-font-color-neutralDark rpHighlightAllClass rpHighlightBodyClass" id="Item.MessageUniqueBody" style="font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont">
<div dir="ltr">
<div id="divtagdefaultwrapper"><span style="font-family: Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols">
<div id="Signature">
<div style="margin:0px"><font style="font-family:Calibri,Arial,Helvetica,sans-serif,serif,EmojiFont"></font></div>
</div>
</span></div>
</div>
</div>
</div>
</div>
<div><span style="font-size: 10pt;color: #808080"></span></div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</body>
</html>