aboutsummaryrefslogtreecommitdiff
path: root/amforth-6.5/msp430/lib/forth-2012/core/evaluate.frt
blob: 9f4cf3bc3ceab887f077e83840967b462634a3a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
\ evaluate
\ temporarily redirect the input source
\ to string buffer. Return the the previous
\ input source afterwards and continue

\ some helper words
variable strlen
variable str
: source-string str @ strlen @ ;

: evaluate \ i*x addr len -- j*y 
    ['] source defer@ >r 
    >in @ >r
    0 >in !
    strlen !
    str !
    ['] source-string to source
    ['] interpret catch
    r> >in !
    r> to source
    throw
;