I have a Racket list with some values (list 'foo 'bar 2 #t 42 9 2 'some) . In fact, these values ββfollow some more specific patterns, but for the question it does not matter. I want to test a test if there are two identical values ββin the list, in this case the number 2 and get the element and other elements. This is my attempt:
#lang racket (match (list 'foo 'bar 2 #t 42 9 2 'some) [(list-no-order aa rest ...) "Do some stuff"] [_ "Do some other stuff"])
Sample (list-no-order aa rest ...) . But the interpretation of the program is not performed:
a11: unbound identifier; also, no
For me, this looks like an error when converting a macro. If you change list-no-order to list , then the template works, but, of course, only if the items are at the top of the list.
Is my template wrong, if so, how can I fix it, or is it impossible, and how can I get around it in the best way?
source share