Skip to content
This repository has been archived by the owner on Jul 2, 2022. It is now read-only.

Difficulty completing Reverse(Twople) exercise #38

Closed
raoulmillais opened this issue Oct 22, 2017 · 3 comments
Closed

Difficulty completing Reverse(Twople) exercise #38

raoulmillais opened this issue Oct 22, 2017 · 3 comments

Comments

@raoulmillais
Copy link

raoulmillais commented Oct 22, 2017

Working through the examples one by one, I found I couldn't complete the Twople exercise. I came across 2 problems:

  1. I had to peek at the answer of how to reverse a two tuple. I did not know how to raise an error at this point in TLA+, so maybe you should consider introducing this earlier on?

  2. The supplied solution didn't work for me when I pasted it into the toolbox (I may be doing something wrong here).

Spec

---------------------------- MODULE LearnTlaPlus ----------------------------
EXTENDS Integers, Sequences
                      
Reverse(Twople) == IF Len(Twople) = 2 THEN <<Twople[2], Twople[1]>> ELSE ASSERT FALSE
               
=============================================================================

Error (truncated for brevity as it's impossible to copy/paste the parse errors on OSX)

***Parse Error***
Was expecting  "==== or more Module body"
Encountered FALSE at ...
@hwayne
Copy link
Owner

hwayne commented Oct 22, 2017 via email

@hwayne
Copy link
Owner

hwayne commented Oct 25, 2017

Fixed in 31b6232.

@hwayne hwayne closed this as completed Oct 25, 2017
@raoulmillais
Copy link
Author

All working for me now when I run it. Thank you very much for your work making this, it's really helpful having plenty of sources to learn from :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants