papyrus icon indicating copy to clipboard operation
papyrus copied to clipboard

REPL always print the same result as [out0]

Open cmal opened this issue 4 years ago • 3 comments

Hi, I installed papyrus using the follow command on Mac OS X, repl always print the same result as [out0].

$ cargo +stable install papyrus --no-default-features --features="format,runnable"

[lib] papyrus=> 2 + 2 papyrus [out0]: 4 [lib] papyrus=> "xxx" == "xxx" papyrus [out1]: 4 [lib] papyrus=> 1 == 3 papyrus [out2]: 4 [lib] papyrus=> 2 + 3 papyrus [out3]: 4

$ uname -a
Darwin xxx.local 19.4.0 Darwin Kernel Version 19.4.0: Wed Mar 4 22:28:40 PST 2020; root:xnu-6153.101.6~15/RELEASE_X86_64 x86_64

cmal avatar May 27 '20 11:05 cmal

Hi @cmal, thanks for the bug report. I am unable to reproduce on Linux or Windows.

What version of Rust are you running?

kurtlawrence avatar Jun 02 '20 05:06 kurtlawrence

Hello,

Can't speak for @cmal but I found the same problem. Same version of MacOS, initially using v1.43.1, now using 1.44.1 of Rust.

Whatever is displayed in the first return output is then always displayed for every consecutive test.

$ papyrus
[lib] papyrus=> 2 + 3
papyrus [out0]: 5
[lib] papyrus=> 2 + 2
papyrus [out1]: 5
[lib] papyrus=> 1 + 1
papyrus [out2]: 5
[lib] papyrus=>

Poking around I looked at the ~/.papyrus/src/lib.rs file and it's capturing output as:

#[no_mangle]
pub extern "C" fn _lib_intern_eval() -> kserd::Kserd<'static> {
let out0 = 2 + 3;
let out1 = 2 + 2;
let out2 = 1 + 1;
kserd::ToKserd::into_kserd(out2).unwrap().into_owned()
}

nclements avatar Jun 30 '20 22:06 nclements

Met the same issue. I use MacOS.

tan-wei avatar Oct 24 '21 03:10 tan-wei