Replies: 1 comment 2 replies
-
Here's an idea that doesn't directly answer the question but might help with conflicts: use some sort of prefix to access state variables, like class A
def initialize(x)
@x = x
end
def plus(x, y)
x + y
end
def plus_x(x)
x + @x
end
end |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We copied the rule from TLA+ that name shadowing is not allowed. While it is, in principle, a nice rule for single-module specifications, it introduces problems with module composition. We have been running into the same problems with TLA+.
The most annoying case is perhaps the collision of state variables and definition parameters:
While it is easy to keep track of naming conventions in your specs, it is hard to do so in external libraries. For instance, if the library author decides to rename a definition parameter, the new version may introduce a naming conflict.
If we decide to allow for shadowing, we will have to rename names in a Quint spec, before translating it to TLA+.
Beta Was this translation helpful? Give feedback.
All reactions