Re: [Plastic-devs] Casting problems (was Re: Plastic and Aladin)
Brought to you by:
johndavidtaylor,
thomasboch
|
From: John T. <jon...@gm...> - 2006-05-05 05:44:43
|
It would be tricky for the hub to do the casting as it doesn't have any idea what the messages mean...so doesn't know what the argument types should be. One way for you guys to get around this would be to agree that your arguments are all Strings rather than Doubles or whatever, so the client has the job of then converting them into an appropriate numeric type. Alasdair Allan wrote: > All, > > I thought this was at the point where it should go to the list... > > For context I was having problems getting Aladin to respond to some, > but not all, pointAtCoords messages sent from my Perl client via the > Hub. Most were successful, but some failed for no apparent reason... > > Thomas Boch wrote: >> Alasdair Allan wrote: >>> Alasdair Allan wrote: >>>> The 20 & 75 is correct and is the requested RA&Dec is decimal >>>> degrees (ie RA 1:20:00.0, Dec 75:00:00)... >>> >>> Ah ha! It's a casting problem, Perl is of course a non-strictly >>> typed language. So when it seems 20.0, it just drops the .0 portion, >>> so the 20.0 getting sent (as a double) to the Hub turns into a >>> Integer, so Aladin isn't happy. When I explicitly cast it as a >>> double everything is fine (which explains why it was working >>> sometimes and not others)! >> >> You are right, Aladin complains with a ClassCastException as it is >> waiting for a Double ! I wonder if the hub shouldn't take care of >> this kind of casting problems ... > > Now there's a thought, it would certainly improve interoperability. > More work on the Hub end though... > >> I mean : it would of course add complexity on the hub side, but Perl >> developpers don't want to explicitly cast, do they ? > > No, it's actually a real pain in the backside to do casting and there > is the odd corner case where it isn't going to work. For instance I've > yet to figure out how to actually cast to a bool so I can send back a > true/false response to a message (just sending a a1 or a 0 doesn't > seem to cut it and Perl doesn't have a boolean type at all). Ho hum... > > Cheers, > Al. > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache > Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Plastic-devs mailing list > Pla...@li... > https://lists.sourceforge.net/lists/listinfo/plastic-devs > |