The Halting Problem in R

It’s possible to write a program that peeks at another program and tells you something about it. Here’s a R function that tells you how long the definition of a function is: library(stringr) function_length <- function(func) { body(func) |> as.character() |> str_length() |> sum() } It can even be applied to itself: function_length(function_length) happens to … Continue reading The Halting Problem in R