Message from discussion
CONTAINS problem
Received: by 10.180.84.74 with SMTP id w10mr103492wiy.4.1349754044005;
Mon, 08 Oct 2012 20:40:44 -0700 (PDT)
MIME-Version: 1.0
Path: q11ni134243540wiw.1!nntp.google.com!feeder2.cambriumusenet.nl!feeder1.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.85.MISMATCH!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newspeer1.nac.net!news.mi.ras.ru!goblin-spool!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail
From: glen herrmannsfeldt <g...@ugcs.caltech.edu>
Newsgroups: comp.lang.fortran
Subject: Re: CONTAINS problem
Date: Tue, 2 Oct 2012 22:19:27 +0000 (UTC)
Organization: Aioe.org NNTP Server
Lines: 28
Message-ID: <k4fp9f$a8n$1@speranza.aioe.org>
References: <k4e7cc$bk2$1@dont-email.me> <k4e7mv$ef6$1@dont-email.me> <817ae7eb-83b6-4f47-8f38-d4b6689aac28@kg10g2000pbc.googlegroups.com> <6adbe8dc-e0ab-4510-8227-0aa2458adea8@googlegroups.com> <k4fl2t$jru$1@dont-email.me>
NNTP-Posting-Host: 0usSS01PZ8AI54GFz6in7A.user.speranza.aioe.org
X-Complaints-To: abuse@aioe.org
User-Agent: tin/1.9.6-20100522 ("Lochruan") (UNIX) (Linux/2.6.32-5-amd64 (x86_64))
X-Notice: Filtered by postfilter v. 0.8.2
James Van Buskirk <not_va...@comcast.net> wrote:
(snip on internal functions)
> The function can be invoked from program units other than the host
> or its sibling internal procedures in f2008, by pointing a Fortran
> procedure pointer at it or taking its C_FUNLOC and passing one of
> those or the function itself as an actual argument to another
> procedure. This can be useful because it allows a program to
> spawn different versions of the function that can have access to
> different instances of the host (for a recursive host).
> For other purposes I generally think internal procedures aren't
> all that useful, except perhaps as a substitute for statement
> functions. After all, if the function were that useful, wouldn't
> it make sense to make it another module procedure so all program
> units could have direct access to it?
Personally, I still like statement functions for very simple
operations that you might need to do in many places. An old
favorite is degree/radian conversion. I hope most compilers
now expand them inline, but maybe not all.
For things that are slightly more complicated, but still
specific to the one procedure, they are nice. Also, for small
programs that don't need any external or module functions.
-- glen