<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<blockquote style="border-color: rgb(200, 200, 200); border-left: 3px solid rgb(200, 200, 200); padding-left: 10px; color: rgb(102, 102, 102);">
I didnt know you could have two [array define] with the same name without printing "warning:
<i>arrayname</i>: multiply defined", and this feels like a bug to me, because what's the use case here? I treid using [array set] and it only did set one of the arrays... (the first one)<br>
</blockquote>
<br>
The use is to warn you against using multiple [array define]'s of the same name! That's a dangerous thing to do, since you're never going to know which array is being used (unless you happen to remember which one you created first).<br>
<br>
There are two possibilities: either you want each instance of the array to be unique. In that case, use $0. Or, you want only one array. In that case, put it outside the abstraction.<br>
<br>
<blockquote style="border-color: rgb(200, 200, 200); border-left: 3px solid rgb(200, 200, 200); padding-left: 10px; color: rgb(102, 102, 102);">
well, by using [array set] it gives you the "warning: <i>arrayname</i>: multiply defined", so there you go... I say this is not "value" behaviour, as you still only have one defined array to access<br>
</blockquote>
<br>
PD is complaining that you have multiple [array define]'s, not multiple [array set]'s. You can have as many [array set]'s of the same name as you want.<br>
<br>
However, you're right that it seems to take an [array set] to trigger this warning message, which is a bit confusing.<br>
<br>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Alexandre Torres Porres <porres@gmail.com><br>
<b>Sent:</b> 07 May 2018 19:11<br>
<b>To:</b> Liam Goodacre<br>
<b>Cc:</b> Pd-list<br>
<b>Subject:</b> Re: [PD] static array/text</font>
<div> </div>
</div>
<meta content="text/html; charset=utf-8">
<div>
<div dir="ltr">I didnt know you could have two [array define] with the same name without printing "warning:
<i>arrayname</i>: multiply defined", and this feels like a bug to me, because what's the use case here? I treid using [array set] and it only did set one of the arrays... (the first one)</div>
<div class="x_gmail_extra"><br>
<div class="x_gmail_quote">2018-05-07 13:41 GMT-03:00 Liam Goodacre <span dir="ltr">
<<a href="mailto:liamg_uw@hotmail.com" target="_blank">liamg_uw@hotmail.com</a>></span>:<br>
<blockquote class="x_gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span class="">
<blockquote style="border-color:rgb(200,200,200); border-left:3px solid rgb(200,200,200); padding-left:10px; color:rgb(102,102,102)">
Seems like the "value behaviour" is something that could be implemented in [array define] with a new flag, right?<br>
</blockquote>
<br>
</span>Correct me if I'm wrong, but the [array] objects already have [value] like behavior, in that you can have multiple objects referencing the same array. The difference is that with [value], the reference is implicit while with [array] it is explicit (ie.
 [array define]).<br>
<br>
The only thing a flag could do would be to tell [array define] to accept the first instance of a particular argument and reject the rest. But this would lead to a lot of confusion since you could have lots of empty [array define]'s scattered around the place.<br>
<br>
The best solution is surely to put the array in a parent patch of the abstraction. If you don't mind putting it there yourself, you can do as Ingo suggested. If you want it to happen automatically, then there are neat dynamic patching solutions available.<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr style="display:inline-block; width:98%">
<div id="x_m_-2072753792705198898divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Pd-list <<a href="mailto:pd-list-bounces@lists.iem.at" target="_blank">pd-list-bounces@lists.iem.at</a>> on behalf
 of Alexandre Torres Porres <<a href="mailto:porres@gmail.com" target="_blank">porres@gmail.com</a>><br>
