Vincent Fourmond
7/26/2006 10:02:00 AM
Hello !
>
> valid_path=valid_string and (/^\/.*$/ === s)
>
> s being = to "path not starting with /" (invalid path)*
>
> i get valid_path= true iff alid_string=true
>
> the test "" doesn't take into account, why ???
>
> because i've changed slightly the syntax to :
>
> valid_path=(valid_string and (/^\/.*$/ === s))
>
> (an enclosing parentheses couple more)
>
> and then, rubically, i get the good result ;-)
>
> any reason for such a behaviour ???
and has got a much lower priority than anything else (including the
assignement), so that your first statement is interpreted as
(valid_path=valid_string) and (/^\/.*$/ === s)
You wouldn't get this problem with the && operator -- and as you did
if you parenthize correctly.
Enjoy
Vince