comp.lang.ada
 help / color / mirror / Atom feed
From: sparre@meyer.fys.ku.dk (Jacob Sparre Andersen)
Subject: Increment operator (+=)
Date: 28 Jan 95 21:23:45 +0100
Date: 1995-01-28T21:23:45+01:00	[thread overview]
Message-ID: <1995Jan28.212345.2262@nbivax.nbi.dk> (raw)
In-Reply-To: 3g9nir$fpl@gnat.cs.nyu.edu

Robert Dewar (dewar@cs.nyu.edu) wrote the most recent article I have read 
in the thread about the operator "+=" in C.

In two still not mentioned languages (dialects) there are these solutions 
to the 'problem':

In COMAL (BASIC like) there are ":+" and ":-" incrementing and decrementing 
'assignments'.

    antal_sider:+1
    rest:-1

In Borland's Pascal dialect the system library contains these procedures:

    Inc(var SomeInteger : <integer type> ; Step : <integer type>) ;
    Dec(var SomeInteger : <integer type> ; Step : <integer type>) ;

I think the last solution is the right way to do it in Ada. But it's only 
really usefull, if any type with "+" and "-" operators can 'inherit' the 
procedures (I don't think that's how Ada 95 works).
The Borland way (tm :-) is just how we should code. No Ada 96 :-)

--

I like the idea about using local renames.

--

"add 1 to long-complex-name" - What a nice readable piece of code. What's 
wrong with this language? :-)

Regards,
                Jacob Sparre Andersen
--
A good movie? - What about three? - Kieslowskis 'White', 'Blue' and 'Red'!
--
URL's: "mailto:sparre@nbi.dk", "http://meyer.fys.ku.dk/~sparre", 
       "mailto:sparre+@pitt.edu" & "http://www.pitt.edu/~sparre".
--
"We need a plan to diverge from", Fesser



  parent reply	other threads:[~1995-01-28 20:23 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3etund$hnr@miranda.gmrc.gecm.com>
1995-01-12  9:56 ` "Subtract C, add Ada" Erik Svensson
     [not found] ` <3f0n6b$qnp@theopolis.orl.mmc.com>
     [not found]   ` <3f3cq3$4tu@gnat.cs.nyu.edu>
1995-01-12 14:25     ` uninitialzed variables Richard Kenner
1995-01-12 14:44 ` "Subtract C, add Ada" Norman H. Cohen
1995-01-13  1:51 ` David O'Brien
1995-01-13 12:38   ` Laurent Gasser
1995-01-13 20:53     ` John DiCamillo
     [not found]       ` <3f8fnf$c8p@gamma.ois.com>
1995-01-16 11:02         ` Matt Kennel
     [not found]         ` <milodD2IFpG.329@netcom.com>
1995-01-17 21:39           ` R. William Beckwith
     [not found]       ` <3fa11q$sdh@gnat.cs.nyu.edu>
1995-01-16 20:20         ` David Moore
1995-01-14  0:24     ` David O'Brien
1995-01-20  4:43     ` Samuel Mize
1995-01-21 20:28       ` David O'Brien
1995-01-22 21:12         ` Robert Dewar
1995-01-23 18:35         ` Norman H. Cohen
1995-01-23 19:18         ` John Cosby - The Coz
1995-01-24 14:11         ` Samuel Mize
     [not found]         ` <3g655n$q5k@theopolis.orl.mmc.com>
1995-01-30 15:33           ` Ada vs. C Martijn Bak
1995-01-14 10:37   ` "Subtract C, add Ada" Keith Thompson
     [not found]     ` <3fcjgt$b0v@cronkite.seas.gwu.edu>
1995-01-16 18:47       ` Robert Dewar
     [not found]   ` <D2It0r.4rp@inmet.camb.inmet.com>
1995-01-17 14:11     ` Norman H. Cohen
     [not found]   ` <3g9nir$fpl@gnat.cs.nyu.edu>
1995-01-28 20:23     ` Jacob Sparre Andersen [this message]
     [not found]     ` <3gc5be$frj@Starbase.NeoSoft.COM>
1995-01-29 12:51       ` Adding in COBOL Robert Dewar
replies disabled

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