]> thyrsus.com Git - intercal.git/commitdiff
Ready for new release, 0.18.
authorEric S. Raymond <esr@thyrsus.com>
Wed, 29 Apr 1998 22:59:22 +0000 (18:59 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Thu, 26 Aug 2010 00:34:20 +0000 (20:34 -0400)
Makefile
NEWS
doc/intercal.mm
intercal.lsm
src/Makefile
src/abcess.h
src/cesspool.c
src/feh.c
src/lexer.l
src/numerals.c
src/perpetrate.c

index ab12568aed8b7372fbb5c13d764bebcf205de884..2a8aa528939fd42905825de30c8de68c8e3d325e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 #
 # Utility productions for the INTERCAL distribution
 #
-VERSION = 0.17
+VERSION = 0.18
 
 tgz: intercal-$(VERSION).tar.gz
 tar: intercal-$(VERSION).tar
diff --git a/NEWS b/NEWS
index 22a2b4ba2c8d0cbe5f8c8bdc47154115c9682251..95ce3ff46d406240042951ff2ef93ae0b5054cc9 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,28 @@
                        NEW IN THIS RELEASE
 
+       Release 0.18 (by Eric S. Raymond) 04 April 1998
+
+(The following changes are due to John Cowan <cowan@ccil.org>)
+
+1.  The source code is now POSIXly correct.  By making the POSIX
+variable in the Makefile undefined, you can restore the use of
+<varargs.h>, but otherwise <stdarg.h> is now used.
+
+2.  Latin-1 (ISO 8859-1) is now the standard input charset of C-INTERCAL.
+This means that the change operator (0xA2) has returned as an alternative to
+big money ($).  Furthermore, the quid (0xA3) and zlotnik (0xA4) are also
+acceptable.  For those using Latin-9 (ISO 8859-15), the euro (0xA4) will also
+work.  ("Euro", like "ampersand", cannot be sillified further.)
+New names have been added to intercal.mm.
+
+3. A fortiori, input of Volap\"uk digits may now be in Latin-1 or TeX format.
+
+4. Yacc is now deprecated in favor of bison; some old yaccs don't do proper
+error recovery, and lines like "DO ~ ERROR" failed at compile time.
+
+5.  Some minor portability bugs on systems where ptr_diff is not the same
+as int were removed by casting expressions of the form (ptr - ptr) to int.
+
        Release 0.17 (by Eric S. Raymond) 27 Feb 1998
 
 Incorporates a minor bug fix by Jeff Uphoff <juphoff@tarsier.cv.nrao.edu>.
index d6d967aa80773722ac5608d02913e8db430ca9b8..cc237c30cd567a28a7b342b5136dfd1c47891c5d 100644 (file)
@@ -60,7 +60,7 @@ and James M. Lyon\fR
 Redistribution encouraged under GPL\}
 .sp
 .ce 1
-(This version distributed with C-INTERCAL 0.16)
+(This version distributed with C-INTERCAL 0.18)
 .AE
 .MT 4
 .nr % 0
@@ -304,7 +304,7 @@ and \fBselect\fR, which
 are represented by a change (\*(ct) and a sqiggle [sic] (~), respectively.
 .if '\*c'y' \{\
 (In C-INTERCAL's ASCII environment, EBCDIC \*(ct is replaced by a big
-money ($).) \}
+money ($), but \*(ct can be used if encoded in Latin-1 as \e0xA2.) \}
 .P
 The interleave operator takes two 16-bit values and produces a 32-bit result
 by alternating the bits of the operands. Thus, #65535\*(ct#0 has the 32-bit
