News for hackers. Stuff that matters.
Re:Differences with other Lisps by linguae on Wednesday November 03, 2021 @03:01AM (#29091834)
Racket also optionally supports a square bracket syntax for cons clauses.

For example, in traditional Scheme one would write:

  ; this is in R5RS Scheme
  (define (length elems)
    (cond ((null? elems) 0)
          (else (+ 1 (length (cdr elems))))))
But in Racket one would write:

  ; this is in Racket
  (define (length elems)
    (cond [(empty? elems) 0]
          [else (+ 1 (length (rest elems)))]))
It is also used in let/let*/letrec bindings in Racket; see https://docs.racket-lang.org/guide/syntax-overview.html#%28p....

I don't know the origins of when brackets started appearing in Lisps. I don't remember seeing brackets in the LISP 1.5 Programmers Manual when using S-expressions (though brackets are a core part of M-expression syntax, which LISP 1.5 still supported), and I haven't encountered brackets in Common Lisp.

Re:Differences with other Lisps by tralarpa on Wednesday November 03, 2021 @03:55AM (#29092086)
> It is also used in let/let*/letrec bindings in Racket

I suppose this is just a personal choice of the author of the manual, right? Please correct me if I am wrong but I thought Racket doesn't care whether you use brackets, parentheses, or even curly brackets.

Re:Differences with other Lisps by rawoke083600 on Wednesday November 03, 2021 @03:06AM (#29091865)
Interesting ! Thank you for the examples. Yes Racket is also on my someday-soon-list !