In article <87wmdwunwk.fsf@nightsong.com>,   
   Paul Rubin wrote:   
   >minforth@gmx.net (minforth) writes:   
   >> Unfortunately, everything is very non-standard, as there is   
   >> no multitasking wordset (for historical reasons?).   
   >> A pity really, as co-operative multitasking existed very   
   >> early on in Forth.   
   >   
   >I had thought there wasn't enough agreement about the wordset to   
   >standardize it, and the same thing happened for cross development. But   
   >at least for multitasking, there is reasonable shared understanding   
   >about how it should work, at least in the cooperative case.   
   >   
   >> Then it would be easier to have better discussions about coroutines   
   >> (the original topic of this thread) or ownership of closure objects   
   >> and different variants of GC.   
   >   
   >I think these fancy closures are mostly of interest to language geeks   
   >and not so much in the old-fashioned Forth spirit. Coroutines don't   
   >seem that important if you have multitasking. Anton's GC is great and I   
   >think cooperative multitasking wouldn't affect it much, if you don't   
   >mind the collection pauses. It would simply block during collection.   
      
   Look at python: they have decorators. In Forth this looks like:   
   ' aap ' noot decorate   
   Execute `aap (e.g. .S) before each invocation of `noot   
      
   This works nicely with coroutines. In ciforth it is actually implemented.   
   (also undecorated of course)   
      
   In ciforth the canonical example is   
   "   
    { &i EMIT .S ;: &o EMIT .S } 'somethingbuggy decorated   
   "   
   The `;: ( `CO ) takes care that the second part is executed after each   
   invocation of `somethingbuggy.   
   Note that this is ideal for Heisenbug's, where you cannot insert testoutput   
   because the bug disappears as soon as memory is shifted.   
      
   Downplaying coroutines is an indication that you have not realised   
   the potential.   
      
   [I don't care much about closures, maybe the same applies to me   
   about closures.]   
      
   Groetjes Albert   
   --   
   Temu exploits Christians: (Disclaimer, only 10 apostles)   
   Last Supper Acrylic Suncatcher - 15Cm Round Stained Glass- Style Wall   
   Art For Home, Office And Garden Decor - Perfect For Windows, Bars,   
   And Gifts For Friends Family And Colleagues.   
      
   --- SoupGate-DOS v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|