Wow. I'm delighted to have provoked such an interesting and
informative discussion.
>
> Somehow *just* falsy/truthy return values seem sloppy to me. It
> doesn't take much effort to prepend result with `!!` and document
> function's return value as that of type Boolean.
>
I guess that's my mind-corrupted-by-Perl coming out! But as you
say, !! can sanitise everything.

>
> Agreed. Regexp version is definitely clearer and more maintainable. We
> can probably agree that it's only wise to apply lookup technique in
> performance critical parts of an application : )

Definitely? I think regexp is one of the most here-be-dragons part of
languages like Perl and Javascript.
While I admit that /option1|option2|option3|option4/ is a pretty clear
and simple example of a regexp, even here people were unsure where
they needed parentheses.


Colin

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to