[Cuis-dev] Expanding on #noteCompilationOf:meta:

Juan Vuletich juan at jvuletich.org
Thu Jan 23 11:05:38 PST 2020


Hi Folks,

(Hernán, I'm not answering your message, but Phil's original one 
because, although I share your curiosity and concerns, I want to answer 
in a rather orthogonal way)

Phil, I think you are raising three completely different issues here 
(inline).

On 1/18/2020 8:07 PM, Phil B via Cuis-dev wrote:
> Attached is a first cut of something I've wanted for a while: the 
> ability to capture method changes as they occur with the ability to 
> prevent them from happening if needed at a global level.  Basically 
> it's just paired methods of #isOkTo[Compile|Remove]:meta: and 
> #note[Compilation|Removal]Of:meta:.
>
> It's always bothered me how central the method  structure is yet 
> completely useless from the standpoint of having extensible 
> metadata... if I'm wrong re: extensibility, please let me know what 
> I've overlooked.  So barring that, these changes allow for things like 
> helping to keep a separate metadata structure in sync with method 
> changes.  The main requirement is to be able to track method adds, 
> changes and deletes to the image globally.  Not sure, but I was 
> thinking that this facility might also be useful for refactoring tools.

Issue 1: Making the infrastructure for rejecting the compilation of a 
method more consistent, flexible and extensible. I'm no sure if your 
implementation is the best possible (because of Hernán's concerns, and 
because it is an ongoing discussion), but I think it is a good idea. If 
we can find a way to do it that makes everybody happy, let's go for it.

Issue 2: Allowing interested parties to be notified of changes to code. 
Here I don't think we need a new mechanism. We already have 
SystemChangeNotifier. See senders of #methodAdded, #methodChanged and 
#methodRemoved . I think it is better to use this, and keep enhancing it 
as convenient.

> One issue / odd thing I noticed: the removal methods only get called 
> instance-side due to ClassDescription #removeSelector: only getting 
> called on instance methods and you have to jump up to the Behavior 
> implementor for class methods.  That seems strange to me since method 
> compilation all appears to occur at the level of ClassDescription.  Is 
> there a reason removals need to be different from compilation in this 
> way?  (Not knowing the answer, I haven't fixed this issue in the 
> attached changeset)

Issue3: Inconsistencies in existing code. WRT #noteCompilationOf:meta: , 
I'd just remove it. Users should use SystemChangeNotifier anyway. Other 
inconsistencies you see in the code should be discussed and fixed.

Thanks,

-- 
Juan Vuletich
www.cuis-smalltalk.org
https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev
https://github.com/jvuletich
https://www.linkedin.com/in/juan-vuletich-75611b3
@JuanVuletich



More information about the Cuis-dev mailing list