Sexpr* args = b->value.b.args;
Sexpr* i = eval(clone(car(args)), env);
Sexpr* j = eval(clone(car(cdr(args))), env);
- uint64_t m = unquote(i)->value.u;
- uint64_t n = unquote(j)->value.u;
+ K_UINT_TYPE m = unquote(i)->value.u;
+ K_UINT_TYPE n = unquote(j)->value.u;
sexpr_free(b);
sexpr_free(i);
sexpr_free(j);
Sexpr* args = b->value.b.args;
Sexpr* i = eval(clone(car(args)), env);
Sexpr* j = eval(clone(car(cdr(args))), env);
- uint64_t m = unquote(i)->value.u;
- uint64_t n = unquote(j)->value.u;
+ K_UINT_TYPE m = unquote(i)->value.u;
+ K_UINT_TYPE n = unquote(j)->value.u;
sexpr_free(b);
sexpr_free(i);
sexpr_free(j);
Sexpr* args = b->value.b.args;
Sexpr* i = eval(clone(car(args)), env);
Sexpr* j = eval(clone(car(cdr(args))), env);
- uint64_t m = unquote(i)->value.u;
- uint64_t n = unquote(j)->value.u;
+ K_UINT_TYPE m = unquote(i)->value.u;
+ K_UINT_TYPE n = unquote(j)->value.u;
sexpr_free(b);
sexpr_free(i);
sexpr_free(j);
Sexpr* args = b->value.b.args;
Sexpr* i = eval(clone(car(args)), env);
Sexpr* j = eval(clone(car(cdr(args))), env);
- uint64_t m = unquote(i)->value.u;
- uint64_t n = unquote(j)->value.u;
+ K_UINT_TYPE m = unquote(i)->value.u;
+ K_UINT_TYPE n = unquote(j)->value.u;
sexpr_free(b);
sexpr_free(i);
sexpr_free(j);
Sexpr* args = b->value.b.args;
Sexpr* i = eval(clone(car(args)), env);
Sexpr* j = eval(clone(car(cdr(args))), env);
- uint64_t m = unquote(i)->value.u;
- uint64_t n = unquote(j)->value.u;
+ K_UINT_TYPE m = unquote(i)->value.u;
+ K_UINT_TYPE n = unquote(j)->value.u;
sexpr_free(b);
sexpr_free(i);
sexpr_free(j);
-
+#include "../config.h"
#include "../types.h"
#include "../builtins.h"
#include "../sexpr.h"
Sexpr* fun = car(cdr(args));
Sexpr* snum = eval(clone(car(cdr(cdr(args)))), env);
// uh yeah i'm not typechecking lol
- uint64_t num = snum->value.u;
+ K_UINT_TYPE num = snum->value.u;
sexpr_free(snum);
// fun not cloned due since i'll be cloning it in the loop
Sexpr* ret = cons(arg, from_nil());
if(CORE_EXIT_ARGS != u64_get_num_args(b))
return cons(b, rest);
Sexpr* args = b->value.b.args;
- uint64_t value = car(args)->value.u;
+ K_UINT_TYPE value = car(args)->value.u;
sexpr_free(b);
sexpr_free(rest);
sexpr_free(env);
#include <stdbool.h>
#include <ctype.h>
+#include "config.h"
#include "types.h"
#include "sexpr.h"
return tokens;
}
-bool is_u64(char* s) {
+bool is_uint(char* s) {
while(*s!='\0') {
if(!isdigit(*s)) return false;
s++;
Sexpr* next = NULL;
while(tokens->type != NIL) {
char* s = car(tokens)->value.s;
- if(is_u64(s)) {
- uint64_t u;
- sscanf(s, "%" SCNu64, &u);
+ if(is_uint(s)) {
+ K_UINT_TYPE u;
+ sscanf(s, "%" K_UINT_SCAN, &u);
next = from_uint(u);
}
else {
#include <stdlib.h>
#include <string.h>
+#include "config.h"
+
#include "types.h"
#include "sexpr.h"
return ret;
}
-Sexpr* from_uint(uint64_t u) {
+Sexpr* from_uint(K_UINT_TYPE u) {
Sexpr* ret = malloc(sizeof(Sexpr));
ret->type = UINT;
ret->value.u = u;
return out;
}
else if(s->type == UINT) {
- nbytes = snprintf(NULL, 0, "%" PRIu64 "", s->value.u) + 1;
+ nbytes = snprintf(NULL, 0, "%" K_UINT_PRINT "", s->value.u) + 1;
out = malloc(nbytes*sizeof(char));
snprintf(out, nbytes, "%" PRIu64 "", s->value.u);
return out;