@@ -3020,6 +3020,19 @@ $        big money       \fIbinary mingle (ASCII)\fR
 \*(no  hookworm
 ^      shark (or simply sharkfin)
 \o"#*\(sq"     blotch
+.if '\*c'y' \{\
+\*(de  bunghole
+\*(rg  name grabber
+\*(mu  andrew cross
+\*(di  norwegian minus
+\*(co  text grabber
+\*(sc  swash
+\*(*m  microscope
+\*(+-  interworm
+\*(no  half turn
+0xA3   quid    binary mingle
+0xA4   zlotnik binary mingle
+\}
 .TE \}
 .el \{\
 .TS
@@ -3066,6 +3079,19 @@ $        big money       binary mingle
 \*(no  hookworm
 ^      shark (or simply sharkfin)      unary logical XOR (TriINTERCAL)
 \o"#*\(sq"     blotch
+.if '\*c'y' \{\
+\*(de  bunghole
+\*(rg  name grabber
+\*(mu  andrew cross
+\*(di  norwegian minus
+\*(co  text grabber
+\*(sc  swash
+\*(*m  microscope
+\*(+-  interworm
+\*(no  half turn
+0xA3   quid    binary mingle
+0xA4   zlotnik binary mingle
+\}
 .TE \}
 .ce 1
 Table 2 (top view). INTERCAL character set.
index 09e3b2fb0753a609e04068608e0cbab7aa64a6b4..445ae46ae26f6cafe57c692ec1568b83441bc44e 100644 (file)
@@ -1,7 +1,7 @@
 Begin3
 Title:         intercal
-Version:       0.17
-Entered-date:  27FEB98
+Version:       0.18
+Entered-date:  04APR98
 Description:   An implementation of the language INTERCAL, legendary for
                its perversity and horribleness (this version adds COME FROM
                for extra flavor).  Comes with language manual and examples
@@ -10,7 +10,7 @@ Keywords:     language, compiler, retrocomputing, geek humor
 Author:        esr@snark.thyrsus.com (Eric S. Raymond)
 Maintained-by: esr@snark.thyrsus.com (Eric S. Raymond)
 Primary-site:  locke.ccil.org /pub/esr
-               166K intercal-0.17.tar.gz
+               166K intercal-0.18.tar.gz
 Platforms:     All
 Copying-policy:        GPL
 End
index 7fe38eab940e81d45a879315301f746318d6909f..5580aff72d470f899a54576820a194e8713d2f8e 100644 (file)
@@ -8,8 +8,9 @@
 # all over creation behind your back.
 # (/dev/null may be another good choice :-))
 
-DVMT=~/WWW/intercal-0.17
+DVMT=~/WWW/intercal-0.18
 #DVMT=/usr/local
+DVMT=/intercal-0.18
 
 BINDIR = $(DVMT)/bin
 INCDIR = $(DVMT)/lib
@@ -20,8 +21,16 @@ LIBDIR = $(DVMT)/lib
 YDEBUG = -vlt
 DEBUG  = -g -DDEBUG
 # DEBUG = -O
+
+# This version (0.18) is POSIX-compliant.  You should only set the POSIX
+# variable to null if you *need* to use the old <varargs.h> support;
+# otherwise, the ANSI-compliant <stdarg.h> library will be used.
+
+# POSIX = 
+POSIX = -D_POSIX_SOURCE
+
 CFLAGS = -I. $(DEBUG) -DICKINCLUDEDIR=\"$(INCDIR)\" \
-       -DICKLIBDIR=\"$(LIBDIR)\" -DYYDEBUG
+       -DICKLIBDIR=\"$(LIBDIR)\" -DYYDEBUG $(POSIX)
 LDFLAGS =
 
 CC = gcc -Wall -W
@@ -30,8 +39,7 @@ CC = gcc -Wall -W
 #LEX = lex
 LEX = flex
 
-# You can use either yacc or bison
-#YACC = yacc
+# You should use bison, because some yaccs won't work correctly
 YACC = bison -y
 
 CSOURCES = ick.y lexer.l feh.c lose.c fiddle.c perpetrate.c
index 8b1984be5fc91b9a81b36501a66434a336c7566f..f0ab2ef368b2462c392fc18532e106b77108cb38 100644 (file)
@@ -36,8 +36,15 @@ extern void binin(unsigned int type, array *a, bool forget);
 extern void binout(unsigned int type, array *a);
 extern unsigned int assign(char *dest, unsigned int type, bool forget,
                           unsigned int value);
+
+#ifdef _POSIX_SOURCE
+extern char *aref(unsigned int type, ...);
+extern void resize(unsigned int type, ...);
+#else
 extern char *aref();
 extern void resize();
+#endif
+
 extern void stashinit(void);
 extern void stash(unsigned int type, unsigned int index, void *from);
 extern void retrieve(void *to, int type, unsigned int index, bool forget);
index b4c5d52af0da2516b7cae0292acd384d31758d5c..33355aa978b1207ede937afc82a4c0defc01e722 100644 (file)
@@ -24,7 +24,13 @@ LICENSE TERMS
 /* LINTLIBRARY */
 #include <stdio.h>
 #include <stdlib.h>
+
+#ifdef _POSIX_SOURCE
+#include <stdarg.h>
+#else
 #include <varargs.h>
+#endif
+
 #include "sizes.h"
 #include "abcess.h"
 #include "lose.h"
@@ -360,21 +366,33 @@ unsigned int assign(char *dest, unsigned int type, bool forget,
 /**********************************************************************
  *
  * The following functions implement the INTERCAL array model
+ * If _POSIX_SOURCE is defined, stdarg is used, otherwise varargs.
  *
  *********************************************************************/
 
+
+#ifdef _POSIX_SOURCE
+char *aref(unsigned int type, ...)
+#else
 char *aref(va_alist) va_dcl
+#endif
 /* return a pointer to the array location specified by args */
 {
+#ifndef _POSIX_SOURCE
   unsigned int type;
+#endif
   array *a;
   unsigned int v;
   va_list ap;
   int address = 0;
   unsigned int i;
 
+#ifdef _POSIX_SOURCE
+  va_start(ap, type);
+#else
   va_start(ap);
   type = va_arg(ap, unsigned int);
+#endif
   a = va_arg(ap, array*);
 
   if (va_arg(ap, unsigned int) != a->rank)
@@ -395,18 +413,28 @@ char *aref(va_alist) va_dcl
     return (char*)&a->data.hybrid[address];
 }
 
+#ifdef _POSIX_SOURCE
+void resize(unsigned int type, ...)
+#else
 void resize(va_alist) va_dcl
+#endif
 /* resize an array to the given shape */
 {
+#ifndef _POSIX_SOURCE
   unsigned int type;
+#endif
   array *a;
   bool forget;
   unsigned int i, r, v;
   va_list ap;
   int prod = 1;
 
+#ifdef _POSIX_SOURCE
+ va_start(ap, type);
+#else
   va_start(ap);
   type = va_arg(ap, unsigned int);
+#endif
   a = va_arg(ap, array*);
   forget = va_arg(ap, bool);
 
index f2a77b4c09adfdd26b38403958fee36b8e6709eb..f029ed19d7b44bf5ab77adf154ad9eb682512d29 100644 (file)
--- a/src/feh.c
+++ b/src/feh.c
@@ -720,7 +720,7 @@ static void emit_guard(tuple *tn, FILE *fp)
     (void) fprintf(fp, "    if (");
     if (tn->exechance < 100)
        (void) fprintf(fp, "roll(%d) && ", tn->exechance);
-    (void) fprintf(fp, "!abstained[%d]) {\n", tn - tuples);
+    (void) fprintf(fp, "!abstained[%d]) {\n", (int)(tn - tuples));
 }
 
 void emit(tuple *tn, FILE *fp)
@@ -799,7 +799,7 @@ void emit(tuple *tn, FILE *fp)
     case NEXT:
        (void) fprintf(fp,
                       "\tpushnext(%d); goto L%d; N%d:;\n",
-                      tn - tuples + 1, tn->u.target, tn - tuples + 1);
+                      (int)(tn - tuples + 1), tn->u.target, (int)(tn - tuples + 1));
        break;
 
     case RESUME:
@@ -861,8 +861,13 @@ void emit(tuple *tn, FILE *fp)
        {
            (void) fprintf(fp,
                           "\n\tfor (i = 0; i < (int)(sizeof(linetype)/sizeof(int)); i++)\n");
-           (void) fprintf(fp,
-                          "\t    if (linetype[i] == %s)\n", enablers[np->constant-GETS]);
+           if (np->constant == ABSTAIN || np->constant == REINSTATE) {
+             (void) fprintf(fp,
+                            "\t    if (linetype[i] == %s || linetype[i] == %s)\n", enablers[np->constant-GETS], enablers[np->constant-GETS+2]);
+           } else {
+             (void) fprintf(fp,
+                            "\t    if (linetype[i] == %s)\n", enablers[np->constant-GETS]);
+           }
            (void) fprintf(fp,
                           "\t\tabstained[i] = FALSE;\n");
        }
@@ -875,8 +880,13 @@ void emit(tuple *tn, FILE *fp)
        {
            (void) fprintf(fp,
                           "\n\tfor (i = 0; i < (int)(sizeof(linetype)/sizeof(int)); i++)\n");
-           (void) fprintf(fp,
-                          "\t    if (linetype[i] == %s)\n", enablers[np->constant-GETS]);
+           if (np->constant == ABSTAIN || np->constant == REINSTATE) {
+             (void) fprintf(fp,
+                            "\t    if (linetype[i] == %s || linetype[i] == %s)\n", enablers[np->constant-GETS], enablers[np->constant-GETS+2]);
+           } else {
+             (void) fprintf(fp,
+                            "\t    if (linetype[i] == %s)\n", enablers[np->constant-GETS]);
+           }
            (void) fprintf(fp,
                           "\t\tabstained[i] = TRUE;\n");
        }
index 67b6ee276a5761b6d7f1f0ae598c53bd0c918929..70117d9e12dbfcaa705ff17f59261d4832f76149 100644 (file)
@@ -196,6 +196,9 @@ D   [0-9][\ \t\n0-9]*
 \#             {return(MESH);}
 
 \$             {return(MINGLE);}
+\xA2           {return(MINGLE);}
+\xA3           {return(MINGLE);}
+\xA4           {return(MINGLE);}
 \~             {return(SELECT);}
 
 \&             {yylval.numval = AND; return(UNARY);}
index 6dbdd9629acbfd3369f4789eb6b3e03360dbb881..5034b6c0d60c9b3aab7d74690dd24e6f84222f9f 100644 (file)
@@ -14,6 +14,9 @@
  * Nahuatl, Tagalog, Sanskrit, Basque, Georgian, Kwakiutl, and
  * Volap\"uk are now supported in addition to English.
  *
+ * As of release 0.18, Volap\"uk digits can be entered in either TeX or
+ * Latin-1 format.
+ *
 LICENSE TERMS
     Copyright (C) 1996 Eric S. Raymond 
 
@@ -129,9 +132,12 @@ static numeral numerals[] =
     { "FOL",           4 },
     { "LUL",           5 },
     { "M\\\"AL",       6 },
+    { "M\0xC4L",       6 },    /* Latin-1 support */
     { "VEL",           7 },
     { "J\\\"OL",       8 },
+    { "J\0xD6L",       8 },    /* Latin-1 support */
     { "Z\\\"UL",       9 },
+    { "Z\0xDCL",       9 },    /* Latin-1 support */
 };
 
 /* numeral.c ends here */
index 03849fb5b33d3e1769ce4b423a1d906ee881417d..7be790781fd2895e0bdf78ecb3120d2590c734d6 100644 (file)
@@ -55,6 +55,9 @@ extern void yyrestart(FILE*);
 /* function created by yacc */
 extern int yyparse(void);
 
+/* getopt declaration */
+int getopt(int, char**, char*);
+
 /* compilation options */
 bool compile_only;     /* just compile into C, don't run the linker */
 bool traditional;      /* insist on strict INTERCAL-72 conformance */
@@ -477,7 +480,7 @@ int main(int argc, char *argv[])
                            if (tp->type == NEXT)
                                (void) fprintf(ofp,
                                               "\tcase %d: goto N%d; break;\n",
-                                              tp-tuples+1, tp-tuples+1);
+                                              (int)(tp-tuples+1), (int)(tp-tuples+1));
                        (void) fprintf(ofp, "    }");
                    }
                    break;