[CONTRIB-102] clojure.contrib.core/-?> (and perhaps others?) have a quoting bug Created: 07/Dec/10 Updated: 09/Jan/11 |
|
| Status: | Open |
| Project: | Clojure-Contrib |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Defect | Priority: | Major |
| Reporter: | Jason Wolfe | Assignee: | Laurent Petit |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
1.2 and 1.3 |
||
| Attachments: |
|
| Patch: | Code |
| Approval: | Test |
| Description |
|
See: https://groups.google.com/group/clojure/browse_frm/thread/cc88ca26352bc604?hl=en# When called via a namespace-qualified symbol and given three or more arguments, -?> gives the error: user=> (clojure.contrib.core/-?> 1 inc inc) |
| Comments |
| Comment by Alan Malloy [ 07/Dec/10 11:27 PM ] |
|
Root cause is in clojure.contrib.core/defnilsafe, so similar functions like .?. will have the same problem. I futzed around for a while to try and figure it out, but defnilsafe is a little too meta for me. The problem is, predictably enough once you've glanced at the code, with ~'~nil-safe-name. The general solution ought to look like But I couldn't make it quite work. |
| Comment by Laurent Petit [ 08/Dec/10 2:14 AM ] |
|
Patch added. Simple patch where I specifically use fully qualified names when calling defnilsafe. |
| Comment by Alan Malloy [ 09/Jan/11 4:23 AM ] |
|
What about this patch instead? It makes sure to resolve the symbols supplied to defnilsafe while still within the c.c.core namespace. I also made the arglists a bit less ugly. |