Comment

Comment by fxj

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))
    }
  }
https://cran.r-project.org/web/packages/codetools/codetools....

then gives:

  (<- factorial_recursive (function as.pairlist(alist(n = )) 
    ("{" (if (== n 1) 
      ("{" (return n)) 
      ("{" (return (* n (factorial_recursive (- n 1))))))
    ) NULL)
  )
parent fxj 1 month ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton