comp.lang.ada
 help / color / mirror / Atom feed
From: "McDoobie" <someone@nospam.net>
Subject: Re: Cannot use NULL as identifier?
Date: Thu, 31 May 2001 10:49:21 GMT
Date: 2001-05-31T10:49:21+00:00	[thread overview]
Message-ID: <RkpR6.5080$DG1.1143031@news1.rdc1.mi.home.com> (raw)
In-Reply-To: 9f2tuk$hbg$1@nh.pace.co.uk

In article <9f2tuk$hbg$1@nh.pace.co.uk>, "Marin David Condic"
<marin.condic.auntie.spam@pacemicro.com> 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



  parent reply	other threads:[~2001-05-31 10:49 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-30 13:04 Cannot use NULL as identifier? McDoobie
2001-05-30 13:22 ` Ted Dennison
2001-05-30 13:27 ` Philip Anderson
2001-05-30 16:40   ` Pascal Obry
2001-05-31 11:49     ` Mats Karlssohn
2001-05-31 12:30       ` David C. Hoos, Sr.
2001-05-31 13:33         ` Mats Karlssohn
2001-05-31 16:26           ` Mario Amado Alves
2001-06-03 10:25         ` Florian Weimer
2001-05-30 20:52   ` Florian Weimer
2001-05-30 13:32 ` Martin Dowie
2001-05-30 13:33 ` Petter Fryklund
2001-05-31  3:15   ` Randy Brukardt
2001-05-30 13:52 ` Marin David Condic
2001-05-31  2:09   ` Robert A Duff
2001-05-31 10:49   ` McDoobie [this message]
2001-05-31 15:12     ` Marin David Condic
2001-06-01 14:01       ` John English
2001-06-01 14:48         ` Ted Dennison
2001-06-01 15:57           ` John English
2001-06-02  6:21             ` Simon Wright
2001-06-01 15:03         ` Gary Scott
2001-06-04 13:46           ` Marin David Condic
2001-06-01 15:19         ` Marin David Condic
2001-06-01 15:26         ` Brian Rogoff
2001-06-01 16:16         ` David Gillon
2001-06-04 12:02         ` Stephen Leake
2001-06-04 17:54           ` tmoran
2001-06-04 18:51             ` Marin David Condic
2001-06-04 21:24               ` Paper or Plastic? Ted Dennison
2001-06-06  9:28           ` Cannot use NULL as identifier? Mats Karlssohn
2001-06-06  9:37             ` John English
2001-06-06  9:48             ` David C. Hoos, Sr.
2001-06-06 10:05               ` Mats Karlssohn
2001-06-05  8:37         ` Tarjei T. Jensen
2001-06-05 14:14           ` Web Publishing was " Robert C. Leif, Ph.D.
2001-06-06  8:12             ` Tarjei T. Jensen
2001-05-30 13:58 ` Claude SIMON
  -- strict thread matches above, loose matches on Subject: below --
2001-05-30 21:45 Beard, Frank
2001-05-31 14:53 ` John English
2001-06-02 10:53 ` Florian Weimer
2001-06-04 18:16 Beard, Frank
2001-06-04 20:36 ` Robert A Duff
2001-06-04 22:48 Beard, Frank
2001-06-05  2:34 ` Robert A Duff
2001-06-05 17:23 Beard, Frank
2001-06-06 15:53 ` Tucker Taft
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox