Write Ln

WriteLn used to be the PascalLanguage version of printf. Fortunately, CeeLanguage came up and gave us a much improved thing called "printf", which at least did not bother being type safe or convenient to use. The problem with WriteLn is that it is in general difficult to define in a library.

LxLanguage has type-safe, variable argument size functions, so you can define WriteLn.

	procedure WriteLn() is
		Write lineTermination	-- Whatever that is

procedure WriteLn(writable X; other) is Write X WriteLn other

When you use something like

	WriteLn "X=", X

the compiler recursively generates the WriteLn(string, int) which calls Write(string) and WriteLn(int), which in turns calls Write(int) and WriteLn().

EditText of this page (last edited August 17, 2001) or FindPage with title or text search