Hi, As you might now, we abuse the literals of compiled methods to hold on to the class and the literal. (and the place used to store the literal is used for additional properties if there are some). So right now we have the problem that #literals just returns all the literals and clients do “allButLast” to filter out the class binging, but they ignore the selector. #hasLiteral: doe the filtering *and* it filters the last two. All quite confusing. So, this is true: (Object >> #yourself) literals includes: #yourself. (Object >> #yourself) hasLiteralSuchThat: [ :lit | lit = #yourself]. but this is false: (Object >> #yourself) hasLiteral: #yourself. (Object >> #yourself) hasLiteralThorough: #yourself. I suggest we make this simpler by: -> #allLiterals return all the literals, even the abused last two -> #literals returns what you think it should: the true literals of the method, without the last two abused fields. -> fix all cases of “literals allButLast”, there are not many. Is there any reason why this could be bad? Marcus
|
Hi Marcus.
#literals and #allLiterals are good idea but maybe we can better distinguish them using more specific names like: - for all literals: encodedLiterals or allEncodedLiterals - for real literals: syntaxLiterals, semanticLiterals, userLiterals, sourceCodeLiterals 2018-06-08 11:17 GMT+03:00 Marcus Denker <[hidden email]>:
|
I am not sure. that looks even more complex to me.
|
Free forum by Nabble | Edit this page |