Re: [Pharo-users] Number is not accepted by UI

2014-07-16 Thread Camille Teruel
On 16 juil. 2014, at 11:12, Max Bareis wrote: > The misunderstanding her is based in the error message of the ui. > when you write > ^ - self width. > and save, the UI writes this text into the code: > ^ only numbers may be negated ->- self width. > > More helpful would have been something lik

Re: [Pharo-users] Number is not accepted by UI

2014-07-16 Thread Alain Busser
Then the browser had helped you, as you would have found that the "-" is a method for subtraction only. But it takes more time to look inside this browser... The reward is that you find gold nuggets here and there; for example, when I saw that there were a "asRomanLitteral" for the integers, I was

Re: [Pharo-users] Number is not accepted by UI

2014-07-16 Thread Norbert Hartl
Am 16.07.2014 um 11:12 schrieb Max Bareis : > The misunderstanding her is based in the error message of the ui. > when you write > ^ - self width. > and save, the UI writes this text into the code: > ^ only numbers may be negated ->- self width. > > More helpful would have been something like:

Re: [Pharo-users] Number is not accepted by UI

2014-07-16 Thread Max Bareis
The misunderstanding her is based in the error message of the ui. when you write ^ - self width. and save, the UI writes this text into the code: ^ only numbers may be negated ->- self width. More helpful would have been something like: „only literals may be negated with - use negated instead“.

Re: [Pharo-users] Number is not accepted by UI

2014-07-16 Thread Alain Busser
That's where the Inspector comes in: To debug, it is good to insert a self width inspect so that the inspector opens up and reveals what exactly the width is. OK, it is a number; then open the browser and look at the number's methods; or in the finder, try 2 . -2 in the examples... Pharo is excel

Re: [Pharo-users] Number is not accepted by UI

2014-07-15 Thread Verkoster Info
It definitely is, thanks for all your answers… Regards Max Am 16.07.2014 um 00:56 schrieb Camille Teruel : > I've been overtaken :) > Isn't that an active mailing list ? > > On 16 juil. 2014, at 00:53, Camille Teruel wrote: > > Hi Max, > Pharo doesn't have syntax for prefix oper

Re: [Pharo-users] Number is not accepted by UI

2014-07-15 Thread Camille Teruel
I've been overtaken :) Isn't that an active mailing list ? On 16 juil. 2014, at 00:53, Camille Teruel wrote: > Hi Max, > > Pharo doesn't have syntax for prefix operator like "-". > The parser does accepts a "-" before literal numbers but it's not possible > for arbitrary expressions. > Howe

Re: [Pharo-users] Number is not accepted by UI

2014-07-15 Thread Camille Teruel
Hi Max, Pharo doesn't have syntax for prefix operator like "-". The parser does accepts a "-" before literal numbers but it's not possible for arbitrary expressions. However you have the message #negated . negatedWidth ^ self width negated Cheers, Camille On 16 juil. 2014, at 00:16, V

Re: [Pharo-users] Number is not accepted by UI

2014-07-15 Thread Norbert Hartl
Max, Am 16.07.2014 um 00:16 schrieb Verkoster Info : > Hi, > > I am using latest Pharo 3.0 + vm. > > I have a method width with > width > > ^ 115 * self ratio. > in my understanding it returns a Number. > > When I try to create a method > negatedWidth > > ^ - (self width). > >

Re: [Pharo-users] Number is not accepted by UI

2014-07-15 Thread Esteban A. Maringolo
You can only put the minus sign ("-") before a literal number. Ej -12, - 4.4, -2/3, etc. But not in front of any other "non number" object (from the parser point of view): Ej: - #() size "only numbers may be negated" What you want to do can be performed sending the message #negated to the obje

[Pharo-users] Number is not accepted by UI

2014-07-15 Thread Verkoster Info
Hi, I am using latest Pharo 3.0 + vm. I have a method width with width ^ 115 * self ratio. in my understanding it returns a Number. When I try to create a method negatedWidth ^ - (self width). the UI tells me that only Numbers may be negated. I am not able to save the meth