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

Mixing of !for based loops and usual sequences breaks order #13

Open
elchupanebrej opened this issue Dec 14, 2021 · 1 comment
Open

Comments

@elchupanebrej
Copy link

When I do:

seq: !-
  - first
  - second

after_seq: !-
  - pre-last
  - last

extended_seq:
  - !for .seq: !()
      - !? $
  - next
  - other next
  - !for .after_seq: !()
      - !? $

I expect the next output:

extended_seq:
  - first
  - second
  - next
  - other next
  - pre-last
  - last

But I get:

extended_seq:
  - next
  - other next
  - first
  - second
  - pre-last
  - last
@lbovet
Copy link
Owner

lbovet commented Jan 16, 2022

I'm willing to fix this but it's difficult to find the time these days.
As a workaround, you can create another for/sequence for the intermediate items:

seq: !-
  - first
  - second

nexts: !- 
  - next
  - other next
  
after_seq: !-
  - pre-last
  - last

extended_seq:
  - !for .seq: !()
      - !? $
  - !for .nexts: !()
      - !? $
  - !for .after_seq: !()
      - !? $

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