Boolean Expression Evaluations #34
-
|
First of all, congrats on the amazing and ambitious project. I've been playing around with it, and I'm not sure how to approach simple boolean evaluations like this: eval("true") eval("2 > 1") eval("3 > 2 && 2 > 5") Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
|
Hi @fakalit ! Thanks for the report. I've created issue #38, #39, and #40 to cover these cases and I'll fix them shortly. For the second issue (2 > 1) you should be able to get around it for now by doing |
Beta Was this translation helpful? Give feedback.
-
|
Fixed in latest master. Will look to get a new version out on Pub soon |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the very quick response and fix @ethanblake4 ! Hope this library takes off, it certainly deserves it. |
Beta Was this translation helpful? Give feedback.
-
|
@fakalit New version 0.4 on Pub is out with these fixes |
Beta Was this translation helpful? Give feedback.
Hi @fakalit !
Thanks for the report. I've created issue #38, #39, and #40 to cover these cases and I'll fix them shortly.
For the second issue (2 > 1) you should be able to get around it for now by doing
eval("bool main() { return 2 > 1; }"). By specifying the function's return type (instead of letting it to default todynamic) the compiler will leave the return value unboxed which should allow this to succeed. Of course, that should not be required and I will fix it.