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

attempting to call undeclared routine: 'mapIt' #63

Open
bluenote10 opened this issue Jul 19, 2020 · 3 comments
Open

attempting to call undeclared routine: 'mapIt' #63

bluenote10 opened this issue Jul 19, 2020 · 3 comments

Comments

@bluenote10
Copy link
Member

I tried to get NimData to work on latest devel again, but I'm running into a weird problem coming from its plotly dependence. On travis I'm getting the error:

/home/travis/build/bluenote10/NimData/examples/example_01.nim(161, 5) template/generic instantiation of `heatmap` from here
/home/travis/build/bluenote10/NimData/src/nimdata/plotting.nim(32, 10) template/generic instantiation of `heatmap` from here
/home/travis/.nimble/pkgs/plotly-0.2.0/plotly/plotly_sugar.nim(64, 16) Error: attempting to call undeclared routine: 'mapIt'

I'm not quite sure why that is happening, because the code makes sense on first glance. Or do all these templates require to actually bind the symbols?

@Vindaar
Copy link
Member

Vindaar commented Jul 19, 2020

Hm, it's possible that this is a recent regression / change on devel. I'll take a look at it.

edit: the problem might just be that heatmap is just a template and so mapIt isn't found, because it's not imported in example_01.nim. Can you check if it works if you import sequtils there?

Also not sure if comments on commits show up in your notifications, so a link here:
bluenote10/NimData@8320f3c#commitcomment-40727862

@bluenote10
Copy link
Member Author

edit: the problem might just be that heatmap is just a template and so mapIt isn't found, because it's not imported in example_01.nim

Yes manually importing on client side should be possible, but I've raised this as an issue, because that's not how such a problem should be worked around. It's normally the responsibility of the template author to bind necessary symbols properly. Otherwise client code would have to import lots of seemingly unrelated stuff just to get things compiled. In this case it would mean that import nimdata is no longer suffcient and we'd have to document that whenever you import nimdata you also have to import sequtils because of some usage in nim-plotly templates. I'm not quite sure why it worked before though.

For now I have disabled the nim-plotly test parts in NimData to get a green build again (bluenote10/NimData#68).

@Vindaar
Copy link
Member

Vindaar commented Jun 9, 2021

I vaguely remember that sometime in the last year some of the symbol lookup rules regarding templates were changed. So that's probably the reason.

I'll try to fix it with manual mixin added.

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

No branches or pull requests

2 participants