Comments on doc/lang.md #440
lasarojc
started this conversation in
User feedback
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Thanks for the extensive documentation. Here goes some comments/questions on this specific file and TNT in general from my first interactions.
What is the cost of not declaring a definition as
pure
? Is it in performance when running Apalache?Would it be possible to support
if p then e1 else e2
instead of/in addition toif (p) e1 else e2
? IMHO it is much more eye pleasing, specially if the condition spans multiple lines (I can never find a pleasing way to indent the parenthesis).If we do not expect people to be coming to TNT from a TLA+ background, why not support CASE?
With respect to discriminated unions
name_1
instead of<ident>
or the other way around.<tag value>_TYPE
is created for me, but experimenting with REPL indicated otherwise (val x = { tag: "Cat", name: "Ours", year: 2019 }
followed byvar xt : CAT_TYPE
)Entries.filter(e => e.year == 2019)
and it worked but with a warning.match
fields other thantag
? If so, I'd consider matching ontag
to explicitly require the field name.Regarding lists,
replaceAt(l, start, end)
should bereplaceAt(l, I, e)
Regarding
Then
(A).then(B)
and in this case A initializes the state s1 and s_2 is computed by applying B?Regarding
Set
, a common operation is to add one elemente
to a sets
. In TLA+ it wass \cup {e}
(which looks clean on a pretty print), but in TNT it is longers.union(Set(e))
. Would anadd
make sense here (s.add(e)
)?Beta Was this translation helpful? Give feedback.
All reactions