From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5c7d7b754dfe430e,start X-Google-Attributes: gid103376,public From: Zeiram Subject: Help needed: Access type to functions in generic package Date: 1999/09/12 Message-ID: <37DBA86F.3805AA69@deathsdoor.com>#1/1 X-Deja-AN: 524075472 Content-Transfer-Encoding: 7bit X-Accept-Language: en,en-US,en-GB,fr Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@sunrise.ch X-Trace: news1.sunrise.ch 937142403 21843 194.230.19.8 (12 Sep 1999 13:20:03 GMT) Organization: sunrise communications ag Mime-Version: 1.0 NNTP-Posting-Date: 12 Sep 1999 13:20:03 GMT Newsgroups: comp.lang.ada Date: 1999-09-12T13:20:03+00:00 List-Id: Hello I'm trying to use access types to functions in a generic package and GNAT refuses to compile my package. Here's the complete description of my problem. I'm trying to use OpenGL and the GLUT toolkit to display a 3D maze on the screen. My approach was to create a package specifying a type T_Maze, which is generic on the length, height and depth of the maze. Then, I wanted to create a child of this package for the procedure displaying my maze. I have to use access types on functions for defining my callback functions used for OpenGL. And, of course, my child package is also generic. My callback functions are defined in a child of the child package. But when I try to compile this with GNAT for Win32, I get the following error message: access type must not be outside generic body I tried to move all my callback functions in the body of my display package, but the same error message was there. Does anyone have an idea how I could compile this package? Here are part of the specs and bodies of my packages. generic Dim_X, Dim_Y, Dim_Z : Positive; package Maze is type T_Cell is (Wall, Corridor, Pebble); type T_Maze is array(1..Dim_X, 1..Dim_Y, 1..Dim_Z) of T_Cell; end Maze; generic package Maze.Display is procedure Display_Maze(Maze : in T_Maze); end Maze.Display; with glut; with Win32.GL; with Maze.Display.Callback; package body Maze.Display is package Callback is new Maze.Display.Callback; use Callback; procedure Display_Maze(Maze : in T_Maze) is Menu : Integer; begin Menu := glutCreateMenu(Main_Menu'access); end Display_Maze; end Maze.Display; package Maze.Display.Callback is procedure Main_Menu(Value : Integer); end Maze.Display.Callback; Thanks in advance for helping me. Regards Zeiram