comp.lang.ada
 help / color / mirror / Atom feed
* proposal for new assignment operators
@ 2003-06-25  6:23 Russ
  2003-06-25  8:49 ` Preben Randhol
                   ` (4 more replies)
  0 siblings, 5 replies; 69+ messages in thread
From: Russ @ 2003-06-25  6:23 UTC (permalink / raw)


As most of you are aware, several very popular programming languages,
such as C, C++, Java, Perl, and Python, have what are called
"assignment operators." The most important of these operators are
"+=", "-=", "*=", and "/=".

On a recent thread, the usefulness of those operators was discussed in
detail, so I won't rehash it.

One of the problems with adding these operators to Ada is that "/=" is
already used for "not equals." So I suggested that the Ada version of
these operators could be ":+", ":-", ":*", and ":/". I did not get
much of a reply, but I think it's an idea worth considering, so I am
repeating it here.

These operators would be consistent with the ":=" assignment operator
of Ada, and I don't think they conflict with any established Ada
operator. I actually think they make *more* sense than the usual "+="
type operators. Consider, for example,

    count :+ 1
    EulerAngles :* D2R

I'm wearing my asbestos underwear, so have at it!



^ permalink raw reply	[flat|nested] 69+ messages in thread
* Re: proposal for new assignment operators
@ 2003-06-27  5:35 christoph.grein
  2003-06-27  9:57 ` Preben Randhol
  2003-06-27 14:11 ` Georg Bauhaus
  0 siblings, 2 replies; 69+ messages in thread
From: christoph.grein @ 2003-06-27  5:35 UTC (permalink / raw)
  To: comp.lang.ada

Georg Bauhaus schrieb:

> Preben Randhol <randhol+abuse@pvv.org> wrote:
> : Georg Bauhaus wrote:
> :> But we are close to that already, here is an excerpt from a working program:
> :> 
> :>    case a*(%$%) is
> :>       when o.O          => A :=+ ('o');
> :>       when (8-v)|12#8B# => OM(O.%/%(0,-0));
> :>       when 2!2:0:..2:1: => null;
> :>       when others       => << oO >> O.oo (O.o>o.O);
> :>    end case;
> :> 
> : 
> : I don't believe this is from a *working* program.
>
> o.K.
>
> procedure glub is
>
>    procedure OM(o: natural) is
>    begin
>       null;
>    end OM;
>
>    a: Natural := 1;
>    v: constant := 1;
>
>    package o is
>       o: constant := 17;
>       procedure oo (o: Boolean);
>       function "/"(o,oo: Natural) return natural;
>       function "*"(left: Natural; right: String) return Natural;
>       function "+"(o: Character) return Natural;
>    end o;
>    package body o is
>       procedure oo (o: Boolean) is begin null; end oo;
>       function "/"(o,oo: Natural) return Natural is
>       begin
>          return 0;
>       end "/";
>       function "*"(left: Natural; right: String) return Natural is
>       begin
>          return 1;
>       end "*";
>       function "+"(o: Character) return Natural is
>       begin
>          return 5;
>       end "+";
>    end o;
>
>    use o;
>
> begin
>    case a*(%$%) is
>       when o.O          => A :=+ ('o');
>       when (8-v)|12#8B# => OM(O.%/%(0,-0));
>       when 2!2:0:..2:1: => null;
>       when others       => << oO >> O.oo (O.o>o.O);
>    end case;
>
> end glub;

Georg, I thought you were kidding when you said this was from a working program. Now I'm 
standing with awe in front of this little gem. I'll keep it in my store forever :-)

Das ist das schönste verrückte Ada-Programm, das ich je gesehen habe :-)



^ permalink raw reply	[flat|nested] 69+ messages in thread

end of thread, other threads:[~2003-07-16  3:14 UTC | newest]

Thread overview: 69+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-25  6:23 proposal for new assignment operators Russ
2003-06-25  8:49 ` Preben Randhol
2003-06-25 10:28 ` Dmitry A. Kazakov
2003-06-25 10:36   ` Lutz Donnerhacke
2003-06-25 17:49     ` Dmitry A. Kazakov
2003-06-26 10:37       ` Lutz Donnerhacke
2003-06-27  8:15         ` Dmitry A. Kazakov
2003-06-27 14:21           ` Hyman Rosen
2003-06-25 19:17   ` Russ
2003-06-25 10:39 ` Larry Kilgallen
2003-06-25 12:06   ` Preben Randhol
2003-06-25 13:40     ` Peter Hermann
2003-06-25 22:12     ` Georg Bauhaus
2003-06-26  8:03       ` Preben Randhol
2003-06-26  8:25         ` Vinzent Hoefler
2003-06-26 15:02       ` Stephen Leake
2003-06-26 17:54         ` Georg Bauhaus
2003-06-26 18:32           ` Stephen Leake
2003-06-27 13:21             ` Georg Bauhaus
2003-06-26 16:32       ` Preben Randhol
2003-06-26 17:41         ` Georg Bauhaus
2003-06-26 17:58           ` Preben Randhol
2003-06-26  2:36     ` Steve
2003-06-26  2:33   ` Russ
2003-06-26 23:02     ` John R. Strohm
2003-06-25 14:07 ` Frank J. Lhota
2003-06-25 16:27   ` Warren W. Gay VE3WWG
2003-06-26  3:09     ` Russ
2003-06-26  6:27       ` Vinzent Hoefler
2003-06-26 10:49       ` Larry Kilgallen
2003-06-26 18:08         ` Russ
2003-06-26 18:19           ` Preben Randhol
2003-06-26 18:45           ` Larry Kilgallen
2003-07-02 15:57             ` Kevin Cline
2003-07-02 17:10               ` tmoran
2003-07-02 18:27                 ` Hyman Rosen
2003-07-02 20:20                   ` tmoran
2003-07-03  1:48               ` Richard Riehle
2003-07-03  3:07                 ` Hyman Rosen
2003-07-03  5:12                   ` Randy Brukardt
2003-07-03 13:03                     ` Hyman Rosen
2003-07-03 14:46                   ` Stephen Leake
2003-07-04  1:17                   ` James Rogers
2003-07-07  4:29                     ` Hyman Rosen
2003-07-08  1:10                       ` James Rogers
2003-07-08 13:59                         ` Hyman Rosen
2003-07-09  0:12                           ` James Rogers
2003-07-09  3:00                             ` Hyman Rosen
2003-07-07 15:36                 ` Matthew Heaney
2003-07-14  1:39                   ` Richard Riehle
2003-07-14  2:54                     ` Hyman Rosen
2003-07-16  3:14                       ` Richard Riehle
2003-06-27 13:34       ` Georg Bauhaus
2003-06-27 23:12         ` Russ
2003-06-27 23:21           ` Larry Kilgallen
2003-06-28 18:51             ` Russ
2003-06-27 18:02       ` Warren W. Gay VE3WWG
2003-06-28  3:50         ` Russ
2003-06-30 15:58           ` Warren W. Gay VE3WWG
2003-06-25 19:44 ` Bill Findlay
2003-06-26  2:06   ` Russ
2003-06-26  2:33     ` Bill Findlay
2003-06-26  5:54     ` Karel Miklav
2003-06-26 12:17     ` Georg Bauhaus
2003-06-26 12:52     ` Joseph Dalton
2003-06-26 18:11     ` Frank J. Lhota
  -- strict thread matches above, loose matches on Subject: below --
2003-06-27  5:35 christoph.grein
2003-06-27  9:57 ` Preben Randhol
2003-06-27 14:11 ` Georg Bauhaus

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