<body><div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left" dir="ltr">
                                        Hi Francisco,<div><br></div><div>have you checked out Ohm/S yet?</div><div><span style="font-size: 10pt"><a href="https://github.com/hpi-swa/Ohm-S">https://github.com/hpi-swa/Ohm-S</a></span><br></div><div><br></div><div>Best,</div><div>Marcel</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;'>
                        <p style='color: #AAAAAA; margin-top: 10px;'>Am 17.04.2021 11:48:19 schrieb Francisco Garau <francisco.garau@gmail.com>:</p><div style='font-family:Arial,Helvetica,sans-serif'>
<div dir="ltr"><div>Hello -- I want to do some experimentation with alternative syntax for Smalltalk. My main motivation is trying to unify the block and method syntax. I see a block as an in-lined method with an empty selector. This syntax helps to visualize that an object is basically a closure over its instance variables. <br></div><div><br></div><div>To make this work, I would also need to make Blocks understand the message #: (which would be equivalent to the current #value:). <br></div><div><br></div><div>Some examples will be more clear than I can describe. <br></div><div><br></div><div>Currently: <br></div><div> <br></div><div></div><div style="margin-left:40px">succ := [:n | n + 1]. <br></div><div style="margin-left:40px">(succ value: 3) = 4. <br></div><div style="margin-left:40px"><br></div><div style="margin-left:40px">addTo := [:a :b | a + b]. <br></div><div style="margin-left:40px">(addTo value: 3 value: 4) = 7. <br></div><div><br></div><div>Proposal:</div><div><br></div><div style="margin-left:40px">[succ: n | n + 1]. <br></div><div style="margin-left:40px">(succ :3) = 4. </div><div style="margin-left:40px"><br></div><div style="margin-left:40px">[add: a to: b | a + b]. <br></div><div style="margin-left:40px">(add :3 to : 4) = 7. </div><div><br></div><div>Class declaration syntax: <br></div><div><br></div><div style="margin-left:40px">[Point << Object | <br></div><div style="margin-left:80px">| x y | <br></div><div style="margin-left:80px"><br></div><div style="margin-left:80px">[hash | ^x hash + y hash]. <br></div><div style="margin-left:80px"><br></div><div style="margin-left:80px">[extent: aPoint | ^Rectangle origin: self extent: aPoint]. <br></div><div style="margin-left:80px"><br></div><div style="margin-left:80px">[distance: aPoint |</div><div style="margin-left:120px">| dx dy | <br></div><div style="margin-left:120px">dx := aPoint x - x. <br></div><div style="margin-left:120px">dy := aPoint y - y. <br></div><div style="margin-left:120px">^((dx * dx) + (dy * dy)) sqrt]. </div><div style="margin-left:40px">].</div><div><br></div><div><div>I am reaching out for ideas or direction on how to do such experiments. I would rather avoid touching the current  compiler. Maybe defining this alternative syntax that compiles to regular Smalltalk. Nowadays PEG parsers are very trendy. Is there one available for any of the Squeak/Smalltalk flavours?</div><div><br></div><div>Thanks,</div><div>Francisco<br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div></div>
</div></blockquote>
                                        </div></body>