Re: acceptance of forth
- From: tinkerer@xxxxxxxxxxxxxxx (Tinkerer Atlarge)
- Date: Mon, 30 Nov 2009 10:51:42 +1000
Marcel Hendrix <mhx@xxxxxx> wrote:
tinkerer@xxxxxxxxxxxxxxx (Tinkerer Atlarge) writes Re: acceptance of forth[order of choices switched]
Stephen Pelc <stephenXXX@xxxxxxxxxxxx> wrote:
On Sun, 29 Nov 2009 00:32:01 +1000, tinkerer@xxxxxxxxxxxxxxx (Tinkerer
Atlarge) wrote:
You have basically three choices as in any language:
2) test at the bottom
begin
<action>
<test>
until
Realizing its similarity to the "goto" loop was my breakthrough in
appreciating how simple 'begin:until' is beneath the surface.
Can you remember what you thought before the breakthrough?
I didn't think anything about it because, prior to that, it had nothing
to differentiate itself in my mind from other constructs also starting
with BEGIN. Keeping my finger on the page while I copied it into the
computer was the only way I could be sure I didn't accidentally switch
templates halfway through.
What I am talking about has as much to do with how to make these things
stick in our minds as how they work.
With "until" I always have the problem remembering if it continues
when <test> is TRUE, or when <test> is FALSE.
You're way ahead of me if you can remember that much about it.
1) test at the top
begin
<test>
while
<action>
repeat
One of my recurring frustrations when learning forth was repeatedly (and
I felt undeservedly) finding myself painted into a corner. The symptoms
were that the going kept getting unaccountably harder, the further I
proceeded along a certain path. It was like I had unwittingly taken a
wrong turn which I could only realize further down the track. The "wrong
turn" had no symptoms of its own. However, if I had made a mistake
anywhere, that is where it happened.
Although this reads very nicely and heightens the user's anticipation of
revelation to almost unbearable heights, I still do not quite grasp what
you mean by this. My hypothesis is that you think new users may interpret
the construct as testing once, before entering an infinite loop (i.e.
repeat jumps to after while instead of after begin?)
I haven't had a chance to form such an opinion yet. I was responding
positively to the clarity of Stephen's template as instantly conveying
what I assumed was its meaning. However, on consulting other books and
looking back over the source code which is the most accurate record of
my forth learning experience, I now see that
1) begin..while..repeat has multiple templates (which, overlooked as it
was, might be enough to account for my confusion)
2) the way I have used it myself is more lilke a FOR loop where the body
leads up to the test, all within the <test> section. All I have used the
<action> part for is to increment a count. The secret might be to forget
about constructs and consider the action of WHILE and REPEAT as entities
in their own right which only need BEGIN as an end-marker for their own
purposes. But that is just me thinking aloud. I don't claim to know yet.
To understand where I am coming from you need to visualize the
circumstances where I consulted the books. The first time I read them in
genuine book-reading mode. The Loops section came up, full of
hard-to-remember detail, right at the end of my attention span.
In subsequent readings I was using them as reference books, trying to
find the appropriate looping construct for what I needed as quickly as
possible. (All languages I have used in the past have them, and I have
never had difficulty finding the right one before). If I had someone
there to tell me which one to use I would gladly have taken their word
for it without being distracted by their theoretical implications.
Although your analogies are very nice, like other readers of this thread
I am dying to hear some concrete examples. Please!
That will take a bit more time as I have a lot of code to sift through
first. I will try to answer it in another post.
.
- Follow-Ups:
- Re: acceptance of forth
- From: Josh Grams
- Re: acceptance of forth
- From: Elizabeth D Rather
- Re: acceptance of forth
- References:
- continued fractions
- From: Hugh Aguilar
- Re: continued fractions
- From: Albert van der Horst
- Re: continued fractions
- From: Hugh Aguilar
- Re: continued fractions
- From: Coos Haak
- Re: continued fractions
- From: Hugh Aguilar
- Re: continued fractions
- From: Coos Haak
- Re: continued fractions
- From: Hugh Aguilar
- Re: continued fractions
- From: idknow
- Re: continued fractions
- From: Elizabeth D Rather
- acceptance of forth (was: Re: continued fractions)
- From: Uwe Kloß
- Re: acceptance of forth
- From: Tinkerer Atlarge
- Re: acceptance of forth
- From: Doug Hoffman
- Re: acceptance of forth
- From: Tinkerer Atlarge
- Re: acceptance of forth
- From: Stephen Pelc
- Re: acceptance of forth
- From: Tinkerer Atlarge
- Re: acceptance of forth
- From: Marcel Hendrix
- continued fractions
- Prev by Date: Re: acceptance of forth
- Next by Date: Re: LC53 statistics
- Previous by thread: Re: acceptance of forth
- Next by thread: Re: acceptance of forth
- Index(es):
Relevant Pages
|