Formatting output optimal for processing in Max

With this thread I like to get opinions of the MFL community for the output format of complex objects in Max. After explaining a real live example I will ask 3 questions for your opinions.

The demo is for Windows. I don’t know if it will work on Apple.

[attachment=132790,561]

I’ve written a MFL interface for the Novation Launchpad. It will also work with the software only. So stay tuned! The most obvious use is to place it inside a bpatcher and to add circuitry to make it do something useful.

The direction has changed from top-down to left-right. At the top a start/stop and a reset button are added and it plays in sync with Live 8th notes. This application is written in Javascript.

As a seasoned C# programmer I tend to see Max objects as the equivalent of functions. When working with javascript this works quite well. I want to recreate this program in Max. This gets me into some issues for choosing the most useful output format.

Currently the syntax for asking the colour of a led/button is:
[top|matrix|right] get [column-number] and for matrix leds additionally [row-number]
The answer is currently:
[top|matrix|right] color [0-7].

1. The position of the led is currently not in the output format.
The javascript for rainstorm has to save the position of the led for witch the colour is asked. To prevent mismatches it is clear that the position of the led should be added to the output. But should this come before or after the colour information?

The colour of a led can be asked for several reasons. I’m not certain that after asking a colour because a button was pressed the first output answers this question and is not an output for the working of the sequencer. In Max there is no function call, only goto. This can be solved by adding a symbol (or even a js object) to the input. This symbol should be part of the output to lead the processing in the right direction. For instance the input of the launchpad emulation could be ‘matrix get 3 4 ShiftIt’