Replies: 5 comments 9 replies
|
@happy-barney, correct me if I'm wrong, but this may be what you were describing when you said:
at https://www.nntp.perl.org/group/perl.perl5.porters/2023/05/msg266478.html. |
2 replies
|
The current RFC 0022 for metaprogramming does not address this per Perl/PPCs#25 (comment). |
0 replies
|
This will also be needed for multimethods. |
0 replies
|
I also wonder how this would work with signature of something like sub around(
METHOD_NAME $method_name, # * Str that matches a valid method name
# (maybe check the package stash too?)
CODEREF[ [
coderef_check_with_signature_of($method_name), # * This is another CODEREF
parameters_of($method_name) # * Flattens all the checks
] => Any ] ) { # * `around` allows return type to change
# (though that would be bad design)
...
}or if this should be part of a DbC-style precondition? |
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
In addition to making the checks themselves be first class as brought up in https://github.com/orgs/Perl-Oshun/discussions/6, this information should also be available at runtime for introspection via the MOP.
This has some precedent on CPAN:
It also would allow for a kind of check that is not yet defined in the spec
which is to check
CODEparameters and return:And would allow for some decoupling in the implementation of Design by Contract https://github.com/orgs/Perl-Oshun/discussions/41 (any kind of verifier could be used by the user).
Keywords: MOP, meta, metadata, introspection, coderef
All reactions