comp.lang.ada
 help / color / mirror / Atom feed
From: "Nasser M. Abbasi" <nma@12000.org>
Subject: Re: Ada++
Date: Sat, 13 Jun 2020 04:40:53 -0500
Date: 2020-06-13T04:40:53-05:00	[thread overview]
Message-ID: <rc26v3$fnb$1@gioia.aioe.org> (raw)
In-Reply-To: raq8p8$ds3$1@dont-email.me

On 5/29/2020 1:06 AM, J-P. Rosen wrote:
> Le 29/05/2020 à 06:38, Nasser M. Abbasi a écrit :
>> "Ada has neither heredocs nor multiline strings. A
>> workaround is to use containers of strings:"
> 


> Please provide a use case showing how these features are
> necessary/important.
> 
I wanted sometime ago to use Ada to generate Latex file on the
fly.

You might ask, why not use Latex editor? Because this is different.

When writing a program to generate the Latex file, then
one can do some computation in the program on the fly, and emit
the resulting string into the Latex file as it is being composed.

This way each time the program is run, a new Latex file is
generated, with possible new content each time.

This can be much faster/better than having to edit a static
Latex file in the Latex editor and update the document manually each
time new results are obtained for example, by manually copying
some computation result from another program into the Latex document.

I do this all the time for example in Mathematica.

Each time I update something in the data, I run the program, which
generate brand new Latex file, then compile this Latex file
to get the new PDF report. Much much faster than editing Latex file
each time something new changed.

But to do this, one has to be able to write, inside the Ada editor,
as if one is using a plain Latex editor, and not worry about
having to close strings every 80 characters or so and start new line
and having to append each string one by one. It is much
better to write large amount of text at once, and having
its structure preserved as is.

This is what multi-line raw strings allow one to do.

It is like writing a program to generate new program.

It is not possible to do this in Ada. Well, it is,  but it will
be very very cumbersome.

Here are some very basic examples using Ruby, Perl and C++

https://www.12000.org/my_notes/here_document/index.htm

To see an example using Mathematica, used to generate a web page,
here is an example

https://mathematica.stackexchange.com/questions/152663/making-a-website-with-mathematica

it is the second answer there.


> In the rare cases where I needed to put a several-lines message into a
> single string, I just marked the place of line break with a LF character
> (in Ada, you could even use an NUL character for that!), and issued a
> New_Line when I encountered it. Anyway, that's what other languages do
> implicitely.
> 
> If you don't mind being (slightly) OS dependent, printing the LF will
> naturally accompish what you want.
> 

