:noname  ( -- cfa-addr )

publication: 8 janvier 2022 / mis Ă  jour 9 novembre 2024

Read this page in english

 

vocabulaire: forth

DĂ©finit un code FORTH sans en-tĂȘte. cfa-addr est l'adresse d'exĂ©cution d'une dĂ©finition.

Exemple:

:noname s" Saturday" ; 
:noname s" Friday" ; 
:noname s" Thursday" ; 
:noname s" Wednesday" ; 
:noname s" Tuesday" ; 
:noname s" Monday" ; 
:noname s" Sunday" ; 
  
create (ENday) ( --- addr) 
	, , , , , , , 
  
:noname s" Samedi" ; 
:noname s" Vendredi" ; 
:noname s" Jeudi" ; 
:noname s" Mercredi" ; 
:noname s" Mardi" ; 
:noname s" Lundi" ; 
:noname s" Dimanche" ; 
  
create (FRday) ( --- addr) 
	, , , , , , , 
  
defer (day) 
  
: ENdays  
    ['] (ENday) is (day) ; 
  
: FRdays  
    ['] (FRday) is (day) ; 
  
3 value dayLength 
: .day	 
    (day) 
    swap cell * 
    + @ execute 
    dayLength ?dup if 
        min 
    then 
    type 
; 
ENdays 
0 .day \ display Sun  
1 .day \ display Mon  
2 .day \ display Tue  
FRdays  ok 
0 .day \ display Dim  
1 .day \ display Lun  
2 .day \ display Mar 

Legal: site web personnel sans commerce / personal site without seling