![]() |
||
| Home | SwiftForth Archive | SwiftX Archive | |

{ ==========
The problem is to execute the previous method for the same message in a [+SWITCH.
I suspect there exist a possibility to start the search-process from the previous list-node entry.
My solution here is to redef [+SWITCH as a [SWITCH. But its not very nice.
A better method will be interesting.
Charles Melice
======== }
0 VALUE (PREV-SWITCH-XT)
: [+SWITCH
>IN @ >R
' DUP TO (PREV-SWITCH-XT) \ save previous switch
R@ >IN ! :SWITCH \ redef switch with previous as default
R> >IN ! [+SWITCH ; \ execute [+switch
: RUN-SUPER ( n -- ) (PREV-SWITCH-XT) COMPILE, ; IMMEDIATE
\ --------------------------------------
\ example
\ --------------------------------------
: FOODEFAULT . ." not used" ;
[SWITCH FOO FOODEFAULT
1 RUN: ." ONE" ;
2 RUN: ." TWO" ;
3 RUN: ." THREE" ;
SWITCH]
[+SWITCH FOO
1 RUN: ." UN" ;
2 RUN: ." DEUX" ;
3 RUN: 3 RUN-SUPER ." , say TROIX in french" ; \ use previous method
SWITCH]
\ EOF
.
Received on Mon Mar 29 1999 - 13:07:21 PST
This archive was generated by hypermail 2.2.0 : Thu Nov 20 2008 - 03:04:27 PST