[Pharo-project] Argument names created by Debugger
I tweaked the code because in my most common case, I don't care that it's e.g. aByteString, but only that it's aString: (argument isKindOf: String) ifTrue: [ ^ 'aString' ]. (argument isKindOf: Collection) ifTrue: [ ^ 'aCollection' ]. (argument isKindOf: Integer) ifTrue: [ ^ 'anInteger' ]. Am I the only one, or would this be useful for everyone? lmk and I'll prepare a slice... ----- Cheers, Sean -- View this message in context: http://forum.world.st/Argument-names-created-by-Debugger-tp4682387.html Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
On 18 April 2013 21:15, Sean P. DeNigris <sean@clipperadams.com> wrote:
I tweaked the code because in my most common case, I don't care that it's e.g. aByteString, but only that it's aString:
(argument isKindOf: String) ifTrue: [ ^ 'aString' ]. (argument isKindOf: Collection) ifTrue: [ ^ 'aCollection' ]. (argument isKindOf: Integer) ifTrue: [ ^ 'anInteger' ].
Am I the only one, or would this be useful for everyone? lmk and I'll prepare a slice...
That sounds like a very useful thing to have. frank
----- Cheers, Sean
On 18 April 2013 21:17, Frank Shearar <frank.shearar@gmail.com> wrote:
On 18 April 2013 21:15, Sean P. DeNigris <sean@clipperadams.com> wrote:
I tweaked the code because in my most common case, I don't care that it's e.g. aByteString, but only that it's aString:
(argument isKindOf: String) ifTrue: [ ^ 'aString' ]. (argument isKindOf: Collection) ifTrue: [ ^ 'aCollection' ]. (argument isKindOf: Integer) ifTrue: [ ^ 'anInteger' ].
Am I the only one, or would this be useful for everyone? lmk and I'll prepare a slice...
That sounds like a very useful thing to have.
Belatedly, a comment: I usually turn numeric things into aNumber. You particularly want to hint at the separate treatment of Integer and friends from ScaledDecimal, Fraction, Float? frank
frank
----- Cheers, Sean
Frank Shearar-3 wrote
Belatedly, a comment: I usually turn numeric things into aNumber. You particularly want to hint at the separate treatment of Integer and friends from ScaledDecimal, Fraction, Float?
Particularly with Integers, I find that it matters more often than not e.g. for indices, etc. But I agree that for other numeric types, Number would be a good default... I'll add that :) ----- Cheers, Sean -- View this message in context: http://forum.world.st/Argument-names-created-by-Debugger-tp4682387p4682399.h... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
On 18 April 2013 22:15, Sean P. DeNigris <sean@clipperadams.com> wrote:
I tweaked the code because in my most common case, I don't care that it's e.g. aByteString, but only that it's aString:
(argument isKindOf: String) ifTrue: [ ^ 'aString' ]. (argument isKindOf: Collection) ifTrue: [ ^ 'aCollection' ]. (argument isKindOf: Integer) ifTrue: [ ^ 'anInteger' ].
Am I the only one, or would this be useful for everyone? lmk and I'll prepare a slice...
plus one.
----- Cheers, Sean -- View this message in context: http://forum.world.st/Argument-names-created-by-Debugger-tp4682387.html Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
-- Best regards, Igor Stasenko.
a bit smarter system does not hurt. Stef On Apr 18, 2013, at 10:15 PM, Sean P. DeNigris <sean@clipperadams.com> wrote:
I tweaked the code because in my most common case, I don't care that it's e.g. aByteString, but only that it's aString:
(argument isKindOf: String) ifTrue: [ ^ 'aString' ]. (argument isKindOf: Collection) ifTrue: [ ^ 'aCollection' ]. (argument isKindOf: Integer) ifTrue: [ ^ 'anInteger' ].
Am I the only one, or would this be useful for everyone? lmk and I'll prepare a slice...
----- Cheers, Sean -- View this message in context: http://forum.world.st/Argument-names-created-by-Debugger-tp4682387.html Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
Am 18.04.2013 um 22:15 schrieb "Sean P. DeNigris" <sean@clipperadams.com>:
I tweaked the code because in my most common case, I don't care that it's e.g. aByteString, but only that it's aString:
(argument isKindOf: String) ifTrue: [ ^ 'aString' ]. (argument isKindOf: Collection) ifTrue: [ ^ 'aCollection' ]. (argument isKindOf: Integer) ifTrue: [ ^ 'anInteger' ].
Am I the only one, or would this be useful for everyone? lmk and I'll prepare a slice...
Sure, strikes me all the time! What keeps you from delegating this to the argument object itself. It doesn't need to be the name selector. Norbert
On 18 April 2013 23:02, Norbert Hartl <norbert@hartl.name> wrote:
Am 18.04.2013 um 22:15 schrieb "Sean P. DeNigris" <sean@clipperadams.com>:
I tweaked the code because in my most common case, I don't care that it's e.g. aByteString, but only that it's aString:
(argument isKindOf: String) ifTrue: [ ^ 'aString' ]. (argument isKindOf: Collection) ifTrue: [ ^ 'aCollection' ]. (argument isKindOf: Integer) ifTrue: [ ^ 'anInteger' ].
Am I the only one, or would this be useful for everyone? lmk and I'll prepare a slice...
Sure, strikes me all the time! What keeps you from delegating this to the argument object itself. It doesn't need to be the name selector.
Indeed... To the hell these case statements. It should be one-liner: ^ argument class canonicalArgumentName
Norbert
-- Best regards, Igor Stasenko.
Igor Stasenko wrote
Indeed... To the hell these case statements. It should be one-liner:
^ argument class canonicalArgumentName
+1 I was thinking the same thing... it started as a one-line hack for ByteString and... well, you know ;) ----- Cheers, Sean -- View this message in context: http://forum.world.st/Argument-names-created-by-Debugger-tp4682387p4682409.h... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
On 18 April 2013 22:19, Sean P. DeNigris <sean@clipperadams.com> wrote:
Igor Stasenko wrote
Indeed... To the hell these case statements. It should be one-liner:
^ argument class canonicalArgumentName
+1 I was thinking the same thing... it started as a one-line hack for ByteString and... well, you know ;)
Just don't forget to categorise the methods correctly: they belong in the same category as the Debugger. I try avoid class-side stuff so I just put #canonicalArgumentName on Class (for instance). So 1 canonicalArgumentName = 'Integer'. You could add Boolean as well, to avoid creating a name like 'aTrue'. I've nicked your idea for Squeak, Sean. And it flushed out a bug in my recent Debugger hackings too! [1] So when I finally get around to porting my "just in time development" hacks to Pharo, there'll hopefully be one less bug in it. Thanks! frank [1] http://bugs.squeak.org/view.php?id=7761
----- Cheers, Sean -- View this message in context: http://forum.world.st/Argument-names-created-by-Debugger-tp4682387p4682409.h... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
Frank Shearar-3 wrote
You could add Boolean as well, to avoid creating a name like 'aTrue'.
Ooh, good idea! Okay, there's obviously enough interest. I'll get on it... https://pharo.fogbugz.com/f/cases/10314/Debugger-create-better-argument-name... ----- Cheers, Sean -- View this message in context: http://forum.world.st/Argument-names-created-by-Debugger-tp4682387p4682445.h... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
finally, someone with a sense of opportunity :) +100 On Apr 19, 2013, at 5:39 AM, "Sean P. DeNigris" <sean@clipperadams.com> wrote:
Frank Shearar-3 wrote
You could add Boolean as well, to avoid creating a name like 'aTrue'.
Ooh, good idea! Okay, there's obviously enough interest. I'll get on it...
https://pharo.fogbugz.com/f/cases/10314/Debugger-create-better-argument-name...
----- Cheers, Sean -- View this message in context: http://forum.world.st/Argument-names-created-by-Debugger-tp4682387p4682445.h... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
EstebanLM wrote
finally, someone with a sense of opportunity :)
Fix in inbox: SLICE-Issue-10314-Debugger-create-better-argument-names-SeanDeNigris.1 Issue 10314: Debugger: create better argument names - For sub-instances of Collection, Integer, Class, Number, and String; use those classes to create argument names e.g. aByteString -> aString - Add tests for new behavior - Clean up and update DynamicMessageImplementorTest ----- Cheers, Sean -- View this message in context: http://forum.world.st/Argument-names-created-by-Debugger-tp4682387p4690543.h... Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
Am 18.04.2013 um 23:13 schrieb Igor Stasenko <siguctua@gmail.com>:
On 18 April 2013 23:02, Norbert Hartl <norbert@hartl.name> wrote:
Am 18.04.2013 um 22:15 schrieb "Sean P. DeNigris" <sean@clipperadams.com>:
I tweaked the code because in my most common case, I don't care that it's e.g. aByteString, but only that it's aString:
(argument isKindOf: String) ifTrue: [ ^ 'aString' ]. (argument isKindOf: Collection) ifTrue: [ ^ 'aCollection' ]. (argument isKindOf: Integer) ifTrue: [ ^ 'anInteger' ].
Am I the only one, or would this be useful for everyone? lmk and I'll prepare a slice...
Sure, strikes me all the time! What keeps you from delegating this to the argument object itself. It doesn't need to be the name selector.
Indeed... To the hell these case statements. It should be one-liner:
^ argument class canonicalArgumentName
Yes. Or ^ argument class mostCommonDialectIndependentSuperClass name Well, I suck at names but you get the idea :) And demeter shall forgive me this time. Norbert
participants (6)
-
Esteban Lorenzano -
Frank Shearar -
Igor Stasenko -
Norbert Hartl -
Sean P. DeNigris -
stephane ducasse