From owner-sc22wg5@open-std.org  Mon Dec  6 19:23:27 2010
Return-Path: <owner-sc22wg5@open-std.org>
X-Original-To: sc22wg5-dom8
Delivered-To: sc22wg5-dom8@www2.open-std.org
Received: by www2.open-std.org (Postfix, from userid 521)
	id 10979C3BA1C; Mon,  6 Dec 2010 19:23:27 +0100 (CET)
X-Original-To: sc22wg5@open-std.org
Delivered-To: sc22wg5@open-std.org
Received: from exprod6og107.obsmtp.com (exprod6og107.obsmtp.com [64.18.1.208])
	by www2.open-std.org (Postfix) with ESMTP id 0721BC178E3
	for <sc22wg5@open-std.org>; Mon,  6 Dec 2010 19:23:24 +0100 (CET)
Received: from source ([136.162.34.13]) (using TLSv1) by exprod6ob107.postini.com ([64.18.5.12]) with SMTP
	ID DSNKTP0qG/qwUBxcuO3WxIoql12Fn0B4m5EF@postini.com; Mon, 06 Dec 2010 10:23:25 PST
Received: from fortran.us.cray.com (fortran.us.cray.com [172.31.19.200])
	by stplmr01.us.cray.com (8.14.3/8.13.8/hubv2-LastChangedRevision: 12441) with ESMTP id oB6INMYr023622;
	Mon, 6 Dec 2010 12:23:22 -0600
Message-ID: <4CFD2A4D.6070600@cray.com>
Date: Mon, 06 Dec 2010 12:24:13 -0600
From: Bill Long <longb@cray.com>
Reply-To: longb@cray.com
Organization: Cray Inc.
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.11) Gecko/20101013 Thunderbird/3.1.5
MIME-Version: 1.0
To: fortran standards email list for J3 <j3@j3-fortran.org>
Cc: sc22wg5 <sc22wg5@open-std.org>
Subject: Re: (j3.2006) (SC22WG5.4376) [ukfortran] WG5 informal ballot re	Interop.
 TR
References: <20101108175805.5B97EC178E5@www2.open-std.org>	<20101206103130.1AE8AC178E3@www2.open-std.org>	<20101206134148.834A7C178E4@www2.open-std.org>	<4CFD0D53.8030501@cray.com> <20101206172155.862D5C178DA@www2.open-std.org>
In-Reply-To: <20101206172155.862D5C178DA@www2.open-std.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Sender: owner-sc22wg5@open-std.org
Precedence: bulk



On 12/6/10 11:21 AM, Aleksandar Donev wrote:
> On 12/06/10 11:20, Bill Long wrote:
>> However, if it is a C function calling Fortran with such an interface,
>> reconstructing all of the CLASS infrastructure on the Fortran side
>> from the information in the C descriptor might be problematic.
> Those are not interoperable, so there is no way for C to call such a
> Fortran function, nor do we want that. The issue here is only whether

I'm not sure what you mean by "those". We are defining interoperability 
of interfaces (not variables) here.  If the interface is interoperable, 
it works both ways. Fortran calls C and C calls Fortran.  In fact, the 
"C" side does not even have to be written in C.  This is a fundamental 
feature of interoperability, spelled out in the first paragraph of 
Clause 15.

> Fortran can pass a CLASS(*) object to C via a descriptor. It seems

If we make that the case, then we have to also allow a C function to 
call a BIND(C) Fortran subprogram that has a CLASS(*) dummy.  Note that 
CLASS(*) and TYPE(*) are very different in this respect. A Fortran 
subprogram can do almost nothing with a TYPE(*) dummy argument, so the 
information contained in the C descriptor is more than adequate.  A 
Fortran subprogram can do a lot more with a CLASS(*) dummy.

Cheers,
Bill


> Malcolm and Reinhold suggest yes, and I agree. I think Craig does too
> (or he should listen to me anyway :-).
> Best,
> Aleks
>

-- 
Bill Long                                           longb@cray.com
Fortran Technical Support    &                 voice: 651-605-9024
Bioinformatics Software Development            fax:   651-605-9142
Cray Inc./Cray Plaza, Suite 210/380 Jackson St./St. Paul, MN 55101


