Machine serves human, not vise-versa. If machine can guess it without ambiguity, you don't have to write it.
- Clean, simple syntax (Haskell)
- Indentation-guided blocks (Python, Ruby)
>>> if x >>> do_this >>> do_that
>>> if y: continue
- First-class regular expressions (Javascript, Perl, Ruby)
>>> if x ~ /^(exit|quit)$/i : break
- No excessive brackets function call (Haskell, Ruby)
>>> x = f arg1
- Multiline strings (Python, Ruby)
>>> s = """foo >>> bar"""
>>> typedef UTF8_like = bits {1: is_last, 7: data} # defines a type 8 bits long, first bit is accesible as is_last member, others as data member
- List comprehensions (Erlang, Haskell, Python, Ruby, etc)
>>> [3..] # infinite list of 3,4,5,... >>> [x * 2 for x in [1..5]] # 2,4,6,8,10
TODO: maybe LCs don't need surrounding []
- Dict compehensions (Python3)
>>> names = ["foo", "bar", "zar"] >>> {a: 0 for a in names} # results in {'foo': 0, 'bar': 0, 'zar': 0}
- List item access by index
>>> list[5]
Negative indexes mean 'from end'
>>> list = [1..10] >>> list[-1] # 10
>>> (x -> x * x + x) 3 # 12
>>> (lambda x: x * x + x) 3
>>> (x => x * x + x) 3