synonyms

Mark Wieder ahsoftware at sonic.net
Thu Jun 29 15:13:38 EDT 2017


On 06/29/2017 09:57 AM, Alex Tweedly via use-livecode wrote:
> Mark,
> 
> are you trying to allow mixing of positional and named actual parameters ?

Exactly.

> 
> In your example, is "This is a chart" the actual parameter for the first 
> or second positional parameter ?
> 
> Would it not be less confusing to expect (as Python does) that non-named 
> parameters must come first in the actual usage, so they can be 
> unambiguously allocated to the correct parameter place ?
> 
> [  i.e. SyntaxError: non-keyword arg after keyword arg ]

Don't know about the 'less confusing' part, but otherwise ruby lets you 
interleave them: if there's an associated name with a parameter then 
that parameter gets assigned to that variable. Otherwise you have to 
work with the parameter position, which IMO is less intuitive, more 
error-prone, and harder to read and maintain. I wouldn't object to using 
python's restriction, but I don't think it's necessary. Given that 
parameters are comma-separated, it's a simple change to the script 
parser to allow this (not that I expect this will ever happen).

-- 
  Mark Wieder
  ahsoftware at gmail.com




More information about the use-livecode mailing list