home *** CD-ROM | disk | FTP | other *** search
- \ INTERP.SEQ Interpret a string by Martin Tracy
-
- comment:
-
- Originally suggested to me by Martin Tracy, but all the names have
- been changed to protect the guilty !!!
-
- Allows the definition of macros that will be interpreted at the run
- time of the macro. The first character of the first word following
- the macro name being defined is the delimiter for the macro as follows:
-
- macro test " .( this is a test)"
-
- macro test / .( this is a test)/
-
- macro test \ .( this is a test)\
-
- The delimiter must naturally not occur within the macro.
-
- comment;
-
- : "interpret ( a1 n1 --- )
- 'tib @ >r >in @ >r span @ >r
- 0 >in ! dup span ! #tib ! 'tib !
- interpret
- r> dup span ! #tib ! r> >in ! r> 'tib ! ;
-
- : macro ( name --- ) \ start a macro definitions
- ['] noop is ] [compile] :
- ['] (]) is ] compile (")
- bl word 1+ c@ word c@ 1+ allot
- compile "interpret state on [compile] ; ;
-
-