[fpc-pascal] My favourite missing feature

Marco van de Voort marcov at stack.nl
Wed Dec 24 13:12:46 CET 2008


In our previous episode, Mark Morgan Lloyd said:
> Frank de Groot (Rent-a-Geek) wrote:
> 
> > 1. The number of people proficient in RegExes is very small, and it 
> > takes regular practice to keep the skill up.
> > Very bad to be dependent on such a subset of Pascal programmers.
> 
> I am very sorry, but your logic is bad there. A high proportion of unix 
> users have at least basic familiarity with regexes. 

True. But mostly for trial and error interactive use in editors and simple
scripts, and have no clue about doing them safely automated.

IMHO use in unattended programming is totally different.

> C++ programmers, particularly working under unix, are familiar with 
> them. The reason that comparatively few Pascal programmers are familiar 
> with them is because they are not widely used in Pascal.

Most of them also only basic. There is a lot of bad code out there.
 
> Your argument could have been applied against including generics, 
> polymorphic functions or streams into Pascal: before they were 
> implemented few people were familiar with them.

No. At least those come from the same realm. Regexes come from scripts and
interactive use. Sure, they are used in other programs (like Spamassasin
too), but crafting such ones is a truely black art.
 
> > 4. RegExes, especially complex ones, are usually orders of magnitude 
> > slower than straight Pascal, because they're usually interpreted at 
> > runtime by a parser.
> 
> They could possibly be preprocessed if assigned to a constant, although 
> I've not tried doing this.

See previous message. If they are not directly interpreted, why bother with
such terse syntax?



More information about the fpc-pascal mailing list