From fed2e90c3dc8294434230f1a369ae90f433d3014 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Tue, 23 Jan 2018 17:07:52 -0500 Subject: [PATCH] WIP --- match-simple.scm | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/match-simple.scm b/match-simple.scm index 9061f553..508239ad 100644 --- a/match-simple.scm +++ b/match-simple.scm @@ -161,10 +161,41 @@ ;(display (tst "gehtdurch")) ;(display (tst 42)) +;(display (match-one '(a . b) (? pair? x) 1 0)) (display (match - '(a . b) ;;"test" - ((? pair? x) x) + "test" + ;'(c . d) ;;"test" + ;((? pair? x) x) ((? string? x) x) (_ 'no-match) )) + ;; Expanded version of above, what is going on? + (display + ((lambda (tmp$1539$1543) + ((lambda (fail$1534$1545 fail$1537$1544) + (set! fail$1534$1545 (lambda () 'no-match)) + (set! fail$1537$1544 + (lambda () (error "no matches" tmp$1539$1543))) + (if (string? tmp$1539$1543) + (if (pair? tmp$1539$1543) + ((lambda (tmp1$1558$1559) + ((lambda (abracadabra$1561$1612) + ((lambda (tmp2$1555$1608$1613) + (if (if (pair? tmp2$1555$1608$1613) + (null? (cdr tmp2$1555$1608$1613)) + #f) + ((lambda (tmp$1617$1621) + ((lambda (abracadabra$1623$1670) + abracadabra$1623$1670) + tmp$1617$1621)) + (car tmp2$1555$1608$1613)) + (fail$1534$1545))) + (cdr tmp$1539$1543))) + tmp1$1558$1559)) + (car tmp$1539$1543)) + (fail$1534$1545)) + (fail$1534$1545))) + #f + #f)) + "test"))