Add add, sub, mul, and div functions to integers
Arithmetic among integers is supportd. Yey! Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -15,7 +15,7 @@ pub static PRINTLN_BUILTIN_FUN: Lazy<NativeFunRef> = Lazy::new(|| NativeFun::new
|
||||
{
|
||||
read_obj!(let str_obj = return_value);
|
||||
let str_obj: &Str = str_obj.as_any().downcast_ref()
|
||||
.ok_or_else(|| Error::ValueError { error: "expected str value".to_string(), value: return_value.clone() })?;
|
||||
.ok_or_else(|| Error::ValueError { error: "expected str value".to_string(), })?;
|
||||
println!("{}", str_obj.value());
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ pub static PRINT_BUILTIN_FUN: Lazy<NativeFunRef> = Lazy::new(|| NativeFun::new_o
|
||||
{
|
||||
read_obj!(let str_obj = return_value);
|
||||
let str_obj: &Str = str_obj.as_any().downcast_ref()
|
||||
.ok_or_else(|| Error::ValueError { error: "expected str value".to_string(), value: return_value.clone() })?;
|
||||
.ok_or_else(|| Error::ValueError { error: "expected str value".to_string(), })?;
|
||||
print!("{}", str_obj.value());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user