-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using chained comparator #4353
Using chained comparator #4353
Conversation
Does this read better ? ~~~diff -$/.Int <= 255 && $/.Int >= 0 +0 <= $/.Int <= 255 ~~~
I think so, yes. |
I don't know the context, intent of the example, etc, but why not Is there some numeric coercion edge case that I'm not taking into account but would occur in the intended context? (eg if |
my regex ipv4-octet { \d ** 1..3 <?{ 0 <= $/ <= 255 }> } It looks to me like the match could only be a number comprising of 1 to 3 digits and so an implicit cast is safe ? FWIW if I run the full code snippet, then I get the same result. The next example negates things and so things get split up: $o < 0 || $o > 255 So perhaps it would be even more clearer to use : $/ ~~ 0..255
$/ !~~ 0..255 and make them more self-similar instead ? |
Ah. OK. Yeah. But a few things to note:
|
The document is about regexes, so not sure if going into |
I agree just the small change is fine. Are you happy with the PR as is? @raiph can submit a separate PR for the change they are suggesting. |
Yes, thank you. |
Done, thanks for the cleanup. |
Does this read better ?