You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Per other discussions, it seems like P5P would prefer a specification rather than an implementation. That's what sort of happened with my initial work with Corinna, though Paul Evans then wrote Object::Pad and the community rallied around the idea to the point where Object::Pad is being used in production systems, despite the disclaimer that it shouldn't be.
We have three "main" components for Data::Checks
Native checks
HASH, INT, and so on. These are implemented.
User-defined checks.
check Grades :isa(NUM[0..4]);
# The values of the hash must remain unique...
check Bijective :on(HASH) ($new_value, %target) {
#######return$target{old} eq$new_value
|| notgrep { $_eq$new_value} } values$target{var}->%*;
}
This is not yet implemented.
Coercions
# Must be a string that's at least twelve characters long (if not, pad it)...
coercion LongStr :to(STR[/.{12}/]) ($value) {
my$is_ref = reftype($value);
die"$is_ref reference $value can't be converted to a LongStr"if$is_ref;
returnsprintf('%12s', $value) }
}
This is not yet implemented. They present some issues. One of the biggest is that coercions cannot be disabled without breaking the code.
I would suggest that for the MVP, we only include native checks. That will be a frustrating limitation, but also constrains the problem space. tremendously.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Per other discussions, it seems like P5P would prefer a specification rather than an implementation. That's what sort of happened with my initial work with Corinna, though Paul Evans then wrote
Object::Pad
and the community rallied around the idea to the point whereObject::Pad
is being used in production systems, despite the disclaimer that it shouldn't be.We have three "main" components for
Data::Checks
Native checks
HASH
,INT
, and so on. These are implemented.User-defined checks.
This is not yet implemented.
Coercions
This is not yet implemented. They present some issues. One of the biggest is that coercions cannot be disabled without breaking the code.
I would suggest that for the MVP, we only include native checks. That will be a frustrating limitation, but also constrains the problem space. tremendously.
Beta Was this translation helpful? Give feedback.
All reactions