Skip to main content
added 15 characters in body
Source Link
Malabarba
  • 23.5k
  • 8
  • 82
  • 168

Once upon a time, the sharp quote was necessary for lambdas, now that's no longer the case.

So, it appears that (lambda (x) x) and #'(lambda (x) x) are equivalent, but '(lambda (x) x) is not (most importantly, when byte-compiling).

Yes. In fact, the first two are completely identical when evaluated. As described in the manual page you linked:

The following forms are all equivalent:

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

Other than trying to support Emacs versions from two decades ago, there's never a reason to sharp quote a lambda.

So don't.


As a sidenote:

  • Hard quoting a lambda (with ') does make a difference, it prevents byte compilation. I can't think of a scenario where that's useful, but who knows.

  • The backtic is the only quote that's genuinely useful with lambdas, but only if you're not using lexical binding for some reason.

Once upon a time, the sharp quote was necessary for lambdas, now that's no longer the case.

So, it appears that (lambda (x) x) and #'(lambda (x) x) are equivalent, but '(lambda (x) x) is not (most importantly, when byte-compiling).

Yes. In fact, the first two are completely identical. As described in the manual page you linked:

The following forms are all equivalent:

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

Other than trying to support Emacs versions from two decades ago, there's never a reason to sharp quote a lambda.

So don't.


As a sidenote:

  • Hard quoting a lambda (with ') does make a difference, it prevents byte compilation. I can't think of a scenario where that's useful, but who knows.

  • The backtic is the only quote that's genuinely useful with lambdas, but only if you're not using lexical binding for some reason.

Once upon a time, the sharp quote was necessary for lambdas, now that's no longer the case.

So, it appears that (lambda (x) x) and #'(lambda (x) x) are equivalent, but '(lambda (x) x) is not (most importantly, when byte-compiling).

Yes. In fact, the first two are completely identical when evaluated. As described in the manual page you linked:

The following forms are all equivalent:

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

Other than trying to support Emacs versions from two decades ago, there's never a reason to sharp quote a lambda.

So don't.


As a sidenote:

  • Hard quoting a lambda (with ') does make a difference, it prevents byte compilation. I can't think of a scenario where that's useful, but who knows.

  • The backtic is the only quote that's genuinely useful with lambdas, but only if you're not using lexical binding for some reason.

added 106 characters in body
Source Link
Malabarba
  • 23.5k
  • 8
  • 82
  • 168

Once upon a time, the sharp quote was necessary for lambdas, now that's no longer the case.

So, it appears that (lambda (x) x) and #'(lambda (x) x) are equivalent, but '(lambda (x) x) is not (most importantly, when byte-compiling).

Yes. In fact, the first two are completely identical. As described in the manual pagemanual page you linked:

The following forms are all equivalent:

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

Other than trying to support Emacs versions from two decades ago, there's never a reason to sharp quote a lambda.

So don't.


As a sidenote:

  • Hard quoting a lambda (with ') does make a difference, it prevents byte compilation. I can't think of a scenario where that's useful, but who knows.

  • The backtic is the only quote that's genuinely useful with lambdas, but only if you're not using lexical binding for some reason.

Once upon a time, the sharp quote was necessary for lambdas, now that's no longer the case.

So, it appears that (lambda (x) x) and #'(lambda (x) x) are equivalent, but '(lambda (x) x) is not (most importantly, when byte-compiling).

Yes. In fact, the first two are completely identical. As described in the manual page you linked:

The following forms are all equivalent:

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

Other than trying to support Emacs versions from two decades ago, there's never a reason to sharp quote a lambda.

So don't.


As a sidenote:

  • Hard quoting a lambda (with ') does make a difference, it prevents byte compilation. I can't think of a scenario where that's useful, but who knows.

  • The backtic is the only quote that's genuinely useful with lambdas, but only if you're not using lexical binding for some reason.

Once upon a time, the sharp quote was necessary for lambdas, now that's no longer the case.

So, it appears that (lambda (x) x) and #'(lambda (x) x) are equivalent, but '(lambda (x) x) is not (most importantly, when byte-compiling).

Yes. In fact, the first two are completely identical. As described in the manual page you linked:

The following forms are all equivalent:

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

Other than trying to support Emacs versions from two decades ago, there's never a reason to sharp quote a lambda.

So don't.


As a sidenote:

  • Hard quoting a lambda (with ') does make a difference, it prevents byte compilation. I can't think of a scenario where that's useful, but who knows.

  • The backtic is the only quote that's genuinely useful with lambdas, but only if you're not using lexical binding for some reason.

added 314 characters in body
Source Link
Malabarba
  • 23.5k
  • 8
  • 82
  • 168

Once upon a time, the sharp quote was necessary for lambdas, now that's no longer the case.

So, it appears that (lambda (x) x) and #'(lambda (x) x) are equivalent, but '(lambda (x) x) is not (most importantly, when byte-compiling).

Yes. In fact, the first two are completely identical. As described in the manual page you linked:

The following forms are all equivalent:

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

Other than trying to support Emacs versions from two decades ago, there's never a reason to sharp quote a lambda.

So don't.So don't.


As a sidenote:

  • Hard quoting a lambda (with ') does make a difference, it prevents byte compilation. I can't think of a scenario where that's useful, but who knows.

  • The backtic is the only quote that's genuinely useful with lambdas, but only if you're not using lexical binding for some reason.

Once upon a time, the sharp quote was necessary for lambdas, now that's no longer the case.

So, it appears that (lambda (x) x) and #'(lambda (x) x) are equivalent, but '(lambda (x) x) is not (most importantly, when byte-compiling).

Yes. In fact, the first two are completely identical. As described in the manual page you linked:

The following forms are all equivalent:

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

Other than trying to support Emacs versions from two decades ago, there's never a reason to sharp quote a lambda.

So don't.

Once upon a time, the sharp quote was necessary for lambdas, now that's no longer the case.

So, it appears that (lambda (x) x) and #'(lambda (x) x) are equivalent, but '(lambda (x) x) is not (most importantly, when byte-compiling).

Yes. In fact, the first two are completely identical. As described in the manual page you linked:

The following forms are all equivalent:

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

Other than trying to support Emacs versions from two decades ago, there's never a reason to sharp quote a lambda.

So don't.


As a sidenote:

  • Hard quoting a lambda (with ') does make a difference, it prevents byte compilation. I can't think of a scenario where that's useful, but who knows.

  • The backtic is the only quote that's genuinely useful with lambdas, but only if you're not using lexical binding for some reason.

Source Link
Malabarba
  • 23.5k
  • 8
  • 82
  • 168
Loading