paradigm/syntax general principles
from ruby
- mixins over inheritance
- the last statement of a function is the return value (encourages small modular code)
- no semicolon
- symbols with a prime before them like 'this
- everything is an object even primitives
- higher order functions for loop constructs
from Mathematica
- List based hierarchy and functional operations
- Powerful pattern matching for code branch decisions
new
- syntax
- methods, classes, operators can all look the same to make a scalable language
- simple but expansive predifened associativity :, precedence provide scalability
- {}, () replacable
- _ for multiple fill on based on contexts
- pattern imports
- types
- imultibility (val, List)
- multibility (var, Array)
- operators
- Parenthesis on an object calls the apply method
- Parenthesis on an object with an equals assignment calls the update method
- Single argument methods do not require a dot
- Any method can be used in operator notation
- predefined prefix unary operators +,-,!,~
- postfix operators are methods that take no arguments
- methods ending in : are for right called objects in operator notation
- equals == test uniformly verifies value with a pre null check
- methods are operators, precedence is sorted by beginning characters and associativity is sorted by ending character(:)
- classes
- Factory methods make use of apply
- Companion objects for cleaner instantiation of a companion class
- base code is the build in constructor
- parameters are fields
- parameters can have preconditions with require
- separate companion objects for static like pieces
- case classes for field pattern matching and companion object construction
- traits
- pattern matching
- case classes for field pattern matching and companion object construction
- control structures
- everything returns values
- nested loops by additional generators
- currying to make language like control structures
- functions
- first class functions
- function literals
blank _ assumed input parameter patterns
partially applied functions with an automatic apply wrapping with _ matching
- typing inference
- target typing
- simple flow typing versus complex Haskel typing for better OO interoperation
- built in tools
- xml
- combinator parsers: these are really powerful and really useful. These provide whole new levels of abstraction