You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
we could use this to force the compiler to perform its casting or tagging magic to a value, e.g.,
l := cast (list u8) nil
f := cast f32 0
b := cast bool TRUE
a,b,c is
abc := if cc then
cast (a|b|c) a
else
cast (a|b|c) b
match abc
a => say "a"
b => say "b"
c => say "c"
instead of
l list u8 := nil
f f32 := 0
b bool := TRUE
a,b,c is
abc a | b | c := if cc then
a
else
b
match abc
a => say "a"
b => say "b"
c => say "c"
Are there any cases where this is useful? This could at least be used an example in the tutorial to explain the compiler magic that happens to adapt an expression to match the target type.
The text was updated successfully, but these errors were encountered:
If we defined
we could use this to force the compiler to perform its casting or tagging magic to a value, e.g.,
instead of
Are there any cases where this is useful? This could at least be used an example in the tutorial to explain the compiler magic that happens to adapt an expression to match the target type.
The text was updated successfully, but these errors were encountered: