<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Using pointers for abstraction in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-pointers-for-abstraction/m-p/840694#M58663</link>
    <description>I would suggest the same as Jugoslav, use ISO_C_BINDING and the C_PTR type. Declare a derived type with PRIVATE components to hold the context identifier and have this be the handle.&lt;BR /&gt;</description>
    <pubDate>Mon, 23 Jul 2007 18:12:34 GMT</pubDate>
    <dc:creator>Steven_L_Intel1</dc:creator>
    <dc:date>2007-07-23T18:12:34Z</dc:date>
    <item>
      <title>Using pointers for abstraction</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-pointers-for-abstraction/m-p/840691#M58660</link>
      <description>I have a module that implements an algebraic expression parser.  The module consists of two public subroutines, initialize_expression and evaluate_expression.  The initialize_expression takes a string and converts into an internal representation.
&lt;P&gt;
Right now that internal representation gets returned to the calling program (it is just an array of a data type).  What I would like 
to do is hide the internal representation from the calling program
and return just a "generic" pointer, much like dss_create() routine does in the Math Kernel Library.
&lt;/P&gt;&lt;P&gt;
Part of the rationale is philosophical--the calling program shouldn't care about the internal representation, part of it is to minimize recompling if I change the internal representation.
&lt;/P&gt;&lt;P&gt;
Is this even a good idea to do in Fortran?  What is the "best" way for doing this?  The definition of "best" means closest to the standard.&lt;/P&gt;</description>
      <pubDate>Sun, 22 Jul 2007 19:07:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-pointers-for-abstraction/m-p/840691#M58660</guid>
      <dc:creator>Dishaw__Jim</dc:creator>
      <dc:date>2007-07-22T19:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: Using pointers for abstraction</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-pointers-for-abstraction/m-p/840692#M58661</link>
      <description>Well, the concept of handle is a well known paradigm. What makes this difficult in the context of Fortran is that there's no standard-conforming way to "cast" a pointer to something into void*, (metaphorically speaking), or, pointer to something into a pointer to something else.&lt;BR /&gt;&lt;BR /&gt;So, you can reuse (and cheat on) the fact that Fortran scalar POINTERs are 32 (64)-bit entities in all compilers around and provide a mismatch on the argument-lists (i.e. INTEGER, POINTER vs. TYPE(Internal), POINTER); doing so, however, would require deliberate breaking of explicit interfaces provided by the MODULEs.&lt;BR /&gt;&lt;BR /&gt;A possibly better approach is to use ISO_C_BINDING module (which can have legitimate uses even in purely Fortran contexts), and which lets you cast a C pointer to Fortran pointer (C_F_POINTER) and reverse (C_LOC) using a type(C_PTR) as "mediator". It gives you wider portability, but it's not implemented in all modern compilers yet (it is in at least Ifort 10.x, and g95).&lt;BR /&gt;</description>
      <pubDate>Mon, 23 Jul 2007 15:55:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-pointers-for-abstraction/m-p/840692#M58661</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2007-07-23T15:55:29Z</dc:date>
    </item>
    <item>
      <title>Re: Using pointers for abstraction</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-pointers-for-abstraction/m-p/840693#M58662</link>
      <description>&lt;P&gt;There is a somewhat standard way to call C/C++ from Fortran. If you wish to have your code follow a standard then you could have a C/C++ dummy routine that takes a Reference of one type and returns the handle (void*). Let C/C++ perform the cast.&lt;/P&gt;
&lt;P&gt;Jim Dempsey&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jul 2007 17:45:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-pointers-for-abstraction/m-p/840693#M58662</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2007-07-23T17:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: Using pointers for abstraction</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-pointers-for-abstraction/m-p/840694#M58663</link>
      <description>I would suggest the same as Jugoslav, use ISO_C_BINDING and the C_PTR type. Declare a derived type with PRIVATE components to hold the context identifier and have this be the handle.&lt;BR /&gt;</description>
      <pubDate>Mon, 23 Jul 2007 18:12:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-pointers-for-abstraction/m-p/840694#M58663</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2007-07-23T18:12:34Z</dc:date>
    </item>
  </channel>
</rss>

