First of all, note that the comma is a special abbreviation for the reader. (hi,there)
reads as (hi (unquote there))
. This is difficult to determine - since the list of printers is printed by default, the first element of which is unquote
special way.
Welcome to DrRacket, version 5.3.0.14--2012-07-24(f8f24ff2/d) [3m]. Language: racket. > (list 'hi (list 'unquote 'there)) '(hi ,there)
Therefore, you need a template (list h (list "unquote t") ".
> (define s '(hi,there)) > (match s [(list h (list 'unquote t)) (list ht)]) (list 'hi 'there)
source share