# C(a|d)ⁿr 1.1: Future-proofing RacketCon

**URL:** <https://racket.discourse.group/t/c-a-d-r-1-1-future-proofing-racketcon/3715>\
**Category:** Show & Tell\
**Created:** [May 3, 2025, 10:33am UTC](https://racket.discourse.group/t/c-a-d-r-1-1-future-proofing-racketcon/3715 "2025-05-03T10:33:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eutro](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/eutro/32/2275_2.png) [@Eutro](https://racket.discourse.group/u/Eutro)\
**Post date:** [May 3, 2025, 10:33am UTC](https://racket.discourse.group/t/c-a-d-r-1-1-future-proofing-racketcon/3715/1 "2025-05-03T10:33:43Z")

</div>

With `(fifteenth RacketCon)` coming up, we will once again be running out of list accessors in [`racket/list`](https://docs.racket-lang.org/reference/pairs.html#%28mod-path._racket%2Flist%29) soon. Fortunately, with the new [c(a|d)ⁿr](https://racket.discourse.group/t/c-a-d-r-car-cdr-caaaaddddr-and-everything-in-between/1876) release now providing [list accessors into the millions and beyond](https://docs.racket-lang.org/cadnr/index.html#(cadnr._numberth)), this pressing issue can finally be solved for good:

```scheme
> (require cadnr)
> (define RacketCon
    (for/list ([year (in-range twenty-eleven one-million)])
      `(RacketCon ,year)))

; --------------- before ... ---------------
> (cadddddddddddddddddddddddddddr RacketCon) ;; hmm yes, this is lovely, but...
'(RacketCon 2038); ^ 18... 19... ah! I lost count :(

; --------------- after... ---------------
> (twenty-eighth RacketCon) ;; perfect!
'(RacketCon 2038)

```

It doesn't stop there, though! The new c(a|d)ⁿr knows about all sorts of numbers and containers, even those that haven't been written yet:

```scheme
> (vector-fifth (list 1 2 3 4 5))
5
> (string-last "abcdefghijklmnopqrstuvwxyz")
          ; this one's clearly not that useful, writing out
          ; (string-ref s (sub1 (string-length s)))
          ; is far easier on the eyes
#\z
> (non-empty-vector? (vector 1))
          ; analogous to the venerable non-empty-string?
#t
> (string-empty? "")
#t

> (require math/flonum)
> (define flvec (build-flvector ten-million (compose fl add2011)))
          ; unlike sequence-ref, cadnr accessors always
          ; use type-ref for maximum performance

> (time (sequence-two-millionth flvec)) ; linear time :(
cpu time: 45 real time: 46 gc time: 5
2002010.0

> (time (flvector-two-millionth flvec)) ; constant time! :)
cpu time: 0 real time: 0 gc time: 0
2002010.0

```

Read the [documentation](https://docs.racket-lang.org/cadnr/index.html), and try it out today!

---

<div class="post-metadata">

**Author:** ![spdegabrielle](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/spdegabrielle/32/95_2.png) [@spdegabrielle](https://racket.discourse.group/u/spdegabrielle)\
**Post date:** [May 4, 2025, 11:09pm UTC](https://racket.discourse.group/t/c-a-d-r-1-1-future-proofing-racketcon/3715/2 "2025-05-04T23:09:44Z")

</div>

![jay gatsby toast gif](https://global.discourse-cdn.com/free1/uploads/racket/original/2X/3/3f613afafb188dd457285e5052ec26e512c77d7a.gif)

Thank you. I will certainly use this to promote [`(fifteenth RacketCon)`](https://con.racket-lang.org) 😄

Did you see [RacketCon 2025: Call for Presentations](https://racket.discourse.group/t/racketcon-2025-call-for-presentations/3718) ?

:beetle:
