<div dir="ltr"><div dir="ltr">Hi Nahuel,<div><br></div><div>Interesting timing as I was thinking along the same lines in the last few days.  However, I think an Interval subclass is the wrong way to do it given the relative inefficiency of Interval as the parent class.  How about something along the lines of a SourceCodeRange class (a subclass of Object?) which just stores the start/end (or first/last... whatever) of the range and add whatever methods from Interval we find appropriate?  Then we could make things like SHRange subclasses of it.  Basically the convenience and (mostly) behavior of an Interval without the overhead.</div><div><br></div><div>What got me thinking about this is the OMeta uses Association to store first/last of ranges to *avoid* using Interval.  But I've always disliked using an Association this way and would like to switch to something else as long as it's efficient.</div><div><br></div><div>Thanks,</div><div>Phil</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, May 10, 2020 at 2:24 PM Nahuel Garbezza via Cuis-dev <<a href="mailto:cuis-dev@lists.cuis.st">cuis-dev@lists.cuis.st</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi! <br><div><br></div><div>I'm attaching a changeset (+ tests changeset) with the following:</div><div><br></div><div>Main changes:<br><br>Introduce the SourceCodeInterval class as a specialization of Interval, capable of dealing with source code transformations. Start to use SourceCodeInterval in the source ranges reported by the Parser, and on the intervals created on refactorings. This helped us to reduce utility methods related to source code on the Refactoring and ParseNode classes.<br><br>Changes on refactorings:<br><br>* [extract temporary] allow extracting entire statements without introducing an unnecessary extra statement<br>* [extract temporary] do not allow the user to extract on a smalltalk editor that does not contain a method<br>* [extract temporary] change the #apply message to return the updated source code<br>* [extract method] allow extracting expressions with multiple levels of parentheses and spaces between them<br></div></div>
-- <br>
Cuis-dev mailing list<br>
<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank">Cuis-dev@lists.cuis.st</a><br>
<a href="https://lists.cuis.st/mailman/listinfo/cuis-dev" rel="noreferrer" target="_blank">https://lists.cuis.st/mailman/listinfo/cuis-dev</a><br>
</blockquote></div></div>