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

[BUG] seq works differently on different bash versions #669

Open
KrosFire opened this issue Jan 25, 2025 · 1 comment
Open

[BUG] seq works differently on different bash versions #669

KrosFire opened this issue Jan 25, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@KrosFire
Copy link
Member

Amber range echo 2..2 produces bash code: echo $(seq 2 1)

For bash version 3.2.57(1)-release it produces output: 2 1. Bash in newer version doesn't have this issue.

We should add some kind of check for range bounds to return no output, in order to standardise behaviour in all enviroments.
Something like:

fun range(start: Num, end: Num): [Num] {
  let range = [Num]

  if end != start {
    range = trust $seq {start} {end}$ as [Num]
  }

  return range
}
@KrosFire KrosFire added the bug Something isn't working label Jan 25, 2025
@github-project-automation github-project-automation bot moved this to 🆕 New in Amber Project Jan 25, 2025
@b1ek
Copy link
Member

b1ek commented Jan 27, 2025

i think a hotfix should be a compiler warning about this issue until we come up with a long term solution

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

No branches or pull requests

2 participants