Nim
Nim copied to clipboard
Support dot-like method calls; alternative to #19384 #19919; fixes #19392
closes #19384 closes #19919 fixes #19392
tests are coming ...
I'm checking https://github.com/nim-lang/Nim/issues/19806
Hi @markspanbroek. I tested the tests of question, all of them pass. I would like to add questionable to important packages in case of regression. However it is blocked by https://github.com/mratsim/weave/pull/182
for i in x .++ (if true: 12):
collector.add i
if expr gives the same error like before:
Error: expression '12' is of type 'int literal(12)' and has to be used (or discarded)
Please explain your solution here.
Sorry for the delay. My PR has the same problem as https://github.com/nim-lang/Nim/issues/8759 ([parser] a => counter+=1 parsed as (a => counter) += 1, violating the spec, and causing issues with => )
What's the status on this PR :) ? Looking forward for questionable to work again on devel
@Menduist, Sorry for the inconveneience. I cannot think of a good solution.
https://github.com/nim-lang/Nim/pull/19919 can be merged now which reverts enabling the experiemental feature, we can embrace dot-like method calls in the future.
Maybe it's the best solution indeed, we can keep it as an optional flag until we find a solution / give up & remove it
I will revisit it later.