Re: [Pharo-users] BLOG: Block Translators - parsing magic

2014-09-23 Thread Udo Schneider
Hi Estaban, I think the first time I saw this pattern was in ReStore on Dolphin Smalltalk. I didn't understand it's implementation back then. I assume that it's similar to what I described though. But having a Smalltalk block automagically creating the equivalent SQL SELECT expression was

Re: [Pharo-users] BLOG: Block Translators - parsing magic

2014-09-23 Thread Thierry Goubier
Thanks Udo; I reviewed a few techniques for implementing internal / embeddel DSLs in a host language and I didn't saw this one :) Thierry 2014-09-23 1:48 GMT+02:00 Udo Schneider udo.schnei...@homeaddress.de: All, I just finished a blog entry. It shows how to use Smalltalk blocks as

Re: [Pharo-users] BLOG: Block Translators - parsing magic

2014-09-23 Thread kilon alios
just as it is black magic for me now :D At least I get the general feeling. I am new to parsing too, so far I have only played with regex parsing. Not the most smalltalkish way but it works well so far. On Tue, Sep 23, 2014 at 9:39 AM, Udo Schneider udo.schnei...@homeaddress.de wrote: Hi

Re: [Pharo-users] BLOG: Block Translators - parsing magic

2014-09-23 Thread Udo Schneider
just as it is black magic for me now :D The nice thing about this approach is the fact that it just piggybacks the normal Smalltalk message sending. So you can step through it using the Debugger - it's Smalltalk all the way down. I still remember my first shock when (having no formal

Re: [Pharo-users] BLOG: Block Translators - parsing magic

2014-09-23 Thread kilon alios
it reminds a lot of Kent's Beck Smalltalk Practice Patterns where it removes all ifs and replaces them with regular unary messages . It is definitely an elegant way of coding making the code just flow. I have not used PettitParser yet, looks powerful but I find it a bit weird in design. On the

Re: [Pharo-users] BLOG: Block Translators - parsing magic

2014-09-23 Thread p...@highoctane.be
Cool article technique indeed. Ah Smalltalk, where were you all those years ;-) Speaking of PetitParser, which is excellent indeed, there is this #== method in Boolean. PetitParser uses that a lot. I can use the thing but do not really grasps how it works. Now, the method comment says:

Re: [Pharo-users] BLOG: Block Translators - parsing magic

2014-09-23 Thread p...@highoctane.be
On Tue, Sep 23, 2014 at 10:15 AM, kilon alios kilon.al...@gmail.com wrote: it reminds a lot of Kent's Beck Smalltalk Practice Patterns where it removes all ifs and replaces them with regular unary messages . It is definitely an elegant way of coding making the code just flow. I have not used

Re: [Pharo-users] LF instead of CR for new lines or writing about Pharo inside Pharo

2014-09-23 Thread Ben Coman
Offray Vladimir Luna Cárdenas wrote: Hi :-), A small answer to myself that can be useful is someone find this thread: I have seen some post on Internet about CR and LF issues on Pharo Smalltalk, like this: [1]

Re: [Pharo-users] BLOG: Block Translators - parsing magic

2014-09-23 Thread Udo Schneider
I have not used PettitParser yet, looks powerful but I find it a bit weird in design. On the other hand regex is quite ugly and understanding complex regex a pain. I normally encounter two issues with RegExps: 1) The syntax between different apps/libs/frameworks differs sligtly. Esp. for

Re: [Pharo-users] LF instead of CR for new lines or writing about Pharo inside Pharo

2014-09-23 Thread Henrik Johansen
On 23 Sep 2014, at 6:28 , Offray Vladimir Luna Cárdenas off...@riseup.net wrote: Hi :-), A small answer to myself that can be useful is someone find this thread: I have seen some post on Internet about CR and LF issues on Pharo Smalltalk, like this: [1]

Re: [Pharo-users] Forcing a library to load

2014-09-23 Thread Annick Fron
And with FFI and Alien ? Do FFI Alien and NativeBoost share the same libraries ? Le 22 sept. 2014 à 21:19, p...@highoctane.be a écrit : NativeBoost has loadModule: aModuleName which should do the trick. Phil ​

Re: [Pharo-users] BLOG: Block Translators - parsing magic

2014-09-23 Thread Thierry Goubier
2014-09-23 13:35 GMT+02:00 kilon alios kilon.al...@gmail.com: yeap noway I compare Regex with PettitParser. I will probably give a PettitParser a try, because I try to parse Pharo syntax to Python, I want now to parse Pharo classes to python class and that will be a nightmare with regex, so

Re: [Pharo-users] BLOG: Block Translators - parsing magic

2014-09-23 Thread Udo Schneider
yeap noway I compare Regex with PettitParser. I will probably give a PettitParser a try, because I try to parse Pharo syntax to Python, I want now to parse Pharo classes to python class and that will be a nightmare with regex, so time to give PettitParser a serious try. Without wanting to go

Re: [Pharo-users] Ridiculous we are

