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

endless while cycle #575

Closed
IngeniariusSoftware opened this issue Jan 13, 2022 · 10 comments
Closed

endless while cycle #575

IngeniariusSoftware opened this issue Jan 13, 2022 · 10 comments

Comments

@IngeniariusSoftware
Copy link
Member

IngeniariusSoftware commented Jan 13, 2022

code

+package c2eo.src

+alias org.eolang.txt.sprintf
+alias org.eolang.io.stdout

[] > whiletest
  memory > m

  [] > main
    seq > @
      m.write 5
      while.
        (((m.greater 0).if 1 0).eq 0).if FALSE TRUE
        seq
          m.write (m.sub 1)
          stdout (sprintf "%d\n" m)
      TRUE

  main > @

result
image

@yegor256
Copy link
Member

@IngeniariusSoftware can you make this code shorter? Are you sure that ALL lines in your example are relevant to the bug you report?

@IngeniariusSoftware
Copy link
Member Author

@yegor256, I made it shorter

@yegor256
Copy link
Member

@IngeniariusSoftware I believe it should be like this:

[] > main
    seq > @
      m.write 5
      while.
        (((m.greater 0).if 1 0).eq 0).if FALSE TRUE
        [i]
          seq > @
            m.write (m.sub 1)
            stdout (sprintf "%d\n" m)
      TRUE

See how it's done here: https://github.com/cqfn/eo/blob/master/eo-runtime/src/test/eo/org/eolang/bool-tests.eo#L55-L65

@IngeniariusSoftware
Copy link
Member Author

@yegor256, thank you, it was a typo, but your code still gives the same result

@yegor256
Copy link
Member

@IngeniariusSoftware you are right, reopening

@yegor256 yegor256 reopened this Mar 26, 2022
yegor256 added a commit that referenced this issue Mar 28, 2022
@yegor256
Copy link
Member

@IngeniariusSoftware it's reproduced and fixed in 7d86e63

@yegor256
Copy link
Member

@rultor release, tag is 0.22.2

@rultor
Copy link
Contributor

rultor commented Mar 28, 2022

@rultor release, tag is 0.22.2

@yegor256 OK, I will release it now. Please check the progress here

@rultor
Copy link
Contributor

rultor commented Mar 28, 2022

@rultor release, tag is 0.22.2

@yegor256 Done! FYI, the full log is here (took me 15min)

@yegor256
Copy link
Member

@IngeniariusSoftware try version 0.22.2, it should work

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

4 participants