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

nested call variable shadowing #23

Open
choltreppe opened this issue Jun 12, 2022 · 3 comments
Open

nested call variable shadowing #23

choltreppe opened this issue Jun 12, 2022 · 3 comments
Labels
bug Something isn't working invalid This doesn't seem right

Comments

@choltreppe
Copy link

shadowing variable names doenst seem to work correctly.

neither with custom name:

echo:
  @[@[1,2],@[3,4]].items |>
    map[a](
      a.items |> map[a](a+1).toSeq()).
    toSeq()

nor with it:

echo:
  @[@[1,2],@[3,4]].items |>
    map(
      it.items |> map(it+1).toSeq()).
    toSeq()
@hamidb80 hamidb80 added bug Something isn't working invalid This doesn't seem right labels Jun 12, 2022
@hamidb80
Copy link
Owner

hamidb80 commented Jun 12, 2022

Umm ...

That's because it replaces every occurrence of the identifier in "top-down" order, and it is done manually by iterrr

Honestly iterrr is not designed be to used nested in the first place, but I'm thinking for a way to make it possible.

the temporary solution is gonna be choosing different identifier for nested usage of iterrr

@hamidb80
Copy link
Owner

hamidb80 commented Jun 12, 2022

using templates should fix the problem, I'll give it a try on the weekend

@hamidb80
Copy link
Owner

hamidb80 commented Aug 7, 2022

well, I've tried different ways, and failed

maybe that can't be fixed

maybe forcing to choose an unique identifier is good idea LOL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants