# Origins of the phrase "nil punning"?

**URL:** https://clojureverse.org/t/origins-of-the-phrase-nil-punning/4329
**Category:** Other Languages
**Created:** [June 3, 2019, 5:06pm UTC](https://clojureverse.org/t/origins-of-the-phrase-nil-punning/4329 "2019-06-03T17:06:56Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![apbleonard](https://clojureverse.org/letter_avatar_proxy/v4/letter/a/ccd318/32.png) [@apbleonard](https://clojureverse.org/u/apbleonard)
#### Post date: [June 3, 2019, 5:06pm UTC](https://clojureverse.org/t/origins-of-the-phrase-nil-punning/4329/1 "2019-06-03T17:06:56Z")

</div>

Hi there,

I wondered if anyone knew the origins of the phrase “nil punning”. I presume it preceded Clojure?

Bonus question - does anyone know of a library in Java that attempts nil punning in its common collection implementations (without changing everything to use Optional)?

Best wishes,  
Anthony.

---

<div class="post-metadata">

### Author: ![vijaykiran](https://clojureverse.org/user_avatar/clojureverse.org/vijaykiran/32/350_2.png) [@vijaykiran](https://clojureverse.org/u/vijaykiran)
#### Post date: [June 5, 2019, 6:13am UTC](https://clojureverse.org/t/origins-of-the-phrase-nil-punning/4329/2 "2019-06-05T06:13:28Z")

</div>

I’d say it precedes Clojure - see [http://wiki.c2.com/?WhatIsNull](http://wiki.c2.com/?WhatIsNull) and [https://www.gnu.org/software/emacs/manual/html\_node/eintr/nil-explained.html](https://www.gnu.org/software/emacs/manual/html_node/eintr/nil-explained.html)  
and probably tangentially related: [https://en.wikipedia.org/wiki/Type\_punning](https://en.wikipedia.org/wiki/Type_punning)

---

<div class="post-metadata">

### Author: ![plexus](https://clojureverse.org/user_avatar/clojureverse.org/plexus/32/6_2.png) [@plexus](https://clojureverse.org/u/plexus)
#### Post date: [June 19, 2019, 10:02am UTC](https://clojureverse.org/t/origins-of-the-phrase-nil-punning/4329/3 "2019-06-19T10:02:15Z")

</div>

I googled “nil punning” and the first hit was by @ericnormand 🙂 ([https://lispcast.com/nil-punning/](https://lispcast.com/nil-punning/))

Seems it comes from the fact that `nil` had/has multiple meanings in Lisp (false, empty list, absence of a value), hence it’s a “pun”.

---

<div class="post-metadata">

### Author: ![ericnormand](https://clojureverse.org/user_avatar/clojureverse.org/ericnormand/32/1099_2.png) [@ericnormand](https://clojureverse.org/u/ericnormand)
#### Post date: [June 19, 2019, 12:30pm UTC](https://clojureverse.org/t/origins-of-the-phrase-nil-punning/4329/4 "2019-06-19T12:30:29Z")

</div>

And don’t forget [A Short Ballad Dedicated to the Growth of Programs](https://ashwinram.org/1986/01/28/a-short-ballad-dedicated-to-the-growth-of-programs/). It says a lot about nil punning in a few lines of poetry.

---

<div class="post-metadata">

### Author: ![apbleonard](https://clojureverse.org/letter_avatar_proxy/v4/letter/a/ccd318/32.png) [@apbleonard](https://clojureverse.org/u/apbleonard)
#### Post date: [June 29, 2019, 8:37pm UTC](https://clojureverse.org/t/origins-of-the-phrase-nil-punning/4329/5 "2019-06-29T20:37:27Z")

</div>

Having re-read Erics article more carefully I see it very thoroughly covers this.

It never once occurred to me that “nil punning” was to do with the word “pun”. I’ve been trying to work out what I thought it meant:

- onomatopaic perhaps (“take that nil!” … _pung!_)
- like “dead panning”, (not reacting to a wierd result)
- nil “punting”, (“this is not my problem…”)

To me what I find wonderful about nil punning is the ability to cope gracefully with a lack of information - thereby handling unreliable data sources, expansion of a contract prior to new information becoming available, and software “growth” in the sense that Rich covers brilliantly in “Maybe Not”. The act of information processing becomes like panning (that word again) for gold in a river of nils, letting them flow on without caring … It is a wonderful asset of Clojure and yet such a difficult one to understand why you would miss it - and therefore a hard sell for those from a Java background who are conditioned to be strict with contracts to the point of letigiousness. I wondered if all those outcomes was prefigured in the origin of the term. It’s not really - but the actual origin of the term is quite poetic enough.

The word “pun” itself apparently stems from the verb “pound” as in “consolidating earth”. Perhaps anything is polymorphic when you pound it into a protocol 🙂 (Nil points for that pun!)

---

<div class="post-metadata">

### Author: ![tyohDeveloper](https://clojureverse.org/user_avatar/clojureverse.org/tyohdeveloper/32/2175_2.png) [@tyohDeveloper](https://clojureverse.org/u/tyohDeveloper)
#### Post date: [September 19, 2019, 4:17pm UTC](https://clojureverse.org/t/origins-of-the-phrase-nil-punning/4329/6 "2019-09-19T16:17:32Z")

</div>

When I first used McCcarthy’s lisp, we used nil in place of false. It took up two bytes less. Or we were just lazy.

I still use it for punting a result. Languages like Scala, Rust, and others are very proud to have Option or the like. Somehow they convince themselves that it is safer. I have yet to see code where it did anything more than take three lines of code for every semantic statement. Nil isn’t as useful as a non-signaling error return value. When you need one of those, you need a very domain specific error handling. In which case neither approach is appropriate.

The only time I’ve found the phrase useful is if the conversation is talking explicitly about the topic. It’s pretty much like air, you don’t think of it unless you stop breathing.

---

<div class="post-metadata">

### Author: ![system](https://clojureverse.org/uploads/default/original/2X/5/51079bf9e4b7d9466242c06cf1e43b9f8bd6da14.png) [@system](https://clojureverse.org/u/system)
#### Post date: [March 20, 2020, 4:21am UTC](https://clojureverse.org/t/origins-of-the-phrase-nil-punning/4329/7 "2020-03-20T04:21:15Z")

</div>

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
