1. hypocrite's reply
- Posted by "BABOR, JIRI" <J.Babor at GNS.CRI.NZ> Sep 21, 1998
- 502 views
> discard = { x, y, discard } So it is not a joke. Read it again, Ralf. And tell the old hypocrite (me!) what the line is really meant to do. To create an artificial fog? jiri
2. Re: hypocrite's reply
- Posted by Ralf Nieuwenhuijsen <nieuwen at XS4ALL.NL> Sep 21, 1998
- 491 views
>> discard = { x, y, discard } > >So it is not a joke. Read it again, Ralf. And tell the old hypocrite (me!) what the line >is really meant to do. To create an artificial fog? jiri Ok, this was a bad, useless example. First of all, the reason I want a discard variable is, so Euphoria can speed things up for those cases Im not gonna use the result of an expression, or more logically a function call. However, when a function is called merely for its side-effects, and not the return value, there could be arguments that are only used to gain the result value. Such arguments can be discarded as well. sequence list list = {} function my_func (integer x, integer y, object z) list = append(list, {x,y}) return x*y*z end function discard = my_func (3, 23, discard) *legal* discard = my_func (discard, 3, {2,3}) *crash* .. side effect no longer possible Ok, recondiring this, it isnt very clean, still an discard variable for assignment to speed things up, which also halts your program if you accidently do use the value of discard in an expression, is something I would like to see in some release of Euphoria. And I dont have to explain the speed gain. In the above example the interpreter can skip the calculation of the return value for example. It would be one of the more complex things to add to the preproccesor inside ex.exe though. Ralf