‹ BackHN Continuity

Thread

What makes Lisp difficult to read?

47 points · 81 comments · ibobev

  1. fxj · · focus · HN ↗
    R is already a Lisp dialect disguised in algebraic syntax. Here is the first example in R:

      factorial_recursive <- function(n) {
        if (n == 1) {
          return(n)
        } else {
          return(n * factorial_recursive(n - 1))
        }
      }
    
    <a href="https:&#x2F;&#x2F;cran.r-project.org&#x2F;web&#x2F;packages&#x2F;codetools&#x2F;codetools.pdf" rel="nofollow">https:&#x2F;&#x2F;cran.r-project.org&#x2F;web&#x2F;packages&#x2F;codetools&#x2F;codetools....

    then gives:

      (&lt;- factorial_recursive (function as.pairlist(alist(n = )) 
        (&quot;{&quot; (if (== n 1) 
          (&quot;{&quot; (return n)) 
          (&quot;{&quot; (return (* n (factorial_recursive (- n 1))))))
        ) NULL)
      )
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.