Liste des Groupes | Revenir à cl forth |
Not sure if previously mentioned but here's another version of LOCALThis approach does not work well with catch/throw. Because `throw` must restore the values of all "local" variables that are used in the definitions whose execution is being terminated. And this is difficult to implement.
: ;: >r ;
: LOCAL ( x adr -- )
r> -rot dup @ over 2>r ! ;: 2r> ! ;
variable A variable B 8 a ! 7 b !
: divide ( a b -- ) b local a local
a @ b @ / . cr ;
15 3 divide a ? b ?
Les messages affichés proviennent d'usenet.