2020-10-28 18:06:58 -04:00
|
|
|
( r c -- r f )
|
|
|
|
( Parse digit c and accumulate into result r.
|
2020-10-28 20:29:28 -04:00
|
|
|
Flag f is true when c was a valid digit )
|
2020-10-28 18:06:58 -04:00
|
|
|
: _pdacc
|
2020-10-28 20:29:28 -04:00
|
|
|
'0' - DUP 10 < IF ( good, add to running result )
|
|
|
|
SWAP 10 * + 1 ( r*10+n f )
|
|
|
|
ELSE ( bad ) DROP 0 THEN ;
|