Hi all,
I am bulding some Strings to have nice textual representations of some of my objects. What is happening a lot is code like this: self foo , ' in ', (String with: Character cr), self bar. Is there some syntactic sugar for String with: Character cr to make these things nicer ? -- Johan Fabry [hidden email] - http://dcc.uchile.cl/~jfabry PLEIAD Lab - Computer Science Department (DCC) - University of Chile _______________________________________________ Pharo-users mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users |
On Jan 25, 2010, at 4:16 PM, Johan Fabry wrote: > Hi all, > > I am bulding some Strings to have nice textual representations of some > of my objects. What is happening a lot is code like this: > self foo , ' in ', (String with: Character cr), self bar. > > Is there some syntactic sugar for String with: Character cr to make > these things nicer ? Character cr asString ? -- Marcus Denker -- http://www.marcusdenker.de INRIA Lille -- Nord Europe. Team RMoD. _______________________________________________ Pharo-users mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users |
On Mon, Jan 25, 2010 at 4:19 PM, Marcus Denker <[hidden email]> wrote:
String cr ?
_______________________________________________ Pharo-users mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users |
On Mon, Jan 25, 2010 at 4:21 PM, Mariano Martinez Peck <[hidden email]> wrote:
I meant, self foo , ' in ', String cr, self bar.
_______________________________________________ Pharo-users mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users |
On 25 Jan 2010, at 12:22, Mariano Martinez Peck wrote: > String cr ? > > > I meant, self foo , ' in ', String cr, self bar. Nice and short, that will do. Thanks Mariano, Marcus! -- Johan Fabry [hidden email] - http://dcc.uchile.cl/~jfabry PLEIAD Lab - Computer Science Department (DCC) - University of Chile _______________________________________________ Pharo-users mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users |
On 25 Jan 2010, at 16:43, Johan Fabry wrote: >> I meant, self foo , ' in ', String cr, self bar. > Nice and short, that will do. Thanks Mariano, Marcus! Well, thats not what I would call nice and short... but its probably clean. Isn't there anything better for throw away debug code? some like a nice and short (and pretty universal) '\n'? Best Stefan > -- > Johan Fabry > [hidden email] - http://dcc.uchile.cl/~jfabry > PLEIAD Lab - Computer Science Department (DCC) - University of Chile > > > > > _______________________________________________ > Pharo-users mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users -- Stefan Marr Software Languages Lab Vrije Universiteit Brussel Pleinlaan 2 / B-1050 Brussels / Belgium http://soft.vub.ac.be/~smarr Phone: +32 2 629 3956 Fax: +32 2 629 3525 _______________________________________________ Pharo-users mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users |
On Jan 25, 2010, at 5:21 PM, Stefan Marr wrote: > > On 25 Jan 2010, at 16:43, Johan Fabry wrote: >>> I meant, self foo , ' in ', String cr, self bar. >> Nice and short, that will do. Thanks Mariano, Marcus! > Well, thats not what I would call nice and short... > but its probably clean. > > Isn't there anything better for throw away debug code? some like a nice and short (and pretty universal) '\n'? String lf :) '\ ljkljk' withCrs Stef > Best > Stefan > > >> -- >> Johan Fabry >> [hidden email] - http://dcc.uchile.cl/~jfabry >> PLEIAD Lab - Computer Science Department (DCC) - University of Chile >> >> >> >> >> _______________________________________________ >> Pharo-users mailing list >> [hidden email] >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users > > -- > Stefan Marr > Software Languages Lab > Vrije Universiteit Brussel > Pleinlaan 2 / B-1050 Brussels / Belgium > http://soft.vub.ac.be/~smarr > Phone: +32 2 629 3956 > Fax: +32 2 629 3525 > > > _______________________________________________ > Pharo-users mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users _______________________________________________ Pharo-users mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users |
On Mon, Jan 25, 2010 at 9:07 PM, Stéphane Ducasse <[hidden email]> wrote:
Cool! I wasn't aware of that one :) A minor detail, it is '\ ljkl \jk' withCRs Upper case R :)
_______________________________________________ Pharo-users mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users |
In reply to this post by jfabry
You can also just do the line-break in the string literal, ie
self foo , ' in ', self bar. As an alternative you might also consider '<1s> in<n><2s>' expandMacrosWith: self foo with: self bar cheers, AA -- Follow me on http://twitter.com/akuhn |
Free forum by Nabble | Edit this page |