Mercurial > repo
view interps/c-intercal/pit/explib/compunex.c @ 12514:500486b20e41 draft default tip
<int-e> slwd fungot//s/ds/d s/
author | HackEso <hackeso@esolangs.org> |
---|---|
date | Fri, 27 Sep 2024 20:43:06 +0100 |
parents | 859f9b4339e6 |
children |
line wrap: on
line source
/* Public domain, by Alex Smith. An example of CREATing statements from C, in this case an example COMPUNEX statement that does a computed NEXT. (Note that newly CREATEd statements can't contain consecutive characters that spell an INTERCAL keyword; also, I wanted a name that was 8 chars or shorter to serve as a DOS filename.) Note that as a CREATEd command, COMPUNEX uses one NEXT stack entry itself, meaning the COMPUNEX will take up two NEXT stack entries total. Programs that do large RESUMEs will need to take this into account. (Tail call optimisation would require some sort of GOTO, but ick_goto isn't documented and therefore shouldn't be used, right? */ #include <ick_ec.h> /* This name starts ick_, but isn't used; in general, the prefix ick_my_ is reserved for expansion libraries (as are the line numbers 1600-1699) because it doesn't conflict either with the compiler or with any linked-in C programs. */ ICK_EC_FUNC_START(ick_my_compunex) { ick_startup( { ick_create(".COMPUNEX",1600); ick_create(";COMPUNEX",1600); ick_create("~COMPUNEX",1600); }); ick_linelabel(1600); ick_next(ick_c_value(0)); ick_resume(1); } ICK_EC_FUNC_END