Files
kraken/stdlib/simple_print.krak

60 lines
1.1 KiB
Plaintext
Raw Normal View History

fun println() {
print("\n")
}
fun println(to_print: *char) {
print(to_print)
print("\n")
}
fun println(to_print: char) {
print(to_print)
print("\n")
}
fun println(to_print: int) {
print(to_print)
print("\n")
}
fun println(to_print: float) {
print(to_print)
print("\n")
}
fun println(to_print: double) {
print(to_print)
print("\n")
}
fun println(to_print: bool) {
print(to_print)
print("\n")
}
fun print(to_print: *char) {
__if_comp__ __C__ simple_passthrough(to_print::) """
printf("%s", to_print);
"""
}
fun print(to_print: char) {
__if_comp__ __C__ simple_passthrough(to_print::) """
printf("%c", to_print);
"""
}
fun print(to_print: int) {
__if_comp__ __C__ simple_passthrough(to_print::) """
printf("%d", to_print);
"""
}
fun print(to_print: float) {
__if_comp__ __C__ simple_passthrough(to_print::) """
printf("%f", to_print);
"""
}
fun print(to_print: double) {
__if_comp__ __C__ simple_passthrough(to_print::) """
printf("%f", to_print);
"""
}
fun print(to_print: bool) {
if (to_print) print("true")
else print("false")
}