<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Ofelia modules are confusing me]]></title><description><![CDATA[<p>OK, this is really perplexing me.</p>
<p>This works -- I can define a module using an argument for the name, and access it by name in a different abstraction.</p>
<p><img src="/uploads/files/1608465991919-of-moduletest.png" alt="of-moduletest.png" class="img-responsive img-markdown" /></p>
<p>But this modified version of @60-hz 's gl.image abstraction doesn't accept this style. The image loader shows no errors but the smaller 'bind' abstraction can't find <code>m.img</code>.</p>
<p><img src="/uploads/files/1608466162097-of-image-module.png" alt="of-image-module.png" class="img-responsive img-markdown" /></p>
<p>Same design: abs1 puts something into its M, abs2 &quot;require&quot;s that module and accesses a known variable name. But in the second case, require isn't getting the thing.</p>
<p><img class="emoji emoji-extended" src="http://forum.pdpatchrepo.info/plugins/nodebb-plugin-emoji-extended/images/question.png" title="???" alt="???" /></p>
<p>hjh</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/13193/ofelia-modules-are-confusing-me</link><generator>RSS for Node</generator><lastBuildDate>Sat, 16 May 2026 17:52:33 GMT</lastBuildDate><atom:link href="http://forum.pdpatchrepo.info/topic/13193.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 20 Dec 2020 12:11:08 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Ofelia modules are confusing me on Sun, 20 Dec 2020 12:11:08 GMT]]></title><description><![CDATA[<p>OK, this is really perplexing me.</p>
<p>This works -- I can define a module using an argument for the name, and access it by name in a different abstraction.</p>
<p><img src="/uploads/files/1608465991919-of-moduletest.png" alt="of-moduletest.png" class="img-responsive img-markdown" /></p>
<p>But this modified version of @60-hz 's gl.image abstraction doesn't accept this style. The image loader shows no errors but the smaller 'bind' abstraction can't find <code>m.img</code>.</p>
<p><img src="/uploads/files/1608466162097-of-image-module.png" alt="of-image-module.png" class="img-responsive img-markdown" /></p>
<p>Same design: abs1 puts something into its M, abs2 &quot;require&quot;s that module and accesses a known variable name. But in the second case, require isn't getting the thing.</p>
<p><img class="emoji emoji-extended" src="http://forum.pdpatchrepo.info/plugins/nodebb-plugin-emoji-extended/images/question.png" title="???" alt="???" /></p>
<p>hjh</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/13193/ofelia-modules-are-confusing-me</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/13193/ofelia-modules-are-confusing-me</guid><dc:creator><![CDATA[ddw_music]]></dc:creator><pubDate>Sun, 20 Dec 2020 12:11:08 GMT</pubDate></item><item><title><![CDATA[Reply to Ofelia modules are confusing me on Sun, 20 Dec 2020 20:02:19 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/ddw_music">@ddw_music</a> Hi, Can you upload a simplified patch that doesn't work? Does it happen when you require a variable name using &quot;$1&quot; symbol?</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/13193/ofelia-modules-are-confusing-me/2</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/13193/ofelia-modules-are-confusing-me/2</guid><dc:creator><![CDATA[cuinjune]]></dc:creator><pubDate>Sun, 20 Dec 2020 20:02:19 GMT</pubDate></item><item><title><![CDATA[Reply to Ofelia modules are confusing me on Mon, 21 Dec 2020 01:08:03 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/cuinjune">@cuinjune</a> said:</p>
<blockquote>
<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/ddw_music">@ddw_music</a> Hi, Can you upload a simplified patch that doesn't work? Does it happen when you require a variable name using &quot;$1&quot; symbol?</p>
</blockquote>
<p>I'll try... simple cases are still working -- this prints &quot;OK.&quot;</p>
<p><img src="/uploads/files/1608512830848-ofelia-module-simpler-ok.png" alt="ofelia-module-simpler-ok.png" class="img-responsive img-markdown" /></p>
<p>My initial approach did use $1 in the variable name and it seemed to construct the variable name correctly. But I removed $1 from the variable name when I realized I could keep it local to the module.</p>
<p>hjh</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/13193/ofelia-modules-are-confusing-me/3</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/13193/ofelia-modules-are-confusing-me/3</guid><dc:creator><![CDATA[ddw_music]]></dc:creator><pubDate>Mon, 21 Dec 2020 01:08:03 GMT</pubDate></item><item><title><![CDATA[Reply to Ofelia modules are confusing me on Mon, 21 Dec 2020 04:52:35 GMT]]></title><description><![CDATA[<p>I am also just now trying to do <code>for k, v in ipairs(m) do print(k, v) end;</code> after <code>require</code> and neither the simple cases nor the breaking case print any pairs...? I get e.g. <code>m = table: 0x555e9df43050</code> after require so it's getting some data structure, but I have no idea what's inside.</p>
<p>Is there any sort of established debugging methodology for this? It seems rather difficult to debug if one can't inspect the contents of the table.</p>
<p>hjh</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/13193/ofelia-modules-are-confusing-me/4</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/13193/ofelia-modules-are-confusing-me/4</guid><dc:creator><![CDATA[ddw_music]]></dc:creator><pubDate>Mon, 21 Dec 2020 04:52:35 GMT</pubDate></item><item><title><![CDATA[Reply to Ofelia modules are confusing me on Mon, 21 Dec 2020 11:01:57 GMT]]></title><description><![CDATA[<p>Oh, I finally spotted it. The root of the problem is an incorrect assumption about the meaning of the symbolic name given to [ofelia define].</p>
<p>I was basing my patch on @60-hz 's gl.image abstraction.</p>
<p>In the original, there's an [ofelia define image-$0] <em>and also</em> an [ofelia function image-$0].</p>
<p>I had inferred from this that sharing a name would allow the boxes to share data -- but now I see this was an incorrect design (both in my version and in the original). The second box sharing the name overwrites the table for that name, making data from the first box inaccessible elsewhere.</p>
<p>There should be one and only one box declaring a name. Other boxes that need to use data from the first box should use <code>require</code> but not specify a name.</p>
<p>After I deleted the function box from my broken test abstraction, then all was working.</p>
<p>So that looks like it -- multiple ofelia objects with the same name seems to be a counterindicated practice.</p>
<p>hjh</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/13193/ofelia-modules-are-confusing-me/5</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/13193/ofelia-modules-are-confusing-me/5</guid><dc:creator><![CDATA[ddw_music]]></dc:creator><pubDate>Mon, 21 Dec 2020 11:01:57 GMT</pubDate></item></channel></rss>