Index: uspace/dist/src/sysel/demos/arith.sy
===================================================================
--- uspace/dist/src/sysel/demos/arith.sy	(revision c5cb943d5d19ad0d75578f54188f2491dfd64937)
+++ uspace/dist/src/sysel/demos/arith.sy	(revision ce8f4f447a7e1abe7fa084ed0f030d495f17524c)
@@ -30,57 +30,57 @@
 	fun Main(), static is
 		-- Test addition, multiplication and precedence.
-		Builtin.Write("2*2 + 2*2 = ");
-		Builtin.Write(2*2 + 2*2);
-		Builtin.WriteLine(" (expected: 8)");
+		Console.Write("2*2 + 2*2 = ");
+		Console.Write(2*2 + 2*2);
+		Console.WriteLine(" (expected: 8)");
 
 		-- Test subtraction, multiplication and precedence.
-		Builtin.Write("1111 - 1 - 10 - 10*10 - 10*10*10 = ");
-		Builtin.Write(1111 - 1 - 10 - 10*10 - 10*10*10);
-		Builtin.WriteLine(" (expected: 0)");
+		Console.Write("1111 - 1 - 10 - 10*10 - 10*10*10 = ");
+		Console.Write(1111 - 1 - 10 - 10*10 - 10*10*10);
+		Console.WriteLine(" (expected: 0)");
 
 		-- Test parenthesized sub-expressions.
-		Builtin.Write("10 * (1 - 1) = ");
-		Builtin.Write(10 * (1 - 1));
-		Builtin.WriteLine(" (expected: 0)");
+		Console.Write("10 * (1 - 1) = ");
+		Console.Write(10 * (1 - 1));
+		Console.WriteLine(" (expected: 0)");
 
 		-- Test unary plus and minus.
-		Builtin.Write("(+1) - (-1) - (+(+1)) + (+(-1)) = ");
-		Builtin.Write((+1) - (-1) - (+(+1)) + (+(-1)));
-		Builtin.WriteLine(" (expected: 0)");
+		Console.Write("(+1) - (-1) - (+(+1)) + (+(-1)) = ");
+		Console.Write((+1) - (-1) - (+(+1)) + (+(-1)));
+		Console.WriteLine(" (expected: 0)");
 
 		-- Test signed multiplication.
-		Builtin.Write("+1 * +1 = ");
-		Builtin.Write(+1 * +1);
-		Builtin.WriteLine(" (expected: 1)");
+		Console.Write("+1 * +1 = ");
+		Console.Write(+1 * +1);
+		Console.WriteLine(" (expected: 1)");
 
-		Builtin.Write("-1 * -1 = ");
-		Builtin.Write(-1 * -1);
-		Builtin.WriteLine(" (expected: 1)");
+		Console.Write("-1 * -1 = ");
+		Console.Write(-1 * -1);
+		Console.WriteLine(" (expected: 1)");
 
-		Builtin.Write("+1 * -1 = ");
-		Builtin.Write(+1 * -1);
-		Builtin.WriteLine(" (expected: -1)");
+		Console.Write("+1 * -1 = ");
+		Console.Write(+1 * -1);
+		Console.WriteLine(" (expected: -1)");
 
-		Builtin.Write("-1 * +1 = ");
-		Builtin.Write(-1 * +1);
-		Builtin.WriteLine(" (expected: -1)");
+		Console.Write("-1 * +1 = ");
+		Console.Write(-1 * +1);
+		Console.WriteLine(" (expected: -1)");
 
 		-- Test multiplication with large result.
-		Builtin.Write("1000000 * 1000000 * 1000000 * 1000000 = ");
-		Builtin.Write(1000000 * 1000000 * 1000000 * 1000000);
-		Builtin.WriteLine(" (expected: 1000000000000000000000000)");
+		Console.Write("1000000 * 1000000 * 1000000 * 1000000 = ");
+		Console.Write(1000000 * 1000000 * 1000000 * 1000000);
+		Console.WriteLine(" (expected: 1000000000000000000000000)");
 
 		-- Test large literals.
