----- Original Message ----
From: "Martin Stjernholm, Roxen IS @ Pike developers forum" 10353@lyskom.lysator.liu.se To: pike-devel@lists.lysator.liu.se Sent: Sat, September 10, 2011 4:15:02 PM Subject: Re: Val.true and Val.false [Was: XMLRPC] (from pike@roxen.com)
How tiresome. :P
Now I see the magic_zero thingy is a workaround for the same thing. It wasn't the wisest choice to disregard any false value like that in the parser.
I think the best solution would be to fix Parser.XML.Simple.parse to use UNDEFINED as "disregard" value instead, since the current behavior clearly affects the usability.
But doing so would of course introduce another compat issue, and I don't know if a flag would be required there as well, or if we could just use the #pike compat level. I'd be somewhat in favor of the latter, but I don't really know how much that parser is used.
In any case, it wouldn't be good to extend the decoder to handle Val.true without handling Val.false as well. If you're not inclined to dig into the parser, and cannot find another passable workaround (by using another xml parser, or perhaps another way to collect the results, or something), then I think the best course is to not change anything on the decode side for now.
I agree, but I fixed it by doing the same sort of thing. I created a magic_false class that gets replaced at the end with Val.false if the compatibility flag is off, or 0 (through the normal code) if it is on.
I've tested it on 7.8, and the module.pmod file is identical with 7.9, so it should work there too. I tested some of my routines with the compat flag both on and off, and verified that I got the results I expected. Everything should be good now.