Re: Back & Forth - Co-routines

Liste des GroupesRevenir à cl forth 
Sujet : Re: Back & Forth - Co-routines
De : no.email (at) *nospam* nospam.invalid (Paul Rubin)
Groupes : comp.lang.forth
Date : 31. Jan 2025, 23:06:00
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <87plk2y6yf.fsf@nightsong.com>
References : 1 2
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
melahi_ahmed@yahoo.fr (ahmed) writes:
: tri_mf3 ( x a b c -- mf) { a b c -- } \ locals à la gforth
 dup a < if drop 0 exit then
 dup a >= over b < and if a - 100 b a - */ exit then
 dup b >= over c < and if c swap - 100 c b - */ exit then
 drop 0
;

This seems more in the locals spirit:

: blend { a x b -- n } 100 b x - b a - */ ;
: tri_mf3.1 { x a b c -- mf }
    a x <= x b < AND IF b x a blend EXIT THEN
    b x <= x c < AND IF b x c blend EXIT THEN
    0 ;

Date Sujet#  Auteur
31 Jan 25 * Re: Back & Forth - Co-routines12ahmed
31 Jan 25 +* Re: Back & Forth - Co-routines2ahmed
31 Jan 25 i`- Re: Back & Forth - Co-routines1ahmed
31 Jan 25 +- Re: Back & Forth - Co-routines1ahmed
31 Jan 25 +- Re: Back & Forth - Co-routines1ahmed
31 Jan 25 +* Re: Back & Forth - Co-routines6Paul Rubin
1 Feb 25 i+* Re: Back & Forth - Co-routines2ahmed
1 Feb 25 ii`- Re: Back & Forth - Co-routines1ahmed
1 Feb 25 i`* Re: Back & Forth - Co-routines3Anton Ertl
1 Feb 25 i `* Re: Back & Forth - Co-routines2ahmed
1 Feb 25 i  `- SELECT (was: Back & Forth - Co-routines)1Anton Ertl
1 Feb 25 `- Re: Back & Forth - Co-routines1mhx

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal