Thank you for finding these anomolies!

> user=> (-<> 0 [1 <> <>])
> [1 0]
>
>
This case is undefined behavior because only one <> point is allowed.



> user=> (-<> 0 {1 <> 2 <>})
> IllegalArgumentException No value supplied for key: 2
>  clojure.lang.PersistentHashMap.createWithCheck (PersistentHashMap.java:89)
>
>
Again, only one <> point is allowed.  So undefined behavior is expected
behavior in that case.



> user=> (-<> 0 {<> 1})
> CompilerException java.lang.RuntimeException: Unable to resolve symbol: <>
> in this context, compiling:(NO_SOURCE_PATH:16)
>
>
This is an interesting use case I hadn't considered.  I will play around a
bit with that and try to find out why it doesn't just work.

user=> (-<> 0 '(<>))
> (<> 0)


user=> (-<> 0 [<>])
> CompilerException java.lang.RuntimeException: Unable to resolve symbol: <>
> in this context, compiling:(NO_SOURCE_PATH:24)


These two are an interesting case that *should* be valid (I know why this
one wouldn't work because of how I wrote it, easily fixable).  I just
hadn't thought of that.

;; I guess this one is expected, although it would be nice if it worked.

user=> (-<> 0 '(1 (1 <>)))
> (1 (1 <>) 0)


This is invalid.  I guess it would be nice but walking the form would
complicate matters. :)

Thanks again for finding the two issues mentioned above!

Rob

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to