Skip to content

Commit

Permalink
Created a separate version of format string client for Onward demo
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanAldrich committed Dec 9, 2020
1 parent 5df7934 commit 7154e3a
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 10 deletions.
23 changes: 13 additions & 10 deletions examples/tsls/formatstringClient.wyv
Original file line number Diff line number Diff line change
Expand Up @@ -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
24 changes: 24 additions & 0 deletions examples/tsls/formatstringClient2.wyv
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 7154e3a

Please sign in to comment.