PasteRack.org
Paste # 13903
2016-02-08 12:55:23

Forked from paste # 84646.

Fork as a new paste.

Paste viewed 78 times.


Embed:

  1. #lang racket
  2.  
  3. (struct myset (contents)
  4.   #:transparent
  5.   #:constructor-name make-myset)
  6.  
  7. (define (myset . as) (make-myset as))
  8.  
  9. (define ok/c (struct/c myset list?))
  10.  
  11. (values
  12.  (myset 1 2 3)
  13.  (match (myset 1 2 3)
  14.    [(myset x) x]))

=>

eval:4:0: struct/c: expected a struct identifier

  at: myset

  in: (struct/c myset list?)

eval:5:0: match: syntax error in pattern

  in: (myset x)