logo       

Delagating variable lookup.: msg#00161

lang.groovy.user

Subject: Delagating variable lookup.

Hello,

Since I program on the client side, I decided to use groovy on more than the
toys I have been using it with. So I want to create a little swing
spreadsheet. I also want the formulas in cells to be groovy scripts.
How would I do something like:
sum(A1..A10)
when A1 is not a variable but rather a name of a cell. Cells will be stored
in a sparse array backed by a map.
With Jython I can create a custom dictionary and check if the variable name
looks like a cell name, and find the correct cell. It is a hack, but it is
possible.
Is there some sort of way to delegate variable lookup to my code in Groovy?
Otherwise I will need to do things like sum("A1..A10") and parse the range
myself, which is not as nice.

Thanks
-Ed




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise