localVariables.praat 380 B

1234567891011121314151617181920
  1. echo Local variables
  2. procedure add .x .y
  3. .result = .x + .y
  4. endproc
  5. procedure square .x
  6. .result = .x ^ 2
  7. endproc
  8. procedure hypotenuse .x .y
  9. call square .x
  10. .x2 = square.result
  11. call square .y
  12. .y2 = square.result
  13. call add .x2 .y2
  14. .result = sqrt (add.result)
  15. endproc
  16. call hypotenuse 3 4
  17. assert hypotenuse.result = 5
  18. assert add.result = 25
  19. assert square.result = 16
  20. printline OK