Janet indexing/method call resolution order potentially confusing #624
MikeBeller
started this conversation in
General
Replies: 1 comment 3 replies
-
Thanks for enumerating it, I knew about all the cases, but I was not aware of the order. The example, keyword first/last difference, was discussed many times before and was stated a couple of times it is WNF for @bakpakin. But with rereading it, I guess the second invocation should lead to err? I very much agree with documenting it somewhere. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Indexing/method lookup is perhaps a bit confusing in Janet because of the interplay of method resolution and data structure indexing. To the best of my understanding, the expression
(x y)
is evaluated as:((get y x) y)
(x y)
(get x y)
(get y x)
I suggest this could be confusing because, for example:
If someone didn't know about the above resolution order, they might wonder what the heck is going on.
(1) Is this resolution order correct, and is it what was intended and is desired?
(2) If so, should it be documented in one place perhaps, and in what chapter? (As it crosses between method resolution and data structure indexing.)
-Mike
Beta Was this translation helpful? Give feedback.
All reactions