[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sweet-expressions are not homoiconic



On Thu, 23 May 2013 11:32:46 -0500, John David Stone <stone@xxxxxxxxxxxxxxx> wrote:
>  > > Whitespace characters don't look like grouping symbols, as
>  > > parentheses, brackets, braces, or oriented quotation marks do, because
>  > > they don't have appropriate shapes and don't come in pairs.  Moreover,
>  > > they don't visibly nest, so it is unnatural to use them to represent
>  > > recursively defined syntactic structures.
>  > 

John Cowan:
>  > Au contraire.  It is so natural than even suits use nested indentation
>  > to show hierarchy in their PowerPoints.


John David Stone:
>         Yes, and we see how well that works out when the hierarchies are as
> deeply nested as those in LISP-like languages are.

As I commented earlier, programs are indented in pretty much ALL languages,
specifically to show nesting.

As far as *deep* nesting goes, though, I think that:
1. Indentation works best to show the nesting of major structures, and parentheses
work best to show nesting at the leaves.  This means that "deep nesting"
doesn't really cause problems, because indentation and parens can work together.
2. If you have long constructs, the "!" indent character works *really* well
to show grouping.  I've used them, for example, in long "cond" constructs.
You correctly note that whitespace characters by themselves
do not have the appropriate shapes to visibly emphasize certain kinds of nesting
structures, but that's ok; we already noted and resolved that.

--- David A. Wheeler