2014-09-23 Thread Damien Cassou
On Mon, Sep 22, 2014 at 10:07 PM, Hilaire hila...@drgeo.eu wrote: However font path seems ok: File @ /home/hilaire/Téléchargements/DrGeo.app/Contents/Resources. Inspecting this path, it looks like 'Téléchargements' is 8 bits, but it should be utf-8, right? I recently read documents about

Re: [Pharo-users] BLOG: Block Translators - parsing magic

2014-09-23 Thread kilon alios
damn you guys speak in a language I am not aware of :D Looks like I have reading to do. Anyway regex worked fin for converting pharo messages to python method calls and assignment / reading variables . Regex was actually quite simple to learn. Now for classes I dont know if RBParser would be an

Re: [Pharo-users] Ridiculous we are

2014-09-23 Thread Hilaire
Le 23/09/2014 14:09, Damien Cassou a écrit : I recently read documents about utf-8 encoding. In all of them, the author says that pathnames should be kept as is because you never know which encoding the filesystem uses. So, a filename should probably be a bytearray. yes, but a #é should be

Re: [Pharo-users] BLOG: Block Translators - parsing magic

2014-09-23 Thread Udo Schneider
Confirmed in even a better way: given how convoluted and hacky is writing a full Python Parser, it is probably not even a Context Free Grammar. Let's agree on the fact that you'll be able to parse it using Context Sensitive Grammar (Type 1) for sure ... and if you're very lucky Context Free

Re: [Pharo-users] BLOG: Block Translators - parsing magic

2014-09-23 Thread Udo Schneider
Phil, If I remember correctly one of Andres Valloud's books has some more information on Boolean (logic) and Smalltalk. I think it was A Mentoring Course on Smalltalk [1]. Definitely worth a read!! CU, Udo [1]

Re: [Pharo-users] FFI examples on Linux don't work

2014-09-23 Thread Annick Fron
Thank you your examples work for me as well, and it’s pretty fast drawing ! Annick Le 23 sept. 2014 à 01:04, p...@highoctane.be a écrit : I've got the 32 bit ones. I checked. Nicolas got it working, I'll check. Phil On Tue, Sep 23, 2014 at 12:32 AM, Casimiro de Almeida Barreto

Re: [Pharo-users] BLOG: Block Translators - parsing magic

2014-09-23 Thread Thierry Goubier
2014-09-23 15:57 GMT+02:00 Udo Schneider udo.schnei...@homeaddress.de: Confirmed in even a better way: given how convoluted and hacky is writing a full Python Parser, it is probably not even a Context Free Grammar. Let's agree on the fact that you'll be able to parse it using Context

Re: [Pharo-users] BLOG: Block Translators - parsing magic

2014-09-23 Thread Udo Schneider
I reviewed a few techniques for implementing internal / embeddel DSLs in a host language and I didn't saw this one :) IMHO it's a nice tool to know about. Only for specific use cases but still useful. CU, Udo On 23.09.14 09:06, Thierry Goubier wrote: Thanks Udo; I reviewed a few

Re: [Pharo-users] BLOG: Block Translators - parsing magic

2014-09-23 Thread Udo Schneider
Hi Sven, thanks for the feedback. Keep that kind of stuff coming, it is very helpful. I'll try to. It just always takes so long to write stuff. But I think you know that, don't you? :-) CU, Udo On 23.09.14 16:00, Sven Van Caekenberghe wrote: Hi Udo, This is really an excellent article:

Re: [Pharo-users] BLOG: Block Translators - parsing magic

2014-09-23 Thread Sven Van Caekenberghe
On 23 Sep 2014, at 21:00, Udo Schneider udo.schnei...@homeaddress.de wrote: Hi Sven, thanks for the feedback. Keep that kind of stuff coming, it is very helpful. I'll try to. It just always takes so long to write stuff. But I think you know that, don't you? :-) Yes I do, but you also

Re: [Pharo-users] BLOG: Block Translators - parsing magic

2014-09-23 Thread Udo Schneider
Yes I do, but you also know (it was clear from the article) that you learn a lot yourself from writing something for public consumption. Most people underestimate how powerful that is. True indeed - sorting my thoughts to be able to write them down in a coherent way for public consumption

Re: [Pharo-users] BLOG: Block Translators - parsing magic

2014-09-23 Thread Udo Schneider
Phil, I mixed up the books. It Fundamentals of Smalltalk Programming Technique, Volume 1 by Andres Valloud. Just checked it. http://www.lulu.com/shop/andres-valloud/fundamentals-of-smalltalk-programming-technique-volume-1/paperback/product-5299835.html CU, Udo On 23.09.14 16:05, Udo

Re: [Pharo-users] Moose Software selfies: How to graph the story of a Monticello repo within Pharo/Moose/Roassal

2014-09-23 Thread Alexandre Bergel
Hi Offray, I have not had a look at your code, but I have the impression that the tricky part is getting the data. I guess you can open a repository, get all the files, and get the data from a .mcz file. When you click on the ‘Browse’ button in the Monticello browser, you can see all the