Polyglot, document-based computing environment. Leisure is very much in flux, right now; please check the readme, below. For a taste of the new version, click the link below, but be warned that it only works in Chrome.
-- Should this just be full pattern matching, with first-arg type constraints being just an optimization case?
Type constraints:
Introduce type constraint operator, '::', like in Julia. This means to use the dispatch mechanism when calling the function. Calls to polymorphic function with unhandled type produces an error, so this also provides type checking.
printString x::list = printString-list x
Subtypes -- used in dispatch and type constraints
subtype type subtype -- monad to declare a subtype
isSubtype type subtype -- returns boolean
JS prototypes
Dispatch on first arg can be implemented as JS method
-- Should this just be full pattern matching, with first-arg type constraints being just an optimization case?
Type constraints:
Introduce type constraint operator, '::', like in Julia. This means to use the dispatch mechanism when calling the function. Calls to polymorphic function with unhandled type produces an error, so this also provides type checking.
printString x::list = printString-list x
Subtypes -- used in dispatch and type constraints
subtype type subtype -- monad to declare a subtype
isSubtype type subtype -- returns boolean
JS prototypes
Dispatch on first arg can be implemented as JS method
Dispatch on other args can be done like in Xtend