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.9 required=5.0 tests=BAYES_00,XPRIO autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,daf1e35a4e978e9d,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-06-19 16:36:22 PST Path: archiver1.google.com!news2.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!newsswitch.lcs.mit.edu!snoopy.risq.qc.ca!newsfeed.belnet.be!news.belnet.be!newsfeed.stueberl.de!newspeer1-gui.server.ntli.net!ntli.net!news11-gui.server.ntli.net.POSTED!not-for-mail From: "chris.danx" Newsgroups: comp.lang.ada Subject: have to use unrestricted access but just what about access X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: <0x8Q8.6779$ZP1.1263481@news11-gui.server.ntli.net> Date: Thu, 20 Jun 2002 00:32:50 +0100 NNTP-Posting-Host: 80.5.140.234 X-Complaints-To: abuse@ntlworld.com X-Trace: news11-gui.server.ntli.net 1024529596 80.5.140.234 (Thu, 20 Jun 2002 00:33:16 BST) NNTP-Posting-Date: Thu, 20 Jun 2002 00:33:16 BST Organization: ntl Cablemodem News Service Xref: archiver1.google.com comp.lang.ada:26446 Date: 2002-06-20T00:32:50+01:00 List-Id: Hi, How can the unrestricted_access attribute be replaced by just access in the following code? procedure on_create (window : in out dot_window) is begin ... -- watcher is a task which uses key_coordinator -- (a protected object) to record certain keypresses -- which another task retrieves and does it's thing -- with. -- Window.Watcher := new Dot_Key_Watcher.Watcher (Window.Key_Coordinator'Unrestricted_Access); ... end on_create; -- this is the window where watcher and key_coordinator live. -- type Dot_Window is new Gwindows.Windows.Main.Main_Window_Type with record Drawing_Surface : Gwindows.Drawing_Panels.Drawing_Panel_Type; Key_Coordinator : aliased Dot_Key_Coor.Coordinator; Watcher : Dot_Key_Watcher.Watcher_Access; Builder : Dot_Builder.Builder_Access; end record; I understand what is meant by "non-local pointer cannot point to local object" in the case of 'access I just can't think of a way to fix it. It's really just curiosity, (the code is limited to GNAT anyway!) it'd just be nice to find out a more general solution since this problem could arise elsewhere. Chris