Open demarey opened 1 year ago
Do you have an example?
(Smalltalk compiler compile: 'foo ^1') class >>> CompiledMethod
ClassDescription>>#compile:classified:notifying:
String compile: 'foo' classified: 'foo' notifying: nil >>> "#foo"
My guess it's that a legacy thing and since that there are a lot of clients that expect that such methods return selectors there is no real gain to change that. Maybe @MarcusDenker knows the history better.
yes, this is legacy.. I wonder if it is not better to add new APIs and keep the old ones compatible
I opened a meta-issue #12883 to rant about the compilation API for instance :)
My position on this specific issue: compile:*
is legacy, maybe we could deprecate it? The way forward is the compiler
message. But the API is still under heavy changes. It could be a Pahro12 goal
String compile: 'foo' classified: 'foo' notifying: nil >>> "#foo"
should become something like
String compiler protocol: 'foo'; install: 'foo' >>> aCompiledMethod
Strangely, all compile: .... methods return a selector. They should return the
CompiledMethod
object.