Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Forth > Re: A Brief Loo...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 3932 of 4160
Post > Topic >>

Re: A Brief Look at History

by Jonah Thomas <jethomas5@[EMAIL PROTECTED] > Mar 19, 2008 at 10:58 AM

Bruce McFarling <agila61@[EMAIL PROTECTED]
> wrote:
> Jonah Thomas <jethom...@[EMAIL PROTECTED]
> wrote:
> 
> > 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.

I think I agree with you right down the line, and it sounds vaguely like
you're disagreeing. So I want to make sure I haven't missed the point.

I don't need DRAW-LINE or Line or whatever its name is to  be re-entrant
because it might as well be a primitive. I'm never going to stop it in
the middle to do another graphics word.

I might do something else that's re-entrant that uses Line and I can
save the values then. So it isn't a problem for me to use a 2VARIABLE
instead of a double stack variable or a graphics stack etc. And if I
want those, I can use them at a higher level than Line.

Since very often the place I want to start the next line is where the
last line ended, it makes sense to keep that info in a global variable.
For sheer esthetics I prefer as a general rule to avoid variables. but
when they work better, why not use them? Similarly with locals.
 




 2 Posts in Topic:
Re: A Brief Look at History
Jonah Thomas <jethomas  2008-03-19 10:58:54 
Re: A Brief Look at History
Frank Buss <fb@[EMAIL   2008-03-21 15:07:05 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 18 22:40:15 CDT 2008.