tmemoization.nim 261 B

123456789101112131415161718
  1. discard """
  2. msg: "test 1\ntest 2\ntest 3"
  3. output: "TEST 1\nTEST 2\nTEST 3"
  4. """
  5. import strutils
  6. proc foo(s: static[string]): string =
  7. static: echo s
  8. const R = s.toUpperAscii
  9. return R
  10. echo foo("test 1")
  11. echo foo("test 2")
  12. echo foo("test " & $3)