Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Instead of declaring a local function, you can use let (http://docs.plt-scheme.org/reference/let.html)

e.g.:

  > (let fac ([n 10])
      (if (zero? n)
          1
          (* n (fac (sub1 n)))))

  3628800


Yes, "named let" is lovely, but perhaps less obvious for the non-cognoscenti. It also doesn't translate into Python, etc.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: