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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,af5bf4e3cf0c28b8 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-05-31 03:49:22 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newshub2.home.com!news.home.com!news1.rdc1.mi.home.com.POSTED!not-for-mail From: "McDoobie" Subject: Re: Cannot use NULL as identifier? Newsgroups: comp.lang.ada Organization: Caffinated Corps References: <9f2tuk$hbg$1@nh.pace.co.uk> User-Agent: Pan/0.8.1beta4 (Unix) X-No-Productlinks: Yes Message-ID: Date: Thu, 31 May 2001 10:49:21 GMT NNTP-Posting-Host: 24.0.109.49 X-Complaints-To: abuse@home.net X-Trace: news1.rdc1.mi.home.com 991306161 24.0.109.49 (Thu, 31 May 2001 03:49:21 PDT) NNTP-Posting-Date: Thu, 31 May 2001 03:49:21 PDT Xref: archiver1.google.com comp.lang.ada:7920 Date: 2001-05-31T10:49:21+00:00 List-Id: In article <9f2tuk$hbg$1@nh.pace.co.uk>, "Marin David Condic" wrote: > Null is a reserved word in Ada - used as a null statement and as a value > for access types, etc. You can't use it as an identifier. > > What you probably want is ASCII.Nul - notice only one 'l'. > > Also, unless you are interfacing to some C/C++ routines, you do not need > to terminate strings with Nul. You are much better off using the > attributes > 'First, 'Last, 'Range, etc. along with the string handling routines > you'll > find in Ada.Strings, Ada.Strings.Fixed, Ada.Strings.Bounded, > Ada.Strings.Unbounded. (My personal favorite is to use > Ada.Strings.Unbounded for just about everything. It will have some > speed/space penalties over fixed strings, but you'd really have to have > an intense application to start noticing the difference.) > > BTW, you probably don't want to use the package ASCII since it is > falling out of vogue and may eventually go away. More appropriately, you > should use Ada.Characters.Latin_1 which also contains a constant called > "Nul". > > If you have not done so already, you will want to get hold of an Ada95 > Reference Manual (plenty of electronic sources). To really get all the > benefits of Ada, you'll want to look over all the appendices and at > least be cognizant of the language defined packages and what they > contain. That way, when you need a resource (like character constants, > math routines, string manipulation, etc.) you'll at least have a vague > memory of what is available and know where to look for more help. I > repeatedly find myself in there digging up routines to leverage someone > else's work! :-) > > MDC > -- > Marin David Condic Senior Software Engineer Pace Micro Technology > Americas www.pacemicro.com Enabling the digital revolution e-Mail: > marin.condic@pacemicro.com Web: http://www.mcondic.com/ > Thanks for your reply. I have duly noted the difference between 'NUL' and 'NULL' thanks to the many replies pointing out that goof up. Also, I will be spending some time exploring the Latin_1 package in detail, as well as exploring the internals of the Ada system much more thoroughly. I've recently purchased an Ada textbook, so I should proceed much more rapidly now. And yes, I was interfacing with the GNU glibc libraries. glibc 2.2 to be exact. I wonder if it would make more sense to just put all my glibc interfaces into an Ada package and then use them that way. However, I'm also aware that there are Posix bindings already available, and so I'm tempted to say that it would make more sense to use those instead. However, as I am relatively inexperienced in the whole OOP paradigm (coming from a C and x86 ASM background) I cant yet say for sure what the best route would be. Back to the books I guess. ;-> Thanks again for all the replies. McDoobie chris@dont.spam.me