Language neutrality

Alasdair Allan aa at astro.ex.ac.uk
Thu May 1 15:24:08 PDT 2008


>> An issue about language neutrality. You have the method names of  
>> the form;
>>
>> samp.hub.isAlive( )
>>
>> in the XML-RPC mapping of the Standard Profile. This is of course  
>> very Java-centric.
>
> That's a bit harsh - you can't have a method name with a full stop  
> in Java either.

Yes, alright, a bit harsh. I'd just got to the "oh no, more full  
stops" bit in the code.

> The intention is namespace delimitation, so if I'd had my (somewhat  
> rusty) Perl head on when deciding this bit it would have looked  
> something like Samp::Hub::isAlive(), which I suspect is still not a  
> valid Perl method name.

It is, but not when called via XMLRPC.

> I always thought that Perl's quoting mechanisms were under- 
> powered :-).

;)

> If I understand what you're talking about correctly, auto-dispatch  
> is some kind of syntactic sugar - you're not saying that you can't  
> make these XML-RPC invocations, just that those periods make it  
> harder to write your entire hub implementation...

Yup it's syntactic sugar, but I've just managed to work round this in  
a semi-elegant way. Although language purists will throw up their  
hands in horror and throw ripe tomatoes from the roof tops when they  
see it I think...

> ...in a single line of Perl.


Hey! I resemble that remark.

Actually I'm being careful and doing a nice object orientated job of  
work (since I'm guessing there might actually be a market for this  
thing) as opposed to my PLASTIC code which has always been a bit on  
the hack and slash side of the fence (since I never got round to  
writing those base classes   I always promised to do).

> As I say the intention is namespacing - the thinking being that you  
> might want to run a single XML-RPC server which offers a SAMP hub  
> or SAMP client (or both) along with some other completely unrelated  
> services, and so it's good practice to avoid using XML-RPC  
> methodNames which might be in use for some other purpose.

Makes sense...

> In practice - that's not very likely, so removing the namespacing  
> altogether would probably not hurt.

Nooooo, but I can see why its this way. Is this going to cause  
problems elsewhere? I don't think so, but...

Al.



More information about the apps-samp mailing list