evanrmurphy / SweetScript

A lispy language that compiles into JavaScript, strongly influenced by Arc.
https://github.com/evanrmurphy/SweetScript
14 stars 4 forks source link

Overload functional position #14

Open evanrmurphy opened 13 years ago

evanrmurphy commented 13 years ago

Consider an extended version of arc's system for functional position:

  1. Functions and macros are called
  2. Lists return their nth element, e.g. '((a b c) 0) => a
  3. Objects return a key value, e.g. '({a 1 b 2} 'a) => 1
  4. Association lists return a key value, e.g. '(((a 1) (b 2)) 'a) => 1