-
- Downloads
WhyML: tuple terms/expressions do not require parentheses
This makes the syntax cleaner and brings us closer to OCaml. One incompatibility with the previous grammar is that "ghost" binds stronger than the left arrow of assignment, and thus ghost assignments have to be written as "ghost (x.f <- v)". This is unavoidable, because assignment has to be weaker than the tuple comma (think "x.f, y.g <- y.g, x.f" or "a[i] <- u,v"), and "ghost" has to be stronger than comma, for consistency with our patterns and our return types. The "return" construction is weaker than comma, for "return a,b". It is also weaker than assignment, though "return x.f <- b" does not make much sense either way. This change does not concern type expressions, where a tuple type must always have its clothes^Wparentheses on: (int, int). It might be nice to write "constant pair: int, bool", but on the other hand this would break casts like "42: int, true".
Showing
- examples/add_list.mlw 7 additions, 7 deletionsexamples/add_list.mlw
- examples/assigning_meanings_to_programs.mlw 1 addition, 1 deletionexamples/assigning_meanings_to_programs.mlw
- examples/balance.mlw 24 additions, 24 deletionsexamples/balance.mlw
- examples/binomial_heap.mlw 7 additions, 7 deletionsexamples/binomial_heap.mlw
- examples/braun_trees.mlw 5 additions, 5 deletionsexamples/braun_trees.mlw
- examples/defunctionalization.mlw 18 additions, 18 deletionsexamples/defunctionalization.mlw
- examples/esterel.mlw 2 additions, 2 deletionsexamples/esterel.mlw
- examples/fibonacci.mlw 12 additions, 12 deletionsexamples/fibonacci.mlw
- examples/finger_trees.mlw 18 additions, 18 deletionsexamples/finger_trees.mlw
- examples/in_progress/simple_queue.mlw 1 addition, 1 deletionexamples/in_progress/simple_queue.mlw
- examples/mergesort_list.mlw 2 additions, 2 deletionsexamples/mergesort_list.mlw
- examples/patience.mlw 23 additions, 23 deletionsexamples/patience.mlw
- examples/residual.mlw 2 additions, 2 deletionsexamples/residual.mlw
- examples/swap.mlw 2 additions, 2 deletionsexamples/swap.mlw
- examples/there_and_back_again.mlw 3 additions, 3 deletionsexamples/there_and_back_again.mlw
- examples/to_port/linear_probing.mlw 4 additions, 4 deletionsexamples/to_port/linear_probing.mlw
- examples/tower_of_hanoi.mlw 1 addition, 1 deletionexamples/tower_of_hanoi.mlw
- examples/tree_of_list.mlw 6 additions, 6 deletionsexamples/tree_of_list.mlw
- examples/verifythis_2015_parallel_gcd.mlw 4 additions, 4 deletionsexamples/verifythis_2015_parallel_gcd.mlw
- examples/verifythis_2016_tree_traversal.mlw 2 additions, 2 deletionsexamples/verifythis_2016_tree_traversal.mlw
Loading
Please register or sign in to comment