import static org.tabooproject.fluxon.runtime.FunctionSignature.returns;
import org.tabooproject.fluxon.runtime.Type;
FluxonRuntime runtime = FluxonRuntime.getInstance();
runtime.registerExtension(File.class, "fs:io")
.function("exists", returns(Type.Z).noParams(), ctx -> {
ctx.setReturnBool(ctx.getTarget().exists());
})
.asyncFunction("length", returns(Type.J).noParams(), ctx -> {
ctx.setReturnLong(ctx.getTarget().length());
})
.syncFunction("getName", returns(Type.STRING).noParams(), ctx -> {
ctx.setReturnRef(ctx.getTarget().getName());
});