Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: Is there a module for object-oriented substring handling/substitution?

by Anonymous Monk
on Jan 25, 2013 at 03:06 UTC ( #1015254=note: print w/ replies, xml ) Need Help??

Comment on Re^2: Is there a module for object-oriented substring handling/substitution?
Re^3: Is there a module for object-oriented substring handling/substitution?
by roboticus (Canon) on Jan 26, 2013 at 00:49 UTC

    Ah, thanks for that link! It lead to a nice hour or so of reading & thinking.

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.

Re^3: Is there a module for object-oriented substring handling/substitution?
by smls (Friar) on Jan 26, 2013 at 15:43 UTC

    Anonymous Monk:

    I don't care much for speed, I care about convenience and elegance.

    Regarding the use-case of creating editors, they might prefer to use their own special-purpose class for performance reasons, with integrated support for efficient feedback on state changes of tracked ranges. For example, the Kate editor (coded in C++ with Qt and KDE libs) uses a light-weight class called MovingRange for keeping track of persistent ranges withing an opened document. They created this solution from scratch in 2010, dropping their previously used, more generic framework called "SmartRanges", in part due to performance reasons (see blog post).
    Now, if this is a performance-critical code path that benefits from special-case optimization even in an editor written in C++, it probably will be even more so in an editor written in Perl...

    For my purposes, notification about state changes is not needed, nor is performance a critical consideration so having a full substring class that stores a copy of its text (rather than just a thin "range" class pointing to a location withing the parent string) should not be a problem.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1015254]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2014-12-21 20:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (107 votes), past polls