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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,9e87e366cae15081 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.germany.com!news.mixmin.net!news2.euro.net!newsfeed.freenet.de!newsfeed01.chello.at!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Newsgroups: comp.lang.ada Subject: Re: if Restrict_Func /= null confusion From: Georg Bauhaus In-Reply-To: <95f36a62-b94c-4211-896a-300fa98932b7@x41g2000hsb.googlegroups.com> <95f36a62-b94c-4211-896a-300fa98932b7@x41g2000hsb.googlegroups.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1206913458.22025.4.camel@K72> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Date: Sun, 30 Mar 2008 23:44:18 +0200 Organization: Arcor NNTP-Posting-Date: 30 Mar 2008 23:44:18 CEST NNTP-Posting-Host: 17913ff2.newsspool4.arcor-online.net X-Trace: DXC=ZM1FIZPmkLP1`E>oC;JXEZ4IUKRejVXP3i]AANdTbQOMTMZ=OAXaS X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:20657 Date: 2008-03-30T23:44:18+02:00 List-Id: On Sun, 2008-03-30 at 13:58 -0700, ma740988@gmail.com wrote: > -- used to restrict a variable within a range > -- for example: -PI to +PI > type Restrict_Function is access function (X: Real4) return Real4; > > type Filt_Data is > record > Restrict_Func : Restrict_Function ; > > end record ; > > > -- within a procedure we have > Fdata : Filt_Data; > Restrict_Func : Restrict_Function := FData.Restrict_Func ; > > if Restrict_Func /= null then > -- stuff > endif > > At issue: I'm not following the conditional logic 'if (Restrict_Func / > = null)'. Not understanding the impetus behind the check for null. The type Restrict_Function includes the null value. The FData.Restrict_Func record component gets the default initial value for access values. It is therefore null. So Filt_Data.Restrict_Func is actually null.