Skip to content

Commit

Permalink
Shorter lines.
Browse files Browse the repository at this point in the history
  • Loading branch information
axch committed May 23, 2013
1 parent 7e4b072 commit 182a232
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions patterns.scm
Original file line number Diff line number Diff line change
Expand Up @@ -252,15 +252,15 @@
;;; last submatcher in the pattern and, if it's a segment variable,
;;; arranges for it to avoid its search.
(define (list-pattern->combinators pattern)
(define (last-list-submatcher subpattern)
(if (match:segment? subpattern)
(segment-matcher! (match:element (match:variable-name subpattern) '()))
(match:->combinators subpattern)))
(define (last-list-submatcher subpat)
(if (match:segment? subpat)
(segment-matcher! (match:element (match:variable-name subpat) '()))
(match:->combinators subpat)))
(if (null? pattern)
(match:eqv '())
(apply match:list
(append (map match:->combinators (except-last-pair pattern))
(list (last-list-submatcher (car (last-pair pattern))))))))
`(,@(map match:->combinators (except-last-pair pattern))
,(last-list-submatcher (car (last-pair pattern)))))))

(new-pattern-syntax! match:list? list-pattern->combinators)

Expand Down

0 comments on commit 182a232

Please sign in to comment.