From: Ulrich H. <uh...@xl...> - 2008-07-16 06:12:49
|
Hi Bernie, Mike, > Is the solution now to use *: perform postpone @ postpone execute; *?? yes In Forth-83 there were two distinct words for user defined compilation: COMPILE for non-immediate words and [COMPILE] for immediate words. However some special Forth systems had immediate words which are non-immediate in typical systems: for example cmForth defines @ as an immediate compiler macro. Thus the use of COMPILE and [COMPILE] was not portable to those systems. POSTPONE tries to hide the immediateness of the compiled word, so POSTPONE @ compiles the correct code whether or not @ is immediate. Interesting enough, if you want to emulate POSTPONE on older systems with COMPILE and [COMPILE] you have to deal with the immediateness of the compiled word in order to hide it... Regards, Ulli Am 15.07.2008 um 23:28 schrieb Bernard Mentink: > Thanks Michael, > > I don't understand German but I get the code, I had found the > definition to > tuck elsewhere, I just wanted to check it was correct. > > Also I am still having trouble with the old style forth in the > definition :*perform compile @ compile execute ; > * > Is the solution now to use *: perform postpone @ postpone execute; *?? > > Cheers, > Bernie > > 2008/7/16 Kalus Michael <mic...@on...>: > >> Guten Abend Bernard. >> >> Am 15.07.2008 um 03:03 schrieb Bernard Mentink: >>> .. does anyone >>> have the definition for "tuck" at hand? >> >> : tuck ( w1 w2 – w2 w1 w2 ) \ core-ext "tuck" >> swap over ; >> >> Beispiel aus gforth: >> >> 11 22 .s >> <2> 11 22 ok >> tuck .s >> <3> 22 11 22 ok >> >> 33 44 .s >> <5> 22 11 22 33 44 ok >> swap over .s >> <6> 22 11 22 44 33 44 ok >> >> Tuck ist nützlich wenn es als code definiert ist, weil die >> Kkombiantion SWAP OVER doch häufiger vorkommt. Ist aber nicht sooo >> dringend das zu implementieren, es sei denn du hättest wirklich sehr >> laufzeitkritischen Code hast. >> >> Grüße, Michael >> ------------------------------------------------------------------------- >> This SF.Net email is sponsored by the Moblin Your Move Developer's >> challenge >> Build the coolest Linux based applications with Moblin SDK & win >> great >> prizes >> Grand prize is a trip for two to an Open Source event anywhere in >> the world >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >> _______________________________________________ >> Amforth-devel mailing list >> Amf...@li... >> https://lists.sourceforge.net/lists/listinfo/amforth-devel >> > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win > great prizes > Grand prize is a trip for two to an Open Source event anywhere in > the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Amforth-devel mailing list > Amf...@li... > https://lists.sourceforge.net/lists/listinfo/amforth-devel |