Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

lisp for scripting/extensions/plugins

Name: Anonymous 2016-09-28 7:39

which is the best one?

I'm starting a project which requires a bit of low-level programming (and I prefer to be able to deliver it as a self-contained binaries, without the user having to install any sort of lisp runtime) but I've grown used to s-expression syntax so it would be easier for me to implement most of the higher-level logic in something with a lot of parentheses. I'm thinking of writing a C program which consists mostly of a library of low-level functions and a main() that simply loads and executes some lisp scripts. I know Guile Scheme can do that but it's a GNU project so it might suck. what are the alternatives?

Name: Anonymous 2016-09-28 19:01

>>9
They're 30-bit because the interpreter uses 2 bits for the type flag. It literally has just 4 types which it tests for at runtime. This is an ancient shitty trick used by Lispers to avoid implementing a real type system.

#define tag(x) ((x)&0x3)

switch (tag(v)) {
case TAG_NUM: fprintf(f, "%ld", numval(v)); break;
case TAG_SYM: fprintf(f, "%s", ((symbol_t*)ptr(v))->name); break;
case TAG_BUILTIN: fprintf(f, "#<builtin %s>",
builtin_names[intval(v)]); break;
case TAG_CONS:

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List