jed-users mailing list

[2013 Date Index] [2013 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: [Jed-users-l] () vs pop


> When I do slang coding and have functions where I do not need the
return
> value I have the two possibilities:
>
>   () = function(...);
>   pop(function(...));
>
> Is one better than the other?

The '()' syntax is obviously closer to describing what you want (ie,
discard the return value), whereas the 'pop' disguises things quite a
bit.

If you use 'pop', you also need to know how many return values to pop
from the stack. Using '()' is much more convenient and gives you the
opportunity to assign some of the return values. For example,
    variable mode;
    (mode,) = what_mode()

/mark


DISCLAIMER:
This electronic transmission (and any attachments thereto) is intended solely for the use of the addressee(s). It may contain confidential or legally privileged information. If you are not the intended recipient of this message, you must delete it immediately and notify the sender. Any unauthorized use or disclosure of this message is strictly prohibited. Faurecia does not guarantee the integrity of this transmission and shall therefore never be liable if the message is altered or falsified nor for any virus, interception or damage to your system.

_______________________________________________
Jed-users-l mailing list
Jed-users-l@xxxxxxxx
http://mailman.jtan.com/mailman/listinfo/jed-users-l


[2013 date index] [2013 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]