-		Builtin.Write("1000000000000000000000000 = ");
-		Builtin.Write(1000000000000000000000000);
-		Builtin.WriteLine(" (expected: 1000000000000000000000000)");
+		Console.Write("1000000000000000000000000 = ");
+		Console.Write(1000000000000000000000000);
+		Console.WriteLine(" (expected: 1000000000000000000000000)");
 
 		-- Test large factorials.
 		var n : int;
 
-		Builtin.WriteLine("Factorials:");
+		Console.WriteLine("Factorials:");
 		n = 1;
 		while n <= 40 do
-			Builtin.WriteLine(Factorial(n));
+			Console.WriteLine(Factorial(n));
 			n = n + 1;
 		end
Index: uspace/dist/src/sysel/demos/array.sy
===================================================================
--- uspace/dist/src/sysel/demos/array.sy	(revision c5cb943d5d19ad0d75578f54188f2491dfd64937)
+++ uspace/dist/src/sysel/demos/array.sy	(revision ce8f4f447a7e1abe7fa084ed0f030d495f17524c)
@@ -40,5 +40,5 @@
 		i = 0;
 		while i < 3 do
-			Builtin.WriteLine(a[i, 0]);
+			Console.WriteLine(a[i, 0]);
 			i = i + 1;
 		end
Index: uspace/dist/src/sysel/demos/autobox.sy
===================================================================
--- uspace/dist/src/sysel/demos/autobox.sy	(revision c5cb943d5d19ad0d75578f54188f2491dfd64937)
+++ uspace/dist/src/sysel/demos/autobox.sy	(revision ce8f4f447a7e1abe7fa084ed0f030d495f17524c)
@@ -39,11 +39,11 @@
 		--
 		b = true;
-		Builtin.WriteLine(b.Value);
+		Console.WriteLine(b.Value);
 		c = 'a';
-		Builtin.WriteLine(c.Value);
+		Console.WriteLine(c.Value);
 		i = 1;
-		Builtin.WriteLine(i.Value);
+		Console.WriteLine(i.Value);
 		s = "Hello";
-		Builtin.WriteLine(s.Value);
+		Console.WriteLine(s.Value);
 
 		-- Anything can be converted to Object.
Index: uspace/dist/src/sysel/demos/count.sy
===================================================================
--- uspace/dist/src/sysel/demos/count.sy	(revision c5cb943d5d19ad0d75578f54188f2491dfd64937)
+++ uspace/dist/src/sysel/demos/count.sy	(revision ce8f4f447a7e1abe7fa084ed0f030d495f17524c)
@@ -33,5 +33,5 @@
 		i = a;
 		while i < b do
-			Builtin.WriteLine(i);
+			Console.WriteLine(i);
 			i = i + 1;
 		end
Index: uspace/dist/src/sysel/demos/ctor.sy
===================================================================
--- uspace/dist/src/sysel/demos/ctor.sy	(revision c5cb943d5d19ad0d75578f54188f2491dfd64937)
+++ uspace/dist/src/sysel/demos/ctor.sy	(revision ce8f4f447a7e1abe7fa084ed0f030d495f17524c)
@@ -32,6 +32,6 @@
 
 		a = new A(1);
-		Builtin.Write("a.v = ");
-		Builtin.WriteLine(a.v);
+		Console.Write("a.v = ");
+		Console.WriteLine(a.v);
 	end
 end
@@ -41,5 +41,5 @@
 
 	new(i : int) is
-		Builtin.WriteLine("A.new()");
+		Console.WriteLine("A.new()");
 		v = i;
 	end
Index: uspace/dist/src/sysel/demos/deleg.sy
===================================================================
--- uspace/dist/src/sysel/demos/deleg.sy	(revision c5cb943d5d19ad0d75578f54188f2491dfd64937)
+++ uspace/dist/src/sysel/demos/deleg.sy	(revision ce8f4f447a7e1abe7fa084ed0f030d495f17524c)
@@ -55,6 +55,6 @@
 	-- Function having delegate as the first parameger
 	fun Operate(op : BinaryOp; opName : string) is
-		Builtin.Write(opName + "(1, 2): ");
-		Builtin.WriteLine(op(1, 2));
+		Console.Write(opName + "(1, 2): ");
+		Console.WriteLine(op(1, 2));
 	end
 
