view samples/logical.tp @ 97:59a94f3ad56f

Added short-circuit && and || operators
author Mike Pavone <pavone@retrodev.com>
date Thu, 26 Jul 2012 23:40:56 -0700
parents
children
line wrap: on
line source
#{

	foo <- {
		print: "foo\n"
		true
	}
	
	bar <- {
		print: "bar\n"
		false
	}
	
	baz <- {
		print: "baz\n"
		true
	}
	
	qux <- {
		print: "shouldn't be printed\n"
		true
	}
	
	
	main <- {
		foo && bar || (baz || qux)
	}

}