On Mar 15, 8:33 pm, Alex McDonald <b...@[EMAIL PROTECTED]
> wrote:
> On Mar 15, 12:21 am, "Ed" <nos...@[EMAIL PROTECTED]
> wrote:
>
>
>
> > "Mark W. Humphries" <m...@[EMAIL PROTECTED]
> wrote in
messagenews:68cfbbe8-8cf3-461d-99b5-bf34f619cb66@[EMAIL PROTECTED]
>
> > > On Mar 14, 9:43 am, "Ed" <nos...@[EMAIL PROTECTED]
> wrote:
> > > ...
> > > I've named one of the two conditional exits WHEN
> > >http://wiki.forthfreak.net/index.cgi?TerseControlStructures,
I don't
> > > know is this is common usage though:
>
> > > : example1 full? unless eat-lunch ;
> > > : example2 hungry? when eat-lunch ;
>
> > Interesting. I hadn't seen that before.
>
> > I don't know that there's been common use of the name WHEN
> > in forth. I checked several popular '94 forths before using it. I
> > saw WHEN used once or twice in control structure articles early
> > on in FD but nothing seems to have come of them.
>
> > I chose WHEN because it exists in control structure statements
> > of other languages and therefore would be familiar to users in
> > that context. Similarly with COND.
>
> I'd caution against the use if a word like WHEN in this context. In
> normal English usage WHEN is the time at which something happens. It
> has connotations of asynchronous processing, perhaps as an interrupt
> routine. As in
>
> : wait-interrupt-****t ( ****t# -- )
> ****t-wait when ... some async actvity ... end-when ;
>
> (wait-interrupt-****t returns immediately, but the WHEN END-WHEN body
> is run asynchronously.)
>
> WHEN doesn't imply some form of immediate inline IF test to me.
>
> --
> Regards
> Alex McDonald
I agree completely with your point. I'm happy with UNLESS but I
haven't yet been able to come up with better name for WHEN. I tend to
use conditional exists quite a lot in my code, so I'd welcome any
suggestions.


|