Both of the following programs should work,
let q = [1,2,3].
let q@1:%integer = 0. -- constraint applied to list location
assert( q == [1,0,3] ).
and
structure Foo with
data a.
function __init__
with x do
let this@a:%integer = 1. -- constraining the modification of the data field
end.
end
let f = Foo(1).
assert( f is Foo(1) ).
That is we should be able to apply named/constraint patterns to any arbitrary lval structure.
Both of the following programs should work,
and
That is we should be able to apply named/constraint patterns to any arbitrary lval structure.