| With the veritable flurry of state machine posts today[0,1] I thought I'd (re)submit[2] one of my favorite posts on finite state machines in Forth. The specific example is of number input routine allows signed decimal numbers without power-of-10 exponents (fixed-point, in FORTRAN parlance) and comes from the author's book Scientific Forth, where a fuller example is used ... to determine whether a piece of text is a proper identifier (that is, the name of a variable, subroutine or function) according to the rules of FORTRAN. I originally heard of Scientific Forth from Programming in the Twenty First Century where it made a list of "Five Memorable Books about Programming"[3] with the following description: Dr. Noble demonstrates how he uses Forth for hardcore matrix work and, when he realizes that RPN notation isn't ideal in all circumstances, develops a translator from infix expressions to Forth. [0]: https://news.ycombinator.com/item?id=22746708 [1]: https://news.ycombinator.com/item?id=22748785 [2]: previously 3, 6 and 8 years ago, never any comments: https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que... [3]: https://prog21.dadgum.com/19.html |
[0] https://github.com/Josefg/Scientific_FORTH [1] https://github.com/Josefg/Scientific_FORTH/blob/master/Conse...