4 ms·
Quick side question on this piece of Smalltalk: my_func := [ 'Look, I'm a function!' ]. How does the string parsing work here? I like it a lot edit: welp
by fenollp 12y ago
Quick side question on this piece of Smalltalk:
my_func := [ 'Look, I'm a function!' ].
How does the string parsing work here? I like it a lot
edit: welp, this [1] makes it sound like 'Look, I'm a function!' is a typo and should in fact be 'Look, I''m a function!' (Note the double simple quote `I''m`)
But the idea to not need to escape single quotes when surrounded by something else than whitespace is interesting.
[1] https://gist.github.com/sin3141592/602700#file-smalltalk-grammar-L53 https://gist.github.com/sin3141592/602700#file-smalltalk-gra...
- klibertp 12y agoOMG, yeah, my bad - I tested the code with some other string in Pharo and then changed it when pasting it here. I should have known better and tested the exact code I was going to post :)