Index: uspace/dist/src/sysel/demos/enum.sy
===================================================================
--- uspace/dist/src/sysel/demos/enum.sy	(revision c5cb943d5d19ad0d75578f54188f2491dfd64937)
+++ uspace/dist/src/sysel/demos/enum.sy	(revision ce8f4f447a7e1abe7fa084ed0f030d495f17524c)
@@ -31,40 +31,40 @@
 		var color : ChessColor;
 
-		Builtin.WriteLine("Set color to ChessColor.Black.");
+		Console.WriteLine("Set color to ChessColor.Black.");
 		color = ChessColor.Black;
 
-		Builtin.Write("Test color == ChessColor.Black.. ");
+		Console.Write("Test color == ChessColor.Black.. ");
 		if color == ChessColor.Black then
-			Builtin.WriteLine("True - OK");
+			Console.WriteLine("True - OK");
 		else
-			Builtin.WriteLine("False - Fail!");
+			Console.WriteLine("False - Fail!");
 			raise new Error.Base();
 		end
 
-		Builtin.Write("Test color != ChessColor.Black.. ");
+		Console.Write("Test color != ChessColor.Black.. ");
 		if color != ChessColor.Black then
-			Builtin.WriteLine("True - Fail!");
+			Console.WriteLine("True - Fail!");
 			raise new Error.Base();
 		else
-			Builtin.WriteLine("False - OK");
+			Console.WriteLine("False - OK");
 		end
 
-		Builtin.Write("Test color == ChessColor.White.. ");
+		Console.Write("Test color == ChessColor.White.. ");
 		if color == ChessColor.White then
-			Builtin.WriteLine("True - Fail!");
+			Console.WriteLine("True - Fail!");
 			raise new Error.Base();
 		else
-			Builtin.WriteLine("False - OK");
+			Console.WriteLine("False - OK");
 		end
 
-		Builtin.Write("Test color != ChessColor.White.. ");
+		Console.Write("Test color != ChessColor.White.. ");
 		if color != ChessColor.White then
-			Builtin.WriteLine("True - OK");
+			Console.WriteLine("True - OK");
 		else
-			Builtin.WriteLine("False - Fail!");
+			Console.WriteLine("False - Fail!");
 			raise new Error.Base();
 		end
 
-		Builtin.WriteLine("Success");
+		Console.WriteLine("Success");
 
 		-- Test enum declared in non-CSI scope
Index: uspace/dist/src/sysel/demos/except.sy
===================================================================
--- uspace/dist/src/sysel/demos/except.sy	(revision c5cb943d5d19ad0d75578f54188f2491dfd64937)
+++ uspace/dist/src/sysel/demos/except.sy	(revision ce8f4f447a7e1abe7fa084ed0f030d495f17524c)
@@ -29,5 +29,5 @@
 class ExceptionDemo is
 	fun foo(), static is
-	        Builtin.WriteLine("Entered foo().");
+	        Console.WriteLine("Entered foo().");
 		raise new BaseException();
 	end
@@ -38,9 +38,9 @@
 			foo();
 		except e : DerivedException do
-			Builtin.WriteLine("Caught derived exception.");
+			Console.WriteLine("Caught derived exception.");
 		except e : BaseException do
-			Builtin.WriteLine("Caught base exception.");
+			Console.WriteLine("Caught base exception.");
 		finally do
-			Builtin.WriteLine("Finally.");
+			Console.WriteLine("Finally.");
 		end
 	end
Index: uspace/dist/src/sysel/demos/gen.sy
===================================================================
--- uspace/dist/src/sysel/demos/gen.sy	(revision c5cb943d5d19ad0d75578f54188f2491dfd64937)
+++ uspace/dist/src/sysel/demos/gen.sy	(revision ce8f4f447a7e1abe7fa084ed0f030d495f17524c)
@@ -31,5 +31,5 @@
 class GenericsDemo is
 	fun Main(), static is
-		Builtin.WriteLine("Let's try some generics.");
+		Console.WriteLine("Let's try some generics.");
 
 		var f : B/int/string;
