[Cuis-dev] Turning morphs back into source code
Ian Jeffries
mail at ianjeffries.net
Thu Dec 19 12:12:48 PST 2024
Thank you, that's a great example!
On Sat, Dec 7, 2024 at 8:46 AM H. Hirzel <hannes.hirzel at gmail.com> wrote:
> Hi Ian
>
> Just responding to your last mail on the issue of 'turning morphs back
> into source code':
>
> Hilaire Fernandes demonstrated in the 'July 2023' video ('What is new';
> https://www.youtube.com/watch?v=uAMkjTzHr8E) how he implemented the
> Scalable Vector Graphics export in DrGeo (File which generates the XML code
> is attached. He points out that the coding effort was astonishingly simple.
>
> The particular point is at minute 6:53 (see attachment) but it is good to
> start watching at minute 5 to have the context.
>
> Rendering morphs as SVG code is similar to rendering them as source code.
> You have to go through the morph hierarchy. Instead of generating XML
> elements you might generate source code or if that is not directly
> possible an intermediary code which will allow you to generate the source
> code later.
>
> I guess double-dispatching is used to do this (not checked).
>
> So you might have a SourceCodeCanvas which renders morphs as source code.
>
> I think I did something similar in my experiment years back, I'll see if I
> find time this month or early January to dig this out.
>
> Regards
>
> Hannes
>
>
>
> On 12/3/2024 5:22 PM, Ian Jeffries via Cuis-dev wrote:
>
> I hadn't seen `storeOn:` yet, thanks for pointing it out. I think my thing
> will complement it well, and I could even use `storeOn:` as a fallback in
> certain situations.
>
> On Wed, Nov 27, 2024 at 11:45 PM Luciano Notarfrancesco <
> luchiano at gmail.com> wrote:
>
>>
>> On Thu, Nov 28, 2024 at 08:01 Ian Jeffries <mail at ianjeffries.net> wrote:
>>
>>>
>>> OTOH I'm only starting with Morphic because it's handy. The topic I'm
>>> interested in is turning *any runtime objects* back into source code in
>>> the most idiomatic way possible.
>>>
>>
>> There’s Object>>#storeOn:, in case you haven’t seen it. Not really “the
>> most idiomatic wat”, tho, but you could implement your own if you wanted…
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20241219/cb40bd3a/attachment.htm>
More information about the Cuis-dev
mailing list