Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uwm.edu!bionet!agate!ucbvax!CS.ARIZONA.EDU!cjeffery From: cjeffery@CS.ARIZONA.EDU (Clinton Jeffery) Newsgroups: comp.lang.icon Subject: Multiple value assignment in icon??? Message-ID: <9103190605.AA25040@cheltenham.cs.arizona.edu> Date: 19 Mar 91 06:05:09 GMT References: <1991Mar18.150838.24597@midway.uchicago.edu> Sender: daemon@ucbvax.BERKELEY.EDU Distribution: inet Organization: The Internet Lines: 27 >>Also, I hesitated somewhat at creating a co-expression just to do >>something that short that I'm likely to use quite a lot. Isn't that >>likely to be quite expensive in terms of garbage produced? Or would >>reusing the same temporary to hold it mean that reference counting or >>something rescues things? >You know, I really don't know. Co-expressions involve less overhead >than a procedure call, as I understand them, and are a bit faster. Basically everyone is right. Co-expression >activation< involves less overhead and is a bit faster than procedure call. Co-expression >creation< does involve some work setting up stacks and copying variables. In many of these situations there is some magic "average number of results" beyond which co-expressions are cost-effective. But of course, Icon is focused on programmer time more than on execution time. If you are a busy person and you are in the habit of avoiding co-expressions for performance reasons, not only will you miss out on a lot of fun, you will spend a lot more time writing and debugging, and often you will not gain enough to have justified it. Clint P.S. I have been guilty of avoiding co-expressions before! Its very understandable and really is justified, AFTER the program is finished and you are tuning it. Why not write it in two lines with a co-expression first, and write yourself a comment to look at it again later...