c0e6843240
and functional update (copy). The only creative piece of concrete syntax is that of the expression for functional updates: copy foo with record field = value end where "copy", "with", "record" and "end" are keywords.
41 lines
690 B
Plaintext
41 lines
690 B
Plaintext
type t is int * string
|
|
type u is t
|
|
type v is record foo: key; bar: mutez; baz: address end
|
|
type w is K of (U of int) (*v * u*)
|
|
|
|
storage s : w // Line comment
|
|
type i is int;
|
|
operations o : u;
|
|
const pi : int = 314159
|
|
|
|
const x : v =
|
|
record
|
|
foo = 4;
|
|
bar = 5;
|
|
baz = 0x3244
|
|
end
|
|
|
|
(* Block comment *)
|
|
|
|
entrypoint g (const l : list (int)) is
|
|
|
|
var y : v := copy x with record bar = 7 end;
|
|
|
|
function f (const x : int) : int is
|
|
var y : int := 5 - x
|
|
const z : int = 6
|
|
begin
|
|
y := x + y
|
|
end with y * 2
|
|
|
|
begin
|
|
match l with
|
|
[] -> null
|
|
| h#t -> q (h+2)
|
|
end;
|
|
begin
|
|
g (Unit);
|
|
fail "in extremis"
|
|
end
|
|
end
|