Variable Arguments Annotation Issue
I’m testing out using variable arguments in Iguana, and it seems annotations doesn’t understand what’s happening; displaying nil instead of the parameters. It still works fine, so I know it’s a small issue, but thought you might want to know about it.
Alan Mc Grane,
Attachments:You must be logged in to view attached files.
It’s really difficult to get that working with the Lua apis offered to make getting the annotations possible.
Simple solution for you in this case is rather than using the … notation just pass in a Lua table instead which gives you the same flexibility but has first class annotation support etc.
Yes, the table is definitely an alternative. I just thought I would let you know in case you had missed it, as it is a feature of Lua that wouldn’t be used too often.
Yes thanks Alan – I think the table solution will be just fine. I’ve never had to use the … notation.
It would be nice if we could handle that … notation with annotations but I know from experience that there is a world of pain going in and messing with the logic that we use to detect parameters coming in and out of Lua functions. We’ve tried about 4 different algorithms before arriving on the compromise we have today which still has some minor flaws. It’s be re-written multiple times – honestly there are other areas of the product that more effort could be put into that would yield much greater benefits.
Looks like Bret is making really good progress with the new project manager tree – it supports nested directories and there is an ability for translator projects to have their own local files which are not shared. It’s a big piece of work but for anyone who has used the translator it will spell out to a lot more convenience and power. It will be so nice to be able to run locally modified versions of shared modules without needing to worry about the impact on other channels.
Haha, oh dear…that sounds pretty involved! Yeah, it’s a very small aspect of annotations for a feature that is not necessary (at least not for our purposes) when a table can replace it. Actually, I think Lua automatically adds the variables to a temp table called ‘arg’ anyway once the function is called, so the only way to access the variables is to treat them like a table one way or the other.
That sounds invaluable; a change made to a module in a test channel which is shared with a live one can very easily happen and cause errors.
I meant to thank you for implementing the channel API…We’re still using the one I developed which gets the channel milestone info from the vcs_repo.sqlite file, but as we upgrade more Iguana instances to the newer version which includes the API, we can then convert to using it.
You must be logged in to reply to this topic.