Wiki

Changes between Version 18 and Version 19 of StandardLibraryExtensionMethods

Show
Ignore:
Timestamp:
09/23/12 04:59:22 (12 years ago)
Author:
Charles
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • StandardLibraryExtensionMethods

    v18 v19  
    1515{{{ 
    1616#!cobra 
    17 namespace Cobra.Lang 
    18  
    19     extend System.Object 
    20  
    21         def typeOf as System.Type 
    22             """ Using .typeOf is portable between platforms in contrast to CLR .getType and JVM .getClass. """ 
    23             return .getType 
    24  
    25         def toTechString as String 
    26  
    27         def toPrintString as String 
     17namespace Cobra.Core 
     18 
     19        extend System.Object 
     20 
     21                def typeOf as System.Type 
     22                        """ 
     23                        Return the Type of the object this is called on.  
     24                        Using .typeOf is portable between platforms in contrast to CLR .getType and JVM .getClass. 
     25                        """ 
     26 
     27                def toTechString as String 
     28                        """ 
     29                        Generate a 'technical' string representation of the object suitable for inspection and debugging. 
     30                        Used for AssertExceptions (and subclasses such as RequireException) and the `trace` statement. 
     31                        It provides more information about collections and enumerations and recovers from exceptions 
     32                        when making strings so that debugging can proceed. 
     33                        """ 
     34 
     35                def toPrintString as String 
     36                        """ 
     37                        Generate a string representation of the object suitable for printing. 
     38                        Strings are only quoted if they are inside collections such as a list or dictionary. 
     39                        """              
    2840 
    2941