view samples/recursive_closure.tp @ 55:93ddb4ad6fcb

Fix some nested closure bugs
author Mike Pavone <pavone@retrodev.com>
date Fri, 13 Jul 2012 21:05:52 -0700
parents
children 3a169ebb3224
line wrap: on
line source
#{
	true <- #{
	  if:else <- :self trueblock :elseblock {
		trueblock:
	  }
	}

	false <- #{
	  if:else <- :self trueblock :elseblock {
		elseblock:
	  }
	}
	main <- {
		foo <- :n {
			if: n < 10 {
				true
			} else: {
				foo <- :n { n }
			}
			foo: n + 1
		}
		print: (string: (foo: 0))
	}
}