From xemacs-m  Thu Jul  3 10:58:35 1997
Received: from jagor.srce.hr (hniksic@jagor.srce.hr [161.53.2.130])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id KAA28716
	for <xemacs-beta@xemacs.org>; Thu, 3 Jul 1997 10:58:33 -0500 (CDT)
Received: (from hniksic@localhost)
          by jagor.srce.hr (8.8.5/8.8.4)
	  id RAA12005; Thu, 3 Jul 1997 17:58:32 +0200 (MET DST)
To: XEmacs Developers <xemacs-beta@xemacs.org>
Subject: Re: More on Ebola
References: <199707022247.SAA16133@anthem.CNRI.Reston.Va.US> <m24tad2cod.fsf@altair.xemacs.org>             <19970703090625.60839@iria.mines.u-nancy.fr> <199707031536.LAA15642@black-ice.cc.vt.edu>
X-Attribution: Hrv
X-Face: Mie8:rOV<\c/~z{s.X4A{!?vY7{drJ([U]0O=W/<W*SMo/Mv:58:*_y~ki>xDi&N7XG
        KV^$k0m3Oe/)'e%3=$PCR&3ITUXH,cK>]bci&<qQ>Ff%x_>1`T(+M2Gg/fgndU%k*ft
        [(7._6e0n-V%|%'[c|q:;}td$#INd+;?!-V=c8Pqf}3J
From: Hrvoje Niksic <hniksic@srce.hr>
Date: 03 Jul 1997 17:58:31 +0200
In-Reply-To: Valdis.Kletnieks@vt.edu's message of "Thu, 03 Jul 1997 11:36:42 -0400"
Message-ID: <kigsoxwktzs.fsf@jagor.srce.hr>
Lines: 51
X-Mailer: Gnus v5.4.59/XEmacs 20.3(beta10) - "Athens"

Valdis.Kletnieks@vt.edu writes:

> Standard first-year programming assignment, with standard error included:
> 
> main()
> {
> char c;
> 	while((c=getchar()) != EOF)) putchar(c);
> }
> 

Actually, this first-year assignment is astonishingly similar to the
issues we are currently discussing.  `following-char' returning ?\0
(instead of 0) would be in many ways equivalent to declaring `char c;'.

> Hint: what's the *actual* prototype for getchar(), and the *actual*
> value of EOF? ;)

Oh, let me guess:

#include "lisp.h"

Lisp_Object getchar (void);
void putchar (Lisp_Object);

#define EOF Qnil

main()
{
  Lisp_Object c;

  while ((c=getchar()) != EOF)
  {
    if (!CHARACTERP (c)) /* fuck integers, markers and other crock of junk,
                            shit, crap and FSFmacs randomness. */
      abort ();  /* This is mandatory in XEmacs sources. */
    putchar (c);
  }
}

The error is, of course, that the compilation will fail if you use
union type for Lisp_Object.  Try to figure out why.


Have I just shown a certain type of geekiness that is the result of
all-too-long staring at XEmacs sources?  Naaay... :-)

-- 
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
"Psychos _do not_ explode when sunlight hits them."

