On Mar 10, 6:12 am, [email protected] (Lawrence O.) wrote:
will not be the one stating that ST is not OO
I don’t know Python, so answer me this: With that required len
method, can you write arr.len() to find out the length? Does the
built-in array class have any more conveniently-named method you can
call to find the length of the array?
If the answer to those is “no”, then it’s no OO because you have a
global function that works on a specific object (or set of objects)
and cannot thus be used with other objects. Requiring the use of a
single global namespace to call functions is not OO, by my definition.
On Mar 10, 1:34 am, “gga” [email protected] wrote:
On 8 mar, 09:08, “planetthoughtful” [email protected]
As you asked in the Ruby list, and Perl/Python/Ruby were mentioned,
I’ll give you answers for them.
An excellent, informative post. Thanks for sharing!
One question:
Ruby1.8’s regexp engine is less powerful than Perl’s or Python’s as it
does not have backtracking, named groups or unicode (if you don’t know
what that is or care, ruby1.8’s regexp are perfect for you already).
If I understand the terminology correctly, the 1.8 regexp engine
doesn’t support lookbehind assertions (positive or negative), but it
does support backtracking. Isn’t backtracking what permits /.bar/ to
match “foobar”? Without backtracking, . would match “foobar”, and
then the regexp would fail when it didn’t find another “bar” after
“foobar”.
On 17.03.2007 15:37, Phrogz wrote:
match “foobar”? Without backtracking, .* would match “foobar”, and
then the regexp would fail when it didn’t find another “bar” after
“foobar”.
Yes. Basically NFA regexp engines have to do backtracking, DFA’s don’t.
See “Mastering Regular Expressions” for details.
Kind regards
robert