obriencj / python-sibilant

A dialect of Lisp compiling to Python bytecode
GNU Lesser General Public License v3.0
7 stars 1 forks source link

support for typing annotations #184

Open obriencj opened 6 years ago

obriencj commented 6 years ago

augment the function and define specials to support optional typing hints

potential examples

(define [foo :type int] 100)
(def function [do-something :type int]
   [[a type: str] [b type: int] [c: "Hello" type: str]]
   ... )

potentially this could augment the existing binding spec as well

(let [[foo as: inner-foo type: int]
     [(do-something 9) as: bar type: Any]
     [food 'tacos type: symbol]]
   ...)
obriencj commented 6 years ago

As a side-effect, the augmented function syntax might also be the right way to do decorators.