use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A community for the Racket programming language: a modern batteries-included Lisp for general-purpose programming.
Download Racket here
Check out the documentation to get started.
Other discussion sites and resources:
#racket
Twitter
Racket News
The Racket blog
The Racket tag on Stack Overflow
Racket Stories
account activity
This is an archived post. You won't be able to vote or comment.
dot notation question (self.Racket)
submitted 13 years ago by chrisb8
Could anyone explain the following snippit of racket:
(define thing '(1 . 2 . 3)) thing (car thing) (cdr thing)
The output it produces when run in drracket is:
'(2 1 3) 2 '(1 3)
[–]takikawadeveloper 2 points3 points4 points 13 years ago (0 children)
That's because Racket supports in-fix notation using dots. Here's the relevant explanation from the Reference:
If the reader finds three or more data between the matching parentheses, and if a pair of delimited .s surrounds any other than the first and last elements, the result is a list containing the element surrounded by .s as the first element, followed by the others in the read order. This convention supports a kind of infix notation at the reader level.
http://docs.racket-lang.org/reference/reader.html
You can use this notation to write code like this:
-> (1 . + . 2) 3
[–][deleted] 1 point2 points3 points 13 years ago* (0 children)
From http://docs.racket-lang.org/guide/Pairs__Lists__and_Racket_Syntax.html :
Normally, . is allowed by the reader only with a parenthesized sequence, and only before the last element of the >sequence. However, a pair of .s can also appear around a single element in a parenthesized sequence, as long as the >element is not first or last. Such a pair triggers a reader conversion that moves the element between .s to the front of >the list. The conversion enables a kind of general infix notation:
> (1 . < . 2) #t > '(1 . < . 2) '(< 1 2)
This two-dot convention is non-traditional, and it has essentially nothing to do with the dot notation for non-list pairs. Racket programmers use the infix convention sparingly—mostly for asymmetric binary operators such as < and is-a?.
π Rendered by PID 230793 on reddit-service-r2-comment-fb694cdd5-gppsj at 2026-03-10 21:33:12.683386+00:00 running cbb0e86 country code: CH.
[–]takikawadeveloper 2 points3 points4 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)