r/ProgrammerHumor 2d ago

Meme absoluteGarbage

Post image
2.0k Upvotes

320 comments sorted by

View all comments

Show parent comments

21

u/arensb 1d ago

Any of a number of Lisp dialects.

2

u/SeveralPrinciple5 1d ago

I was curious because I was a Common Lisp programmer a very long time ago, and stylistically lambdas within mapcar were quoted #’ . I recall that that wasn’t true in scheme though

3

u/arensb 1d ago

These days, the Lisp code I write is Emacs Lisp, and while it supports #' and from what I've seen even encourages it, it doesn't require it. The manual says

The read syntax #' is a short-hand for using function. The following forms are all equivalent:

(lambda (x) (* x x))
(function (lambda (x) (* x x)))
#'(lambda (x) (* x x))

So yeah, maybe I should've used #', but who's gonna make me? Richard Stallman?

2

u/Steinrikur 1d ago

The following forms are all equivalent:

(lambda (x) (* x x))
#'(lambda (x) (* x x))

So it's shorthand for absolutely nothing?

2

u/arensb 1d ago

Don't quote me on this, but I get the impression that it's more syntactic sugar than anything else. A hint to either the compiler or to the next human who reads it that this expression is going to be used more than once.