...
This commit is contained in:
1
example/core/c.nub
Normal file
1
example/core/c.nub
Normal file
@@ -0,0 +1 @@
|
||||
extern func puts(str: string);
|
||||
@@ -1,34 +0,0 @@
|
||||
func print(msg: string) {
|
||||
syscall(1, 1, msg, str_len(msg));
|
||||
}
|
||||
|
||||
func print(value: int64) {
|
||||
print(itoa(value));
|
||||
}
|
||||
|
||||
func print(value: bool) {
|
||||
if value {
|
||||
print("true");
|
||||
} else {
|
||||
print("false");
|
||||
}
|
||||
}
|
||||
|
||||
func println() {
|
||||
print("\n");
|
||||
}
|
||||
|
||||
func println(msg: string) {
|
||||
print(msg);
|
||||
println();
|
||||
}
|
||||
|
||||
func println(value: bool) {
|
||||
print(value);
|
||||
println();
|
||||
}
|
||||
|
||||
func println(value: int64) {
|
||||
print(value);
|
||||
println();
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import "core";
|
||||
|
||||
func main() {
|
||||
println("test");
|
||||
let x = "test";
|
||||
puts(x);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user