in reply to Six uses for curlies?

I'll bet I missed something completely obvious.

...not to mention the fact that you can legitimately use {} in quote-like constructs such as:


Dave

Replies are listed 'Best First'.
Re^2: Six uses for curlies?
by glwtta (Hermit) on Jan 13, 2006 at 05:24 UTC
    I just saw that comments at the end of the article also mention variable name disambiguiation (eg "${foo}_bar"), didn't think of that one.

    So if we count the regex uses that's 7, and if we don't it's only 5 (seems there's no reason to count the quoting uses, since pretty much anything can be used there).

      Actually, more than seven if you count the uses within regexen: (?{...}), and (??{...}) are two different types of extended patterns, plus quantification, though you could argue that the curlies function as code blocks within the extended regex patterns, though that's a difficult distinction. Disambiguation!, I knew I missed a good one.


      Dave

        I think that's cheating. Since those are just another example of {} delimiting code, I'd class those with the block category.