wolfram_library_link/docs/
evaluate_wolfram_code_from_rust.rs

1/*!
2# How To: Evaluate Wolfram code from Rust
3
4
5## Generating Wolfram messages from Rust
6
7Suppose you want to generate a Wolfram [`Message[..]`][ref/Message] from within Rust.
8
9The easiest way to accomplish this is to construct an appropriate Wolfram expression
10using the [`Expr`] type, and then use the [`evaluate()`] function to call back into
11Wolfram to evaluate that expression.
12
13[ref/Message]: https://reference.wolfram.com/language/ref/Message.html
14
15**Rust**
16
17```rust
18# mod scope {
19*/
20#![doc = include_str!("../../examples/docs/evaluate_wolfram_code_from_rust/generate_message.rs")]
21/*!
22# }
23```
24
25**Wolfram**
26
27```wolfram
28*/
29#![doc = include_str!("../../RustLink/Examples/Docs/EvaluateWolframCodeFromRust/GenerateMessage.wlt")]
30/*!
31```
32
33## Using Print[..] from Rust
34
35*TODO*
36
37*/
38
39use crate::{evaluate, expr::Expr};