Signal.st
changeset 3157 b8dd7d5fedd2
parent 3103 a53892ec3492
child 3280 11acfea80af7
--- a/Signal.st	Mon Jan 12 14:15:14 1998 +0100
+++ b/Signal.st	Mon Jan 12 14:15:34 1998 +0100
@@ -86,43 +86,43 @@
 
     [Instance variables:]
 
-        mayProceed      <Boolean>       hint for the debugger - program may 
-                                        proceed (currently not honored by the
-                                        debugger)
+	mayProceed      <Boolean>       hint for the debugger - program may 
+					proceed (currently not honored by the
+					debugger)
 
-        notifierString  <String>        error message to be output 
+	notifierString  <String>        error message to be output 
 
-        nameClass       <Class>         for the printOn-implementation; nameClass
-                                        is the class, to which message (below) 
-                                        should be sent to create the receiver.
+	nameClass       <Class>         for the printOn-implementation; nameClass
+					is the class, to which message (below) 
+					should be sent to create the receiver.
 
-        message         <Symbol>        for the printOn-implementation; message
-                                        is the selector, which should be sent to 
-                                        nameClass (above) to create the receiver.
+	message         <Symbol>        for the printOn-implementation; message
+					is the selector, which should be sent to 
+					nameClass (above) to create the receiver.
 
-        handlerBlock    <Block>         if nonNil, a 1-arg block to be 
-                                        evaluated when no handler context is 
-                                        found. The block gets the exception
-                                        object as argument. This will play the role
-                                        of an on-stack handler.
+	handlerBlock    <Block>         if nonNil, a 1-arg block to be 
+					evaluated when no handler context is 
+					found. The block gets the exception
+					object as argument. This will play the role
+					of an on-stack handler.
 
     [Class variables:]
 
-        NoHandlerSignal <Signal>        signal raised when no handler for a signal
-                                        was found in raise.
-                                        If this one is not handled either,
-                                        Exceptions emergencyHandler will be evaluated
-                                        instead (or a per-proces handler, if there
-                                        is one).
+	NoHandlerSignal <Signal>        signal raised when no handler for a signal
+					was found in raise.
+					If this one is not handled either,
+					Exceptions emergencyHandler will be evaluated
+					instead (or a per-proces handler, if there
+					is one).
 
     [author:]
-        Claus Gittinger
+	Claus Gittinger
 
     [see also:]
-        Exception 
-        SignalSet QuerySignal
-        Object
-        (``Exception handling and signals'': programming/exceptions.html)
+	Exception 
+	SignalSet QuerySignal
+	Object
+	(``Exception handling and signals'': programming/exceptions.html)
 "
 ! !
 
@@ -132,8 +132,8 @@
     "setup the parent of all signals."
 
     GenericSignal isNil ifTrue:[
-        GenericSignal := self basicNew notifierString: 'unknown Signal with: '.
-        GenericSignal nameClass:self message:#genericSignal.
+	GenericSignal := self basicNew notifierString: 'unknown Signal with: '.
+	GenericSignal nameClass:self message:#genericSignal.
     ].
 
     "Modified: 8.10.1997 / 11:58:01 / cg"
@@ -143,13 +143,13 @@
     "setup the signal used to handle unhandled signals"
 
     GenericSignal isNil ifTrue:[
-        self initGenericSignal.
+	self initGenericSignal.
     ].
 
     NoHandlerSignal isNil ifTrue:[
-        NoHandlerSignal := ErrorSignal newSignalMayProceed:true.
-        NoHandlerSignal nameClass:self message:#noHandlerSignal.
-        NoHandlerSignal notifierString:'unhandled exception'.
+	NoHandlerSignal := ErrorSignal newSignalMayProceed:true.
+	NoHandlerSignal nameClass:self message:#noHandlerSignal.
+	NoHandlerSignal notifierString:'unhandled exception'.
     ]
 
     "Modified: 8.10.1997 / 11:48:40 / cg"
@@ -324,16 +324,16 @@
     |t|
 
     errorString isNil ifTrue:[
-        t := notifierString
+	t := notifierString
     ] ifFalse:[
-        t := errorString.
-        (errorString endsWith:Character space) ifTrue:[
-            t := errorString , notifierString
-        ] ifFalse:[
-            (errorString startsWith:Character space) ifTrue:[
-                t := notifierString , errorString
-            ]
-        ].
+	t := errorString.
+	(errorString endsWith:Character space) ifTrue:[
+	    t := errorString , notifierString
+	] ifFalse:[
+	    (errorString startsWith:Character space) ifTrue:[
+		t := notifierString , errorString
+	    ]
+	].
     ].
     ^ t.
 
