Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REPL always print the same result as [out0] #87

Open
cmal opened this issue May 27, 2020 · 3 comments
Open

REPL always print the same result as [out0] #87

cmal opened this issue May 27, 2020 · 3 comments

Comments

@cmal
Copy link

cmal commented May 27, 2020

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

@kurtlawrence
Copy link
Owner

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

What version of Rust are you running?

@nclements
Copy link

nclements commented Jun 30, 2020

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()
}

@tan-wei
Copy link

tan-wei commented Oct 24, 2021

Met the same issue. I use MacOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants