Changes between Version 1 and Version 2 of C
- Timestamp:
- 05/02/08 13:44:14 (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
C
v1 v2 26 26 * instance variable optionally prefixed with _ (implicitly makes them private). If so prefixed can be accessed directly in methods 27 27 * methods (and properties) invoked with leading '''this.''' or more usually just '''.'''. 28 * constructor method called init, has no return value 28 29 29 30 * String type accessed as '''string''' rather than '''String''' … … 35 36 * Variable specification - typing, access modifiers, argument attributes by keyword 'as' rather than C-like syntax 36 37 * e.g. x as int32, instVar as string public 37 * typecasting by keyword 'to' as in 'x to Type' rather than (Type)x 38 * 'as shared' to declare a static type 38 * typecasting by keyword '''to''' as in 'x to Type' rather than '(Type)x' 39 * cast to and away from nilable Type. 40 * '''as shared''' to declare a static type 39 41 40 42 * '''<>''' instead of '''!=''' for 'not equals' comparisons 41 * '''nil''' for n ullvalue43 * '''nil''' for no object (null) value 42 44 * Supports +=, -=, etc. It does not support ++ or -- unary operators ( use += 1 and -= 1 instead). 43 45 … … 48 50 49 51 * Strings delimited by single or double quotes, normal range of \c expansion ( e.g \n, \t) 50 * Substitute expressions (values) directly in strings with [].52 * Substitute expressions (values) directly in strings by enclosing with []. 51 53 * such expressions can have optional String.format specification 52 54 * 'Raw' Strings (r"a raw string") no escape sequence expansion 53 55 * '!NoSubstitution' strings ( ns" no substitution [done] here") 54 * !DocStrings on classes and methods56 * !DocStrings on Programs, classes, Instane variables, methods and properties 55 57 * Different syntax for characters c'x' 56 58 … … 61 63 * e.g def doCalc( start as int) as int instead of int doCalc( int start) 62 64 * '''use''' keyword instead of 'using' to get access to a non default namespace 65 * ''' branch... on, on, [else]''' statement rather than c# '''case''' statement 63 66 64 67 * Slicing syntax for sequences (Lists and Strings) [start:stop:step] as well as normal library subsequence methods (substring, range, ...)