Index: uspace/dist/src/sysel/demos/hello.sy
===================================================================
--- uspace/dist/src/sysel/demos/hello.sy	(revision c5cb943d5d19ad0d75578f54188f2491dfd64937)
+++ uspace/dist/src/sysel/demos/hello.sy	(revision ce8f4f447a7e1abe7fa084ed0f030d495f17524c)
@@ -29,5 +29,5 @@
 class HelloWorld is
 	fun Main(), static is
-		Builtin.WriteLine("Hello world!");
+		Console.WriteLine("Hello world!");
 	end
 end
Index: uspace/dist/src/sysel/demos/htxtfile.sy
===================================================================
--- uspace/dist/src/sysel/demos/htxtfile.sy	(revision c5cb943d5d19ad0d75578f54188f2491dfd64937)
+++ uspace/dist/src/sysel/demos/htxtfile.sy	(revision ce8f4f447a7e1abe7fa084ed0f030d495f17524c)
@@ -45,5 +45,5 @@
 		while not in_file.EOF do
 			line = in_file.ReadLine();
-			Builtin.WriteLine(name + ": " + line);
+			Console.WriteLine(name + ": " + line);
 			out_file.WriteLine(name + ": " + line);
 		end
Index: uspace/dist/src/sysel/demos/iface.sy
===================================================================
--- uspace/dist/src/sysel/demos/iface.sy	(revision c5cb943d5d19ad0d75578f54188f2491dfd64937)
+++ uspace/dist/src/sysel/demos/iface.sy	(revision ce8f4f447a7e1abe7fa084ed0f030d495f17524c)
@@ -43,5 +43,5 @@
 		f = g as Foo;
 
-		Builtin.WriteLine(g.a());
+		Console.WriteLine(g.a());
 	end
 end
Index: uspace/dist/src/sysel/demos/inherit.sy
===================================================================
--- uspace/dist/src/sysel/demos/inherit.sy	(revision c5cb943d5d19ad0d75578f54188f2491dfd64937)
+++ uspace/dist/src/sysel/demos/inherit.sy	(revision ce8f4f447a7e1abe7fa084ed0f030d495f17524c)
@@ -29,5 +29,5 @@
 class A is
 	fun Foo() is
-		Builtin.WriteLine("A.Foo()");
+		Console.WriteLine("A.Foo()");
 	end
 end
@@ -35,5 +35,5 @@
 class B : A is
 	fun Foo() is
-		Builtin.WriteLine("B.Foo()");
+		Console.WriteLine("B.Foo()");
 	end
 end
Index: uspace/dist/src/sysel/demos/list.sy
===================================================================
--- uspace/dist/src/sysel/demos/list.sy	(revision c5cb943d5d19ad0d75578f54188f2491dfd64937)
+++ uspace/dist/src/sysel/demos/list.sy	(revision ce8f4f447a7e1abe7fa084ed0f030d495f17524c)
@@ -43,5 +43,5 @@
 		e = list.GetEnumerator();
 		while e.MoveNext() do
-			Builtin.WriteLine(e.Data);
+			Console.WriteLine(e.Data);
 		end
 	end
Index: uspace/dist/src/sysel/demos/map.sy
===================================================================
--- uspace/dist/src/sysel/demos/map.sy	(revision c5cb943d5d19ad0d75578f54188f2491dfd64937)
+++ uspace/dist/src/sysel/demos/map.sy	(revision ce8f4f447a7e1abe7fa084ed0f030d495f17524c)
@@ -43,7 +43,7 @@
 		e = map.GetEnumerator();
 		while e.MoveNext() do
-			Builtin.Write(e.Data);
-			Builtin.Write(" -> ");
-			Builtin.WriteLine(map[e.Data]);
+			Console.Write(e.Data);
+			Console.Write(" -> ");
+			Console.WriteLine(map[e.Data]);
 		end
 	end
Index: uspace/dist/src/sysel/demos/property.sy
===================================================================
--- uspace/dist/src/sysel/demos/property.sy	(revision c5cb943d5d19ad0d75578f54188f2491dfd64937)
+++ uspace/dist/src/sysel/demos/property.sy	(revision ce8f4f447a7e1abe7fa084ed0f030d495f17524c)
@@ -33,14 +33,25 @@
 	prop X : int is
 		get is
