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,78cc8abd24f9e91f,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-06 07:24:47 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!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: why does this work? private new types. 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: Date: Mon, 6 May 2002 15:24:21 +0100 NNTP-Posting-Host: 213.107.24.115 X-Complaints-To: abuse@ntlworld.com X-Trace: news11-gui.server.ntli.net 1020695084 213.107.24.115 (Mon, 06 May 2002 15:24:44 BST) NNTP-Posting-Date: Mon, 06 May 2002 15:24:44 BST Organization: ntl Cablemodem News Service Xref: archiver1.google.com comp.lang.ada:23582 Date: 2002-05-06T15:24:21+01:00 List-Id: Hi, This example code will explain it better than I can. with hash_tables; -- generic package blah is subtype word is string (some_range); type table is private; procedure add (a : in word; t : in out table); ... private ... -- some functions in here package tables is new hash_tables (items => word, size => 100, -- for quickyness! hash_function => hash_function, equals => equals, to_string => to_string); type table is new tables.hash_table; end blah; package body blah is procedure add (a : in word; t : in out table) is begin insert (a, t); -- *** here *** end add; end blah; insert is defined in hash_tables, so why can it be used in the body of blah without "using" it? Is it implicitly "used" when table is defined as a 'new' hash_table (i.e. it's allowed to be used . That'd kindof make sense, but is this the correct way to think of it, or is there a better way? Seems like you learn new things about Ada every day! Thanks, Chris