News for hackers. Stuff that matters.
Re:Chuck Moore, Extreme Programmer by progman on Thursday November 02, 2017 @07:21AM (#15609368)
> : right# negate 32 + . ;

This is an example of "ugly" Forth code. It's ok here to make the code as short as possible.

In reality I would write (educational) Forth code this way. The texts in parentheses are comments.

  ( compute Hypotenuse sqrt[a²+b²] )
  : hypo       ( a  b   )
    swap       ( b  a   )
    dup *      ( b  a²  )
    swap       ( a² b   )
    dup *      ( a² b²  )
    +          ( a²+b²  )
    sqrt       ( result )
  ;

  ( Application:  1.2 3.4 hypo )
Re:Chuck Moore, Extreme Programmer by minsight on Thursday November 02, 2017 @04:54PM (#15614218)
Isn't the first swap unneccesary?
Re:Chuck Moore, Extreme Programmer by progman on Friday November 03, 2017 @01:36PM (#15620880)
Of course. You learn quickly ;-)