Closed Tros-t closed 2 years ago
print!()
without ln
doesn't flush the stdout buffer. libstd only writes to the OS stdout every time it sees a newline. That is stdout is line buffered.
Thanks for the report @Saad-py. That's interesting that a=5
doesn't error. What's happening is that because it doesn't end in a semicolon, it's treated as an expression and evcxr tries to print expressions. You can imagine it taking your code and wrapping it as println!("{}", a = 5);
... which compiles. I think in order to make this code produce an error, I'd probably need to explicitly check for it.
But rest assured, errors should in general be displayed. For example if you do a = 5;
then you get:
>> a = 5;
^ not found in this scope
cannot find value `a` in this scope
Could you write println!("{}", &(a=5));
ibstead of println!("{}", a=5);
for a=5
? That should avoid interpreting a=
by println!()
instead of as assignment.
With the above commit, an error is now show as expected.
>> a = 5
^ not found in this scope
cannot find value `a` in this scope
Hi, Loved the main thing but I cannot see my errors when I run
a = 5
without defining a it doesn't gives me any error just prints 5 out.And when I try to print something without the ln or just
print!("hi");
it doesn't print anything to the output area.And do you guys have any ideas to make this a bit faster