From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Simon Clubley Newsgroups: comp.lang.ada Subject: Re: is it possible to add multi-line raw strings (HERE-DOCUMENT) support to Ada? Date: Fri, 10 Jul 2015 17:26:40 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Date: Fri, 10 Jul 2015 17:26:40 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="2cff86a8b0483dfa1f67fda3cfe01216"; logging-data="29580"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18qwDsxHQlfbtuXNXdoJXiYu8AN4pxz1Yo=" User-Agent: slrn/0.9.9p1 (Linux) Cancel-Lock: sha1:vOkczNRBzZkEE/i5tRB+xc/ykO8= Xref: news.eternal-september.org comp.lang.ada:26746 Date: 2015-07-10T17:26:40+00:00 List-Id: On 2015-07-10, Nasser M. Abbasi wrote: > It is very useful to be able to have multi-line raw > strings in the code, written as is, over many lines, > as one raw string. > > Ada currently does not support this feature. This is called > multi-line raw strings, and also called HERE-DOCUEMNT > > https://en.wikipedia.org/wiki/Here_document > > The rosseta entry is http://rosettacode.org/wiki/Here_document > > One can see the Ada entry there is not a true multi-line > raw string as one needs to add &"" at each line. Compare > that to the Python or Perl. > [snip] I would strongly oppose this for Ada (given Ada's safety critical design goals). Ada syntax was choosen to try and reduce the chances that silly mistakes made while typing in code would produce a program which compiled but was wrong due to a silly typing error. (For example, "==" versus "=" in C). In your proposal, if the terminating sequence was slightly mistyped then the following program code would be consumed as data until a valid heredoc terminator was found. This is also why there is no multiline comment construct in Ada IIRC but only "--". Simon. -- Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP Microsoft: Bringing you 1980s technology to a 21st century world