Browse Source

Add println function

github-actions
Garrit Franke 3 years ago
parent
commit
dbee5b9eab
  1. 2
      examples/greeter.sb
  2. 9
      lib/stdio.sb

2
examples/greeter.sb

@ -4,4 +4,4 @@ fn main() {
fn greet(name) {
return "Hello " + name
}
}

9
lib/stdio.sb

@ -1,3 +1,10 @@
// Raw wrapper around _printf builtin function.
// Writes the given content to stdout
fn print(msg) {
_printf(msg + "\n")
_printf(msg)
}
// Like print(), but with an extra newline ('\n') character
fn println(msg) {
print(msg + "\n")
}
Loading…
Cancel
Save