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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c548fcf2944e2c9b,start X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!postnews.google.com!b1g2000hsg.googlegroups.com!not-for-mail From: amal.alphonse@gmail.com Newsgroups: comp.lang.ada Subject: What's wrong with my code? Date: Mon, 28 Apr 2008 07:42:44 -0700 (PDT) Organization: http://groups.google.com Message-ID: <5a3b83ab-c9eb-448d-8e01-093df11bd3d2@b1g2000hsg.googlegroups.com> NNTP-Posting-Host: 144.32.126.12 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1209393765 27806 127.0.0.1 (28 Apr 2008 14:42:45 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 28 Apr 2008 14:42:45 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: b1g2000hsg.googlegroups.com; posting-host=144.32.126.12; posting-account=196-KwoAAAAHKkXLxxseFZmReiRY5OND User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14,gzip(gfe),gzip(gfe) X-HTTP-Via: 1.1 wc6.york.ac.uk:3128 (squid) Xref: g2news1.google.com comp.lang.ada:21097 Date: 2008-04-28T07:42:44-07:00 List-Id: Sorry if I'm posting in the wrong forum. I have a generic package, with specification: generic type Element is private; with procedure Element_Put(E : in Element); package SelectionP is type My_Array is array (0..10) of Element; Max : constant Integer := 10; procedure Find_Min (A : My_Array; Offset : Integer; Pos : Integer); procedure Swap (A : in out My_Array; First : Integer; Second : Integer); procedure Sort (A : in out My_Array); procedure Print (A : in My_Array); end SelectionP; -------------------------------------------------- and its package body is: package body SelectionP is A : My_Array; procedure Find_Min (A : My_Array; Offset : Integer; Pos : Integer) is ... end Find_Min; procedure Swap (A : in out My_Array; First : Integer; Second : Integer) is ... end Swap; procedure Sort (A : in out My_Array) is ... end Sort; procedure Print (A: in out My_Array) is ... end Print; end SelectionP; ------------------------------------------- And I try to make use of this package in this file: with Ada.Text_IO, Ada.Integer_Text_IO; with SelectionP; procedure SelectionPUser is package IntSelectionP is new SelectionP(Integer, Ada.Text_IO.Put); begin Ada.Text_IO.New_Line; end SelectionPUser; --- I try to compile but it says 'no visible subprogram matches the specification for Element_Put' referring to the line above where I make the new package IntSelectionP. I can't see what i've done wrong. Also, is my code correct if my purpose is to use the package to create arrays of different elements (integer, character, etc) and use the procedures Find_Min and Sort and Print on them? Thanks