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

From: Jos Koot (jos.koot at gmail.com)
Date: Tue Jun 17 12:20:34 EDT 2014

I always use write-style.
When I want another format, I use my own formatter (available on planet as
planet-fmt)
Best wishes, Jos
 
PS 
 


  _____  

From: users [mailto:users-bounces at racket-lang.org] On Behalf Of Laurent
Sent: martes, 17 de junio de 2014 17:12
To: Jason Hemann
Cc: users
Subject: Re: [racket] Make printer abbreviate unquote at the end of a list


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/010e3d36/attachment.html>

Posted on the users mailing list.