aboutsummaryrefslogtreecommitdiff
path: root/amforth-6.5/examples/rec-char.frt
blob: 1e7b1ac4037d342bbe1254acd1b9cc766bc10758 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
\ check for the 'c' syntax for single
\ characters.
: rec:char ( addr len -- n r:num | r:fail )
  3 = if \ a three character string
    dup c@ [char] ' = if \ starts with a '
      dup 2 + c@ [char] ' = if \ and ends with a '
        1+ c@ r:num exit
      then
    then
  then
  drop r:fail
;