Re: [Pharo-dev] printing Symbol

2020-01-20 Thread ducasse
In fact I did it because this is irregular in the sense that binary selector should not printed with # while the keywords based symbol should. (RBScanner on: '(RBScanner on: 'Object < #MyObject classVariables: { #A. #B }; package: #MyPackage' readStream)

Re: [Pharo-dev] printing Symbol

2020-01-20 Thread ducasse
Hi sven I think that I will have to hack my own, I was just surprised that we do not have a nice way back from tokens back to code. (not talking about quote inside strings). String streamContents: [ :s | #('self' 'classVariables:' ${ #A $. #B $}) do:

Re: [Pharo-dev] printing Symbol

2020-01-20 Thread Sven Van Caekenberghe
#foo printString. '#foo' String streamContents: [ :out | out print: #foo ]. '#foo' String streamContents: [ :out | out << #foo ]. 'foo' I would not use #storeOn: directly, I would consider the fact that String>>#printOn: uses it an implementation detail, and a confusing one at that. > On

Re: [Pharo-dev] printing Symbol

2020-01-19 Thread Eliot Miranda
> On Jan 19, 2020, at 1:50 PM, Stéphane Ducasse > wrote: > >  > The idea that is that I would like to be able to > > text -> tokens -> text > > For text -> tokens > > (RBScanner on: 'self classVariables: { #A . #B }' readStream) > contents collect: #value > > > I

[Pharo-dev] printing Symbol

2020-01-19 Thread Stéphane Ducasse
The idea that is that I would like to be able to text -> tokens -> text For text -> tokens (RBScanner on: 'self classVariables: { #A . #B }' readStream) contents collect: #value I wrote a little method that takes the result of the RBScanner and recreate the text But