diff --git a/examples/tsls/formatstringClient.wyv b/examples/tsls/formatstringClient.wyv index 90ace00c7..b226b4904 100644 --- a/examples/tsls/formatstringClient.wyv +++ b/examples/tsls/formatstringClient.wyv @@ -3,23 +3,26 @@ require stdout import metadata formatstring import wyvern.String -/* def printf(str:formatstring.FormatString): {stdout.print} Unit stdout.print(str) stdout.println() +val conference = "Onward!" -//just a plain string -stdout.printf(~) - Hello \\\%World!\n +val id = (x:Int) => x -stdout.printf(~) - Hello %{"string!"}%{" \"}{mm}"} and %{ "another string!" } +printf(~) + Hello %{conference} val x = 3 -stdout.printf(~) - %{x} %{4} %.5{1.6} %{1.7} -stdout.printf({%{1 == 2}%{true}}) -*/ +printf(~) + %{id(4)} %.5{1.6} + +printf({%{1 == 2}%{true}}) + + +printf(~) + %.5{1.5} + 3 \ No newline at end of file diff --git a/examples/tsls/formatstringClient2.wyv b/examples/tsls/formatstringClient2.wyv new file mode 100644 index 000000000..25dfbacd2 --- /dev/null +++ b/examples/tsls/formatstringClient2.wyv @@ -0,0 +1,24 @@ +require stdout + +import wyvern.String + +/* +def printf(str:formatstring.FormatString): {stdout.print} Unit + stdout.print(str) + stdout.println() +*/ + +//just a plain string +stdout.printf(~) + Hello \\\%World!\n + +stdout.printf(~) + Hello %{"string!"}%{" \"}{mm}"} and %{ "another string!" } + +val x = 3 +stdout.printf(~) + %{x} %{4} %.5{1.6} %{1.7} + +stdout.printf({%{1 == 2}%{true}}) + +3 \ No newline at end of file