[Grace-core] Further questions on the specification

Andrew P. Black black at cs.pdx.edu
Thu May 26 09:22:12 PDT 2011


On 25 May 2011, at 15:53 , Michael Homer wrote:

>> So, my proposal is that this behavior is restricted to varargs parameters. It doesn't work on literals.  Yes, this is a special case, and I'm not sure that I like it.
> So another way of looking at it would be that varargs processing
> constructs a tuple if required (regardless of how the argument passing
> "actually" works)? That doesn't seem like a problem.

Yes, I think that's right.  "If required" means if the requested method has a varargs parameter.
In general, this won't be known until after after dynamic dispatch has taken place.

We should probably restrict any method to having at most one varargs parameter.  It would make implementation easier if the varargs parameter were always last, but that makes life harder for the programmer in order to make it easier for the implementor — probably not the right trade-off.

My parser currently explicitly remembers the tuple-ing of arguments explicitly, rather than flattening it out.  I did this to preserve all the available information, since I was not certain what would be needed to reconstruct things in the invoked method.

	Andrew



More information about the Grace-core mailing list