From xemacs-m  Thu Mar 13 10:09:25 1997
Received: from crystal.WonderWorks.COM (crystal.WonderWorks.com [192.203.206.1])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id KAA27675
	for <xemacs-beta@xemacs.org>; Thu, 13 Mar 1997 10:09:18 -0600 (CST)
Received: by crystal.WonderWorks.COM 
	id QQcgse10831; Thu, 13 Mar 1997 11:09:09 -0500 (EST)
Date: Thu, 13 Mar 1997 11:09:09 -0500 (EST)
Message-Id: <QQcgse10831.199703131609@crystal.WonderWorks.COM>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
From: Kyle Jones <kyle_jones@wonderworks.com>
To: xemacs-beta@xemacs.org
Subject: Re: RETURN_UNGCPRO
In-Reply-To: <byg1y0f531.fsf@math.ethz.ch>
References: <QQcghe00106.199703101637@crystal.WonderWorks.COM>
	<199703130838.AAA00861@xemacs.eng.sun.com>
	<byg1y0f531.fsf@math.ethz.ch>
X-Face: /cA45WHG7jWq>(O3&Z57Y<"WsX5ddc,4c#w0F*zrV#=M
        0@~@,s;b,aMtR5Sqs"+nU.z^CSFQ9t`z2>W,S,]:[+2^
        Nbf6v4g>!&,7R4Ot4Wg{&tm=WX7P["9%a)_da48-^tGy
        ,qz]Z,Zz\{E.,]'EO+F)@$KtF&V

Jan Vroonhof writes:
 > Martin Buchholz <mrb@Eng.Sun.COM> writes:
 > 
 > > Kyle> if anyone cares about such things.  I suppose from the compiler's
 > > Kyle> point of view calling 'return' unconditionally inside a do-while
 > > Kyle> loop is a pretty dim-bulb thing to do, but how could the compiler
 > > Kyle> anticipate XEmacs' Creative Use of Macros?
 > 
 > Can somebody tell me why the contruction is this way anyway?
 > 
 > > #define RETURN_UNGCPRO(expr) do			\
 > > {							\
 > >   Lisp_Object ret_ungc_val = (expr);		\
 > >   UNGCPRO;						\
 > >   return ret_ungc_val;				\
 > > } while (0)

Using do-while(0) is a standard hack when you want a multi-statement
macro to appear and parse as a single statement.  A simple { ... }
block statement is undesirable, because

if (NILP(foo))
  RETURN_UNGCPRO(bar);
else
  egg = decode_extent(foo, 0);

would be a syntax error.

XEmacs uses maros more than I like; tracing where function are
called is challenging sometimes.  The compiler must generate some
very deep parse trees.

