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

[See screenshot]


> "Functions in Ruby are methods"

RECORD SCRATCH. THE ROOM FALLS SILENT.

NARRATOR: A common assumption, but no. Equating object methods to functions is a furphy. The argument along the lines of:

"Ruby's object methods are Ruby's functions, but you can't pass them around, ergo they're not functions"

is using the term "function" in two different ways, but assuming they're the same; this is not an argument based on substance, but upon mislabelling. The conclusion is bogus because the premise is bogus.

It may arise from a category error, assuming that the thing depends intrinsically upon the literal representation of the thing, or (worse) the common name of the thing, but this is a) wrong anyway, and b) loses coherence entirely in a language in which function literals can be conjured and lexically rebound at runtime.

In actuality, Ruby's lambdas are functions, and first-class, by the only definition with substance: they are closures capable of higher-order expression, taking functions as parameters when invoked, and returning functions as results.

Which is why saying "it don't have them" on a forum named after a fixed-point combinator is to invite: a) ridicule, and b) lambda calculus expressions in rap battle form.

CROWD: Yeah!

MUSIC STARTS / GLITTERBALL CLOSEUP


I’m glad you think highly of your poetic abilities, but I have no desire to engage in that pointless argument.

Edit: and yes.. uh comment deleted as charged, since you had edited after I replied.


> I have no desire to engage

And yet,

> go full on neckbeard

Here you are,

> you seem to have balled up tightly in your own self worth

In full-on pompous balloon ad hominem mode,

> https://ruby-doc.org/docs/ruby-doc-bundle/Manual/man-1.4/fun...

With a reference page that is 22 years out of date,

> you can finish this argument with whatever hand you prefer

And a bitter, resentful, dick joke.

Well, I don't have a beard, and I ain't the dick here.

> How does one call a lambda after all

Why not fire up the interpreter and go

    f[x]
yourself.

Which is the title of this song.

POSTSCRIPT:

Oh look, a comment deleter / throws around shit / but too late for this meter / Yo' can check it all out / at https://inopinatus.org/i/all_the_sweeter.png


You win.




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

Search: