SAMP MType parameters issue

Mark Taylor m.b.taylor at bristol.ac.uk
Tue Nov 11 02:55:41 PST 2008


Luigi and others,

I'm sorry to act indecisive on this, but having thought about it
a bit further, I'm inclined to agree with Mike that I don't support
this proposal after all.

It presents a somewhat untidy, and otherwise unnecessary, restriction
on the details of the map which is used for specifying MType parameters
(at present this is just a normal SAMP map).

Even as far as the Python goes, there is a problem with the proposed
usage:

On Fri, 7 Nov 2008, Luigi Paioro wrote:
> In oder to send a notification message with SAMPy/Python using the standard 
> SAMP API I would write something like:
>
> hub.notifyAll("my-client-pkey", {"samp.mtype": "table.load.votable", 
> "samp.params": {"url": "file:///path/of/a/votable", "table-id": "1234abcd"}})
>
> while using a more "Pythonic" API (which would be pertinent only in SAMPy) 
> the same operation would be:
>
> cli.enotifyAll("table.load.votable", url="file:///path/of/a/votable",
> table-id="1234abcd")

the pythonic function you suggest would presumably have a signature
like this:

    def enotifyAll(mtype, **params)

and one consequence of this is that it would be impossible to invoke
this function in such a way as to send a message with an MType parameter
named "mtype".  So do we need to define the parameter BNF in such a 
way as to exclude the name "mtype" or some other similar reserved word?
Functions such as call() and callAll() will have additional named
parameters which might cause confusion.  So I actually think that the
earlier ("less pythonic") example above, which more closely matches
the structure of the invocation being made, is likely to lead to less 
confusion in use.

Also, as I said before, I'm generally against making changes to the
standard for the convenience of particular languages.

Does anyone else want to revise or restate their opinion in light
of futher consideration?

Mark

-- 
Mark Taylor   Astronomical Programmer   Physics, Bristol University, UK
m.b.taylor at bris.ac.uk +44-117-928-8776 http://www.star.bris.ac.uk/~mbt/



More information about the apps-samp mailing list