On 25 Feb 2019, Scott Lurndal wrote
(in article ):
> Keith Thompson writes:
> > Bill Findlay writes:
> > [...]
> > > There is language in which you can write:
> > >
> > > copy : String := source;
> > >
> > > The compiler does all the work.
> > > No need to use the heap.
> > > The errors being discussed cannot happen, so no need for defensive
coding.
> > > It is used when lives are at stake.
> > > It runs, at least some, code faster than C.
> > > It is available on the R Pi.
> > >
> > > Any guesses?
> >
> > No.
> >
> > You've posted at least two more followups without telling us what
> > language you're talking about.
> >
> > So, what language are you talking about? I, for one, am not interested
> > in guessing.
> >
> > Please consider trimming the newsgroups to which this discussion is
> > being inappropriately cross-posted.
>
> I'm pretty sure it is ADA.
Ada (2012).
> type ALIs_Record is record
> Afile : File_Name_Type;
> -- Name of ALI file
>
> Ofile_Full_Name : Name_Id;
> -- Full name of object file corresponding to the ALI file
>
> Sfile : File_Name_Type;
> -- Name of source file that generates this ALI file (which is equal
> -- to the name of the source file in the first unit table entry for
> -- this ALI file, since the body if present is always first).
> ...
>
> Which would make the above example simple string assignment; in C
>
> strcpy(copy, source);
>
> I believe that ADA strings, however, have an implicit length field.
There are actually several kinds of string type.
One has an explicit length field.
One is actually allocated on the heap.
String, as you say, may have an implicit length field,
although the compiler can discard that if the length is
known at compile type.
--
Bill Findlay
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|