Skip to content

Commit

Permalink
adding a print method for functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Leung committed Apr 2, 2015
1 parent 7936fa5 commit d717b6f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/print.cpp
Expand Up @@ -42,6 +42,9 @@ namespace Vole {
case Value::VECTOR:
ss << print(val.content.vector);
break;
case Value::FUNCTION:
ss << "[native function]";
break;
default:
break;
}
Expand Down
2 changes: 2 additions & 0 deletions test/primitives_test.cpp
Expand Up @@ -53,6 +53,8 @@ int main() {

cout << "(length '(1 hey 3 ho 5)) => " << print(Primitives::length(ctx, ctx.new_vector({ more }).content.vector)) << endl;
cout << "(length \"hello\") => " << print(Primitives::length(ctx, ctx.new_vector({ ctx.new_string("hello") }).content.vector)) << endl;

cout << "printing out `number?`: " << print(nump) << endl;
return 0;
}

0 comments on commit d717b6f

Please sign in to comment.