fork(1) download
  1. : HEX,{ ( "hex-byte hex-byte ... }" ) \ Add bytes in hex to dictionary
  2. \ Temporary hex numbers
  3. BASE @
  4. HEX
  5.  
  6. \ Loop over input
  7. BEGIN
  8. 0.
  9.  
  10. \ Read while parse area has content and not }
  11. PARSE-NAME
  12. DUP IF
  13. 2DUP S" }" COMPARE
  14. ELSE
  15. FALSE
  16. THEN
  17. WHILE
  18.  
  19. \ Convert to number and add to dictionary
  20. ( 0 name-a name-u ) >NUMBER 2DROP D>S C,
  21. REPEAT
  22.  
  23. 2DROP 2DROP
  24.  
  25. \ Restore BASE
  26. BASE ! ;
  27.  
  28.  
  29. CREATE TEST
  30. HEX,{ 10 20 30 40 50 10 20 30 10 20 }
  31.  
  32. HERE TEST - CONSTANT #TEST
  33.  
  34. : .TEST #TEST 0 ?DO TEST I + C@ . LOOP CR ;
  35.  
  36. .TEST
  37.  
Success #stdin #stdout 0.01s 4516KB
stdin
Standard input is empty
stdout
16 32 48 64 80 16 32 48 16 32