evincarofautumn / kitten

A statically typed concatenative systems programming language.
http://kittenlang.org/
Other
1.09k stars 39 forks source link

Support user-defined prefix function macros #77

Closed evincarofautumn closed 10 years ago

evincarofautumn commented 11 years ago

Preliminary idea:

def if _ _ (r Bool (r -> s +e) -> s +e):
  {} __if_else

def if _ _ else _ (r Bool (r -> s +e1) (r -> s +e2) -> s +(e1 + e2)):
  __if_else

def for _ _ ([a] (a -> b +e) -> [b] +e):
  map

def foreach _ _ ([a] (a -> +IO) -> +IO):
  each

Row variables are needed for if because we don’t want to break concatenativity.