logo       

Re: params Methods: msg#00040

lang.boo.devel

Subject: Re: params Methods

Daniel Grunwald wrote:
How are params methods represented in the AST?
def Method(*args as (int)):
print args.Length

translates to
<Parameters Name="args">
<Type xsi:type="ArrayTypeReference">
<ElementType xsi:type="SimpleTypeReference" Name="int" />
</Type>
</Parameters>

Looking at BooPrinterVisitor, it seems there isn't any code to output the *.

Daniel


It's printing for me, see the WriteParameterList method in BooPrinterVisitor. It uses ParameterDeclarationCollection.VariableNumber

But you are right, the information is not there when you do xml serialization.
I think we either have to add attributes to the right places (serializable/xmlattribute/xmlinclude/defaultvalue/etc.), or maybe move VariableNumber to ParameterDeclarationCollectionImpl by editing ast.model.boo (scripts/astgen.boo would need altering to handle fields in collection classes).



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

News | FAQ | advertise