added a new method modifier #lenient that applies to a primitive method. when set, it turns soft failure to error return

This commit is contained in:
hyunghwan.chung
2017-05-07 16:45:27 +00:00
parent f45cde7ba7
commit 937895ef59
8 changed files with 90 additions and 63 deletions

View File

@ -2,7 +2,7 @@ class Apex(nil)
{
}
class Error(Apex)
class(#limited) Error(Apex)
{
}
@ -37,12 +37,7 @@ extend Apex
## -------------------------------------------------------
## -------------------------------------------------------
method(#class) dump
{
<primitive: #_dump>
}
method dump
method(#dual) dump
{
<primitive: #_dump>
}
@ -50,12 +45,7 @@ extend Apex
## -------------------------------------------------------
## -------------------------------------------------------
method(#class) yourself
{
^self.
}
method yourself
method(#dual) yourself
{
^self.
}
@ -63,6 +53,15 @@ extend Apex
## -------------------------------------------------------
## INSTANTIATION & INITIALIZATION
## -------------------------------------------------------
method(#class,#lenient) _basicNew
{
<primitive: #_basic_new>
}
method(#class,#lenient) _basicNew: size
{
<primitive: #_basic_new>
}
method(#class) basicNew
{
| perr |
@ -79,6 +78,7 @@ extend Apex
{
| perr |
## <primitive: #_basicNew>
<primitive: #_basic_new>
self primitiveFailed.

View File

@ -339,7 +339,7 @@ class(#pointer) CompiledMethod(Object)
method preambleCode
{
(* TODO: make this a primtive for performance *)
^(self.preamble bitAnd: 16rFF) bitShift: -3.
^(self.preamble bitShift: -4) bitAnd: 16r1F.
}
method owner

View File

@ -43,7 +43,7 @@ class Association(Magnitude)
}
}
class Character(Magnitude)
class(#limited) Character(Magnitude)
{
## method basicSize
## {
@ -53,7 +53,7 @@ class Character(Magnitude)
method(#primitive) asInteger.
}
class Number(Magnitude)
class(#limited) Number(Magnitude)
{
method + aNumber
{
@ -300,7 +300,7 @@ class(#limited) Integer(Number)
}
}
class SmallInteger(Integer)
class(#limited) SmallInteger(Integer)
{
## method basicSize
## {