[PD] Pd-extended can't see $0-arrays ???

Jonathan Wilkes jancsika at yahoo.com
Sat Feb 18 20:20:35 CET 2012



----- Original Message -----
> From: Mathieu Bouchard <matju at artengine.ca>
> To: Jonathan Wilkes <jancsika at yahoo.com>
> Cc: Фывапр Олджэвич <tofuckof at inbox.ru>; PD-list <pd-list at iem.at>
> Sent: Saturday, February 18, 2012 1:20 PM
> Subject: Re: [PD] Pd-extended can't see $0-arrays ???
> 
> Le 2012-02-13 à 20:07:00, Jonathan Wilkes a écrit :
> 
>> Do gpointers only point to scalars?  Because if you _could_ get a pointer 
> to an array-- perhaps using my canvas 'get' method patch-- you could 
> just make all arrays canvas local and forget all this $0- business:
> 
> AFAIK :
> 
> Pointers point either to scalars or to array elements. You can't point to a 
> whole array in a way distinct from pointing to an element of it. Therefore, a 
> pointer to the first element (0) of an array is the best equivalent of what 
> would be a pointer to an array (like it is in C language).

Hm, maybe it's simpler than that:
1) make all arrays canvas local, e.g., "array1" is local to the canvas that holds its [table] object or "Put" menu array graph
2) tabread, tabwrite~, etc. read from the array on the local canvas
3) add an optional (gpointer) argument to the "set" method so you can do "set arrayname (gpointer)" to tell it to look in 
a different canvas for arrayname. (Since (gpointer) can point to the "head" of a glist.)

This could potentially double as a way to use ds-arrays inside tabread, tabwrite~, etc., since with "set array (gpointer)" 
$1 could specify the name of the [struct] that is used as a template for the array and $2 could point to scalar that contains it.

It wouldn't be hard to abstraction-ize it so the user doesn't even have to think about pointers or scalars or $0.

-Jonathan

> 
> ______________________________________________________________________
> | Mathieu BOUCHARD ----- téléphone : +1.514.383.3801 ----- Montréal, QC
> 



More information about the Pd-list mailing list