arturo-lang / arturo

Simple, expressive & portable programming language for efficient scripting
http://arturo-lang.io
MIT License
723 stars 32 forks source link

[VM/eval] `switch` not working properly in `print` block? #1065

Open github-actions[bot] opened 1 year ago

github-actions[bot] commented 1 year ago

[VM/eval] switch not working properly in print block?

For example this: https://github.com/arturo-lang/arturo/blob/even-more-RC-problem-solving/examples/rosetta/practical%20numbers.art#L24-L25

if written like: ```

print ["666" (practical? 666) ? -> "is" -> "is not" "a practical number"]


the whole thing freezes

https://github.com/arturo-lang/arturo/blob/3f408e2ed98260b1972f8bd984af826bcb7a3174/src/vm/eval.nim#L440

```text
                            hookOptimProfiler("opUnlessE")
                of opSwitch:    
                    # TODO(VM/eval) `switch` not working properly in `print` block?
                    #  For example this: https://github.com/arturo-lang/arturo/blob/even-more-RC-problem-solving/examples/rosetta/practical%20numbers.art#L24-L25
                    #  if written like: ```
                    #  print ["666" (practical? 666) ? -> "is" -> "is not" "a practical number"]
                    #  ```
                    #  the whole thing freezes
                    #  labels: vm, bug, evaluator
                    optimizeConditional(consts, it, item, withPotentialElse=true, isSwitch=true, withInversion=true)
                    when defined(PROFILER):
                        if alreadyProcessed:
ndex da747cde14..3cd2f13ab5 100755
++ b/tools/tester.art

9c081a145858e745b8f329dedd6d719e54144496

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 8 months ago

Closing issue as stale.

stale[bot] commented 3 weeks ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.