[squeak-dev] [Q] Why we can't use - before a number?

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Wed Mar 3 14:23:29 UTC 2010


2010/3/3 Edgar J. De Cleene <edgardec2001 at yahoo.com.ar>:
> To my previous question
>
> mixedWith: aSoundBuffer
> | start end |
> start := - 32767 . “you can’t use it , Squeak is not FORTRAN , you should
> use 0 – aninteger instead “

Yes, we have no unary prefix operator,
But you can as well use -32767 without any space in between because
this is an officially supported Smalltalk literal.

Nicolas

> end := 32767.
>     ^ ((aSoundBuffer size >= self size) ifTrue: [aSoundBuffer] ifFalse:
> [self])
>         collectWithIndex: [:s :i |
>             (s + (self at: i ifAbsent: [0])) forceIn: (Interval from: start
> to:  end)].
>
> Edgar
>
>
>
>
>



More information about the Squeak-dev mailing list