PasteRack.org
Paste # 54196
2018-01-10 19:49:42

Fork as a new paste.

Paste viewed 34 times.


Embed:

Struct match

  1. #lang racket
  2.  
  3. (struct dot (x y))
  4.  
  5. (define (match-element element value)
  6.   (match value
  7.     [(struct element (p)) p]))
  8.  
  9. (match-element dot (dot 1))

=>

eval:3:0: match: element does not refer to a structure

definition

  at: element

  in: (struct element (p))

match-element: undefined;

 cannot reference an identifier before its definition

  in module: 'm