Re: Idea for 'documenting' unused values

new topic     » goto parent     » topic index » view thread      » older message » newer message

On Tue, 20 Jul 2004 06:25:21 -0700, Derek Parnell
<guest at RapidEuphoria.com> wrote:

>Any thoughts about this idea...?

Probably the best solution given the tools available. I will offer
void() or used() as alternative shorter names for the procedure, not
that I'll worry if the consensus goes against me. There is one other
thing I feel the need to mention, which is object(); an utterly,
utterly useless routine which exists only for completeness, and, if
Rob felt so inclined, could do this job with no overhead whatsoever.
Of course it requires an interpreter (etc) change, so that "object(x)"
does not complain "function result must be used or assigned".

I'm not entirely sold on that, "don't "object" if (x) is unused", but
at least it offers no unnecessary pollution of the namespace...

Actually, there may also be a third use: completely unused (and
unassigned) variables. Just occasionally, I've defined the data I know
I *will* need, but am testing before it ever gets used, and I don't
actually want a dummy init, because it may block an error path. It is
pretty damn rare though, since {} or 0 would be ok 99.9% of the time.
Just so you understand: object(x) [with *zero* overhead] kills the
warning message; y=x or somesuch would crash at runtime.
Nothing you could do for that with the current tools anyway.
Can I remind you all that I did state that it is *very* rare, and no,
I don't have an example blink Bad programming practice to boot.

Aside from all that, in the long term (in posetf) I plan to use #()=,
since that marries in with multiple assignment handling, and avoids
the overhead mentioned; obviously not [yet] available in Euphoria.

Whew, so much for a quick reply while my tea brews (stews),
Pete

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu