A small quiz: longest selector

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

A small quiz: longest selector

Pavel Krivanek-3
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

Reply | Threaded
Open this post in threaded view
|

Re: A small quiz: longest selector

Benjamin Van Ryseghem (Pharo)
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
>


Reply | Threaded
Open this post in threaded view
|

Re: A small quiz: longest selector

Sean P. DeNigris
Administrator
In reply to this post by Pavel Krivanek-3
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...
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: A small quiz: longest selector

Sven Van Caekenberghe-2
In reply to this post by Pavel Krivanek-3
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 <[hidden email]> 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
>


Reply | Threaded
Open this post in threaded view
|

Re: A small quiz: longest selector

Pavel Krivanek-3
in 20281 there is even longer method selector :-)

-- Pavel

On Thu, Sep 13, 2012 at 8:31 PM, Sven Van Caekenberghe <[hidden email]> 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 <[hidden email]> 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
>>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: A small quiz: longest selector

Sven Van Caekenberghe-2
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 <[hidden email]> wrote:

> in 20281 there is even longer method selector :-)
>
> -- Pavel
>
> On Thu, Sep 13, 2012 at 8:31 PM, Sven Van Caekenberghe <[hidden email]> 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 <[hidden email]> 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
>>>
>>
>>
>


Reply | Threaded
Open this post in threaded view
|

Re: A small quiz: longest selector

Pavel Krivanek-3
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 <[hidden email]> 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 <[hidden email]> wrote:
>
>> in 20281 there is even longer method selector :-)
>>
>> -- Pavel
>>
>> On Thu, Sep 13, 2012 at 8:31 PM, Sven Van Caekenberghe <[hidden email]> 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 <[hidden email]> 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
>>>>
>>>
>>>
>>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: A small quiz: longest selector

Esteban A. Maringolo
In reply to this post by Sven Van Caekenberghe-2
Good oneliner.

But why `Symbol allSymbols asSortedCollection last`

Doesn't return the same?

 






Reply | Threaded
Open this post in threaded view
|

Re: A small quiz: longest selector

Pavel Krivanek-3
it sorts by alphabetical order, not by symbol size

On Thu, Sep 13, 2012 at 10:21 PM, Esteban A. Maringolo
<[hidden email]> 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.
>

Reply | Threaded
Open this post in threaded view
|

Re: A small quiz: longest selector

Esteban A. Maringolo
Pavel Krivanek-3 wrote
it sorts by alphabetical order, not by symbol size
Excellent, I didn't look into its implementation.

Thank you Pavel.
Reply | Threaded
Open this post in threaded view
|

Re: A small quiz: longest selector

Sean P. DeNigris
Administrator
In reply to this post by Sven Van Caekenberghe-2
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...
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: A small quiz: longest selector

Hannes Hirzel
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 <[hidden email]> 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.
>
>

Reply | Threaded
Open this post in threaded view
|

Re: A small quiz: longest selector

Hannes Hirzel
On 9/13/12, H. Hirzel <[hidden email]> 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-smalltalk-libraries/

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 <[hidden email]> 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.
>>
>>
>