PasteRack.org
Paste # 5720
2018-01-10 20:12:40

Fork as a new paste.

Paste viewed 24 times.


Embed:

match example

  1. #lang racket
  2. (define (extract-meta-data content)
  3.   (match content
  4.          [(struct h:html-full (attributes content))
  5.           (apply append (map extract-pcdata content))]
  6.          [(struct tag-name (attributes))
  7.           (get-content-if-named attributes)]
  8.          [(struct h:html-element (attributes)) null]))

=>

eval:2:0: match: h:html-full does not refer to a structure

definition

  at: h:html-full

  in: (struct h:html-full (attributes content))