From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 110292,45b50f14dadfce5b X-Google-Attributes: gid110292,public X-Google-Thread: 1164f8,45b50f14dadfce5b X-Google-Attributes: gid1164f8,public X-Google-Thread: 102b75,45b50f14dadfce5b X-Google-Attributes: gid102b75,public From: William Clodius Subject: Re: Final kick at the "Merced Guessing Game" Date: 1997/10/08 Message-ID: <343BA412.167E@lanl.gov>#1/1 X-Deja-AN: 278723140 References: <612k6f$i79@news-rocq.inria.fr> <619nmn$4jv$1@goanna.cs.rmit.edu.au> <34392537.AA4A9F96@tonys.ecology.umn.edu> <61c9kl$94l$1@goanna.cs.rmit.edu.au> <343AAA16.41C6@lanl.gov> Organization: Los Alamos National Lab Newsgroups: comp.sys.intel,comp.arch,comp.sys.dec Jan Vorbrueggen wrote: > > William Clodius writes: > > > F90 also lacks pointers to procedures. > > Is that true? Then it isn't a superset of F77 anymore. Or is the way you can > pass the address of a function or subroutine in F77 not a pointer to a > procedure? > 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. In priciple in F90 terms you want something like INTERFACE FUNCTION A(x) REAL :: A, x END FUNCTION A FUNCTION B(x) REAL :: A, x END FUNCTION B END INTERFACE INTERFACE(A), POINTER ::C ! define a pointer that accepts real arguments ! and returns real results IF ... THEN C => A ELSE C => B ! All subsequent invocations of C actually invoke B ENDIF ... y = C(z) ! Invokes A or B 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. -- William B. Clodius Phone: (505)-665-9370 Los Alamos Nat. Lab., NIS-2 FAX: (505)-667-3815 PO Box 1663, MS-C323 Group office: (505)-667-5776 Los Alamos, NM 87545 Email: wclodius@lanl.gov