From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,45b50f14dadfce5b X-Google-Attributes: gid1164f8,public X-Google-Thread: 110292,45b50f14dadfce5b X-Google-Attributes: gid110292,public X-Google-Thread: 102b75,45b50f14dadfce5b X-Google-Attributes: gid102b75,public From: schow@bnr.ca (Stanley Chow) Subject: Re: Final kick at the "Merced Guessing Game" Date: 1997/10/08 Message-ID: <61gv43$70k@bcarh8ab.bnr.ca>#1/1 X-Deja-AN: 278806346 References: <343BA412.167E@lanl.gov> Organization: Bell-Northern Research Ltd. Newsgroups: comp.sys.intel,comp.arch,comp.sys.dec In article <343BA412.167E@lanl.gov>, William Clodius wrote: > >F90 has this capability. This is typically implemented as a pointer to a >procedure and can be used to emulate some of the capabilities that you >want from pointers to procedures, but it is not an explicit pointer to a >procedure. [...] >IF ... THEN > C => A >ELSE > C => B ! All subsequent invocations of C actually invoke B >ENDIF >... >y = C(z) ! Invokes A or B I would call this "Procedure Variables" as opposed to "Pointers to Procedures". I consider procedure variables to be fairly safe (as these things go) compared to pointers to procedures. The usual need is for proc vars, and it is a vast overkill (with dangerous consequences) to force users to implement proc vars via pointers. >This is equivalent to C pointers to procedures, and is roughly what is >planned for F200x. In the most general case, you want procedures to >return pointers to procedures as values, i.e., a form of closures. This >is not currently planned. Not all closures are good. -- Stanley Chow; schow@nortel.ca, (613) 763-2831 Nortel/BNR, PO Box 3511 Station C, Ottawa, Ontario Me? Represent other people? Don't make them laugh so hard.