<b>Sent:</b> 07 May 2018 15:46<br>
<b>To:</b> Pd-list<span class=""><br>
<b>Subject:</b> Re: [PD] static array/text</span></font>
<div> </div>
</div>
<div>
<div class="x_h5">
<div>
<div dir="ltr">Seems like the "value behaviour" is something that could be implemented in [array define] with a new flag, right?</div>
<div class="x_m_-2072753792705198898x_gmail_extra"><br>
<div class="x_m_-2072753792705198898x_gmail_quote">2018-05-07 10:19 GMT-03:00 Antoine Rousseau
<span dir="ltr"><<a href="mailto:antoine@metalu.net" target="_blank">antoine@metalu.net</a>></span>:<br>
<blockquote class="x_m_-2072753792705198898x_gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div dir="ltr">In moonlib you can find [sarray] and [slist], which implement the [value] behaviour (i.e multiple declarations of a shared data) for array and list of symbols.
<br>
They are also dynamically re-assignable.<span class="x_m_-2072753792705198898x_HOEnZb"><font color="#888888"><br>
<br>
</font></span></div>
<div class="x_m_-2072753792705198898x_gmail_extra"><span class="x_m_-2072753792705198898x_HOEnZb"><font color="#888888"><br clear="all">
<div>
<div class="x_m_-2072753792705198898x_m_823390575588311968gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div dir="ltr"><font face="arial, helvetica, sans-serif">Antoine Rousseau </font></div>
<div dir="ltr"><font face="arial, helvetica, sans-serif">  <a href="http://metalu.net" target="_blank">http://www.metalu.net</a> __ <a href="http://www.metaluachahuter.com/compagnies/al1-ant1/" target="_blank">htt<wbr>p://www.metaluachahuter.com/</a><br>
<br>
</font></div>
</div>
</div>
</div>
</div>
</div>
</font></span>
<div>
<div class="x_m_-2072753792705198898x_h5"><br>
<div class="x_m_-2072753792705198898x_gmail_quote">2018-05-07 13:47 GMT+02:00 Ingo Stock
<span dir="ltr"><<a href="mailto:mail@ingostock.de" target="_blank">mail@ingostock.de</a>></span>:<br>
<blockquote class="x_m_-2072753792705198898x_gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
Maybe you can just put the text/array object into the main file, like in<br>
the attached demo?<br>
<br>
best, ingo<br>
<span><br>
<br>
On 05/07/2018 12:02 AM, Dan Wilcox wrote:<br>
> Is there one way to define a "static" table or text data that can be<br>
> shared among abstractions? I have a few abstractions which use lookup<br>
> tables and I realize now that they are basically creating a copy with<br>
> each instance when they could really share the same data directly. I<br>
> suppose this would be somewhat related to [value].<br>
> <br>
> --------<br>
> Dan Wilcox<br>
</span>> @danomatika <<a href="http://twitter.com/danomatika" rel="noreferrer" target="_blank">http://twitter.com/danomatika</a><wbr>><br>
> <a href="http://danomatika.com" rel="noreferrer" target="_blank">danomatika.com</a> <<a href="http://danomatika.com" rel="noreferrer" target="_blank">http://danomatika.com</a>><br>
> <a href="http://robotcowboy.com" rel="noreferrer" target="_blank">robotcowboy.com</a> <<a href="http://robotcowboy.com" rel="noreferrer" target="_blank">http://robotcowboy.com</a>><br>
> <br>
> <br>
> <br>
> <br>
> <br>
> ______________________________<wbr>_________________<br>
> <a href="mailto:Pd-list@lists.iem.at" target="_blank">Pd-list@lists.iem.at</a> mailing list<br>
> UNSUBSCRIBE and account-management -> <a href="https://lists.puredata.info/listinfo/pd-list" rel="noreferrer" target="_blank">
https://lists.puredata.info/li<wbr>stinfo/pd-list</a><br>
> <br>
<br>
______________________________<wbr>_________________<br>
<a href="mailto:Pd-list@lists.iem.at" target="_blank">Pd-list@lists.iem.at</a> mailing list<br>
UNSUBSCRIBE and account-management -> <a href="https://lists.puredata.info/listinfo/pd-list" rel="noreferrer" target="_blank">
https://lists.puredata.info/li<wbr>stinfo/pd-list</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</div>
</div>
<br>
______________________________<wbr>_________________<br>
<a href="mailto:Pd-list@lists.iem.at" target="_blank">Pd-list@lists.iem.at</a> mailing list<br>
UNSUBSCRIBE and account-management -> <a href="https://lists.puredata.info/listinfo/pd-list" rel="noreferrer" target="_blank">
https://lists.puredata.info/li<wbr>stinfo/pd-list</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</div>
<br>
______________________________<wbr>_________________<br>
<a href="mailto:Pd-list@lists.iem.at">Pd-list@lists.iem.at</a> mailing list<br>
UNSUBSCRIBE and account-management -> <a href="https://lists.puredata.info/listinfo/pd-list" rel="noreferrer" target="_blank">
https://lists.puredata.info/<wbr>listinfo/pd-list</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</div>
</body>
</html>