You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the compiler on the REPL, I get a value different from null when assigning variables with a let statement."
Steps to reproduce
cargo run
and simply type
let a = 4;
Expected behavior
Welcome to the Monkey programming language! Compiler and Interpreter by @Yag000, in Rust
Feel free to type in commands
>> let a = 4;
Actual behavior
Welcome to the Monkey programming language! Compiler and Interpreter by @Yag000, in Rust
Feel free to type in commands
>> let a = 4;
4
Additional information
This only happens when using the compiler as an engine. This is due to the fact that 4 is at the top of the stack, which is not an intended behavior in this case. NULL should be there. I will look at this later as it does not have any practical implications, and it will not mess with anyone, but it should be addressed.
The text was updated successfully, but these errors were encountered:
Yag000
changed the title
[Bug]
Let statement on compiler repl give aout a value and not null
Aug 3, 2023
Yag000
changed the title
Let statement on compiler repl give aout a value and not null
Let statement on compiler repl give out a value and not null
Aug 3, 2023
Yag000
changed the title
Let statement on compiler repl give out a value and not null
Let statement on compiler repl gives out a value and not null
Aug 8, 2023
I would argue that this is just a feature of the compiler, since when using the REPL you just get the top constant, which in most cases is, ans should be, a value different from 'NULL'. To solve this I would hard code on the REPL itself that it should only print a value if the last input was an expression statement, and ignore the top value in any other case.
Description
When using the compiler on the REPL, I get a value different from null when assigning variables with a let statement."
Steps to reproduce
and simply type
Expected behavior
Actual behavior
Additional information
This only happens when using the compiler as an engine. This is due to the fact that 4 is at the top of the stack, which is not an intended behavior in this case. NULL should be there. I will look at this later as it does not have any practical implications, and it will not mess with anyone, but it should be addressed.
The text was updated successfully, but these errors were encountered: