Noob - Help me understand assert #3648
-
|
I'm trying to go through the exercises about termination here: https://fstar-lang.org/tutorial/book/part1/part1_termination.html#exercise-tail-recursive-reversal The code for the tail-call optimized version of I've added the I then add the following When I execute this, I get the following error message: If I change my asserts to: and I get no errors: I feel like I'm misunderstanding some critical aspect of how this system is supposed to work.
Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hi Carl, lists in F* are separated with (It is sometimes confusing to me though... I stared at this for a couple of minutes being completely dumbfounded.) |
Beta Was this translation helpful? Give feedback.
Hi Carl,
lists in F* are separated with
;, not,. Comma is used to separate tuple components, and outer parentheses are not required (I think both OCaml and F# use similar syntax). So, in your examples all your lists are actually one-element long, and the element is a tuple. Sorev2 [(1,2,3)]is indeed[(1,2,3)].(It is sometimes confusing to me though... I stared at this for a couple of minutes being completely dumbfounded.)