Welcome! Please see the About page for a little more info on how this works.

0 votes
in Clojure by

The recurMismatches vector in LetExpr parser as see in

https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L6062-6065

There is not necessary to add initialize value 'false' into it when it is not a loop expression.

We can rewrite it into:

`

		if(isLoop)
		    {
			for (int i = 0; i < bindings.count()/2; i++)
			    {
			    recurMismatches = recurMismatches.cons(RT.F);
			    }				
		    }

`

It's a little improvement for parsing let expression.

3 Answers

0 votes
by

Comment made by: jafingerhut

Dennis, you might want to clarify the description a little bit, if I understand this ticket correctly. The proposed change would be no change to the behavior of the compiler, except a small speed improvement during compilation?

0 votes
by

Comment made by: killme2008

Yep,the patch doesn't change the behavior of the compiler.All test is fine.

The recurMismatches vector in LetExpr parser as see in

https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L6062-6065

is only used when detecting type mismatch for loop special form,it's not necessary to be initialized for let special form.So i just added a if(isLoop) clause before initializing it.

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJ-1521 (reported by killme2008)
...