From: Stephen M. Beaulieu
Subject: Trees
Date: 
Message-ID: <743sr1$qqp$1@bigboote.WPI.EDU>
Does anyone have a simple algorithm to print a tree?

From: Will Fitzgerald
Subject: Re: Trees
Date: 
Message-ID: <7442nn$a8m$1@leol.net-link.net>
>Does anyone have a simple algorithm to print a tree?
>
>

procedure print-tree (tree)
begin
  pulp <- pulp-tree(tree);
  paper <- make-paper(pulp);
  papers <- cut-paper(paper);
  reams <- wrap(papers);
  for ream in reams do
    sell(ream);
    insert-into-printer(ream);
    initialize-printer();
  end;
end;
From: Stephen M. Beaulieu
Subject: Re: Trees
Date: 
Message-ID: <7445fo$sm9$1@bigboote.WPI.EDU>
There's more to it than that.  I need an answer from someone who actually
knows what they are talking about.


>
>procedure print-tree (tree)
>begin
>  pulp <- pulp-tree(tree);
>  paper <- make-paper(pulp);
>  papers <- cut-paper(paper);
>  reams <- wrap(papers);
>  for ream in reams do
>    sell(ream);
>    insert-into-printer(ream);
>    initialize-printer();
>  end;
>end;
>
>
>
From: Erik Naggum
Subject: Re: Trees
Date: 
Message-ID: <3121644841097177@naggum.no>
* "Stephen M. Beaulieu" <········@wpi.edu>
| There's more to it than that.  I need an answer from someone who actually
| knows what they are talking about.

  I think you need to demonstrate that you know what you talk about before
  you can get more than excessively humorous responses.

  FWIW, properly implemented, a tree is printed with the function PRINT:

(print <tree>)

  I'm sure this is not really useful to you at this time, but it _is_ the
  correct answer to your question.  your next question is "how do I make
  PRINT understand my representation of a tree?", and the answer to that
  question merits more than a joke, but speaking of which...

How the Angel Came to be on Top of the Christmas Tree 

There had been no snow during the entire month of November, and there
didn't appear to be coming any snow any time soon, either.  The elves in
the bicycle department had been on strike since October, and there was the
possibility that the elves in the doll department might join them.

Daily life at the North Pole was not pleasant, and Santa Claus was in a
pretty foul mood.  Mrs. Claus was suffering from arthritis and was very mad
over the fact that her red velvet cake had fallen in the oven.  Santa had
tried to round up some extra helpers, but with no snow, they weren't able
to make it by sleigh to the workshop.

Rudolph had a bad cold, and his nose wouldn't light up.  Comet and Prancer
were fighting over Vixen, who had just come into heat.  Blitzen's right
foreleg was still in a cast, and the vet said that they would have to wait
until 24 December to decide if Blitzen would be able to pull the sleigh.

The electricity had been shaky, and all the power tools had came to a stop
several times.  Nothing was going right.  The helpers were about two weeks
behind schedule, and it didn't look like all the toys would be ready by
Christmas Eve.  Santa's foul mood was exacerbated by a bad case of
hemorrhoids, and he wasn't too happy about the possibility of having to
ride so far on Christmas Eve.  It didn't help that he had gained weight in
the past year and that his favorite pair of pants had split.

Seeing the terrible state of affairs at the North Pole, the angels took up
an offering to buy a gift for the Clauses - something that would brighten
their Christmas.  They chose a Christmas tree, and they sent an angel down
to deliver it.  Just as Santa had squeezed himself into the last pair of
clean pants, uncomfortable though they were, the angel knocked on his front
door.  Santa threw the door open.  Outside was a chirping little angel.
"Hey, Santa!  Where do you want me to put this tree?"

  incidentally, you might want to look at the method PRINT-OBJECT if you
  want to implement your own tree representation as a struture or a class.

#:Erik
-- 
  The Microsoft Dating Program -- where do you want to crash tonight?
From: David B. Lamkins
Subject: Re: Trees
Date: 
Message-ID: <sLl92.17079$Sz4.9897585@news.teleport.com>
In article <············@bigboote.WPI.EDU> , "Stephen M. Beaulieu"
<········@wpi.edu> wrote:

>Does anyone have a simple algorithm to print a tree?
>
>

Do you think you could be more specific?  Conceptually, you can use conses
to build a binary tree, and print will do the right thing to print a tree --
as a list...

--
David B. Lamkins <http://www.teleport.com/~dlamkins/>

((lambda (x) (list x (list 'quote x)))
   '(lambda (x) (list x (list 'quote x))))