~tim/scheme-vm

ref: 6f325e04c5c5c20942580e71c85c03b7ec6f1519 scheme-vm/src/lib.rs -rw-r--r-- 345 bytes
6f325e04Tim Morgan Experiment with Rust extension 5 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#[macro_use]
extern crate ruru;

use ruru::{Boolean, Class, Object, RString};

methods!(
   RString,
   itself,

   fn string_is_weird() -> Boolean {
       Boolean::new(false)
   }
);

#[no_mangle]
pub extern fn initialize_string() {
    Class::from_existing("String").define(|itself| {
        itself.def("weird?", string_is_weird);
    });
}