Print

Print


I wrote:
> > Being a syntactician and not a programmer, I wonder why programmers
> > don't use trees. An interface like the one used for Windows directory
> > structure (where you click on nodes to expand and contract them) seems
> > ideal. Surely programmers can't be guilty of a kind of cerebrally
> > masochistic machismo?

Chris Palmer replies:
> Lisp code *is* a literal tree (parentheses demarcate subtrees); a Lisp
> program is a huge tree of expressions. All programming languages end up
> being represented internally, in an intermediate stage, in their parsers
> and/or virtual machines as trees; but it turns out to be a really bad (=
> difficult and slow) way for humans to write code. Instead, most
> programming languages end up allowing the user to write a series of
> smaller trees ("statements" made up of "expressions").

I meant trees not as a mathematical structure but as a graphical
notation device, contrasting with bracketing and indentation, the
opposing merits of which were being debated in the passage I had
been responding to. Syntacticians would never use indentation or
bracketing for complex structures, since experience shows that
they're much harder to read than tree notation.

Mark Reed replies:
> Are the speakers of the world gulity of cerebrally masochistic machismo
> for not speaking in trees?  For not using trees for all written
> communication?    Should we use clickable TreeViews to construct
> our email messages?

No, partly because we are fluent in English so don't need to use
any kind of syntactic notation, and partly because we are humans
so don't worry very much about broken syntax.

--And.