Files
not-python/runtime/src/obj/int.rs

31 lines
554 B
Rust
Raw Normal View History

use crate::obj::{names::*, prelude::*};
use shredder::Scan;
#[derive(Debug, Scan)]
pub struct Int {
value: i64,
attrs: Attrs,
}
impl Int {
pub fn new(value: i64) -> ObjRef<Self> {
let obj_ref = ObjRef::new(Self {
value,
attrs: Default::default(),
});
{
write_obj!(let obj = obj_ref);
obj.set_attr(*GET_ATTR_MEMBER_SYM, GET_ATTR_MEMBER_FUN.clone());
}
obj_ref
}
pub fn value(&self) -> i64 {
self.value
}
}
impl_obj!(Int, attrs);