How to port VW "Signal" to Squeak

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

How to port VW "Signal" to Squeak

Alejandro Martínez
Hello. I'm trying to figure out how to port a #newSignal message send from a VisualWorks application (something like Object informationSignal newSignal) to Squeak, which lacks of Signal class. Does anybody know how to do it or have a guideline for this?
Thanks

Alejandro



Reply | Threaded
Open this post in threaded view
|

Re: How to port VW "Signal" to Squeak

Andreas.Raab
Use Squeak exception classes. I don't remember this exactly (it has been
more than ten years since I used it) but it went somewhat along the
lines that "Object informationSignal" would answer the exception class
(Signal in VW?), #newSignal would create an instance and #raise would
raise the signal. Translated to Squeak that means roughly:

VW:      (Object informationSignal) newSignal raise
Squeak:  (SomeExceptionClass)       new       signal

Someone please correct me if I remember this wrongly.

Cheers,
   - Andreas


Alejandro Martínez wrote:

> Hello. I'm trying to figure out how to port a #newSignal message send
> from a VisualWorks application (something like Object informationSignal
> newSignal) to Squeak, which lacks of Signal class. Does anybody know how
> to do it or have a guideline for this?
> Thanks
>
> Alejandro
>
>
> ------------------------------------------------------------------------
>
>


Reply | Threaded
Open this post in threaded view
|

RE: How to port VW "Signal" to Squeak

Alan L. Lovejoy
In reply to this post by Alejandro Martínez
<Alejandro Martínez>
Hello. I'm trying to figure out how to port a #newSignal message send from a VisualWorks application (something like Object informationSignal newSignal) to Squeak, which lacks of Signal class. Does anybody know how to do it or have a guideline for this?
</Alejandro Martínez>
 
InformationSignal is simply a subclass of Exception.
 
The message #newSignal simply answers a new instance of an Exception--typically, an instance of the receiver, which would usually be some subclass of Exception.
 
The messages and class names result from the fact that Exceptions in VW were originally instance based, not class based.  If I remember correctly, it was VisualWorks 1.0 (1990) that introduced Exceptions (instance based) to Smalltalk, not just to the ParcPlace branch of Smalltalk.  Personally, I find the instance-based implementation to be more elegant.  I strongly dislike any design approach that results in an explosion of different classes, none of which have behavior that significantly differs from that of its cousins.  The upside of the class-based approach is simply that it makes file-in/file-out of shared globals so easy. But I see that as a problem with the infrastructure for managing globals, shared pools and namespaces, and not as a good reason to use classes as heavyweight globals.
 
--Alan


Reply | Threaded
Open this post in threaded view
|

Re: How to port VW "Signal" to Squeak

Alejandro Martínez
In reply to this post by Andreas.Raab


2007/2/21, Andreas Raab <[hidden email]>:
Use Squeak exception classes. I don't remember this exactly (it has been
more than ten years since I used it) but it went somewhat along the
lines that "Object informationSignal" would answer the exception class
(Signal in VW?), #newSignal would create an instance and #raise would
raise the signal. Translated to Squeak that means roughly:

VW:      (Object informationSignal) newSignal raise
Squeak:  (SomeExceptionClass)       new       signal

Thanks, that's right, what I'm looking for is the appropiate class equivalent (SomeExceptionClass) in Squeak.
 

Someone please correct me if I remember this wrongly.

Cheers,
   - Andreas


Alejandro Martínez wrote:

> Hello. I'm trying to figure out how to port a #newSignal message send
> from a VisualWorks application (something like Object informationSignal
> newSignal) to Squeak, which lacks of Signal class. Does anybody know how
> to do it or have a guideline for this?
> Thanks
>
> Alejandro
>
>
> ------------------------------------------------------------------------
>
>