Wiki

Changes between Version 2 and Version 3 of C

Show
Ignore:
Timestamp:
05/03/08 07:43:15 (17 years ago)
Author:
hopscc
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • C

    v2 v3  
    66     * optional type declarations 
    77 * Block structured by indentation only (like Python) no squiggly braces (brackets) 
    8  * nil tracking - variables can be declared as nil assignable (or not) 
     8  * nil tracking - variables can be declared as nil assignable (or not) 
    99 * Built in language support for  
    1010    * unit test code  
     
    1414     * Lists - [] - List of Dynamic 
    1515     * Dictionaries - {:} Dictionary of <Dynamic, Dynamic> 
    16      * Sets - { 
     16     * Sets - {, 
    1717 * Line Oriented  
    18      * # to comment line (instead of //) 
     18     * '''#''' to comment line (instead of //) 
    1919     * No multiline comments     
    20      * _ to continue line 
    21      * Tab or Spaces to indent line ( Fixed 4 space indent), Cannot mix Tabs and spaces for an indent level 
     20     * '''_''' to continue line 
     21     * Tab or (4) Spaces to indent line (Fixed 4 space indent), Cannot mix Tabs and spaces for an indent level 
     22     * No statement terminator ( goodbye to ';') 
     23 * Numbers default to decimal type (rather than int)- can be overridden (to float/double) with a compiler 
     24   commandline option 
    2225 
    2326 * Methodnames and properties start with lowercase. (i.e lowerCamelCase) 
    2427    * Access to methods/properties in used libraries are also done via (implicitly mapped ) lowerCamelCase methodnames  
    25  * Class names must be CamelCased 
     28 * Class names must be (upper) [http://en.wikipedia.org/wiki/CamelCase CamelCased] or at least start with an upper case letter) 
    2629 * instance variable optionally prefixed with _ (implicitly makes them private). If so prefixed can be accessed directly in methods 
    27  * methods (and properties) invoked with leading '''this.''' or more usually just '''.'''. 
    28  * constructor method called init, has no return value 
     30 * methods (and properties) on current object invoked with leading '''this.''' or more usually (shortcut) just '''.'''. 
     31 * constructor/initializer method is called init, has no return value 
    2932  
    3033 * String type accessed as '''string''' rather than '''String''' 
     
    3336    * int8, int16, int/int32, int64 instead of  SByte, Int16, Int32/int, Int64 
    3437    * uint8, uint16, uint/uint32, uint64  instead of Byte, UInt16,...  
     38 * Type of numeric literals can be dictated using suffixes 
    3539 
    36  * Variable specification - typing, access modifiers, argument attributes  by keyword 'as' rather than C-like syntax 
    37     * e.g. x as int32, instVar as string public 
     40 * Variable specification - typing, access modifiers, argument attributes  specified by keyword '''as''' rather than C-like/Java-like syntax 
     41    * e.g. x as int32, instVar as string public  (vs int32 x;   public String instVar; ) 
    3842 * typecasting by keyword '''to''' as in 'x to Type' rather than '(Type)x' 
    3943    * cast to and away from nilable Type. 
    4044 * '''as shared''' to declare a static type 
    4145 
     46 
    4247 * '''<>''' instead of '''!=''' for 'not equals' comparisons 
     48 * Condition negation uses keyword '''not'''  ( as in {{{ not a >10}}} ) 
     49 * boolean conditions use keywords '''and''' and '''or'''  ( as in {{{ if a>3 and b<10 or b>55 }}}) 
    4350 * '''nil''' for no object (null) value 
    44  * Supports +=, -=, etc. It does not support ++ or -- unary operators ( use += 1 and -= 1 instead). 
     51 * Supports +=, -=, etc. Does not support ++ or -- unary operators ( use += 1 and -= 1 instead). 
    4552  
    4653 * boolean conditions can be tested on any type. True is any of 
     54    * non false (bool Type) 
    4755    * numeric not 0 
     56    * non zero char 
    4857    * not nil 
    49     * non empty List or Dictionary 
     58 * blank strings and empty collections are true (non nil) - must check .length for strings and .count for collections 
    5059 
    5160 * Strings delimited by single or double quotes, normal range of \c expansion ( e.g \n, \t) 
    5261 * Substitute expressions (values) directly in strings by enclosing with []. 
    5362    * such expressions can have optional String.format specification 
    54  * 'Raw' Strings (r"a raw string") no escape sequence expansion 
     63 * 'Raw' Strings (r"a raw string") no escape sequence expansion ( vs c# @"a raw string") 
    5564 * '!NoSubstitution' strings ( ns" no substitution [done] here")  
    56  * !DocStrings on Programs, classes, Instane variables, methods and properties 
     65 * !DocStrings on Programs, classes, Instance variables, methods and properties 
    5766 * Different syntax for characters c'x' 
    58  
     67 $ since '[] used for Lists array literals are specified using ''' @[]''' - comma separated values 
    5968 * '''ref''' keyword for getting pointer to method ( reference) rather calling it ( for delegates) 
    6069 * '''sig''' keyword or declaring a delegate type