<div dir="ltr"><div>And a drawback of storing the bytes in a literal is that it doubles the space required...<br></div>But then we don't need to clone a prototype (veryDeepCopy !!!)<br>If we're really chasing kbytes, then we should ban the prototype, so this can't be an argument.<br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/12/8 Nicolas Cellier <span dir="ltr"><<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div><div>A few things:<br></div>1) PaintBoxMorph new is cloning a Prototype much like the self way.<br>
</div>2) above code is memorizing how the prototype was once initialized.<br>
</div><div>2.a) it will never be invoked again, unless we recreate a whole image <br></div>2.b) it does so partially... It does tell which file, but not from which server.<br></div>The information of well known update server is no more in the image.<br>
You could find <a href="http://ftp.squeak.org" target="_blank">ftp.squeak.org</a> recently in Utilities before I removed the class var...<br>... but <a href="http://ftp.squeak.org" target="_blank">ftp.squeak.org</a> doesn't seem to know about colorPalClosed.obj.<br>
</div>3) I don't see an updateStream dependency in Installer core, only a dependency on its successor MCMcmUpdater<br><br></div>2.a) makes me think we don't need something complex.<br></div>2.b) makes me think it's time to replace/update the initialize mechanism<br>
<br></div>I looked at the cached images, it's about 35kbytes, 16kBytes zipped.<br>A possible alternative is to directly store those bytes in some literal (string -> uudecode -> unzip -> bits).<br></div><div class="HOEnZb">
<div class="h5"><div class="gmail_extra">
<br><br><div class="gmail_quote">2013/12/8 Chris Muller <span dir="ltr"><<a href="mailto:asqueaker@gmail.com" target="_blank">asqueaker@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>On Sun, Dec 8, 2013 at 2:48 PM, Nicolas Cellier<br>
<<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmail.com</a>> wrote:<br>
> Well, above code depends on some bytes left on some file on the internet,<br>
<br>
</div>Not necessarily. See Installer class>>#airplaneMode.<br>
<br>
Besides, even if it did, it's 2013 so developers are accustomed to<br>
working with remote code repositories.<br>
<div><br>
> plus a bunch of methods to retrieve/decode/install those bytes as an image.<br>
<br>
</div>Which is a requirement of #core. See comment for Installer>>#core.<br>
<div><br>
> We could as well imagine a shorter path...<br>
<br>
</div>Like what?<br>
<div><div><br>
<br>
> 2013/12/8 Chris Muller <<a href="mailto:asqueaker@gmail.com" target="_blank">asqueaker@gmail.com</a>><br>
>><br>
>> MorphicExtras is "extras" so we can expect it to depend on myriad<br>
>> other packages. I'm surprised you and Frank aren't harping on such a<br>
>> "catch-all" package.<br>
>><br>
>> I thought to test the waters of making it a dynamic-dependency.<br>
>><br>
>> On Sat, Dec 7, 2013 at 8:27 AM, Nicolas Cellier<br>
>> <<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmail.com</a>> wrote:<br>
>> > On one hand, I find those bytes very useful if ever we'd like to<br>
>> > recreate an<br>
>> > image.<br>
>> > But on the other hand, it creates a dependency.<br>
>> > This makes a nice packaging problem, how to handle it?<br>
>> > One possibility would be to encode image data in some kind of literal<br>
>> > (packed string, byte array, ...), and store & decode this literal in<br>
>> > some<br>
>> > class initialization method...<br>
>> > Anyway, the name and location of file does not bring much value now<br>
>> > (just<br>
>> > save a few bytes by avoiding duplication of image in a literal).<br>
>> ><br>
>> ><br>
>> > 2013/12/7 <<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>><br>
>> ><br>
>> >> Nicolas Cellier uploaded a new version of MorphicExtras to project The<br>
>> >> Trunk:<br>
>> >> <a href="http://source.squeak.org/trunk/MorphicExtras-nice.130.mcz" target="_blank">http://source.squeak.org/trunk/MorphicExtras-nice.130.mcz</a><br>
>> >><br>
>> >> ==================== Summary ====================<br>
>> >><br>
>> >> Name: MorphicExtras-nice.130<br>
>> >> Author: nice<br>
>> >> Time: 7 December 2013, 3:18:35 pm<br>
>> >> UUID: f1cfb1fa-c101-4329-b528-963fb90eef45<br>
>> >> Ancestors: MorphicExtras-fbs.129<br>
>> >><br>
>> >> Some initialization performed once in last century is depending on<br>
>> >> UpdateStream.<br>
>> >><br>
>> >> =============== Diff against MorphicExtras-fbs.129 ===============<br>
>> >><br>
>> >> Item was changed:<br>
>> >> ----- Method: PaintBoxMorph>>loadColorChooser (in category<br>
>> >> 'initialization') -----<br>
>> >> loadColorChooser<br>
>> >> "Load Forms for ColorMemoryMorph."<br>
>> >><br>
>> >> | doc closedForm openForm |<br>
>> >> + doc := UpdateStreamDownloader default objectStrmFromUpdates:<br>
>> >> 'colorPalClosed.obj'.<br>
>> >> - doc := Utilities objectStrmFromUpdates: 'colorPalClosed.obj'.<br>
>> >> closedForm := doc fileInObjectAndCode mapColor: Color<br>
>> >> transparent<br>
>> >> to: Color black.<br>
>> >> + doc := UpdateStreamDownloader default objectStrmFromUpdates:<br>
>> >> 'colorPalOpen.obj'.<br>
>> >> - doc := Utilities objectStrmFromUpdates: 'colorPalOpen.obj'.<br>
>> >> openForm := doc fileInObjectAndCode mapColor: Color transparent<br>
>> >> to: Color black.<br>
>> >><br>
>> >> colorMemoryThin image: closedForm.<br>
>> >> colorMemoryThin position: self position + (0@140).<br>
>> >><br>
>> >> colorMemory delete. "delete old one"<br>
>> >> colorMemory := PaintBoxColorPicker new image: openForm.<br>
>> >> !<br>
>> >><br>
>> >><br>
>> ><br>
>> ><br>
>> ><br>
>> ><br>
>><br>
><br>
><br>
><br>
><br>
<br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>