-			Builtin.Write("Getting value of X which is ");
-			Builtin.WriteLine(x);
+			Console.Write("Getting value of X which is ");
+			Console.WriteLine(x);
 			return x;
 		end
 
 		set value is
-			Builtin.Write("Setting value of X to ");
-			Builtin.WriteLine(value);
+			Console.Write("Setting value of X to ");
+			Console.WriteLine(value);
 			x = value;
 		end
+	end
+
+	-- Test accessing property via an unqualified name
+	fun TestUnqualPropAcc() is
+		var i : int;
+
+		X = 1;
+		i = X;
+
+		Console.Write("TestUnqualPropAcc(): Got ");
+		Console.WriteLine(i);
 	end
 
@@ -51,8 +62,8 @@
 	prop self[index : int] : int is
 		get is
-			Builtin.Write("Getting property with index ");
-			Builtin.Write(index);
-			Builtin.Write(" which is ");
-			Builtin.WriteLine(iprops[index]);
+			Console.Write("Getting property with index ");
+			Console.Write(index);
+			Console.Write(" which is ");
+			Console.WriteLine(iprops[index]);
 
 			return iprops[index];
@@ -60,8 +71,8 @@
 
 		set value is
-			Builtin.Write("Setting property with index ");
-			Builtin.Write(index);
-			Builtin.Write(" to ");
-			Builtin.WriteLine(value);
+			Console.Write("Setting property with index ");
+			Console.Write(index);
+			Console.Write(" to ");
+			Console.WriteLine(value);
 
 			iprops[index] = value;
@@ -82,9 +93,9 @@
 	prop B : Bar is
 		get is
-			Builtin.WriteLine("Getting B");
+			Console.WriteLine("Getting B");
 			return bprop;
 		end
 		set value is
-			Builtin.WriteLine("Setting B");
+			Console.WriteLine("Setting B");
 			bprop = value;
 		end
@@ -110,6 +121,8 @@
 		i = a.X;
 
-		Builtin.Write("Main(): Got ");
-		Builtin.WriteLine(i);
+		Console.Write("Main(): Got ");
+		Console.WriteLine(i);
+
+		a.TestUnqualPropAcc();
 
 		a.iprops = new int[5];
@@ -121,6 +134,6 @@
 		i = a[1];
 
-		Builtin.Write("Main(): Got ");
-		Builtin.WriteLine(i);
+		Console.Write("Main(): Got ");
+		Console.WriteLine(i);
 
 		-- Property field access
@@ -132,7 +145,7 @@
 		a.bprop = b;
 
-		Builtin.WriteLine(a.bprop.i);
+		Console.WriteLine(a.bprop.i);
 		a.bprop.i = 2;
-		Builtin.WriteLine(a.bprop.i);
+		Console.WriteLine(a.bprop.i);
 	end
 end
Index: uspace/dist/src/sysel/demos/string.sy
===================================================================
--- uspace/dist/src/sysel/demos/string.sy	(revision c5cb943d5d19ad0d75578f54188f2491dfd64937)
+++ uspace/dist/src/sysel/demos/string.sy	(revision ce8f4f447a7e1abe7fa084ed0f030d495f17524c)
@@ -30,5 +30,5 @@
 	fun Main(), static is
 		-- Concatenate some strings.
-		Builtin.WriteLine("One-" + "two-" + "three!");
+		Console.WriteLine("One-" + "two-" + "three!");
 
 		-- Extract characters from a string.
@@ -36,9 +36,9 @@
 		i = 0;
 		while i < 5 do
-			Builtin.WriteLine("ABCDE"[i]);
+			Console.WriteLine("ABCDE"[i]);
 			i = i + 1;
 		end
 
-		Builtin.WriteLine("Abracadabra".Slice(2, 4));
+		Console.WriteLine("Abracadabra".Slice(2, 4));
 	end
 end
Index: uspace/dist/src/sysel/demos/svar.sy
===================================================================
--- uspace/dist/src/sysel/demos/svar.sy	(revision c5cb943d5d19ad0d75578f54188f2491dfd64937)
+++ uspace/dist/src/sysel/demos/svar.sy	(revision ce8f4f447a7e1abe7fa084ed0f030d495f17524c)
@@ -31,13 +31,13 @@
 		-- Test static member variable
 		A.B.a = 1;
