Files
gyehoek-hs/runtime/gyehoek.c
T
2026-05-18 07:07:24 -06:00

35 lines
729 B
C

#include <stdio.h>
#include <gc.h>
#include "gyehoek.h"
SCM scm_newline () {
putc ('\n', stdout);
return SCM_PACK(NULL);
}
SCM scm_write (SCM x) {
if (SCM_IMP (x)) {
printf ("%ld", SCM_UNPACK (x) >> 2);
} else {
printf ("#<heap object 0x%016lx>", SCM_UNPACK (x));
}
return SCM_PACK(NULL);
}
SCM scm_words (scm_t_bits word_0, uint32_t n_words) {
scm_t_bits *r = GC_malloc (n_words * sizeof (scm_t_bits));
r[0] = word_0;
return SCM_PACK (r);
}
SCM scm_from_utf8_string (const char *str, size_t len) {
SCM r = scm_words (scm_tc7_string, 3);
const char *s = GC_malloc (len);
SCM_SET_CELL_WORD (r, 1, len);
SCM_SET_CELL_WORD (r, 2, s);
return r;
}
SCM scm_from_utf8_symbol (const char *s) {
}