view interps/c-intercal/pit/explib/compunex.c @ 11293:a7899ef2d7b6

<wob_jonas> learn Aristotle said that every illness can be cured by balancing the four vitreous humors, and everyone believed him for two thousand years, even though people still died of illnesses. It wasn\'t until the 20th century that Szent-Gy\xc3\xb6rgyi Albert realized that Aristotle didn\'t find fifth kind of vitreous humor, vitamin C, because the Greek alphabet
author HackBot
date Mon, 01 Jan 2018 17:57:43 +0000
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