[Pharo-project] A small quiz: longest selector
Hi, I've got a small quiz question for fun: What is the length of the longest method selector in Pharo? Before you will write an oneliner to get the exact result, try to make a tip ;-) Cheers, -- Pavel
I will have bet on a Morphic method, but the result is surprising :) Ben On Sep 13, 2012, at 7:15 PM, Pavel Krivanek wrote:
Hi,
I've got a small quiz question for fun: What is the length of the longest method selector in Pharo?
Before you will write an oneliner to get the exact result, try to make a tip ;-)
Cheers, -- Pavel
Pavel Krivanek-3 wrote
Before you will write an oneliner to get the exact result, try to make a tip ;-)
#subclass:instanceVariableNames:classVariableNames:poolDictionaries:category: ? probably not, but that's the first thing that came to mind... -- View this message in context: http://forum.world.st/A-small-quiz-longest-selector-tp4647311p4647318.html Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
Symbol allSymbols detectMax: [ :each | each size ] MCClassDefinition>>#initializeWithName:superclassName:traitComposition:classTraitComposition:category:instVarNames:classVarNames:poolDictionaryNames:classInstVarNames:type:comment:commentStamp: 173 On 13 Sep 2012, at 19:15, Pavel Krivanek <pavel.krivanek@gmail.com> wrote:
Hi,
I've got a small quiz question for fun: What is the length of the longest method selector in Pharo?
Before you will write an oneliner to get the exact result, try to make a tip ;-)
Cheers, -- Pavel
in 20281 there is even longer method selector :-) -- Pavel On Thu, Sep 13, 2012 at 8:31 PM, Sven Van Caekenberghe <sven@stfx.eu> wrote:
Symbol allSymbols detectMax: [ :each | each size ]
MCClassDefinition>>#initializeWithName:superclassName:traitComposition:classTraitComposition:category:instVarNames:classVarNames:poolDictionaryNames:classInstVarNames:type:comment:commentStamp:
173
On 13 Sep 2012, at 19:15, Pavel Krivanek <pavel.krivanek@gmail.com> wrote:
Hi,
I've got a small quiz question for fun: What is the length of the longest method selector in Pharo?
Before you will write an oneliner to get the exact result, try to make a tip ;-)
Cheers, -- Pavel
Hmm, I did that in #281 ⦠How can there be a longer selector if that was the longest symbol ? This is fun ;-) On 13 Sep 2012, at 20:38, Pavel Krivanek <pavel.krivanek@gmail.com> wrote:
in 20281 there is even longer method selector :-)
-- Pavel
On Thu, Sep 13, 2012 at 8:31 PM, Sven Van Caekenberghe <sven@stfx.eu> wrote:
Symbol allSymbols detectMax: [ :each | each size ]
MCClassDefinition>>#initializeWithName:superclassName:traitComposition:classTraitComposition:category:instVarNames:classVarNames:poolDictionaryNames:classInstVarNames:type:comment:commentStamp:
173
On 13 Sep 2012, at 19:15, Pavel Krivanek <pavel.krivanek@gmail.com> wrote:
Hi,
I've got a small quiz question for fun: What is the length of the longest method selector in Pharo?
Before you will write an oneliner to get the exact result, try to make a tip ;-)
Cheers, -- Pavel
hmm, well, as I see I haven't used clean image, there was Tanker in it. One selector there has 189 characters :-) -- Pavel On Thu, Sep 13, 2012 at 9:12 PM, Sven Van Caekenberghe <sven@stfx.eu> wrote:
Hmm, I did that in #281 â¦
How can there be a longer selector if that was the longest symbol ?
This is fun ;-)
On 13 Sep 2012, at 20:38, Pavel Krivanek <pavel.krivanek@gmail.com> wrote:
in 20281 there is even longer method selector :-)
-- Pavel
On Thu, Sep 13, 2012 at 8:31 PM, Sven Van Caekenberghe <sven@stfx.eu> wrote:
Symbol allSymbols detectMax: [ :each | each size ]
MCClassDefinition>>#initializeWithName:superclassName:traitComposition:classTraitComposition:category:instVarNames:classVarNames:poolDictionaryNames:classInstVarNames:type:comment:commentStamp:
173
On 13 Sep 2012, at 19:15, Pavel Krivanek <pavel.krivanek@gmail.com> wrote:
Hi,
I've got a small quiz question for fun: What is the length of the longest method selector in Pharo?
Before you will write an oneliner to get the exact result, try to make a tip ;-)
Cheers, -- Pavel
Good oneliner. But why `Symbol allSymbols asSortedCollection last` Doesn't return the same? -- View this message in context: http://forum.world.st/A-small-quiz-longest-selector-tp4647311p4647355.html Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
it sorts by alphabetical order, not by symbol size On Thu, Sep 13, 2012 at 10:21 PM, Esteban A. Maringolo <emaringolo@gmail.com> wrote:
Good oneliner.
But why `Symbol allSymbols asSortedCollection last`
Doesn't return the same?
-- View this message in context: http://forum.world.st/A-small-quiz-longest-selector-tp4647311p4647355.html Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
Pavel Krivanek-3 wrote
it sorts by alphabetical order, not by symbol size
Excellent, I didn't look into its implementation. Thank you Pavel. -- View this message in context: http://forum.world.st/A-small-quiz-longest-selector-tp4647311p4647357.html Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
Sven Van Caekenberghe-2 wrote
#detectMax:
Woot! I've needed this several times and hand-rolled something because I didn't know it existed... and to think this thread started as a joke... -- View this message in context: http://forum.world.st/A-small-quiz-longest-selector-tp4647311p4647366.html Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
This means that a browser which is just like a regular natural language dictionary could be useful. A list of buttons (or a list) with A...Z and then just the list of selectors and their class and comment. Not actually new thing. I think Ernest Micklei from the Netherlands had a web site displaying Smalltalk methods this way it seems no longer accessible. Such a list in the browser would be much handier. --Hannes Another note: The discussion about Symbols reminds me that we actually have 'Atoms' in Smalltalk. More on this see http://live.exept.de/doc/online/english/programming/stForLispers.html "Like Lisp, Smalltalk provides atomic character strings, called "symbols". In Smalltalk, these behave much like strings, with the exception of being read-only (i.e. their character elements cannot be changed) and being unique (i.e. they can be compared using the identity compare operator #'==', as opposed to strings, which should be compared using the equality operator #'='). The Smalltalk message "asSymbol" corresponds to the Scheme "string->symbol" function. " On 9/13/12, Sean P. DeNigris <sean@clipperadams.com> wrote:
Sven Van Caekenberghe-2 wrote
#detectMax:
Woot! I've needed this several times and hand-rolled something because I didn't know it existed... and to think this thread started as a joke...
-- View this message in context: http://forum.world.st/A-small-quiz-longest-selector-tp4647311p4647366.html Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
On 9/13/12, H. Hirzel <hannes.hirzel@gmail.com> wrote:
This means that a browser which is just like a regular natural language dictionary could be useful. A list of buttons (or a list) with A...Z and then just the list of selectors and their class and comment.
Not actually new thing. I think Ernest Micklei from the Netherlands had a web site displaying Smalltalk methods this way it seems no longer accessible.
Here is the blog entry http://ernestmicklei.com/2009/11/13/soek-goodies-st-exploring-open-source-sm... However the actual product http://soek.goodies.st/ is no longer available....
Such a list in the browser would be much handier.
--Hannes
Another note:
The discussion about Symbols reminds me that we actually have 'Atoms' in Smalltalk. More on this see http://live.exept.de/doc/online/english/programming/stForLispers.html
"Like Lisp, Smalltalk provides atomic character strings, called "symbols". In Smalltalk, these behave much like strings, with the exception of being read-only (i.e. their character elements cannot be changed) and being unique (i.e. they can be compared using the identity compare operator #'==', as opposed to strings, which should be compared using the equality operator #'='). The Smalltalk message "asSymbol" corresponds to the Scheme "string->symbol" function. "
On 9/13/12, Sean P. DeNigris <sean@clipperadams.com> wrote:
Sven Van Caekenberghe-2 wrote
#detectMax:
Woot! I've needed this several times and hand-rolled something because I didn't know it existed... and to think this thread started as a joke...
-- View this message in context: http://forum.world.st/A-small-quiz-longest-selector-tp4647311p4647366.html Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
participants (6)
-
Benjamin -
Esteban A. Maringolo -
H. Hirzel -
Pavel Krivanek -
Sean P. DeNigris -
Sven Van Caekenberghe