1
Crate Export
jess edited this page 2026-04-15 09:38:07 -07:00
Table of Contents
Crate Export
Trigger
File ▸ Export as Rust Library… or Cmd+Shift+E. Folder + crate name prompt via NSSavePanel.
Output
my-note/
├── Cargo.toml
├── build.sh
├── install.sh
├── README.md
├── .gitignore
└── src/
├── main.rs
├── lib.rs
└── blocks/
├── block_N.cord
└── snake_name.cord
| File | Contents |
|---|---|
Cargo.toml |
lib + bin, git dep on acord-core |
build.sh |
cargo build --release |
install.sh |
Copy binary to ~/.acord/bin, print PATH hints |
README.md |
Block inventory |
src/main.rs |
REPL (:list shows bindings, :q quits) |
src/lib.rs |
pub fn load() -> Interpreter |
src/blocks/*.cord |
One file per block |
Crate-name normalisation: lowercased, _ → -, non-alphanumeric stripped.
Run the exported crate
cd my-note
./build.sh
./install.sh
my-note
REPL:
> ke(100, 9.8)
4802
> :list
m: number = 100
v: number = 9.8
ke: fn(m, v)
> :q
Embed in another crate
[dependencies]
my-note = { path = "../my-note" }
use my_note;
fn main() {
let mut interp = my_note::load();
let result = interp.eval_expr_str("ke(50, 7.0)").unwrap();
println!("{}", result.display());
}
See also
Acord
The editor
Cordial
Power tools
Contributors