6 messages
Open this post in threaded view
|

 I have one question about Fraction. When I print a fraction like 1/2 in the Playground I obtain (1/2) and when I inspect I obtain ((1/2)). Why do we need all these parentheses ? I didn't try with a current Pharo 6.0 image, because my bandwidth is quite limited right now (Vietnam). -- Serge Stinckwich UCBN & UMI UMMISCO 209 (IRD/UPMC) Every DSL ends up being Smalltalk http://www.doesnotunderstand.org/
Open this post in threaded view
|

## Re: About Fraction and parentheses

 Hi sergethe printing should be normal because like that you are ready to type 1/3 + 2/3 and get 1. Now I do not get why you get ((1/2)) thanks for reporting it.StefOn Mon, Dec 19, 2016 at 9:08 AM, Serge Stinckwich wrote:I have one question about Fraction. When I print a fraction like 1/2 in the Playground I obtain (1/2) and when I inspect I obtain ((1/2)). Why do we need all these parentheses ? I didn't try with a current Pharo 6.0 image, because my bandwidth is quite limited right now (Vietnam). -- Serge Stinckwich UCBN & UMI UMMISCO 209 (IRD/UPMC) Every DSL ends up being Smalltalk http://www.doesnotunderstand.org/
Open this post in threaded view
|

## Re: About Fraction and parentheses

 > On 19 Dec 2016, at 22:00, Stephane Ducasse <[hidden email]> wrote: > > Hi serge > > the printing should be normal because like that you are ready to type > 1/3 + 2/3 and get 1. No, not at all: 1/3 + 2/3   "(7/9)" These are all just binary messages evaluated left to right, like this: ((1/3) + 2)/3     "(7/9)" That is why you need the parenthesis in certain contexts. Now adding two of them is definitively wrong. (1/3) + (2/3)   "1" (The first parenthesis are not needed, btw). > Now I do not get why you get ((1/2)) thanks for reporting it. > > Stef > > On Mon, Dec 19, 2016 at 9:08 AM, Serge Stinckwich <[hidden email]> wrote: > I have one question about Fraction. > > When I print a fraction like 1/2 in the Playground I obtain (1/2) and > when I inspect I obtain ((1/2)). Why do we need all these parentheses > ? > > I didn't try with a current Pharo 6.0 image, because my bandwidth is > quite limited right now (Vietnam). > > -- > Serge Stinckwich > UCBN & UMI UMMISCO 209 (IRD/UPMC) > Every DSL ends up being Smalltalk > http://www.doesnotunderstand.org/> >
Open this post in threaded view
|

## Re: About Fraction and parentheses

 I think that I know that :)And this is why I mentioned that if you print 1/3 it prints (1/3) so that we can continue typing + (2/3)On Mon, Dec 19, 2016 at 11:02 PM, Sven Van Caekenberghe wrote: > On 19 Dec 2016, at 22:00, Stephane Ducasse <[hidden email]> wrote: > > Hi serge > > the printing should be normal because like that you are ready to type > 1/3 + 2/3 and get 1. No, not at all: 1/3 + 2/3   "(7/9)" These are all just binary messages evaluated left to right, like this: ((1/3) + 2)/3   "(7/9)" That is why you need the parenthesis in certain contexts. Now adding two of them is definitively wrong. (1/3) + (2/3)   "1" (The first parenthesis are not needed, btw). > Now I do not get why you get ((1/2)) thanks for reporting it. > > Stef > > On Mon, Dec 19, 2016 at 9:08 AM, Serge Stinckwich <[hidden email]> wrote: > I have one question about Fraction. > > When I print a fraction like 1/2 in the Playground I obtain (1/2) and > when I inspect I obtain ((1/2)). Why do we need all these parentheses > ? > > I didn't try with a current Pharo 6.0 image, because my bandwidth is > quite limited right now (Vietnam). > > -- > Serge Stinckwich > UCBN & UMI UMMISCO 209 (IRD/UPMC) > Every DSL ends up being Smalltalk > http://www.doesnotunderstand.org/ > >