indentation and comments
This commit is contained in:
parent
6ba33d1710
commit
041c8d8bbf
1 changed files with 6 additions and 6 deletions
|
|
@ -11,7 +11,7 @@
|
||||||
stack ; we've got an incomplete chunk. return the stack
|
stack ; we've got an incomplete chunk. return the stack
|
||||||
(let ([x (first input)] [xs (rest input)]) ; grab the first element of the input
|
(let ([x (first input)] [xs (rest input)]) ; grab the first element of the input
|
||||||
(if (member x opening) ; if it is an opening bracket
|
(if (member x opening) ; if it is an opening bracket
|
||||||
(go xs (cons x stack)) ; push it on the stack
|
(go xs (cons x stack)) ; push it on the stack and recurse
|
||||||
(let* ([y (first stack)] ; otherwise, it's a closing bracket. grab the top of the stack..
|
(let* ([y (first stack)] ; otherwise, it's a closing bracket. grab the top of the stack..
|
||||||
[matching (second (assoc y pairs))]) ; and find its matching closing bracket
|
[matching (second (assoc y pairs))]) ; and find its matching closing bracket
|
||||||
(if (equal? matching x) ; if they match..
|
(if (equal? matching x) ; if they match..
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue