Fwd: about sensor vs. InputSensor in primitiveError:

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

Fwd: about sensor vs. InputSensor in primitiveError:

Stéphane Ducasse
>
>
> should not this method use InputSensor?
>
> primitiveError: aString
> "This method is called when the error handling results in a  
> recursion in
> calling on error: or halt or halt:."
>
> | context |
> (String
> streamContents:
> [:s |
> s nextPutAll: '***System error handling failed***'.
> s cr; nextPutAll: aString.
> context := thisContext sender sender.
> 20 timesRepeat: [context == nil ifFalse: [s cr; print:  
> (context := context sender)]].
> s cr; nextPutAll: '-------------------------------'.
> s cr; nextPutAll: 'Type CR to enter an emergency evaluator.'.
> s cr; nextPutAll: 'Type any other character to restart.'])
> displayAt: 0 @ 0.
> [Sensor keyboardPressed] whileFalse.
> Sensor keyboard = Character cr ifTrue: [Transcripter  
> emergencyEvaluator].
> World install "init hands and redisplay"
>
>
>


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: about sensor vs. InputSensor in primitiveError:

Michael Rueger-6
Stéphane Ducasse wrote:
>>
>> should not this method use InputSensor?

Sensor is a global pointing to the current sensor instance.

Michael
P.S. We should remove the old Sensor classes to avoid confusion.


>>
>> primitiveError: aString
>> "This method is called when the error handling results in a  
>> recursion in
>> calling on error: or halt or halt:."
>>
>> | context |
>> (String
>> streamContents:
>> [:s |
>> s nextPutAll: '***System error handling failed***'.
>> s cr; nextPutAll: aString.
>> context := thisContext sender sender.
>> 20 timesRepeat: [context == nil ifFalse: [s cr; print:  
>> (context := context sender)]].
>> s cr; nextPutAll: '-------------------------------'.
>> s cr; nextPutAll: 'Type CR to enter an emergency evaluator.'.
>> s cr; nextPutAll: 'Type any other character to restart.'])
>> displayAt: 0 @ 0.
>> [Sensor keyboardPressed] whileFalse.
>> Sensor keyboard = Character cr ifTrue: [Transcripter  
>> emergencyEvaluator].
>> World install "init hands and redisplay"
>>
>>
>>
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: about sensor vs. InputSensor in primitiveError:

Stéphane Ducasse
>>> should not this method use InputSensor?
>
> Sensor is a global pointing to the current sensor instance.
>
> Michael
> P.S. We should remove the old Sensor classes to avoid confusion.

what is the "old sensor class" ?

so we have Sensor -> to InputSensor default  or InputEventSensor?

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project