[Q] How should be this method ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[Q] How should be this method ?

Edgar J. De Cleene
[Q] How should be this method ? !SoundBuffer methodsFor: '*MuO-Music' stamp: 'spfa 11/18/2009 18:16'!
mixedWith: aSoundBuffer

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

Importing in trunk 9553 the compiler say is wrong



mixedWith: aSoundBuffer

    ^ ((aSoundBuffer size >= self size) ifTrue: [aSoundBuffer] ifFalse: [self])
        collectWithIndex: [:s :i |    
            (s + (self at: i ifAbsent: [0])) forceIn: ( expression expected ->- 32767 to:  32767)].


Could explain ?

Edgar


Reply | Threaded
Open this post in threaded view
|

Re: [Q] How should be this method ?

Stéphane Rollandin
I guess this comes from the brand new changes in the reader by Nicolas:
type -32767 instead of - 32767

Stef


Le 03/03/2010 14:12, Edgar J. De Cleene a écrit :

> !SoundBuffer methodsFor: '*MuO-Music' stamp: 'spfa 11/18/2009 18:16'!
> mixedWith: aSoundBuffer
>
> ^ ((aSoundBuffer size >= self size) ifTrue: [aSoundBuffer] ifFalse: [self])
> collectWithIndex: [:s :i |
> (s + (self at: i ifAbsent: [0])) forceIn: (- 32767 to: 32767)].
>
> Importing in trunk 9553 the compiler say is wrong
>
>
>
> mixedWith: aSoundBuffer
>
> ^ ((aSoundBuffer size >= self size) ifTrue: [aSoundBuffer] ifFalse: [self])
> collectWithIndex: [:s :i |
> (s + (self at: i ifAbsent: [0])) forceIn: ( expression expected ->-
> 32767 to: 32767)].
>
>
> Could explain ?
>
> Edgar
>
>
>
>




Reply | Threaded
Open this post in threaded view
|

Re: [Q] How should be this method ?

Nicolas Cellier
Yep, sorry for inconvenience, but this is a price to pay to $- being
at any place in binary selectors (ANSI).
Beside (- 32767) is not documented, not ANSI, not compatible wiith VW
gst Dolphin ..., and interpreted differently in #( - 32767  32767 ).
I even doubt this syntax was created intentionnally, but here I extrapolate :)
If you insist, I can deploy a Preference,but I would prefer code to be sifted.

Nicolas

2010/3/3 Stéphane Rollandin <[hidden email]>:

> I guess this comes from the brand new changes in the reader by Nicolas: type
> -32767 instead of - 32767
>
> Stef
>
>
> Le 03/03/2010 14:12, Edgar J. De Cleene a écrit :
>>
>> !SoundBuffer methodsFor: '*MuO-Music' stamp: 'spfa 11/18/2009 18:16'!
>> mixedWith: aSoundBuffer
>>
>> ^ ((aSoundBuffer size >= self size) ifTrue: [aSoundBuffer] ifFalse:
>> [self])
>> collectWithIndex: [:s :i |
>> (s + (self at: i ifAbsent: [0])) forceIn: (- 32767 to: 32767)].
>>
>> Importing in trunk 9553 the compiler say is wrong
>>
>>
>>
>> mixedWith: aSoundBuffer
>>
>> ^ ((aSoundBuffer size >= self size) ifTrue: [aSoundBuffer] ifFalse:
>> [self])
>> collectWithIndex: [:s :i |
>> (s + (self at: i ifAbsent: [0])) forceIn: ( expression expected ->-
>> 32767 to: 32767)].
>>
>>
>> Could explain ?
>>
>> Edgar
>>
>>
>>
>>
>
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: [Q] How should be this method ?

Edgar J. De Cleene



On 3/3/10 12:16 PM, "Nicolas Cellier" <[hidden email]>
wrote:

> Yep, sorry for inconvenience, but this is a price to pay to $- being
> at any place in binary selectors (ANSI).
> Beside (- 32767) is not documented, not ANSI, not compatible wiith VW
> gst Dolphin ..., and interpreted differently in #( - 32767  32767 ).
> I even doubt this syntax was created intentionnally, but here I extrapolate :)
> If you insist, I can deploy a Preference,but I would prefer code to be sifted.
>
> Nicolas

Not sorry.

I must try without the space....
Anyway, good for remember

Edgar




Reply | Threaded
Open this post in threaded view
|

Re: [Q] How should be this method ?

Stéphane Rollandin
In reply to this post by Nicolas Cellier

> I even doubt this syntax was created intentionnally

it wasn't... that's from me :)

Stef



Reply | Threaded
Open this post in threaded view
|

Re: [Q] How should be this method ?

Nicolas Cellier
2010/3/3 Stéphane Rollandin <[hidden email]>:
>
>> I even doubt this syntax was created intentionnally
>
> it wasn't... that's from me :)
>
> Stef
>

Sure, I mean in the Parser (probably Dan)

Nicolas

Reply | Threaded
Open this post in threaded view
|

Re: [Q] How should be this method ?

Stéphane Rollandin
> Sure, I mean in the Parser (probably Dan)

silly me