jeudi 31 mai 2018

Is it possible to have a list of patterns and exp applied to match?

I wanna use the function match in racket to get the first element for which exp0 gives a true.

(define mylist '(['c c] ['a a] ['* *]))

(match '* mylist))

But that doesn't work. It throws an error "expected a clause with a pattern and a result". How to achieve it then?

Best

Aucun commentaire:

Enregistrer un commentaire