> On 8 Jun 2018, at 12:42, Denis Kudriashov <dionisi...@gmail.com> wrote:
> 
> 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
> 

I am not sure. that looks even more complex to me.

> 2018-06-08 11:17 GMT+03:00 Marcus Denker <marcus.den...@inria.fr 
> <mailto:marcus.den...@inria.fr>>:
> 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.
> 
>       https://github.com/pharo-project/pharo/pull/1502/files 
> <https://github.com/pharo-project/pharo/pull/1502/files>
> 
> Is there any reason why this could be bad? 
> 
>       Marcus
> 

Reply via email to