From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 5 Oct 92 02:33:12 GMT From: alex@MIMSY.CS.UMD.EDU (Alex Blakemore) Subject: Re: Ada question: access types Message-ID: <60887@mimsy.umd.edu> List-Id: In article <1992Oct4.211734.9047@seas.gwu.edu> nreich@seas.gwu.edu (Norman Reic h) writes: Assume package my_types is > TYPE ptr IS ACCESS node; > TYPE node IS > RECORD > name ... > ... > nextn :ptr; > END RECORD; > nl :ptr; and in another library unit > if (nl = NULL) then --error at this line > type clash in parameter to "=" type ptr is probably in a different package than the if statement. you probably made type ptr visible via a with clause and did not make it _directly_ visible via a use clause. this is probably the most common "error" new users hit and Ada9X is more forgiving here. The error message could be better though. Remember the function "=" (left, right : ptr) is implicitly defined just after the definition of type ptr. Your choices are: a. invoke "=" using dotted infix notation. if my_types."=" (nl, null) then b. make my_types."=" directly visible by adding a use clause. use my_types; c. rename my_types."=" to make it directly visible function "=" (left, right : my_types.ptr) renames my_types."="; -- --------------------------------------------------- Alex Blakemore alex@cs.umd.edu NeXT mail accepted