Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support dot-like method calls; alternative to #19384 #19919; fixes #19392 #19921

Closed
wants to merge 3 commits into from

Conversation

ringabout
Copy link
Member

@ringabout ringabout commented Jun 22, 2022

closes #19384
closes #19919
fixes #19392

tests are coming ...

@ringabout ringabout changed the title Support dot-like method calls; alternative to #19384 #19919 Support dot-like method calls; alternative to #19384 #19919; fixes #19392 Jun 22, 2022
@ringabout
Copy link
Member Author

I'm checking #19806

@ringabout ringabout changed the title Support dot-like method calls; alternative to #19384 #19919; fixes #19392 Support dot-like method calls; alternative to #19384 #19919; fixes #19392; fixes #19806 Jun 22, 2022
@ringabout
Copy link
Member Author

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 mratsim/weave#182

@ringabout
Copy link
Member Author

ringabout commented Jun 24, 2022

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)

@ringabout ringabout changed the title Support dot-like method calls; alternative to #19384 #19919; fixes #19392; fixes #19806 Support dot-like method calls; alternative to #19384 #19919; fixes #19392 Jun 25, 2022
@Araq
Copy link
Member

Araq commented Jun 28, 2022

Please explain your solution here.

@ringabout
Copy link
Member Author

Sorry for the delay. My PR has the same problem as #8759 ([parser] a => counter+=1 parsed as (a => counter) += 1, violating the spec, and causing issues with => )

@Menduist
Copy link
Contributor

Menduist commented Aug 3, 2022

What's the status on this PR :) ? Looking forward for questionable to work again on devel

@ringabout
Copy link
Member Author

@Menduist, Sorry for the inconveneience. I cannot think of a good solution.

#19919 can be merged now which reverts enabling the experiemental feature, we can embrace dot-like method calls in the future.

@Menduist
Copy link
Contributor

Menduist commented Aug 3, 2022

Maybe it's the best solution indeed, we can keep it as an optional flag until we find a solution / give up & remove it

@ringabout ringabout closed this Sep 22, 2022
@ringabout ringabout deleted the pr_support_dot branch September 22, 2022 13:32
@ringabout
Copy link
Member Author

I will revisit it later.

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

Successfully merging this pull request may close these issues.

A macro with -d:nimPreviewDotLikeOps enabled gets different arguments
3 participants