<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p>Hi Marcel,</p>
<p><br>
</p>
<p>crazy hack, but it bites with the fact that storing underscore variables in a Workspace is a legal operation. I only need to print "<span>_fileDirectory" in a workspace and the menu will break. Could we please just use a separate dictionary for the properties?
 :-)</span></p>
<p><span><br>
</span></p>
<p>Furthermore, how many different properties can actually be stored in a Workspace? So far I only counted 3 different keys - does this really justify the use of the Variable State pattern?</p>
<p><br>
</p>
<p>Best,</p>
<p>Christoph</p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von commits@source.squeak.org <commits@source.squeak.org><br>
<b>Gesendet:</b> Donnerstag, 25. November 2021 11:44:04<br>
<b>An:</b> squeak-dev@lists.squeakfoundation.org; packages@lists.squeakfoundation.org<br>
<b>Betreff:</b> [squeak-dev] The Trunk: Tools-mt.1074.mcz</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Marcel Taeumel uploaded a new version of Tools to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/Tools-mt.1074.mcz">http://source.squeak.org/trunk/Tools-mt.1074.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Tools-mt.1074<br>
Author: mt<br>
Time: 25 November 2021, 11:44:01.944354 am<br>
UUID: 39954290-b416-f242-a5b0-c7aea0e3c6a6<br>
Ancestors: Tools-mt.1073<br>
<br>
Adds a property protocol to Workspace to avoid having to go through #containingWindow to store extra stuff, which does not even work for MVC, just for morphs (i.e., SystemWindow, not StandardSystemView). Reuses a workspace's "bindings" with each property being
 prefixed with a "_" to not interfere with regular bindings.<br>
<br>
Note that such extra properties have already been added to #containingWindow in the past.<br>
<br>
=============== Diff against Tools-mt.1073 ===============<br>
<br>
Item was added:<br>
+ ----- Method: Workspace>>hasProperty: (in category 'binding - properties') -----<br>
+ hasProperty: aSymbol<br>
+ <br>
+        | propertyValue |<br>
+        propertyValue := self valueOfProperty: aSymbol.<br>
+        propertyValue ifNil: [^ false].<br>
+        propertyValue == false ifTrue: [^ false].<br>
+        ^ true!<br>
<br>
Item was changed:<br>
  ----- Method: Workspace>>initialize (in category 'initialize-release') -----<br>
  initialize<br>
         <br>
         super initialize.<br>
+        bindings := Dictionary new.<br>
-        self initializeBindings.<br>
         acceptDroppedMorphs := false.<br>
         mustDeclareVariables := self class declareVariablesAutomatically not.<br>
         environment := Environment current!<br>
<br>
Item was removed:<br>
- ----- Method: Workspace>>initializeBindings (in category 'binding') -----<br>
- initializeBindings<br>
-        <br>
-        bindings := Dictionary new!<br>
<br>
Item was added:<br>
+ ----- Method: Workspace>>removeProperty: (in category 'binding - properties') -----<br>
+ removeProperty: aSymbol<br>
+ <br>
+        bindings removeKey: ('_', aSymbol) asSymbol ifAbsent: [].!<br>
<br>
Item was added:<br>
+ ----- Method: Workspace>>resetBindings (in category 'binding') -----<br>
+ resetBindings<br>
+        "Remove all bindings that are not prefixed with an $_. See #setProperty:toValue:."<br>
+ <br>
+        bindings keysAndValuesRemove: [:key :value | key first ~= $_]!<br>
<br>
Item was added:<br>
+ ----- Method: Workspace>>setProperty:toValue: (in category 'binding - properties') -----<br>
+ setProperty: aSymbol toValue: anObject<br>
+ <br>
+        anObject ifNil: [^ self removeProperty: aSymbol].<br>
+        bindings at: ('_', aSymbol) asSymbol put: anObject.!<br>
<br>
Item was added:<br>
+ ----- Method: Workspace>>valueOfProperty: (in category 'binding - properties') -----<br>
+ valueOfProperty: aSymbol<br>
+ <br>
+        ^ self valueOfProperty: aSymbol ifAbsent: nil!<br>
<br>
Item was added:<br>
+ ----- Method: Workspace>>valueOfProperty:ifAbsent: (in category 'binding - properties') -----<br>
+ valueOfProperty: aSymbol ifAbsent: aBlock<br>
+ <br>
+        ^ bindings at: ('_', aSymbol) asSymbol ifAbsent: aBlock!<br>
<br>
<br>
</div>
</span></font>
</body>
</html>