We're updating the issue view to help you get more done. 

Evaling #{do ...} or [do ...] is treated as the do special form

Description

Problem: Evaluating a persistent collection for which the function first returns the symbol do leads to that collection being treated as the do special form, even though it may be a vector or even a set. IMHO, the expected result would be to report that do cannot be resolved.

1 2 3 4 5 6 [do 1 2] ;=> 2 #{"hello" "goodbye" do} ;=> "hello" ; Wat?

Cause: The check for do is checking for IPersistentCollection instead of ISeq.

Solution: Change the cast (occurs in two places) for the do form check from IPersistentCollection to ISeq:

1 if(form instanceof IPersistentCollection && Util.equals(RT.first(form), DO))

to

1 if(form instanceof ISeq && Util.equals(RT.first(form), DO))

Current patch: CLJ-1184-p4.patch

Screened by: Alex Miller

Environment

None

Status

Assignee

Unassigned

Reporter

Jirka Maršík

Labels

Approval

Ok

Patch

Code and Test

Fix versions

Affects versions

Release 1.5

Priority

Trivial