On Apr 5, 5:31 pm, "Randy Brukardt" <ra...@[EMAIL PROTECTED]
> wrote:
> "Pascal Obry" <pas...@[EMAIL PROTECTED]
> wrote in message
>
> news:47F76D31.2090009@[EMAIL PROTECTED]
>
> > Gautier,
>
> > > function S (Source : Ada.Strings.Unbounded.Unbounded_String)
return
> > > String
> > > renames Ada.Strings.Unbounded.To_String;
> > > function U (Source : String) return
> > > Ada.Strings.Unbounded.Unbounded_String
> > > renames Ada.Strings.Unbounded.To_Unbounded_String;
>
> > I'm doing the same with operator "+" and "-", but I'm not happy with
> > that. You do not need the parenthesis with operators:
>
> The only useful use for "+" in Ada is for conversions.
Well, I can think of one other potentially useful use: with a numeric
argument (especially a numeric literal, or something like pi). It
doesn't have any effect but could serve to make things clearer in some
mathematical cases. Maybe you'd call a bounded integration routine
with +1.0 and -1.0 as the arguments.
OK, so that's not much of a use. On the other hand, the idea that "+"
represents the identity function is ingrained enough in me that I've
resisted using it for a conversion operator even though others around
me have been doing that. Call it an obstinate adherence to
meaningless purity or whatever. But like Randy, I would have
preferred adding one (maybe even two) operator symbols that would have
no meaning except that the user could define them, although I'm not
sure about "#" since that already has a use (in based numeric
literals). I'd prefer something not currently used at all, like "@[EMAIL PROTECTED]
"
or "!" or tilde. Of course, it apparently isn't going to happen
anyway so there's not much point arguing about which character would
be best.
-- Adam


|