[PicForth] Re: multitasker.fs question

David McNab david at rebirthing.co.nz
Mon Dec 6 14:09:24 CET 2004


Alex Holden wrote:
> Yes, you can do that at the top level. In fact I already do. Where I got 
> mixed up is that you can't do that in subwords. So the toplevel user 
> interface task calls a word which prompts the user for a string, and 
> that word calls 'accept' which in turn calls 'key'. I would like to put 
> something like 'key? if ... else yield then' in the accept word so that 
> the other task can execute while the user interface task is waiting for 
> the user to type a string, but that's not possible because 'accept' 
> isn't a top level word.

For what it's worth, I've addressed the situation by:
1) declaring subwords in 'macro'
2) factoring out as much from the subwords as possible,
    putting it into as few non-macro words as possible
This allows me to reference a macro subword just like it's an actual 
subroutine, and for each reference to generate the minimum possible 
amount of code.

> 
> Sorry for the confusion.
> 

-- 
Cheers
David


More information about the PicForth mailing list