--Nasser

  parent reply	other threads:[~2020-06-13  9:40 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-28 22:33 Ada++ Jerry
2020-05-29  2:09 ` Ada++ Nasser M. Abbasi
2020-05-29  2:57   ` Ada++ Rick Newbie
2020-05-29  9:49     ` Ada++ raph.amiard
2020-05-29  9:51     ` Ada++ gautier_niouzes
2020-05-30  1:32       ` Ada++ Rick Newbie
2020-05-30  6:52         ` Ada++ gautier_niouzes
2020-05-30  7:04           ` Ada++ Rick Newbie
2020-05-30  7:31           ` Ada++ Dmitry A. Kazakov
     [not found]           ` <rb05fk$l5r$1@dont-email.me>
2020-05-31 21:20             ` Ada++ gautier_niouzes
2020-05-29 10:36     ` Ada++ Luke A. Guest
2020-05-30  1:35       ` Ada++ Rick Newbie
2020-05-29 11:09     ` Ada++ Björn Lundin
2020-05-29 12:31       ` Ada++ Nasser M. Abbasi
2020-05-29 21:57       ` Ada++ Optikos
2020-05-31 11:40         ` Ada++ Björn Lundin
2020-05-31 15:51           ` Ada++ J-P. Rosen
2020-05-30  1:36       ` Ada++ Rick Newbie
2020-05-29  3:45 ` Ada++ Optikos
2020-05-29 15:41   ` Ada++ Optikos
2020-05-29  3:54 ` Ada++ cantanima.perry
2020-05-29 10:41   ` Ada++ Luke A. Guest
2020-05-29  4:17 ` Ada++ Wesley Pan
2020-05-29  4:38   ` Ada++ Nasser M. Abbasi
2020-05-29  6:06     ` Ada++ J-P. Rosen
2020-05-29  6:56       ` Ada++ Dmitry A. Kazakov
2020-05-29  7:22         ` Ada++ J-P. Rosen
2020-05-29  9:23       ` Ada++ fabien.chouteau
2020-05-29  9:43         ` Ada++ raph.amiard
2020-05-29 10:27           ` Ada++ Jeffrey R. Carter
2020-05-29 11:00             ` Ada++ Dmitry A. Kazakov
2020-05-29 20:57           ` Ada++ J-P. Rosen
2020-06-13  9:40       ` Nasser M. Abbasi [this message]
2020-06-13 10:03         ` Ada++ gautier_niouzes
2020-06-13 10:11           ` Ada++ Nasser M. Abbasi
2020-06-13 10:07         ` Ada++ Dmitry A. Kazakov
2020-06-14  5:29         ` Ada++ J-P. Rosen
2020-05-30 15:25 ` Ada++ ric.wai88
2020-05-30 17:02   ` Ada++ Stéphane Rivière
2020-05-30 20:56   ` Ada++ Optikos
2020-05-30 21:58     ` Ada++ ric.wai88
2020-06-05 22:37       ` Ada++ Randy Brukardt
  -- strict thread matches above, loose matches on Subject: below --
2004-10-22 13:22 Ada# fabio de francesco
2004-10-22 13:36 ` Ada# Marc A. Criley
     [not found] <200203220829.JAA11725@bulgaria.otn.eurocopter.de>
2002-03-22 15:55 ` Ada? sk
2002-03-22  8:29 Ada? Christoph Grein
2002-03-22 14:57 ` Ada? Ted Dennison
2002-03-22 15:34   ` Ada? Jean-Pierre Rosen
     [not found] <200203220654.HAA11171@bulgaria.otn.eurocopter.de>
2002-03-22  7:58 ` Ada? sk
     [not found] ` <3C9AE426.471865A1@myob.com>
2002-03-22  8:05   ` Ada? sk
2002-03-22  6:54 Ada? Christoph Grein
2002-02-19 21:21 Ada? anymous
2002-02-19 22:02 ` Ada? chris.danx
2002-02-19 23:38 ` Ada? Larry Kilgallen
2002-02-24  3:23 ` Ada? Nick Roberts
2002-02-24 15:09   ` Ada? Georg Bauhaus
2002-02-27 15:26   ` Ada? Enrico A.
2002-03-19 15:06     ` Ada? Colin Paul Gloster
2002-03-19 20:57       ` Ada? Ted Dennison
2002-03-19 22:00         ` Ada? Dan Andreatta
2002-03-19 23:45           ` Ada? Larry Kilgallen
2002-03-20 14:26           ` Ada? Ted Dennison
     [not found]             ` <3C98E9CC.45D733F2@west.raytheon.com>
2002-03-21  9:39               ` Ada? Preben Randhol
2002-03-20  2:08         ` Ada? Adrian Hoe
2002-03-20 17:39           ` Ada? Marin David Condic
2002-03-22  1:56             ` Ada? Adrian Hoe
2002-03-22  2:34               ` Ada? Richard Riehle
2002-03-20  1:41     ` Ada? Adrian Hoe
2002-03-20  2:34       ` Ada? DPH
2002-03-20 10:52       ` Ada? Reinert Korsnes
2002-03-20 13:32       ` Ada? Gary Scott
2002-02-27 21:37 ` Ada? Ken Pinard
replies disabled

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