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 <object> negated instead�.
I was irritated and on the wrong track because I was absolutely sure that self width is a number.
RegardsMaxAm 16.07.2014 um 10:44 schrieb Alain Busser <alain.busser@gmail.com>:AlainPharo is excellent at debugging, that is why I choosed it for my Ontology project, the browser shows welle what is a number, what kind of numbers there are, and why a complex number is not a number...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...
On Wed, Jul 16, 2014 at 2:59 AM, Verkoster Info <info@derverkoster.de> wrote:
It definitely is,
thanks for all your answers�RegardsMaxAm 16.07.2014 um 00:56 schrieb Camille Teruel <camille.teruel@gmail.com>:
I've been overtaken :)Isn't that an active mailing list ?
On 16 juil. 2014, at 00:53, Camille Teruel <camille.teruel@gmail.com> 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.
However you have the message #negated .negatedWidth
^ self width negatedCheers,Camille
On 16 juil. 2014, at 00:16, Verkoster Info <info@derVerkoster.de> wrote:
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 method. Am I on a wrong path or should that work and if how can I avoid the UI error message?
Regards
Max