SuffixConditionals adds #if: and #unless methods to BlockClosure. Currently in VisualWorks but can be ported to other Smalltalks (like Pharo) as well.
Read here: http://forum.world.st/ANN-SuffixConditionals-td4755785.html Code is on Cincom Public Repo and snaphots on https://github.com/randycoulman/SuffixConditionals |
Administrator
|
Good idea! It is MIT and would be a great bridge for a Ruby community in the spirit of http://forum.world.st/a-Pharo-talk-from-a-ruby-conference-tp4756805p4757055.html : FAQ Q: ifTrue: and ifFalse: look weird to me. Why can't I have more readable control flow statements like Ruby? A: You can! Simply load SuffixConditionals from the Configuration Browser and you can write things like: [process stop] if: process isRunning and [process start] unless: process isRunning Also would be a great answer when this inevitably comes up in the endless "why isn't Smalltalk as popular as Ruby" conversations (http://stackoverflow.com/a/438986/424245)
Cheers,
Sean |
As it is MIT I ported it to Pharo:
Code is available on http://smalltalkhub.com/#!/~TorstenBergmann/SuffixConditionals One can load it from the config browser Bye T. > Gesendet: Mittwoch, 30. April 2014 um 14:29 Uhr > Von: "Sean P. DeNigris" <[hidden email]> > An: [hidden email] > Betreff: Re: [Pharo-dev] SuffixConditionals > > Torsten Bergmann wrote > > SuffixConditionals adds #if: and #unless methods to BlockClosure. > > Currently in VisualWorks but can be ported to other Smalltalks (like > > Pharo) as well. > > Good idea! It is MIT and would be a great bridge for a Ruby community in the > spirit of > http://forum.world.st/a-Pharo-talk-from-a-ruby-conference-tp4756805p4757055.html > : > FAQ > Q: ifTrue: and ifFalse: look weird to me. Why can't I have more readable > control flow statements like Ruby? > A: You can! Simply load SuffixConditionals from the Configuration Browser > and you can write things like: > [process stop] if: process isRunning > and > [process start] unless: process isRunning > > Also would be a great answer when this inevitably comes up in the endless > "why isn't Smalltalk as popular as Ruby" conversations > (http://stackoverflow.com/a/438986/424245) > > > > ----- > Cheers, > Sean > -- > View this message in context: http://forum.world.st/SuffixConditionals-tp4757183p4757212.html > Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com. > > |
Administrator
|
On Apr 30, 2014, at 9:59 AM, Torsten Bergmann [via Smalltalk] <[hidden email]> wrote: > As it is MIT I ported it to Pharo: Cool! Thanks :) Was it straightforward to port? I haven’t ported anything from VW in a while. Xtreams was in my sights - we did a proof of concept with filetree and cyprus mapping namespaces to prefixes. Should revisit that...
Cheers,
Sean |
In reply to this post by Torsten Bergmann
Thanks Torsten.
I've been using my own favorite suffix conditional: #haltIfTrue. Regards! Esteban A. Maringolo 2014-04-30 10:57 GMT-03:00 Torsten Bergmann <[hidden email]>: > As it is MIT I ported it to Pharo: > > Code is available on > http://smalltalkhub.com/#!/~TorstenBergmann/SuffixConditionals > > One can load it from the config browser > > Bye > T. > >> Gesendet: Mittwoch, 30. April 2014 um 14:29 Uhr >> Von: "Sean P. DeNigris" <[hidden email]> >> An: [hidden email] >> Betreff: Re: [Pharo-dev] SuffixConditionals >> >> Torsten Bergmann wrote >> > SuffixConditionals adds #if: and #unless methods to BlockClosure. >> > Currently in VisualWorks but can be ported to other Smalltalks (like >> > Pharo) as well. >> >> Good idea! It is MIT and would be a great bridge for a Ruby community in the >> spirit of >> http://forum.world.st/a-Pharo-talk-from-a-ruby-conference-tp4756805p4757055.html >> : >> FAQ >> Q: ifTrue: and ifFalse: look weird to me. Why can't I have more readable >> control flow statements like Ruby? >> A: You can! Simply load SuffixConditionals from the Configuration Browser >> and you can write things like: >> [process stop] if: process isRunning >> and >> [process start] unless: process isRunning >> >> Also would be a great answer when this inevitably comes up in the endless >> "why isn't Smalltalk as popular as Ruby" conversations >> (http://stackoverflow.com/a/438986/424245) >> >> >> >> ----- >> Cheers, >> Sean >> -- >> View this message in context: http://forum.world.st/SuffixConditionals-tp4757183p4757212.html >> Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com. >> >> > |
In reply to this post by Sean P. DeNigris
It was a "no-brainer", I did'nt even load the code into VisualWorks
(which I do not have installed these days as I have no up to date copy/version). I just checked https://github.com/randycoulman/SuffixConditionals, the *.pst files are XML files and are therefore readable. 3 extension methods if:, unless:, and if:else: methods to BlockClosure plus a few tests. Feel free to do the same with Xtreams ;) Bye T. Gesendet: Mittwoch, 30. April 2014 um 16:07 Uhr Von: "Sean P. DeNigris" <[hidden email]> An: [hidden email] Betreff: Re: [Pharo-dev] SuffixConditionals On Apr 30, 2014, at 9:59 AM, Torsten Bergmann [via Smalltalk] <[hidden email]> wrote: > As it is MIT I ported it to Pharo: Cool! Thanks :) Was it straightforward to port? I haven’t ported anything from VW in a while. Xtreams was in my sights - we did a proof of concept with filetree and cyprus mapping namespaces to prefixes. Should revisit that... Cheers, Sean ------------------------------------------------------------ View this message in context: Re: SuffixConditionals[http://forum.world.st/SuffixConditionals-tp4757183p4757233.html] Sent from the Pharo Smalltalk Developers mailing list archive[http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html] at Nabble.com. |
Administrator
|
I just checked https://github.com/randycoulman/SuffixConditionals, the *.pstHa, cool!
Cheers,
Sean |
Free forum by Nabble | Edit this page |