code: 9ferno

ref: b548687a8ed1d0a159c9d3f3f921d93bbb56908e
dir: /tests/sample.b/

View raw version
implement Sample;
include "sys.m";
	sys: Sys;

Sample: module
{
	init: fn();
};

init()
{
	sys = load Sys Sys->PATH;
	sys->print("init 1\n");
#	sys->bind("#e", "/env", sys->MREPL|sys->MCREATE);	# if #e not configured, that's fine
#	fd := sys->open("#e/", Sys->OREAD);
#	if(fd != nil)
#		sys->print("init 2 %q\n", sys->fd2path(fd));
	i : int = 4;
	i = i+100;
	i = i-101;
	case i {
	0 => sys->print("begins with a vowel\n");
	1 => sys->print("begins with a consonant\n");
	2 => sys->print("begins with a consonant\n");
	3 => sys->print("begins with a consonant\n");
	4 => sys->print("begins with a consonant\n");
	* => sys->print("sorry don't understand\n");
	}
	sys->print("ending the program\n");
}