@@ -396,18 +396,18 @@
 
     con := aContext.
     [con notNil] whileTrue:[
-        con := con findNextContextWithSelector:#'handle:do:' or:#'handle:from:do:' or:nil.
-        con notNil ifTrue:[
-            "
-             is this is a #handle:do: or a #handle:from:do: context
-             with self in it ?
-            "
-            (con receiver accepts:self) ifTrue:[
-                "found a handler context"
+	con := con findNextContextWithSelector:#'handle:do:' or:#'handle:from:do:' or:nil.
+	con notNil ifTrue:[
+	    "
+	     is this is a #handle:do: or a #handle:from:do: context
+	     with self in it ?
+	    "
+	    (con receiver accepts:self) ifTrue:[
+		"found a handler context"
 
-                ^ true
-            ]
-        ]
+		^ true
+	    ]
+	]
     ].
     ^ false
 
@@ -438,10 +438,10 @@
      The signals notifierString is used as errorString."
 
     ^ (Exception  
-              signal:self
-              parameter:nil 
-              errorString:notifierString
-              suspendedContext:thisContext sender) raise.
+	      signal:self
+	      parameter:nil 
+	      errorString:notifierString
+	      suspendedContext:thisContext sender) raise.
 
     "Modified: 2.5.1996 / 16:36:23 / cg"
 !
@@ -453,10 +453,10 @@
      The argument is used as errorString."
 
     ^ (Exception  
-              signal:self
-              parameter:nil 
-              errorString:(self errorStringFor:aString with:nil)
-              suspendedContext:thisContext sender) raise.
+	      signal:self
+	      parameter:nil 
+	      errorString:(self errorStringFor:aString with:nil)
+	      suspendedContext:thisContext sender) raise.
 
     "Modified: 9.5.1996 / 15:17:59 / cg"
 !
@@ -470,10 +470,10 @@
      allowing a raise to mimicri the exception happened somewhere else."
 
     ^ (Exception  
-              signal:self
-              parameter:nil 
-              errorString:(self errorStringFor:aString with:nil)
-              suspendedContext:aContext) raise.
+	      signal:self
+	      parameter:nil 
+	      errorString:(self errorStringFor:aString with:nil)
+	      suspendedContext:aContext) raise.
 
     "Created: 26.7.1996 / 16:42:32 / cg"
     "Modified: 26.7.1996 / 16:42:47 / cg"
@@ -487,11 +487,11 @@
      XXX: I am not certain, if this is the correct behavior (seen in remoteInvocation-goodie)"
 
     ^ (Exception 
-              signal:self
-              parameter:something 
-              errorString:notifierString
-              suspendedContext:thisContext sender
-              originator:something) raise.
+	      signal:self
+	      parameter:something 
+	      errorString:notifierString
+	      suspendedContext:thisContext sender
+	      originator:something) raise.
 
     "Modified: 2.5.1996 / 16:36:38 / cg"
 !
@@ -505,10 +505,10 @@
      allowing a raise to mimicri the exception happened somewhere else."
 
     ^ (Exception 
-              signal:self
-              parameter:nil 
-              errorString:notifierString
-              suspendedContext:aContext) raise.
+	      signal:self
+	      parameter:nil 
+	      errorString:notifierString
+	      suspendedContext:aContext) raise.
 
     "Modified: 2.5.1996 / 16:36:44 / cg"
 !
@@ -518,10 +518,10 @@
      The signals notifierString is used as errorString."
 
     ^ (Exception  
-              signal:self
-              parameter:nil 
-              errorString:notifierString
-              suspendedContext:thisContext sender) raiseRequest.
+	      signal:self
+	      parameter:nil 
+	      errorString:notifierString
+	      suspendedContext:thisContext sender) raiseRequest.
 
     "Modified: 2.5.1996 / 16:36:52 / cg"
 !
@@ -534,11 +534,11 @@
      XXX: I am not certain, if this is the correct behavior (seen in remoteInvocation-goodie)"
 
     ^ (Exception 
-              signal:self
-              parameter:something 
-              errorString:notifierString
-              suspendedContext:thisContext sender
-              originator:something) raise.
+	      signal:self
+	      parameter:something 
+	      errorString:notifierString
+	      suspendedContext:thisContext sender
+	      originator:something) raise.
 
     "Modified: 2.5.1996 / 16:36:38 / cg"
 !
