<div dir="auto">+1<div dir="auto">I was thinking exactly the same thing in the context of Squeak recently. However, for text selection, we might need a specialization with pivotPoint.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le dim. 10 mai 2020 à 21:17, Hernan Wilkinson via Cuis-dev <<a href="mailto:cuis-dev@lists.cuis.st">cuis-dev@lists.cuis.st</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Phil, <br><div> great observation! </div><div> I proposed to Nahuel to subclass Interval (he thought the same design that you suggested) to keep polymorphism at the beginning so he could start using SourceCodeRange immediately, and then make a refactoring to get the model you suggested. So this is just a first step, we will see how it evolves.</div><div><br></div><div>Hernan.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, May 10, 2020 at 3:53 PM Phil B via Cuis-dev <<a href="mailto:cuis-dev@lists.cuis.st" target="_blank" rel="noreferrer">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">Actually, Object->Range->SourceCodeRange probably makes more sense.  Non-Interval ranges are useful for things beyond source code.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, May 10, 2020 at 2:37 PM Phil B <<a href="mailto:pbpublist@gmail.com" target="_blank" rel="noreferrer">pbpublist@gmail.com</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"><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" target="_blank" rel="noreferrer">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" rel="noreferrer">Cuis-dev@lists.cuis.st</a><br>
<a href="https://lists.cuis.st/mailman/listinfo/cuis-dev" rel="noreferrer noreferrer" target="_blank">https://lists.cuis.st/mailman/listinfo/cuis-dev</a><br>
</blockquote></div></div>
</blockquote></div>
-- <br>
Cuis-dev mailing list<br>
<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank" rel="noreferrer">Cuis-dev@lists.cuis.st</a><br>
<a href="https://lists.cuis.st/mailman/listinfo/cuis-dev" rel="noreferrer noreferrer" target="_blank">https://lists.cuis.st/mailman/listinfo/cuis-dev</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><span style="font-family:tahoma,sans-serif;font-size:xx-small;border-collapse:collapse"><strong><span style="font-size:8pt"><span><span style="font-size:small"><font size="2"><span style="font-weight:normal"><span style="font-weight:bold">Hernán Wilkinson</span><br>Agile Software Development, Teaching & Coaching</span></font></span></span></span></strong></span></div><div><span style="font-family:tahoma,sans-serif;font-size:xx-small;border-collapse:collapse"><strong><span style="font-size:8pt"><span><span style="font-size:small"><font size="2"><span style="font-weight:normal">Phone: +54-011</span></font></span></span></span></strong></span><font face="tahoma, sans-serif" size="2">-4893-2057</font></div><div><strong style="font-family:tahoma,sans-serif;font-size:xx-small"><span style="font-size:8pt"><span style="font-size:small"><font size="2"><span style="font-weight:normal">Twitter: @HernanWilkinson</span></font></span></span></strong></div><div><span style="font-family:tahoma,sans-serif;font-size:xx-small;border-collapse:collapse"><strong><span style="font-size:8pt"><span><span style="font-size:small"><font size="2"><span style="font-weight:normal">site: <a href="http://www.10pines.com/" style="color:rgb(17,65,112)" target="_blank" rel="noreferrer">http://www.10Pines.com</a></span></font></span></span></span></strong></span></div><div><font face="tahoma, sans-serif"><span style="border-collapse:collapse">Address: Alem 896</span></font>, Floor 6, Buenos Aires, Argentina</div></div></div></div></div></div></div></div></div></div></div></div>
-- <br>
Cuis-dev mailing list<br>
<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank" rel="noreferrer">Cuis-dev@lists.cuis.st</a><br>
<a href="https://lists.cuis.st/mailman/listinfo/cuis-dev" rel="noreferrer noreferrer" target="_blank">https://lists.cuis.st/mailman/listinfo/cuis-dev</a><br>
</blockquote></div>