-		Builtin.WriteLine(A.B.a);
+		Console.WriteLine(A.B.a);
 		A.B.a = 2;
-		Builtin.WriteLine(A.B.a);
+		Console.WriteLine(A.B.a);
 
 		-- Test static property
 		A.B.P = 1;
-		Builtin.WriteLine(A.B.P);
+		Console.WriteLine(A.B.P);
 		A.B.P = 2;
-		Builtin.WriteLine(A.B.P);
+		Console.WriteLine(A.B.P);
 	end
 end
Index: uspace/dist/src/sysel/demos/switch.sy
===================================================================
--- uspace/dist/src/sysel/demos/switch.sy	(revision ce8f4f447a7e1abe7fa084ed0f030d495f17524c)
+++ uspace/dist/src/sysel/demos/switch.sy	(revision ce8f4f447a7e1abe7fa084ed0f030d495f17524c)
@@ -0,0 +1,199 @@
+--
+-- Copyright (c) 2011 Jiri Svoboda
+-- All rights reserved.
+--
+-- Redistribution and use in source and binary forms, with or without
+-- modification, are permitted provided that the following conditions
+-- are met:
+--
+-- o Redistributions of source code must retain the above copyright
+--   notice, this list of conditions and the following disclaimer.
+-- o Redistributions in binary form must reproduce the above copyright
+--   notice, this list of conditions and the following disclaimer in the
+--   documentation and/or other materials provided with the distribution.
+-- o The name of the author may not be used to endorse or promote products
+--   derived from this software without specific prior written permission.
+--
+-- THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+-- IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+-- OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+-- IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+-- INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+-- NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+-- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+--
+
+--- Switch statement demo.
+--
+-- This demonstrates the switch statement. The switch statement looks like:
+--
+-- switch <s_expr> is
+-- when <e1> [, <e2> ...] do
+--	<statements1>
+-- when <f1> [, <f2> ...] do
+--	<statements2>
+-- [...]
+-- [else do
+--	<statements3>]
+-- end
+--
+-- It is mostly equivalent to the pseudocode:
+--
+-- var v : <type of s_expr>;
+-- if v == <e1> [or v == <e2> ...] then
+--	<statements1>
+-- elif v == <f1> [ or v == <f2> ...] then
+--	<statements2>
+-- [...]
+-- [else
+--	<statements3>]
+-- end
+--
+-- This means there is no artificial limitation as to what you can switch
+-- on. The expressions don't have to be constant and they can be of any type
+-- as long as the switch expression (<s_expr>) can be compared with each
+-- of the when expressions (<e1>, <e2>, <f1>, <f2>, ...).
+--
+-- Note however, the 'or' here denotes short-circuit evaluation. (Currently
+-- the 'or' operation does not use short-circuit evaluation, but that's
+-- more of a bug than a feature.
+--
+class SwitchDemo is
+	class A is
+	end
+
+	var a1 : A, static;
+	var a2 : A, static;
+	var a3 : A, static;
+	var a4 : A, static;
+
+	enum MyEnum is
+		red;
+		green;
+		blue;
+		black;
+		cyan;
+	end
+
+	-- Switch on boolean value
+	fun SwitchBool(v : bool) : string, static is
+		switch v is
+		when false do
+			return "false";
+		when true do
+			return "true";
+		end
+	end
+
+	-- Switch on char value
+	fun SwitchChar(v : char) : string, static is
+		switch v is
+		when 'a', 'b' do
+			return "a/b";
+		when 'c', 'd' do
+			return "c/d";
+		else do
+			return "<other>";
+		end
+	end
+
+	-- Switch on integer value
+	fun SwitchInt(v : int) : string, static is
+		switch v is
+		when 0, 1 do
+			return "0/1";
+		when 2, 3 do
+			return "2/3";
+		else do
+			return "<other>";
+		end
+	end
+
+	-- Switch on string value
+	fun SwitchString(v : string) : string, static is
+		switch v is
+		when "foo", "bar"  do
+			return "foo/bar";
+		when "hello", "world" do
+			return "hello/world";
+		else do
+			return "<other>";
+		end
+	end
+
+	-- Switch on object reference
+	fun SwitchObj(v : A) : string, static is
+		switch v is
+		when a1, a2 do
+			return "a1/a2";
+		when a3, a4 do
+			return "a3/a4";
+		else do
+			return "<other>";
+		end
+	end
+
+	-- Switch on object reference
+	fun SwitchEnum(v : MyEnum) : string, static is
+		switch v is
+		when MyEnum.red, MyEnum.green do
+			return "red/green";
+		when MyEnum.blue, MyEnum.black do
+			return "blue/black";
+		else do
+			return "<other>";
+		end
+	end
+
+	fun Test(res : string; test_expr : string; expected : string), static is
+		Console.WriteLine(test_expr + " = '" + res + "' (expected '" +
+		    expected + "')");
+		if res != expected then
+			Console.WriteLine("Error: Got unexpected result.");
+			raise new Error.Base();
+		end
+	end
+
+	fun Main(), static is
+		a1 = new A();
+		a2 = new A();
+		a3 = new A();
+		a4 = new A();
+
+		Test(SwitchBool(false), "SwitchBool(false)", "false");
+		Test(SwitchBool(true), "SwitchBool(true)", "true");
+
+		Test(SwitchChar('a'), "SwitchChar('a')", "a/b");
+		Test(SwitchChar('b'), "SwitchChar('b')", "a/b");
+		Test(SwitchChar('c'), "SwitchChar('c')", "c/d");
+		Test(SwitchChar('d'), "SwitchChar('d')", "c/d");
+		Test(SwitchChar('e'), "SwitchChar('e')", "<other>");
+
+		Test(SwitchInt(0), "SwitchInt(0)", "0/1");
+		Test(SwitchInt(1), "SwitchInt(1)", "0/1");
+		Test(SwitchInt(2), "SwitchInt(2)", "2/3");
+		Test(SwitchInt(3), "SwitchInt(3)", "2/3");
+		Test(SwitchInt(4), "SwitchInt(4)", "<other>");
+
+		Test(SwitchString("foo"), "SwitchString('foo')", "foo/bar");
+		Test(SwitchString("bar"), "SwitchString('bar')", "foo/bar");
+		Test(SwitchString("hello"), "SwitchString('hello')", "hello/world");
+		Test(SwitchString("world"), "SwitchString('world')", "hello/world");
+		Test(SwitchString("boom"), "SwitchString('boom')", "<other>");
+
+		Test(SwitchObj(a1), "SwitchObj(a1)", "a1/a2");
+		Test(SwitchObj(a2), "SwitchObj(a2)", "a1/a2");
+		Test(SwitchObj(a3), "SwitchObj(a3)", "a3/a4");
+		Test(SwitchObj(a4), "SwitchObj(a4)", "a3/a4");
+		Test(SwitchObj(nil), "SwitchObj(nil)", "<other>");
+
+		Test(SwitchEnum(MyEnum.red), "SwitchEnum(MyEnum.red)", "red/green");
+		Test(SwitchEnum(MyEnum.green), "SwitchEnum(MyEnum.green)", "red/green");
+		Test(SwitchEnum(MyEnum.blue), "SwitchEnum(MyEnum.blue)", "blue/black");
+		Test(SwitchEnum(MyEnum.black), "SwitchEnum(MyEnum.black)", "blue/black");
+		Test(SwitchEnum(MyEnum.cyan), "SwitchEnum(MyEnum.cyan)", "<other>");
+	end
+end
Index: uspace/dist/src/sysel/demos/varargs.sy
===================================================================
--- uspace/dist/src/sysel/demos/varargs.sy	(revision c5cb943d5d19ad0d75578f54188f2491dfd64937)
+++ uspace/dist/src/sysel/demos/varargs.sy	(revision ce8f4f447a7e1abe7fa084ed0f030d495f17524c)
@@ -44,5 +44,5 @@
 			-- implemented...
 			do
-				Builtin.WriteLine(args[i]);
+				Console.WriteLine(args[i]);
 			except e : Error.OutOfBounds do
 				error = true;
