diff --git a/stix/kernel/Apex.st b/stix/kernel/Apex.st index fccb956..e038ad8 100644 --- a/stix/kernel/Apex.st +++ b/stix/kernel/Apex.st @@ -219,13 +219,10 @@ ## ------------------------------------------------------- ## ------------------------------------------------------- - #method(#class) primitiveFailed - { - ## TODO: implement this - ## PrimitiveFailureError signal. - self dump. - 'primitive failed' dump. - } + ## #method(#class) primitiveFailed + ## { + ## this method will be added after Exception class has been defined. + ## } #method primitiveFailed { diff --git a/stix/kernel/Context.st b/stix/kernel/Context.st index a5335b4..e25426d 100644 --- a/stix/kernel/Context.st +++ b/stix/kernel/Context.st @@ -390,3 +390,17 @@ Processor activeProcess terminate. self signal: 'no such message'. } } + + +#extend Apex +{ + #method(#class) primitiveFailed + { + ## TODO: implement this + ## PrimitiveFailureError signal. + self dump. + ##'primitive failed' dump. +# TODO: define a specialized exception class for primitive failure and use it. + Exception signal: 'PRIMITIVE FAILED...'. + } +} diff --git a/stix/kernel/test-011.st b/stix/kernel/test-011.st index 6f88124..e9337d1 100644 --- a/stix/kernel/test-011.st +++ b/stix/kernel/test-011.st @@ -168,6 +168,10 @@ ## self test12. ##100 timesRepeat: ['>>>>> END OF MAIN' dump]. + + ## the following line(return:to:) must cause primitive failure... + ##[ Processor return: 10 to: 20. ] on: Exception do: [:ex | ex messageText dump]. + '>>>>> END OF MAIN' dump. } }