mirror of https://gitlab.com/slondr/rust-guile.git
add tldr
This commit is contained in:
parent
af9131942e
commit
db7ed5dbbc
|
@ -29,6 +29,10 @@ To make a Rust function available to the Guile Scheme runtime, this library prov
|
|||
3. The number of optional parameters
|
||||
4. An int which will be interpreted as a boolean: 1 = function has varargs, 0 = function does not have varargs
|
||||
5. The function label (like the macro)
|
||||
** Usage TLDR
|
||||
1. Call =init_scm()=
|
||||
2. Write your Rust functions and register them with =register_void_function!()= or =scm_c_define_gsubr=
|
||||
3. Call =run_scm(argc, argv)= to head to the moon
|
||||
* Example
|
||||
Here's an example client program which defines a simple hello world function and then spawns the Scheme repl. You can run the defined Rust function from within the Repl by typing =(hello-from-rust)= and hitting enter. You'll see it prints the message into the Guile repl, and returns 0!
|
||||
#+begin_src rust
|
||||
|
|
Loading…
Reference in New Issue