This is a rollup of some minor fixes that have been on my back burner. I figured it was easiest to put them in a single pull request.
Attributes.updated and the variadic Attributes.+ now return an Attributes rather than a Map. They also use the same trick as unary + to get the benefit of the (String, String) => (QName, String) conversion.
Attributes is now always backed by an order-preserving map. Prior to this change, it was possible to bypass the companion object and construct an Attributes with an arbitrary delegate map. The old constructor still exists for the sake of passivity, but it is deprecated and it copies it's argument to an order-preserving map.
Zipper.withFilter now preserves the zipper context. The v0.2 Zipper supported this, but we forgot to add it to the new one.
All calls to error have been changed to sys.error, which gets rid of all of our deprecation warnings.
Elem no longer caches its hashcode. This isn't needed anymore and removing it improves the 7MB load time by 10 to 20 percent. (@ncreep - I know we'll soon be checking for duplicate paths again, but it should now be easy to make the test based solely on location. That's probably a more accurate test anyway.)
For the sake of full disclosure, #1 does introduce a minor compile-time passivity break. Namely, if attrs is an Attributes, you can no longer write:
attrs + ("key","value")
Instead, you must write:
attrs + (("key","value"))
Map behaves the same way; Attributes was only more permissive because it didn't override variadic +, which caused the compiler to give greater weight to the unary +. But I'm assuming that was unintentional :-)
Code compiled against the old version of Attributes will still be able to run against the new version; the issue only arises at compile time.
This is a rollup of some minor fixes that have been on my back burner. I figured it was easiest to put them in a single pull request.
Attributes.updated
and the variadicAttributes.+
now return an Attributes rather than a Map. They also use the same trick as unary+
to get the benefit of the(String, String) => (QName, String)
conversion.Attributes
is now always backed by an order-preserving map. Prior to this change, it was possible to bypass the companion object and construct anAttributes
with an arbitrary delegate map. The old constructor still exists for the sake of passivity, but it is deprecated and it copies it's argument to an order-preserving map.Zipper.withFilter
now preserves the zipper context. The v0.2 Zipper supported this, but we forgot to add it to the new one.error
have been changed tosys.error
, which gets rid of all of our deprecation warnings.Elem
no longer caches its hashcode. This isn't needed anymore and removing it improves the 7MB load time by 10 to 20 percent. (@ncreep - I know we'll soon be checking for duplicate paths again, but it should now be easy to make the test based solely on location. That's probably a more accurate test anyway.)For the sake of full disclosure, #1 does introduce a minor compile-time passivity break. Namely, if
attrs
is anAttributes
, you can no longer write:Instead, you must write:
Map
behaves the same way;Attributes
was only more permissive because it didn't override variadic+
, which caused the compiler to give greater weight to the unary+
. But I'm assuming that was unintentional :-)Code compiled against the old version of Attributes will still be able to run against the new version; the issue only arises at compile time.