Replies: 4 comments
-
I think the flag whether the method is instance method or class method is needed.
|
Beta Was this translation helpful? Give feedback.
-
Originating role is probably fine, but just as food for thought, the original traits specification for Smalltalk made it clear that if two roles present methods with identical signatures, there is no conflict if the bytecode representation is the same. Thus, you could have two or more roles presenting the same method. If we were using something like this for automatic refactoring tools, we'd want to know all of the methods that presented an identical method. We probably don't want to inspect the bytecode per method, but I thought I'd mention that in case I'm wrong. However, by ignoring identical bytecode, we have to be explicit in method exclusion. That means "originating role" will still work, but I know there are those who are strongly against aliasing and excluding. (Personally, I'd also add "rename" which is is a combination of "alias" and "exclude") |
Beta Was this translation helpful? Give feedback.
-
Methods now have the |
Beta Was this translation helpful? Give feedback.
-
Current Implementation (2022-08-17)(This issue is about the static representation of a method within a class. For more details on the runtime behaviour of how a method body will run, see also #8) A method is a CV, with additionally the Currently, a method CV does not store any additional information; nor is its existence tracked by any additional data in its class stash, beyond the regular operation of GVs in the stash as would be the case for a regular sub in a regular package. APIA method CV is created by beginning a CV parse operation using the usual void class_prepare_method_parse(CV *cv); This function sets up the OP *class_wrap_method_body(OP *o); The result of that can then be passed into This API shape is a rather delicate balance. It is likely to change before code merge, by folding more parts of the operation into |
Beta Was this translation helpful? Give feedback.
-
How should "methods" be represented?
A method is primarily still a function, so a CV still seems fine. But it does require a few additional bits of data:
Beta Was this translation helpful? Give feedback.
All reactions