lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 23/09/2018 01:18, Coda Highland wrote:
On Sat, Sep 22, 2018 at 2:51 AM, Lorenzo Donati
<lorenzodonatibz@tiscali.it> wrote:
On 11/09/2018 22:14, Roberto Ierusalimschy wrote:
[...]

local Y = function (le)
      local a = function (f)
        return le(function (...) return f(f)(...) end)
      end
      return a(a)
    end


OUCH! My brain hurts!

I can "feel" its beauty, but it's way over my functional head to understand!

(It almost reminds me of the difficulties of understanding Duff's device :-)


I dunno, Duff's device is pretty simple by comparison.

I didn't mean to compare the two things directly. I just compared how I felt when coming in contact with those. The bedazzling feeling is the same! :-)

I saw Duff's device for the first time probably 25+ years ago and I was waaaay less experienced as a programmer back then. Moreover (IIRC) it was in K&R book and I didn't have to understand it for my uni courses, so it was just a curiosity. I did understand it some years later (and it took me quite an effort).

I totally agree that Roberto's example is far more mind-boggling.




/s/ Adam