Wiki
Show
Ignore:
Timestamp:
04/16/09 22:18:35 (3 years ago)
Author:
Chuck.Esterbrook
Message:

Introduce .typeOf as a cross platform means of getting the type of an object.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • cobra/trunk/Samples/forth.cobra

    r1982 r2019  
    146146                methodName = word.toString['built-in:'.length:] 
    147147                methodName = methodName[0].toString.toUpper + methodName[1:] # because at run-time, method names are capped for compatibility with C# and VB 
    148                 method = .getType.getMethod(methodName) 
     148                method = .typeOf.getMethod(methodName) 
    149149                method.invoke(this, nil) 
    150150            else 
     
    396396        branch _which 
    397397            on WordType.String 
    398                 if _s == '' 
    399                     return '(EMPTY-STRING)' 
    400                 if _s.trim == '' 
    401                     return '(BLANK-STRING)' 
     398                if _s == '', return '(EMPTY-STRING)' 
     399                if _s.trim == '', return '(BLANK-STRING)' 
    402400                return _s to ! 
    403401            on WordType.Int 
     
    407405    def toTechString as String 
    408406        branch _which 
    409             on WordType.String, return '[.getType.name](string, "[_s]")' 
    410             on WordType.Int, return '[.getType.name](int, "[_i]")' 
     407            on WordType.String, return '[.typeOf.name](string, "[_s]")' 
     408            on WordType.Int, return '[.typeOf.name](int, "[_i]")' 
    411409        throw FallThroughException(_which) 
    412410