in reply to Re^6: Replace zero-width grouping? (optimizing perl code)
in thread Replace zero-width grouping?

History has it that Mr Wilde's response was, "You will Harvey, you will.". So, in this case, I guess I should simply say. "I will" :)

In C  assert(true); could still be classed as an "assertion". The fact that the assertion is always true doesn't change that. perlre says

This zero-width assertion evaluate any embedded Perl code. It always s +ucceeds,

so 'code block assertion' as a phrase to describe (?{ ... }) makes a certain amount of sense, to me at least.

And the (??{ ... }) is described as a "postponed regular subexpression".

Both are a bit wordy, but it would be nice to have terms for them, rather than needing to constantly use the notation? Maybe CBA and PP-RE?? Just a thought.


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller

Replies are listed 'Best First'.
Re^8: Replace zero-width grouping?
by hv (Prior) on May 09, 2003 at 18:14 UTC

    FWIW, I tend to think of them as "RE eval" and "deferred eval", influenced in part by:

    perl -wle 'sub a { print +(caller)[1] } ""=~/(?{ a() })/'

    Hugo

      That's much better than either my long-winded versions or the aweful TLA's. It also reminds us of the runtime costs.

      Thanks. I'll update my lexicon:)


      Examine what is said, not who speaks.
      "Efficiency is intelligent laziness." -David Dunham
      "When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller