Skip to content

2) Decisions and Revisions

juansc edited this page Jan 31, 2015 · 3 revisions
  • Optional Typing (see Dart for examples)
  • Strong Typing?(Coerce to string? Truthy/Falsey) Look at Python for strong and JS for weak
  • Method Cascading (see Dart) LOW PRIORITY
  • End keyword- implicit begin; colon before blocks (see Lua)
  • Scoping- No more than one declaration of a local variable within a method (see Java). The code below would not be allowed.
void f() {
  int x = 1;
  if (true) {
    int x = 2;
  }
}
  • String interpolation (expression or variable); String formatting not really needed; implement methods if time permits
  • Assignments are expressions (like JS but not Python)
  • Parallel Assignment (see python with packing and unpacking); Tuples
  • No chaining assignment
  • Operator overloading (user allowed to define how they want an operator to work) LOW PRIORITY
  • Comprehensions and Generators
  • Built in times f(f(f()))
  • First class functions
  • import modules; fully qualified name not required if function is specified
  • duck typing
  • anonymous functions
  • promises LOW PRIORITY
  • logically significant newlines, except for within parentheses.
  • single or double quotes; multiline permitted (by default)
  • global keyword to mutate ONLY (see ruby)
  • different operators for assignment (:=) and mutation (=)
  • Precedence like Iki
  • 2 kinds of for loops- 1 that keeps track of counter and 1 that doesn't (NEED SYNTAX)
  • Can't change loop variable
  • Primitive: int, float, string, boolean, lists (mutable), tuple (immutable), dictionary, set, none
  • Builtin: tree
  • Arbitrary precision IFF we can use libraries
  • Ordered Iterables support slicing, unordered iterables(for sets) do not.
  • Dot notation is used for objects, while [] are used for maps.