1

When using

SomeClass compile: someSourceString

the symbol containing method's name is returned. Is there any reason why not an instance of CompiledMethod is returned? There are couple of tests like:

tutu compile: 'foo'.
self deny: (tutu >> #foo) allLiterals last key isNil.

Is there any method that returns a compiled method like:

compileMethod: aString
  ^ self >> (self compile: aString)
Uko
  • 13,134
  • 6
  • 58
  • 106

1 Answers1

1

How about this ?

(SomeClass compiledMethodAt: (SomeClass compile:'foo')) 

This will return the compiled method you need.

Thushar G R
  • 1,017
  • 9
  • 24
  • Yes, `>>` is a shortcut for `compiledMethodAt:`. The question is why would you return selector, and use something like `(SomeClass compiledMethodAt: (SomeClass compile:'foo'))` to get method when you can return a method and get selector with `(SomeClass compile:'foo') selector` if needed. – Uko Aug 01 '14 at 13:43