On Thu, May 8, 2014 at 9:37 AM, Sven Van Caekenberghe <sven@stfx.eu> wrote:
On 07 May 2014, at 23:25, Nicolas Cellier < nicolas.cellier.aka.nice@gmail.com> wrote:
I love these kind of snippets :)
I have built a collection of freak expressions in Squeak3.9. Pharo 3.0 is less spectacular, above collection is shrinking dangerously... but there are still some not so unsurprising features to test for:
These are actually not that funny, we should try to do something about them, or at least discuss them a bit.
'hello' copyReplaceFrom: 6 to: 4 with: 'world'.
#copyReplaceFrom:to:with: seems overloaded with the insert case, is that really necessary ? still the fact that the $o appears twice feels like a bug, no ?
'Helloworldo' was indeed very surprising. Silent failures like this seem pretty dangerous to me.
(5 to: 10) at: 1.3.
understandable, scary, wrong, maybe use #asInteger on the index ?
Especially when the index is intention revealing as in 'anInteger' :-(
'' , #[119 104 97 116 63]. #[] , 'what?'. "honour is safe, it's sorta symmetric..."
that is the ByteString/ByteArray dichotomy at work, may enforce the #species of the receiver and argument to be equal ?
Would you mind enlighten me on this dichotomy? In ByteArray I do see: asString "Convert to a String with Characters for each byte. Fast code uses primitive that avoids character conversion" ^ (String new: self size) replaceFrom: 1 to: self size with: self Ah, replaceFrom:to:with: again... It is the same Collection code for all of these. And now, we get >>asString, >>asWideString And in String>>new: sizeRequested "Answer an instance of this class with the number of indexable variables specified by the argument, sizeRequested." self == String ifTrue:[^ByteString new: sizeRequested] ifFalse:[^self basicNew: sizeRequested]. Mmh, okay... 1) no primitive in a method that says "Fast code uses primitive to avoid character conversion": is that normal? 2) self == String, so ^ByteString new I'd love to know if there is a clear explanation of all of this somewhere. Is there one?
"Cases of special syntax. Is the behavior officially supported in some EBNF?" -2r-1. - 2. "Note the space between the two letters"
These are at the (number) syntax level. Again scary, we should be (much) stricter in parsing.
The second - 2. I do not get as it prints a -2 SmallInteger. What's wrong there? Do you mean - 2 shouldn't be parsable? That I can get. Phil
2014-05-07 22:47 GMT+02:00 phil@highoctane.be <phil@highoctane.be>:
Le 7 mai 2014 22:17, "kilon alios" <kilon.alios@gmail.com> a écrit :
I dont know if you guys are aware of this talk, very funny , quite
weird , so I thought why not share it with you
Yeah, Amber kind of alleviates some of these pain points...