From: Dave Yost
Subject: Parenthesized syntax challenge
Date: 
Message-ID: <453po8$175@Yost.com>
 In article <····················@lox.icsi.berkeley.edu>,
 Marco Antoniotti <·······@lox.icsi.berkeley.edu> wrote:
 >In article <·······················@198.11.57.140> ······@frymulti.com (Paul R. Potts) writes:
 >
 >   From: ······@frymulti.com (Paul R. Potts)
 >   Newsgroups: comp.lang.dylan
 >   Date: 28 Sep 1995 23:04:34 GMT
 >   Organization: Fry Multimedia
 >   Lines: 14
 >   References: <··········@miso.cs.uq.edu.au>
 >
 >   In article <··········@miso.cs.uq.edu.au>, ·······@cs.uq.edu.au (Anthony
 >   Berglas) wrote:
 >
 >   > Do the authors of
 >   > Dylan have the guts to sieze the nettle and produce something that
 >   > might actually succeed?
 >
 >   I think you're coming a little late to this argument.
 >
 >   The syntax is already a clear, Pascal-like form, quite readable. I
 >   don't think anyone familiar with C, C++, or Java should have trouble
 >   with Dylan's syntax.
 >
 >Unfortunately, the world is full of people who fall for a "C-like"
 >syntax merely on the basis of it being a "C-like" syntax.
 >
 >Cheers
 >
 >--
 >Marco Antoniotti - Resistente Umano
 >===============================================================================
 >International Computer Science Institute       | ·······@icsi.berkeley.edu
 >1947 Center STR, Suite 600                     |
 >Berkeley, CA, 94704-1198, USA                  | tel. +1 (510) 643 9153
 >===============================================================================
 >       ...it is simplicity that is difficult to make.
 >       ...e` la semplicita` che e` difficile a farsi.
 >                               Bertholdt Brecht

I dare someone to write an article that whets the
appetite of C programmers for parenthesized syntax
by teaching its benefits and showing the goodies
that it makes possible (particularly Common Lisp's
macros). I bet it can be done.
Or perhaps there are 7 such articles already...

From my own experience having come late to lisp, I can tell
you that there are many, many benefits of it that you can't
have any idea of until you're exposed to them.

Anyone done a parser for a parenthesized Java syntax yet?
Why the heck not?  Call it Kona?  You've got enough of the
runtime at your disposal to do real macros.

If I had some money to throw around, I would
fund and/or do both of these activities.

Dave

From: ···@franz.com
Subject: Re: Parenthesized syntax challenge
Date: 
Message-ID: <458pq6$cnr@sand.cis.ufl.edu>
In article <··········@Yost.com>, ····@Yost.com (Dave Yost) writes:
>  In article <····················@lox.icsi.berkeley.edu>,
>  Marco Antoniotti <·······@lox.icsi.berkeley.edu> wrote:
>  >In article <·······················@198.11.57.140> ······@frymulti.com (Paul R. Potts) writes:
>  >   The syntax is already a clear, Pascal-like form, quite readable. I
>  >   don't think anyone familiar with C, C++, or Java should have trouble
>  >   with Dylan's syntax.
>  >Unfortunately, the world is full of people who fall for a "C-like"
>  >syntax merely on the basis of it being a "C-like" syntax.
> 
> I dare someone to write an article that whets the
> appetite of C programmers for parenthesized syntax
> by teaching its benefits and showing the goodies
> that it makes possible (particularly Common Lisp's
> macros). I bet it can be done.
> Or perhaps there are 7 such articles already...

It just so happens I'm writing a column for the 
Journal of Object Oriented Programming (JOOP) in which I will be
including a section on showing the usefulness of the syntax.
I think it will be out in Feb of 96.  It could merit a whole column,
but this is JOOP and I'm more focused on CLOS than Lisp. 
But consider your dare answered!  Whether it will have any
effect on C++ programmers I can't say.  Actually Smalltalk programmers
should really take more notice, as they almost get Lisp but without
the syntax advantage, and moreover some consider Smalltalk 
syntax more "strange" than Lisp.

-Kelly Murray  ···@franz.com  http://www.franz.com
From: Kelly E Murray
Subject: Re: Parenthesized syntax challenge
Date: 
Message-ID: <45edlh$4d8@sand.cis.ufl.edu>
>···@franz.com writes:
>It just so happens I'm writing a column for the 
>Journal of Object Oriented Programming (JOOP) in which I will be
>including a section on showing the usefulness of the syntax.
>I think it will be out in Feb of 96.  It could merit a whole column,
>but this is JOOP and I'm more focused on CLOS than Lisp. 

>····@festival.ed.ac.uk (J W Dalton):
>Well, what *are* the advantages of Lisp syntax?  Perhaps these
>newsgroups (dylan, lisp -- I've left out java and added scheme)
>are a good place to discuss this.

Well, you'll just have to wait for the article.
My thanks to JOOP for giving me the chance to add some
balance to their mostly C++ and Smalltalk content, so let them
know you'll want to read it and get a subscription!  :)
But I'll make some points here.

I agree that Lisp syntax is simple, which makes it easy to learn.

I'd also add that because of that simplicity and the functional nature,
it makes a program easier to understand -- you can focus on WHAT
the program does and not what it looks like.  I like the point someone made
(please remind me who!)  that Lispers know
to ignore ('s just as C people ignore ;'s, and instead focus on
the "meaning" part of a program.  

In Lisp, all you have (mostly) is function calls, and thus the names of
the functions are the meaning, which are usually long and description
(get-universal-time),  but in C (and C++)
you have huge major differences in meaning by changing single characters;
p->a, p.a; *p->a, (*p).a, (*p->a)(a)  if (p=a) | (p=a>b) | p==a   etc, etc.

I'll also mention another thing which is somewhat related, that strong typing
catches errors at compile time, which is claimed to be a big win.
Because of Lisp's simple syntax, syntax errors are usually always
caught by the editor at "save file" time as mismatched parenthesis.
So program development goes much faster. 

But by far the biggest advantage is macros.  Kevin Gallagher pointed out
years ago the common cases where macros are used and necessary.

1. Top-level defining forms, 
    defclass, defmethod, defmacro, define-circuit-path, defbytecode
   Users can define their own to create higher-level programs.

2. Context or Wrapper forms, 
    with-open-file, without-interrupts, with-transaction, with-lock
   Code fragments are run inside a context, also for higher-level programs.  

3. "Place" expressions, 
     setf, incf, 
   Subforms are unevaluated and used only as a reference.

The danger or downside is that you can go overboard using macros
to create your own language that is a "bad" language which nobody
(including yourself after a little while) understands.
C "macros" are typcially much worse in this regard,
which I submit a case in point from the MIT X server appended
below. (sorry for the length (and for those who have had to
understand the code!))

I would submit that this code could be done significantly
better using a lisp syntax and lisp macros.  I leave it
as an exercise for the reader :)

-Kelly Murray   ···@franz.com  http://www.franz.com



/*
 * mfb copy area
 */

/*
Copyright 1989 by the Massachusetts Institute of Technology

Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of M.I.T. not be used in
advertising or publicity pertaining to distribution of the software
without specific, written prior permission.  M.I.T. makes no
representations about the suitability of this software for any
purpose.  It is provided "as is" without express or implied warranty.

Author: Keith Packard

*/
/* $XConsortium: mfbblt.c,v 1.5 91/01/27 13:02:19 keith Exp $ */

#include	"X.h"
#include	"Xmd.h"
#include	"Xproto.h"
#include	"mfb.h"
#include	"gcstruct.h"
#include	"windowstr.h"
#include	"scrnintstr.h"
#include	"pixmapstr.h"
#include	"regionstr.h"
#include	"maskbits.h"
#include	"fastblt.h"
#include	"mergerop.h"

MROP_NAME(mfbDoBitblt)(pSrc, pDst, alu, prgnDst, pptSrc)
    DrawablePtr	    pSrc, pDst;
    int		    alu;
    RegionPtr	    prgnDst;
    DDXPointPtr	    pptSrc;
{
    unsigned int *psrcBase, *pdstBase;	
				/* start of src and dst bitmaps */
    int widthSrc, widthDst;	/* add to get to same position in next line */

    BoxPtr pbox;
    int nbox;

    BoxPtr pboxTmp, pboxNext, pboxBase, pboxNew1, pboxNew2;
				/* temporaries for shuffling rectangles */
    DDXPointPtr pptTmp, pptNew1, pptNew2;
				/* shuffling boxes entails shuffling the
				   source points too */
    int w, h;
    int xdir;			/* 1 = left right, -1 = right left/ */
    int ydir;			/* 1 = top down, -1 = bottom up */

    unsigned int *psrcLine, *pdstLine;	
				/* pointers to line with current src and dst */
    register unsigned int *psrc;/* pointer to current src longword */
    register unsigned int *pdst;/* pointer to current dst longword */

    MROP_DECLARE_REG()

				/* following used for looping through a line */
    unsigned int startmask, endmask;	/* masks for writing ends of dst */
    int nlMiddle;		/* whole longwords in dst */
    int xoffSrc, xoffDst;
    register int leftShift, rightShift;
    register unsigned int bits;
    register unsigned int bits1;
    register int nl;		/* temp copy of nlMiddle */

				/* place to store full source word */
    int nstart;			/* number of ragged bits at start of dst */
    int nend;			/* number of ragged bits at end of dst */
    int srcStartOver;		/* pulling nstart bits from src
				   overflows into the next word? */
    int careful;
    int tmpSrc;

    MROP_INITIALIZE(alu,0);

    if (pSrc->type == DRAWABLE_WINDOW)
    {
	psrcBase = (unsigned int *)
		(((PixmapPtr)(pSrc->pScreen->devPrivate))->devPrivate.ptr);
	widthSrc = (int)
		   ((PixmapPtr)(pSrc->pScreen->devPrivate))->devKind
		    >> 2;
    }
    else
    {
	psrcBase = (unsigned int *)(((PixmapPtr)pSrc)->devPrivate.ptr);
	widthSrc = (int)(((PixmapPtr)pSrc)->devKind) >> 2;
    }

    if (pDst->type == DRAWABLE_WINDOW)
    {
	pdstBase = (unsigned int *)
		(((PixmapPtr)(pDst->pScreen->devPrivate))->devPrivate.ptr);
	widthDst = (int)
		   ((PixmapPtr)(pDst->pScreen->devPrivate))->devKind
		    >> 2;
    }
    else
    {
	pdstBase = (unsigned int *)(((PixmapPtr)pDst)->devPrivate.ptr);
	widthDst = (int)(((PixmapPtr)pDst)->devKind) >> 2;
    }

    /* XXX we have to err on the side of safety when both are windows,
     * because we don't know if IncludeInferiors is being used.
     */
    careful = ((pSrc == pDst) ||
	       ((pSrc->type == DRAWABLE_WINDOW) &&
		(pDst->type == DRAWABLE_WINDOW)));

    pbox = REGION_RECTS(prgnDst);
    nbox = REGION_NUM_RECTS(prgnDst);

    pboxNew1 = NULL;
    pptNew1 = NULL;
    pboxNew2 = NULL;
    pptNew2 = NULL;
    if (careful && (pptSrc->y < pbox->y1))
    {
        /* walk source botttom to top */
	ydir = -1;
	widthSrc = -widthSrc;
	widthDst = -widthDst;

	if (nbox > 1)
	{
	    /* keep ordering in each band, reverse order of bands */
	    pboxNew1 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox);
	    if(!pboxNew1)
		return;
	    pptNew1 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox);
	    if(!pptNew1)
	    {
	        DEALLOCATE_LOCAL(pboxNew1);
	        return;
	    }
	    pboxBase = pboxNext = pbox+nbox-1;
	    while (pboxBase >= pbox)
	    {
	        while ((pboxNext >= pbox) &&
		       (pboxBase->y1 == pboxNext->y1))
		    pboxNext--;
	        pboxTmp = pboxNext+1;
	        pptTmp = pptSrc + (pboxTmp - pbox);
	        while (pboxTmp <= pboxBase)
	        {
		    *pboxNew1++ = *pboxTmp++;
		    *pptNew1++ = *pptTmp++;
	        }
	        pboxBase = pboxNext;
	    }
	    pboxNew1 -= nbox;
	    pbox = pboxNew1;
	    pptNew1 -= nbox;
	    pptSrc = pptNew1;
        }
    }
    else
    {
	/* walk source top to bottom */
	ydir = 1;
    }

    if (careful && (pptSrc->x < pbox->x1))
    {
	/* walk source right to left */
        xdir = -1;

	if (nbox > 1)
	{
	    /* reverse order of rects in each band */
	    pboxNew2 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec) * nbox);
	    pptNew2 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * nbox);
	    if(!pboxNew2 || !pptNew2)
	    {
		if (pptNew2) DEALLOCATE_LOCAL(pptNew2);
		if (pboxNew2) DEALLOCATE_LOCAL(pboxNew2);
		if (pboxNew1)
		{
		    DEALLOCATE_LOCAL(pptNew1);
		    DEALLOCATE_LOCAL(pboxNew1);
		}
	        return;
	    }
	    pboxBase = pboxNext = pbox;
	    while (pboxBase < pbox+nbox)
	    {
	        while ((pboxNext < pbox+nbox) &&
		       (pboxNext->y1 == pboxBase->y1))
		    pboxNext++;
	        pboxTmp = pboxNext;
	        pptTmp = pptSrc + (pboxTmp - pbox);
	        while (pboxTmp != pboxBase)
	        {
		    *pboxNew2++ = *--pboxTmp;
		    *pptNew2++ = *--pptTmp;
	        }
	        pboxBase = pboxNext;
	    }
	    pboxNew2 -= nbox;
	    pbox = pboxNew2;
	    pptNew2 -= nbox;
	    pptSrc = pptNew2;
	}
    }
    else
    {
	/* walk source left to right */
        xdir = 1;
    }

    while(nbox--)
    {
	w = pbox->x2 - pbox->x1;
	h = pbox->y2 - pbox->y1;

	if (ydir == -1) /* start at last scanline of rectangle */
	{
	    psrcLine = psrcBase + ((pptSrc->y+h-1) * -widthSrc);
	    pdstLine = pdstBase + ((pbox->y2-1) * -widthDst);
	}
	else /* start at first scanline */
	{
	    psrcLine = psrcBase + (pptSrc->y * widthSrc);
	    pdstLine = pdstBase + (pbox->y1 * widthDst);
	}
	if ((pbox->x1 & PIM) + w <= PPW)
	{
	    maskpartialbits (pbox->x1, w, startmask);
	    endmask = 0;
	    nlMiddle = 0;
	}
	else
	{
	    maskbits(pbox->x1, w, startmask, endmask, nlMiddle);
	}
	if (xdir == 1)
	{
	    xoffSrc = pptSrc->x & PIM;
	    xoffDst = pbox->x1 & PIM;
	    pdstLine += (pbox->x1 >> PWSH);
	    psrcLine += (pptSrc->x >> PWSH);
#ifdef DO_UNALIGNED_BITBLT
	    nl = xoffSrc - xoffDst;
	    psrcLine = (unsigned int *)
			(((unsigned char *) psrcLine) + nl);
#else
	    if (xoffSrc == xoffDst)
#endif
	    {
		while (h--)
		{
		    psrc = psrcLine;
		    pdst = pdstLine;
		    pdstLine += widthDst;
		    psrcLine += widthSrc;
		    if (startmask)
		    {
			*pdst = MROP_MASK(*psrc, *pdst, startmask);
			psrc++;
			pdst++;
		    }
		    nl = nlMiddle;

#ifdef LARGE_INSTRUCTION_CACHE
#ifdef FAST_CONSTANT_OFFSET_MODE

		    psrc += nl & (UNROLL-1);
		    pdst += nl & (UNROLL-1);

#define BodyOdd(n) pdst[-n] = MROP_SOLID (psrc[-n], pdst[-n]);
#define BodyEven(n) pdst[-n] = MROP_SOLID (psrc[-n], pdst[-n]);

#define LoopReset \
pdst += UNROLL; \
psrc += UNROLL;

#else

#define BodyOdd(n)  *pdst = MROP_SOLID (*psrc, *pdst); pdst++; psrc++;
#define BodyEven(n) BodyOdd(n)

#define LoopReset   ;

#endif
		    PackedLoop

#undef BodyOdd
#undef BodyEven
#undef LoopReset

#else
#ifdef NOTDEF
		    /* you'd think this would be faster --
		     * a single instruction instead of 6
		     * but measurements show it to be ~15% slower
		     */
		    while ((nl -= 6) >= 0)
		    {
			asm ("moveml %1+,#0x0c0f;moveml#0x0c0f,%0"
			     : "=m" (*(char *)pdst)
			     : "m" (*(char *)psrc)
			     : "d0", "d1", "d2", "d3",
			       "a2", "a3");
			pdst += 6;
		    }
		    nl += 6;
		    while (nl--)
			*pdst++ = *psrc++;
#endif
		    DuffL(nl, label1,
			    *pdst = MROP_SOLID (*psrc, *pdst);
			    pdst++; psrc++;)
#endif

		    if (endmask)
			*pdst = MROP_MASK(*psrc, *pdst, endmask);
		}
	    }
#ifndef DO_UNALIGNED_BITBLT
	    else
	    {
		if (xoffSrc > xoffDst)
		{
		    leftShift = (xoffSrc - xoffDst) << (5 - PWSH);
		    rightShift = 32 - leftShift;
		}
		else
		{
		    rightShift = (xoffDst - xoffSrc) << (5 - PWSH);
		    leftShift = 32 - rightShift;
		}
		while (h--)
		{
		    psrc = psrcLine;
		    pdst = pdstLine;
		    pdstLine += widthDst;
		    psrcLine += widthSrc;
		    bits = 0;
		    if (xoffSrc > xoffDst)
			bits = *psrc++;
		    if (startmask)
		    {
			bits1 = BitLeft(bits,leftShift);
			bits = *psrc++;
			bits1 |= BitRight(bits,rightShift);
			*pdst = MROP_MASK(bits1, *pdst, startmask);
			pdst++;
		    }
		    nl = nlMiddle;

#ifdef LARGE_INSTRUCTION_CACHE
		    bits1 = bits;

#ifdef FAST_CONSTANT_OFFSET_MODE

		    psrc += nl & (UNROLL-1);
		    pdst += nl & (UNROLL-1);

#define BodyOdd(n) \
bits = psrc[-n]; \
pdst[-n] = MROP_SOLID(BitLeft(bits1, leftShift) | BitRight(bits, rightShift), pdst[-n]);

#define BodyEven(n) \
bits1 = psrc[-n]; \
pdst[-n] = MROP_SOLID(BitLeft(bits, leftShift) | BitRight(bits1, rightShift), pdst[-n]);

#define LoopReset \
pdst += UNROLL; \
psrc += UNROLL;

#else

#define BodyOdd(n) \
bits = *psrc++; \
*pdst = MROP_SOLID(BitLeft(bits1, leftShift) | BitRight(bits, rightShift), *pdst); \
pdst++;
		   
#define BodyEven(n) \
bits1 = *psrc++; \
*pdst = MROP_SOLID(BitLeft(bits, leftShift) | BitRight(bits1, rightShift), *pdst); \
pdst++;

#define LoopReset   ;

#endif	/* !FAST_CONSTANT_OFFSET_MODE */

		    PackedLoop

#undef BodyOdd
#undef BodyEven
#undef LoopReset

#else
		    DuffL (nl,label2,
			bits1 = BitLeft(bits, leftShift);
			bits = *psrc++;
			*pdst = MROP_SOLID (bits1 | BitRight(bits, rightShift), *pdst);
			pdst++;
		    )
#endif

		    if (endmask)
		    {
			bits1 = BitLeft(bits, leftShift);
			if (BitLeft(endmask, rightShift))
			{
			    bits = *psrc;
			    bits1 |= BitRight(bits, rightShift);
			}
			*pdst = MROP_MASK (bits1, *pdst, endmask);
		    }
		}
	    }
#endif /* DO_UNALIGNED_BITBLT */
	}
	else	/* xdir == -1 */
	{
	    xoffSrc = (pptSrc->x + w - 1) & PIM;
	    xoffDst = (pbox->x2 - 1) & PIM;
	    pdstLine += ((pbox->x2-1) >> PWSH) + 1;
	    psrcLine += ((pptSrc->x+w - 1) >> PWSH) + 1;
#ifdef DO_UNALIGNED_BITBLT
	    nl = xoffSrc - xoffDst;
	    psrcLine = (unsigned int *)
			(((unsigned char *) psrcLine) + nl);
#else
	    if (xoffSrc == xoffDst)
#endif
	    {
		while (h--)
		{
		    psrc = psrcLine;
		    pdst = pdstLine;
		    pdstLine += widthDst;
		    psrcLine += widthSrc;
		    if (endmask)
		    {
			pdst--;
			psrc--;
			*pdst = MROP_MASK (*psrc, *pdst, endmask);
		    }
		    nl = nlMiddle;

#ifdef LARGE_INSTRUCTION_CACHE
#ifdef FAST_CONSTANT_OFFSET_MODE
		    psrc -= nl & (UNROLL - 1);
		    pdst -= nl & (UNROLL - 1);

#define BodyOdd(n) pdst[n-1] = MROP_SOLID (psrc[n-1], pdst[n-1]);

#define BodyEven(n) BodyOdd(n)

#define LoopReset \
pdst -= UNROLL;\
psrc -= UNROLL;

#else

#define BodyOdd(n)  --pdst; --psrc; *pdst = MROP_SOLID(*psrc, *pdst);
#define BodyEven(n) BodyOdd(n)
#define LoopReset   ;

#endif
		    PackedLoop

#undef BodyOdd
#undef BodyEven
#undef LoopReset

#else
		    DuffL(nl,label3,
			 --pdst; --psrc; *pdst = MROP_SOLID (*psrc, *pdst);)
#endif

		    if (startmask)
		    {
			--pdst;
			--psrc;
			*pdst = MROP_MASK(*psrc, *pdst, startmask);
		    }
		}
	    }
#ifndef DO_UNALIGNED_BITBLT
	    else
	    {
		if (xoffDst > xoffSrc)
		{
		    rightShift = (xoffDst - xoffSrc) << (5 - PWSH);
		    leftShift = 32 - rightShift;
		}
		else
		{
		    leftShift = (xoffSrc - xoffDst) << (5 - PWSH);
		    rightShift = 32 - leftShift;
		}
		while (h--)
		{
		    psrc = psrcLine;
		    pdst = pdstLine;
		    pdstLine += widthDst;
		    psrcLine += widthSrc;
		    bits = 0;
		    if (xoffDst > xoffSrc)
			bits = *--psrc;
		    if (endmask)
		    {
			bits1 = BitRight(bits, rightShift);
			bits = *--psrc;
			bits1 |= BitLeft(bits, leftShift);
			pdst--;
			*pdst = MROP_MASK(bits1, *pdst, endmask);
		    }
		    nl = nlMiddle;

#ifdef LARGE_INSTRUCTION_CACHE
		    bits1 = bits;
#ifdef FAST_CONSTANT_OFFSET_MODE
		    psrc -= nl & (UNROLL - 1);
		    pdst -= nl & (UNROLL - 1);

#define BodyOdd(n) \
bits = psrc[n-1]; \
pdst[n-1] = MROP_SOLID(BitRight(bits1, rightShift) | BitLeft(bits, leftShift),pdst[n-1]);

#define BodyEven(n) \
bits1 = psrc[n-1]; \
pdst[n-1] = MROP_SOLID(BitRight(bits, rightShift) | BitLeft(bits1, leftShift),pdst[n-1]);

#define LoopReset \
pdst -= UNROLL; \
psrc -= UNROLL;

#else

#define BodyOdd(n) \
bits = *--psrc; --pdst; \
*pdst = MROP_SOLID(BitRight(bits1, rightShift) | BitLeft(bits, leftShift),*pdst);

#define BodyEven(n) \
bits1 = *--psrc; --pdst; \
*pdst = MROP_SOLID(BitRight(bits, rightShift) | BitLeft(bits1, leftShift),*pdst);

#define LoopReset   ;

#endif

		    PackedLoop

#undef BodyOdd
#undef BodyEven
#undef LoopReset

#else
		    DuffL (nl, label4,
			bits1 = BitRight(bits, rightShift);
			bits = *--psrc;
			--pdst;
			*pdst = MROP_SOLID(bits1 | BitLeft(bits, leftShift),*pdst);
		    )
#endif

		    if (startmask)
		    {
			bits1 = BitRight(bits, rightShift);
			if (BitRight (startmask, leftShift))
			{
			    bits = *--psrc;
			    bits1 |= BitLeft(bits, leftShift);
			}
			--pdst;
			*pdst = MROP_MASK(bits1, *pdst, startmask);
		    }
		}
	    }
#endif
	}
	pbox++;
	pptSrc++;
    }
    if (pboxNew2)
    {
	DEALLOCATE_LOCAL(pptNew2);
	DEALLOCATE_LOCAL(pboxNew2);
    }
    if (pboxNew1)
    {
	DEALLOCATE_LOCAL(pptNew1);
	DEALLOCATE_LOCAL(pboxNew1);
    }
}
From: Jeff Dalton
Subject: Re: Parenthesized syntax challenge
Date: 
Message-ID: <DGJr5o.8LB@cogsci.ed.ac.uk>
Cyber Surfer <············@wildcard.demon.co.uk> writes:

>In article <··········@scotsman.ed.ac.uk>
>           ····@festival.ed.ac.uk "J W Dalton" writes:

>> But, perhaps without too much loss, you could have an infix syntax
>> for programs that got turned into lists (rather like Prolog's infix
>> syntax is turned into terms).  If, for instance, * was a binary,
>> infix operator, A * B would be turned into (* A B); and * would
>> be interpreted this way everywhere, even in the arguments to
>> macros.

>This is how I'd like to see it done, if Lisp could have a "standard"
>alternative parser. I'd like it if it could be done entirely using
>operator precedence. I love Prolog's ability to define precedence
>for symbols, without losing any of the simplicity of using terms.

>Has anyone done this for Common Lisp? 

There's cgol, though it's not quite what you want.  (I'm pretty sure
it's in the FAQ.)

-- jeff
From: Henry Baker
Subject: Re: Parenthesized syntax challenge
Date: 
Message-ID: <hbaker-1910950925140001@10.0.2.15>
In article <·················@martigny.ai.mit.edu>, ···@zurich.ai.mit.edu
(Bill Dubuque) wrote:

> Cgol dates back to the late seventies at MIT LCS/AI Lab.
> Pratt wrote cgol based upon his "top-down operator precedence
> pahich is also used in Macsyma). See the Aho et. al.
> Dragon book for a reference to Pratt's original paper on
> this parser.
> 
> I don't know if anyone has ported cgol from MacLisp to Common
> Lisp. You could probably dig up the MacLisp source.

I believe that Macsyma uses cgol as its parser.  So presumably if you
have CL Macsyma, you also have CL cgol.

-- 
www/ftp directory:
ftp://ftp.netcom.com/pub/hb/hbaker/home.html
From: Dave Yost
Subject: Re: Parenthesized syntax challenge
Date: 
Message-ID: <458tev$o7@Yost.com>
The following was posted only to the one newsgroup
outside of this thread.  I think it merits posting
to all as a followup:

Newsgroups: comp.lang.dylan
From: ··@das.harvard.edu
Subject: prefix notation
Date: Sat Oct 07 22:39:15 PDT 1995

In article <··········@Yost.com>, Dave Yost <····@Yost.com> wrote:

  I dare someone to write an article that whets the appetite of
  C programmers for parenthesized syntax by teaching its benefits
  and showing the goodies that it makes possible (particularly
  Common Lisp's macros). I bet it can be done.

I tried to do just this in _ANSI Common Lisp_, which should be in
the bookstores in a couple weeks.  The first chapter contains a
careful explanation of the implications of Lisp's syntax (or rather,
lack of syntax).  Several later chapters return to this topic.
Among other things, expressing code as lists dovetails perfectly
with first-class functions to yield a simple and incomparably powerful
macro system.

More than anything else, I think it is the ability of Lisp programs
to manipulate Lisp expressions that sets Lisp apart.  And so no one
who has not written a lot of macros is really in a position to compare
Lisp to other languages.  When I hear people complain about Lisp's
parentheses, it sounds to my ears like someone saying:

  "I tried one of those bananas, which you say are so delicious.
   The white part was ok, but the yellow part was very tough and
   tasted awful."

--pg
From: G. David Kuhlman
Subject: Re: Parenthesized syntax challenge
Date: 
Message-ID: <dkuhlmanDG8M5E.MvJ@netcom.com>
: From my own experience having come late to lisp, I can tell
: you that there are many, many benefits of it that you can't
: have any idea of until you're exposed to them.

: Anyone done a parser for a parenthesized Java syntax yet?
: Why the heck not?  Call it Kona?  You've got enough of the
: runtime at your disposal to do real macros.

: If I had some money to throw around, I would
: fund and/or do both of these activities.

Soon, someone will write a compiler that translates Scheme to
Java byte-code.  Won't that give you what you want?  And, in
a standardized, well thought out language, too.

-- 
----------------------
Dave Kuhlman
Reify, Redwood City, CA
Internet:   ········@netcom.com
----------------------