brundonsmith / rust_lisp

A Rust-embeddable Lisp, with support for interop with native Rust functions
234 stars 20 forks source link

could not find `prelude` in `rust_lisp` #18

Closed omarandlorraine closed 2 years ago

omarandlorraine commented 2 years ago

I have this content in Cargo.toml

[dependencies]
rust_lisp = "0.15.0"

Then I have this content in src/main.rs

extern crate rust_lisp;
use rust_lisp::prelude::*;

But then I'm getting this compiler message

error[E0432]: unresolved import `rust_lisp::prelude`
 --> src/main.rs:7:16
  |
7 | use rust_lisp::prelude::*;
  |                ^^^^^^^ could not find `prelude` in `rust_lisp`

Am I doing something wrong? There is no mention of prelude in the documentation. I'm not sure if I screwed up somehow or if the example on the README is out of date?

omarandlorraine commented 2 years ago

I figured the problem out and stuck the solution in the pull request; hope that's alright

brundonsmith commented 2 years ago

Hi!

Yes I think you came to the right conclusion. Originally the prelude existed to make sure the lisp! macro had everything it needed in scope for the code it generated, but then I realized I could just fully-qualify the references and the prelude was no longer necessary, so I removed it. But I forgot to update the example afterward.

Sorry about the confusion! I'll take a look at the PR later today