How can I recursively move the middle of a 3-element list to the front of the list? There are nested lists.
So,
((not #f) iff (((#f implies #t) and #t) or #f))
Should become
(iff (not #f) (or (and (implies #f #t) #t) #f))
How can I recursively move the middle of a 3-element list to the front of the list? There are nested lists.
So,
((not #f) iff (((#f implies #t) and #t) or #f))
Should become
(iff (not #f) (or (and (implies #f #t) #t) #f))
It's a really good use of
match
because we can set a condition for the 3-element list and simply ignore the other cases -@PetSerAl catches a bug in the comments. Here's the fix -