Re: Idea for 'documenting' unused values
- Posted by "Juergen Luethje" <j.lue at gmx.de> Jul 24, 2004
- 511 views
Derek Parnell wrote: > irv mullins wrote: >> >> Mike Nelson wrote: >>> >>> Derek's idea of an ignore() procedure is excellent in terms of being >>> self-documenting. If it were implemented in the interpreter, the overhead of >>> the procedure call could be optimized away, just as is done for then >>> platform() function. >> >> Perhaps I misunderstand the problem, but isn't this about unused parameters >> (which must nevertheless be included as placeholders) causing warnings? > > No. It is *also* about unused function return values, not just unused > parameters. > >> If that is the case, then Euphoria should provide a dummy type to be used >> as a placeholder, one which wouldn't generate the warning. Should be >> easy to implement. > > I guess you mean something like ... > > procedure Click_Button(integer self, ignore, ignore) > . . . > end procedure > > > This is a nice idea too. Agreed, very nice and straightforward. To make this even more self-documenting, I think I would prefer something like this: procedure Click_Button(integer self, ignore event, ignore parms) . . . end procedure I believe this would also require less changes in the Euphoria parser. > We could expand it to something similar for > function returns... > > void = FuncA() Maybe the same reserved word could be used to serve this purpose? ignore = FuncA() For me as a layman, it looks as if changes in the Euphoria syntax like these are rather easy to implement. Maybe we can see them already in Eu 2.5? Regards, Juergen