comp.lang.ada
 help / color / mirror / Atom feed
From: Thomas <fantome.forums.tDeContes@free.fr.invalid>
Subject: RegEx / rename of a function result
Date: Wed, 06 Jul 2022 18:18:49 +0200	[thread overview]
Message-ID: <62c5b5e9$0$22251$426a34cc@news.free.fr> (raw)
In-Reply-To: a6e2e912-8aa6-4ecf-9118-9dd29a967734n@googlegroups.com

In article <a6e2e912-8aa6-4ecf-9118-9dd29a967734n@googlegroups.com>,
 Shark8 <onewingedshark@gmail.com> wrote:

> On Wednesday, July 7, 2021 at 5:15:43 PM UTC-6, Matt Borchers wrote:

> > BTW, what's wrong with 
> > Gnat.RegExp? It has worked in our code for years. 

> Regular expressions are for regular languages; it is very easy to violate 
> that restriction with your incoming data.
> Most of my professional career has been doing maintenance, and RegEx are 
> *terrible* when it comes to maintainability, to the point that I actively 
> avoid them and advise others to as well, even for things that conceptually 
> *could* be done via RegEx (e.g. recognizing an Integer) in favor of actual 
> parsing... or if you need pattern-matching, something more robust like 
> SNOBOL.

interesting :-)

is it easy to integrate it in an ada program?
i'm thinking about AdaControl, which (if i'm right) uses RegEx a lot.


> 
> > The RENAME is interesting as I have not seen that before. Is it a rename of 
> > the function call (invokes the function upon reference) or a rename of the 
> > function result? 
> That form of RENAMES is the function result.
> I've found it an excellent alternative to CONSTANT, as it signals my intent 
> to have an alias for some result inside DECLARE blocks and certain internal 
> objects. (eg Default_Map : Map renames Internal_Map_Generation(P1, P2); ... 
> and then I can use "Default_Map" instead of calling the generation-function 
> at each point and possibly messing things up should the parameters change.)

why renames is better than constant in this case ?
could you explicit the difference between them, please?

-- 
RAPID maintainer
http://savannah.nongnu.org/projects/rapid/

  reply	other threads:[~2022-07-06 16:18 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-07 19:31 deferred constants Matt Borchers
2021-07-07 20:40 ` Jeffrey R. Carter
2021-07-07 20:41 ` Stephen Leake
2021-07-07 20:44 ` Shark8
2021-07-07 23:15   ` Matt Borchers
2021-07-07 23:37     ` Shark8
2022-07-06 16:18       ` Thomas [this message]
2022-07-06 17:56         ` RegEx / rename of a function result J-P. Rosen
2022-07-06 19:11           ` Jeffrey R.Carter
2022-07-07  5:51             ` RegEx / rename of a function resultRig J-P. Rosen
2022-07-11 17:49           ` RegEx / rename of a function result Thomas
2022-07-12  5:13             ` J-P. Rosen
2022-07-12 14:45               ` G.B.
2022-07-07  0:44         ` Randy Brukardt
2022-07-11 17:45           ` Thomas
2022-07-12  6:54             ` Randy Brukardt
2021-07-08  1:21     ` deferred constants Stephen Leake
2021-07-08 14:18       ` Maxim Reznik
replies disabled

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