comp.lang.ada
 help / color / mirror / Atom feed
From: dewarr@my-dejanews.com
Subject: Re: Type Conversion
Date: 1998/11/01
Date: 1998-11-01T00:00:00+00:00	[thread overview]
Message-ID: <71huur$btv$1@nnrp1.dejanews.com> (raw)
In-Reply-To: 71g71d$r7d@news3.force9.net

In article <71g71d$r7d@news3.force9.net>,
  "Heather Wright" <daglitch@dapad_nojunk_.co.uk> wrote:
> Probably a really lame question, but what is the syntax for type conversion
> in Ada?
>
> I'm trying to convert a float to an int (or vice-versa if necessary), the
> help files are doing
> me no good and the closest thing I found online was a comparison between
> type conversion and
> qualifier.
>
> Yeah, I'm a complete Newbie at Ada.
>
> Thanks very much for any help,


You should definitely be able to answer simple syntax questions like this
for yourself. The RM is complex to read, but the *syntax* sections should
be perfectly straightforward, and if you don't understand the BNF notation
that is used there, make the effort to learn and understand it (understanding
BNF is an absolutely essential piece of knowledge for any programmer). THe
relevant syntax rules can be found in Annex P, where they are gathered
together, or you can trivially find the right section in the RM with a
simple search (or using the index!):

4.6 Type Conversions

1   Explicit type conversions, both value conversions and view conversions,
are allowed between closely related types as defined below.  This clause also
defines rules for value and view conversions to a particular subtype of a
type, both explicit ones and those implicit in other constructs.

                                   Syntax

2   type_conversion ::=
        subtype_mark(expression)
      | subtype_mark(name)

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




  parent reply	other threads:[~1998-11-01  0:00 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-11-01  0:00 Type Conversion Heather Wright
1998-11-01  0:00 ` Tucker Taft
1998-11-01  0:00 ` dewarr [this message]
1998-11-02  0:00 ` Marin David Condic
1998-11-02  0:00 ` Michael Kaufman
1998-11-03  0:00   ` Arun Mangalam
1998-11-06  0:00     ` Niklas Holsti
  -- strict thread matches above, loose matches on Subject: below --
2014-10-11 23:56 type conversion compguy45
2014-10-12  0:07 ` compguy45
2014-10-12  0:25   ` compguy45
2014-10-12  0:33 ` Jeffrey Carter
2014-10-12  0:38   ` compguy45
2014-10-12  3:45     ` Jeffrey Carter
2014-10-12  2:32 ` Shark8
2014-10-12  4:53   ` Anh Vo
2014-10-12  4:57     ` Shark8
2014-10-12  5:41       ` Anh Vo
2014-10-12  6:38       ` Jeffrey Carter
2014-10-12  9:37       ` Pascal Obry
2014-10-12 11:54         ` compguy45
2014-10-12 23:05         ` Georg Bauhaus
2014-10-13  5:40           ` Pascal Obry
2014-10-13  7:26           ` Simon Wright
2014-10-13 22:36           ` Randy Brukardt
2014-10-12  9:16   ` Simon Wright
2014-10-12 21:05     ` Shark8
2014-10-12  9:31 ` Simon Wright
1997-12-08  0:00 Type Conversion Nick Davies
1997-12-08  0:00 ` John English
1997-12-09  0:00 ` Stephen Leake
replies disabled

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