"Pascal Obry" <pascal@[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. So it is a common
convention (I use it sometimes). We actually considered adding that rename
to the strings packages, but enough people thought it was ugly that it
wasn't done. (It needs getting used to, thus the hope of making the intent
clearer by including it in the packages.)
We also briefly considered adding an operator symbol specifically for this
purpose. Something like
function "#" (Source : String) return Unbounded_String;
But the people who don't think "+" is ugly were against this, because we
already have such an operator and thus don't need another one. Thus a
deadlock. Sigh.
> external_packer: array(External) of Unbounded_String:=
> ( +"zip.exe",
> +"7z.exe",
> +"kzip.exe");
>
> Better than nothing...
I agree, and it doesn't look so ugly if you can think of unary "+" as the
conversion operator. (Personally, I'd prefer a different symbol for this
purpose, but "+" has the advantage of actually working now.)
Randy.


|