.PHONY: std api
-std: std/bool.so std/int.so std/str.so
+std: std/bool.so std/int.so std/str.so std/nil.so
api: api/api.so
std/%.so: std/%.c
# Standard library
+## The `:nil` module
+
+- `:nil:nil`: The nil constant
+
## The `:bool` module
- `:bool:if`: Requires exactly 3 arguments of arbitrary type. If $0 is a truthy value, evaluate and return $1. If $0 is a falsy value, evaluate and return $2. Values considered as falsy are: `:bool:false` and `:nil:nil`. Everything else is considered truey.
main :str:cat(
hello_world,
- fibo:print(10)
+ fibo:print(10),
+ :nil:nil
)
return uwubool_get(uwuvm_get_arg(args, i));
}
-#include "../api/str.h"
UwUVMValue uwu_if(UwUVMArgs *args)
{
if (args->num != 3)
UwUVMValue uwu_add(UwUVMArgs *args)
{
- return uwuint_create(reduce(":int:mul", args, ROP_ADD, 0));
+ return uwuint_create(reduce(":int:add", args, ROP_ADD, 0));
}
UwUVMValue uwu_sub(UwUVMArgs *args)
--- /dev/null
+#include "../src/err.h"
+#include "../api/nil.h"
+
+UwUVMValue uwu_nil(UwUVMArgs *args)
+{
+ if (args->num != 0)
+ error(":nil:nil does not accept any arguments\n");
+
+ return uwunil_create();
+}