Forums

[compile warnings] unused method's param

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

Re: [compile warnings] unused method's param

Postby hopscc » Thu Jun 02, 2011 1:18 am

yes, the comparison was with decls in other places (member and local var decls).

Good point re the overloading ',' between separating islist modifier items and separating params - I missed that entirely. :oops:
Agree its reasonable/necessary to have ',' as param decl separator, desirable to continue to use as comma separated list as elsewhere.

Its not insurmountable though the options may be somewhat clumsy.
- multiple islist attributes in '()' - necessary here, optional elsewhere
Code: Select all
def method(x as String is (inout, unused), y as String is unused)

( perhaps this is acceptable given the relative lack of use for multiple items currently/so far)

- explicit terminator :cry:
Code: Select all
def method(x as String is inout, unused|, y as String is unused)
def method(x as String is inout, unused: , y as String is unused)
def method(x as String is inout, unused, stop, y as String is unused)

- whitespace significant :cry:
Code: Select all
def method(x as String is inout, unused  , y as String is unused)


The benefit of separating out attributes is it delineates language supported (or backend language translatable) attributes/modifiers ('private, shared') from environmental ('Conditional("Debug"')' ) ones which I think is valuable.
Mechanism wise I agree there's no real difference.

Re the 'is' ambiguity - I agree with the use in an expression (identity) and current use as a keyword prefix
- anyway thats totally resolved ( without a 'tie-breaker' choice) by fixing/correcting the order of clauses so that the ambiguity doesn't occur - see the latter patches under that bug report.

Dropping the 'is' keyword and commas also looks strange/retrograde/ugly to me.

I think 'is' works well for modifiers and (existing) 'has' for attributes - the problem here ( in params) is the overloading of ','
OTOH I like the comma sep list elsewhere.

Total agreement re changes for a preferred form vs supporting current syntax .
hopscc
 
Posts: 632
Location: New Plymouth, Taranaki, New Zealand

Previous

Return to Discussion

Who is online

Users browsing this forum: No registered users and 48 guests