view samples/hash.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 2a0463c46913
children
line wrap: on
line source

#{
	main <- {
		print: "hash of 'foo' is " . ("foo" hash) . "\n"
		print: "hash of 'bar' is " . ("bar" hash) . "\n"
		print: "hash of 'foobar' is " . ("foobar" hash) . "\n"
		print: "hash of 1 is " . (1 hash) . "\n"
		print: "hash of 2 is " . (2 hash) . "\n"
		print: "hash of 3 is " . (3 hash) . "\n"
		print: "hash of 1u32 is " . (1u32 hash) . "\n"
		print: "hash of 2.0 is " . (2.0 hash) . "\n"
		print: "hash of 3f32 is " . (3.0f32 hash) . "\n"
	}
}