@@ -548,10 +548,10 @@
      The signals notifierString is used as errorString."
 
     ^ (Exception 
-              signal:self
-              parameter:aParameter 
-              errorString:(self errorStringFor:nil with:aParameter)
-              suspendedContext:thisContext sender) raiseRequest.
+	      signal:self
+	      parameter:aParameter 
+	      errorString:(self errorStringFor:nil with:aParameter)
+	      suspendedContext:thisContext sender) raiseRequest.
 
     "Modified: 9.5.1996 / 15:13:20 / cg"
 !
@@ -561,10 +561,10 @@
      The argument, aString is used as errorString."
 
     ^ (Exception 
-              signal:self
-              parameter:aParameter 
-              errorString:(self errorStringFor:aString with:aParameter)
-              suspendedContext:thisContext sender) raiseRequest
+	      signal:self
+	      parameter:aParameter 
+	      errorString:(self errorStringFor:aString with:aParameter)
+	      suspendedContext:thisContext sender) raiseRequest
 
     "Modified: 9.5.1996 / 15:13:35 / cg"
 !
@@ -576,10 +576,10 @@
      allowing a raise to mimicri the exception happened somewhere else."
 
     ^ (Exception 
-              signal:self
-              parameter:aParameter 
-              errorString:(self errorStringFor:aString with:aParameter)
-              suspendedContext:aContext) raiseRequest
+	      signal:self
+	      parameter:aParameter 
+	      errorString:(self errorStringFor:aString with:aParameter)
+	      suspendedContext:aContext) raiseRequest
 
     "Modified: 26.7.1996 / 16:29:27 / cg"
 !
@@ -591,10 +591,10 @@
      allowing a raise to mimicri the exception happened somewhere else."
 
     ^ (Exception 
-              signal:self
-              parameter:aParameter 
-              errorString:(self errorStringFor:nil with:aParameter)
-              suspendedContext:aContext) raiseRequest.
+	      signal:self
+	      parameter:aParameter 
+	      errorString:(self errorStringFor:nil with:aParameter)
+	      suspendedContext:aContext) raiseRequest.
 
     "Modified: 26.7.1996 / 16:29:33 / cg"
 !
@@ -607,10 +607,10 @@
      XXX: I am not certain, if this is the correct behavior (seen in remoteInvocation-goodie)"
 
     ^ (Exception 
-              signal:self
-              parameter:aParameter 
-              errorString:(self errorStringFor:nil with:aParameter)
-              suspendedContext:thisContext sender) raise.
+	      signal:self
+	      parameter:aParameter 
+	      errorString:(self errorStringFor:nil with:aParameter)
+	      suspendedContext:thisContext sender) raise.
 
     "Modified: 9.5.1996 / 15:14:24 / cg"
 !
@@ -623,10 +623,10 @@
      as exception parameter."
 
     ^ (Exception 
-              signal:self
-              parameter:aParameter 
-              errorString:(self errorStringFor:aString with:aParameter)
-              suspendedContext:thisContext sender) raise.
+	      signal:self
+	      parameter:aParameter 
+	      errorString:(self errorStringFor:aString with:aParameter)
+	      suspendedContext:thisContext sender) raise.
 
     "Modified: 9.5.1996 / 15:14:32 / cg"
 !
@@ -642,13 +642,30 @@
 
 
     ^ (Exception 
-              signal:self
-              parameter:aParameter 
-              errorString:(self errorStringFor:aString with:aParameter)
-              suspendedContext:aContext) raise.
+	      signal:self
+	      parameter:aParameter 
+	      errorString:(self errorStringFor:aString with:aParameter)
+	      suspendedContext:aContext) raise.
 
     "Created: 2.5.1996 / 16:37:25 / cg"
     "Modified: 26.7.1996 / 16:29:42 / cg"
+!
+
+raiseWith:aParameter in:aContext
+    "raise a signal nonproceedable.
+     - notice, ST/X does not (for now) distinguish between proceedable and
+       non proceedable exceptions.
+     The argument, aParameter is passed as parameter.
+     XXX: I am not certain, if this is the correct behavior (seen in remoteInvocation-goodie)"
+
+    ^ (Exception 
+	      signal:self
+	      parameter:aParameter 
+	      errorString:(self errorStringFor:nil with:aParameter)
+	      suspendedContext:aContext) raise.
+
+    "Modified: / 9.5.1996 / 15:14:24 / cg"
+    "Created: / 4.1.1998 / 14:38:15 / cg"
 ! !
 
 !Signal methodsFor:'save evaluation'!
@@ -760,6 +777,6 @@
 !Signal class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Signal.st,v 1.47 1997-11-11 15:12:21 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Signal.st,v 1.48 1998-01-12 13:15:34 cg Exp $'
 ! !
 Signal initialize!