On Mar 18, 11:52 pm, Jonah Thomas <jethom...@[EMAIL PROTECTED]
> wrote:
> > > I suspect there were a couple of variables in the original graphics
> > > that Andrew was quoting. Again, I don't see that as invalidating
> > > his approach.
> > So introducing more variables is a good thing in Forth? Interesting
> > concept.
> If we're talking sheer esthetics, I prefer global variables to locals.
> They aren't re-entrant, but I can get by wrthout re-entering DRAW .
> But apart from esthetics, doesn't it make sense to use whatever works?
Using a global variable in this situation is not about esthetics. All
turtle semantics are about a cursor-point and a target-point and
having those as global variables ex****ts that state to all the turtle
primitives that are implemented. A PUSH-TURTLE / POP-TURTLE pair
allows the re-entrant re-use of the global variables at exactly the
point where desired, without stepping on any factoring, and since they
are globals, that can be factored out to a wrapper word and does not
have to be defined in from the outset.


|