view samples/iterfib.tp @ 358:27477c8c2823

Add support for simple type annotations in parser and update llhello sample with a possible new low-level dialect syntax leveraging those annotations
author Michael Pavone <pavone@retrodev.com>
date Fri, 17 Apr 2015 17:50:47 -0700
parents 3a169ebb3224
children
line wrap: on
line source

#{

fib <- :n {
  last <- 0
  cur <- 1
  counter <- 0
  while: { counter < n } do: {
  	counter <- counter + 1
  	tmp <- last
  	last <- cur
  	cur <- last + tmp
  }
  cur
}

main <- {
  print: (string: (fib: 30)) . "\n"
}

}