forked from xxq250/Nasal-Interpreter
🚀 change std::string to string, change identifiers' name, -o is now a function available in debug mode.
This commit is contained in:
@@ -6,20 +6,20 @@ double fibonaci(double x){
|
||||
return x;
|
||||
return fibonaci(x-1)+fibonaci(x-2);
|
||||
}
|
||||
extern "C" nasal_ref fib(std::vector<nasal_ref>& args,nasal_gc& gc){
|
||||
extern "C" nas_ref fib(std::vector<nas_ref>& args,nasal_gc& gc){
|
||||
std::cout<<"[mod] this is the first test module of nasal\n";
|
||||
if(!args.size())
|
||||
return builtin_err("fib","lack arguments");
|
||||
nasal_ref num=args[0];
|
||||
nas_ref num=args[0];
|
||||
if(num.type!=vm_num)
|
||||
return builtin_err("extern_fib","\"num\" must be number");
|
||||
return {vm_num,fibonaci(num.tonum())};
|
||||
}
|
||||
extern "C" nasal_ref quick_fib(std::vector<nasal_ref>& args,nasal_gc& gc){
|
||||
extern "C" nas_ref quick_fib(std::vector<nas_ref>& args,nasal_gc& gc){
|
||||
std::cout<<"[mod] this is the first test module of nasal\n";
|
||||
if(!args.size())
|
||||
return builtin_err("fib","lack arguments");
|
||||
nasal_ref num=args[0];
|
||||
nas_ref num=args[0];
|
||||
if(num.type!=vm_num)
|
||||
return builtin_err("extern_quick_fib","\"num\" must be number");
|
||||
if(num.num()<2)
|
||||
|
||||
Reference in New Issue
Block a user