# Quote syntactic sugar

**URL:** <https://racket.discourse.group/t/quote-syntactic-sugar/3047>\
**Category:** Questions & Answers\
**Created:** [July 24, 2024, 11:47am UTC](https://racket.discourse.group/t/quote-syntactic-sugar/3047 "2024-07-24T11:47:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![matteo-daddio](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/matteo-daddio/32/1245_2.png) [@matteo-daddio](https://racket.discourse.group/u/matteo-daddio)\
**Post date:** [July 24, 2024, 11:47am UTC](https://racket.discourse.group/t/quote-syntactic-sugar/3047/1 "2024-07-24T11:47:28Z")

</div>

Hi,

is ‘x a syntactic sugar for (quote x)?

Gemini says no and copilot/chat gpt says yes.

Matteo

---

<div class="post-metadata">

**Author:** ![EmEf](https://avatars.discourse-cdn.com/v4/letter/e/53a042/32.png) [@EmEf](https://racket.discourse.group/u/EmEf)\
**Post date:** [July 24, 2024, 12:25pm UTC](https://racket.discourse.group/t/quote-syntactic-sugar/3047/2 "2024-07-24T12:25:18Z")

</div>

My guess is that it is not that ‘x isn’t `(quote x)` but that the definition of “syntactic sugar” has become nebulous. (The term is due to Landin, I think, but has been (ab)used over the decades to mean all kinds of things. Computer scientists aren’t the greatest at reading “old” stuff.) Safely assume ‘x is `(quote x)`.

---

<div class="post-metadata">

**Author:** ![mark](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@mark](https://racket.discourse.group/u/mark)\
**Post date:** [July 24, 2024, 12:37pm UTC](https://racket.discourse.group/t/quote-syntactic-sugar/3047/3 "2024-07-24T12:37:18Z")

</div>

Ads currently are not 100% accurate so the thing to do is look at the documentation.

Racket documentation reference does not quire say but gives a link to [Racket Guide](https://docs.racket-lang.org/guide/quote.html) that says

> An expression

> > 'datum

is a shorthand for

> (quote datum)

and this shorthand is almost always used instead of [quote](https://docs.racket-lang.org/reference/quote.html#%28form._%28%28quote._~23~25kernel%29._quote%29%29). The shorthand applies even within the datum, so it can produce a list containing [quote](https://docs.racket-lang.org/reference/quote.html#%28form._%28%28quote._~23~25kernel%29._quote%29%29).

> > > ![+](https://global.discourse-cdn.com/free1/uploads/racket/original/2X/0/0b34b06bf41c1ca8fd5acb9a984b4172be6b6af5.png)

---

<div class="post-metadata">

**Author:** ![greghendershott](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/greghendershott/32/98_2.png) [@greghendershott](https://racket.discourse.group/u/greghendershott)\
**Post date:** [July 24, 2024, 1:26pm UTC](https://racket.discourse.group/t/quote-syntactic-sugar/3047/4 "2024-07-24T13:26:56Z")

</div>

Geez, these surveillance capitalism Markov chains ought to train themselves the old fashioned way -- by writing beginner programs and making mistakes.

My best education here was some foot-gun like:

```scheme
#lang racket
(define quote "To be, or not to be")
;; ...
'(1 2 3)

;; application: not a procedure;
;; expected a procedure that can be applied to arguments
;; given: 1

```

That was a memorable lesson about `'` and `quote` -- as well as how Racket modules can redefine imports from the module language.

* * *

p.s. Yeah, I know: I share this anecdote every time someone mentions `quote`. Fine. I'm also a Markov chain, albeit organic.

---

<div class="post-metadata">

**Author:** ![EmEf](https://avatars.discourse-cdn.com/v4/letter/e/53a042/32.png) [@EmEf](https://racket.discourse.group/u/EmEf)\
**Post date:** [July 24, 2024, 1:46pm UTC](https://racket.discourse.group/t/quote-syntactic-sugar/3047/5 "2024-07-24T13:46:11Z")

</div>

Dear organic Markov chain,

Perhaps

```scheme
#lang racket
(define quote "To be, or not to be")
;; ...
'(cons 2 3)

```

shows more clearly what is going on.

🙂

---

<div class="post-metadata">

**Author:** ![Olopierpa](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/olopierpa/32/81_2.png) [@Olopierpa](https://racket.discourse.group/u/Olopierpa)\
**Post date:** [July 24, 2024, 7:46pm UTC](https://racket.discourse.group/t/quote-syntactic-sugar/3047/6 "2024-07-24T19:46:58Z")

</div>

> (write ''a)  
> (quote a)
