At 0:17 +0200 21/9/04, Frank Heckenbach wrote:
I agree with the semantics, but as you might remember, we had such a discussion, and I expressed my concerns about that syntax:
Yes, I wasn't trying to reopen the debate on that issue.
BTW, is `nil := ...' MW syntax?
No no, that is just something I made up, its always seemed to me to be the most applicable syntax since nil is such a recognizable thing.
Does MW support macros with arguments? If so, you could on the MW side define a macro `Discard (foo)' that expands to `nil := (foo)'.
No, MW does not have any such facility either.
BTW, I do use "attribute( ignorable )" on function definitions where appropriate.
Ignoring it would be fine, preferably not only in Mac mode, it would need its own switch or pedantic would be fine by me (I don't generally use Mac mode as such even though it is Mac specific because I want to access the general GPC facilities in as GPC a manner as possible). Ignoring {$unused} should be safe for anything other than pedantic mode since other than leading to a possible source compatibility issue, it can't do any real damage since it only hides a warning and if it is ignored by GPC it will just mean the warning is displayed again...
OK. Do we still need this if we add `Discard'?
Yes, because Discard could not be implemented in MW (at least I don't see any way to do it with a Macro that would make the equivalent of {$unused}.
The original problem was to support specifying parameters as unused in a way that is source code compatible between MW and GPC. As I sated, I can specify a parameter as being unused in GPC using "attribute ( unused);" and use a define that expands to "attribute ( unused );" in GPC and nothing in MW. But I can only do this in MW by using {$unused(paramname)} which I cannot "hide" from GPC since I can't use a macro to expand to a pragma.
BTW, a future GPC version might allow macros that expand to compiler-directives, but AFAICS this wouldn't help here since you'd need this on the MW side where it apparently isn't possible.
Correct.
The nice thing about GPC is it is still in development, so essentially for any code compatibility between GPC and MW, GPC is the only place to turn. I don't mind adjusting my source code (as long as it is not too hideous), I just need some way to write code that is source compatible.
Thanks, Peter.