Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,3 @@
fun dosomething (a, b, c) = print ("a = " ^ a ^ "\nb = " ^ Real.toString b ^ "\nc = " ^ Int.toString c ^ "\n")
fun example {a, b, c} = dosomething (a, b, c)

View file

@ -0,0 +1 @@
example {a="Hello World!", b=3.14, c=42}

View file

@ -0,0 +1,12 @@
datatype param = A of string | B of real | C of int
fun args xs =
let
(* Default values *)
val a = ref "hello world"
val b = ref 3.14
val c = ref 42
in
map (fn (A x) => a := x | (B x) => b := x | (C x) => c := x) xs;
(!a, !b, !c)
end

View file

@ -0,0 +1 @@
dosomething (args [A "tam", B 42.0]);