Roy now has a limited, compile-time meta-programming system. Simple example:
macro printArgLength = console.log "Compiling to:" arguments.length [| console.log &(arguments.length) |] printArgLength 1 printArgLength 1 2 printArgLength 1 2 3
console.log(1) console.log(2) console.log(3)
I’d really like to make Roy’s meta-programming work more like Template Haskell or Converge. Unfortunately I have only skimmed papers on both and used neither. My goal is to make the meta-programming powerful enough to express modules and do notation.
$ ./roy roy> 10 * 2 - 5 15 : Number roy>