[racket] Make printer abbreviate unquote at the end of a list

From: Laurent (laurent.orseau at gmail.com)
Date: Tue Jun 17 11:11:53 EDT 2014

Click on the button in the bottom left corner of DrRacket, then on "Show
details", then select another printing style.

Here are some differences between the 4 styles:

#lang racket
(struct A (x y) #:transparent) ; for the examples below

(list 'xxx '(5 . ,a) (vector 'a 'b) (A 2 3))

; constructor
; (list 'xxx (list 5 'unquote 'a) (vector 'a 'b) (A 2 3))

; quasi-quote
; `(xxx (5 ,'unquote a) #(a b) ,(A 2 3))

; write
; (xxx (5 . ,a) #(a b) #(struct:A 2 3))

; print
; (list 'xxx '(5 unquote a) '#(a b) (A 2 3))

Personally, I generally use the "write" style. I wonder what other people
prefer.

Laurent


On Tue, Jun 17, 2014 at 4:40 PM, Jason Hemann <jhemann at umail.iu.edu> wrote:

> Hi,
>
> How do I make Racket's printer abbreviate unquote at the end of a list?
> See the difference in behavior between racket and petite chez below.
>
> bash-3.2$ petite
> Petite Chez Scheme Version 8.3
> Copyright (c) 1985-2011 Cadence Research Systems
>
> > '(5 . ,a)
> (5 . ,a)
> >
> bash-3.2$ racket
> Welcome to Racket v6.0.1.
> > '(5 . ,a)
> '(5 unquote a)
> >
>
> Thanks,
>
> JBH
>
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140617/fdcf3efb/attachment-0001.html>

Posted on the users mailing list.