2 Sep 23:25
Re: Number handling in RPCs
Andrew Plotkin <erkyrath <at> eblong.com>
2005-09-02 21:25:38 GMT
2005-09-02 21:25:38 GMT
On Fri, 19 Aug 2005, Doug Orleans wrote: > Andrew Plotkin writes: > > * First case: we accept that RPCs coming from the client will never > > contain <int> values. I tweak my Python referee code to convert floats to > > ints where possible (before type-checking occurs). > > On second thought, I think I prefer this solution. If we're going to > enforce (or strongly encourage) UIs to be written in ECMAScript, we > should use its type system as the type system of rulesets, and let > everything else deal with that. And frankly I favor type systems > where numbers are just numbers and you don't have to care about the > internal representation. > > Or actually, I think I would prefer a more general solution: any > parameter or return value that is defined by the ruleset to be a > "number" may either be an <int> or <double> in the Jabber-RPC payload, > and clients and referees must be able to handle both as input (but can > choose to output either one). This gives implementations a little > more leeway, so they could send <int>s if they really wanted to. Or > maybe it would be simpler to just discard the <int> type altogether. I > don't have a strong opinion about this at the moment. Getting back to this: I have updated the wiki to explain that clients may send numbers as either <int> or <double> (whether they're sending RPC method arguments or replies). I've updated my Python ref code to accomodate this. As I understand it, the Perl ref code shouldn't need updating. I did not make the same claim about other channels (anybody -> client,(Continue reading)

RSS Feed