<div dir="ltr"><div dir="ltr">On Wed, Jun 12, 2024 at 6:56 AM Mark Volkmann via Cuis-dev <<a href="mailto:cuis-dev@lists.cuis.st">cuis-dev@lists.cuis.st</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I saw this example in a YouTube video about Smalltalk this morning:<div><br></div><div><font face="monospace">(2 > 3) ifTrue: ['Yes'] ifFalse: ['No']</font></div><div><br></div><div>It seems to me that none of the parentheses or square brackets are needed here.</div><div>The following works the same for me.</div><div><br></div><div><font face="monospace">2 > 3 ifTrue: 'Yes' ifFalse: 'No'</font></div><div><br></div><div>Is it true that keyword messages that take no-arg blocks can always take a literal value instead?</div><div>It seems this works because the `Object` class defines the `value` method to just return `self`.</div></div></blockquote><div><br></div><div>Yes it only works because of Object>>value.</div><div><br></div><div>It's also twice as slow to leave out the block brackets because it prevents compiler optimizations and forces actual sends to be made. You can verify that by benchmarking, and understand it by looking at the bytecodes generated and running a message tally.</div><div><br></div><div>Nessa </div></div></div>