[IronPython] Default-valued arguments to C# functions

Curt Hagenlocher curt at hagenlocher.org
Fri Apr 23 20:43:52 PDT 2010


On Fri, Apr 23, 2010 at 8:43 PM, Curt Hagenlocher <curt at hagenlocher.org>wrote:

>  On Fri, Apr 23, 2010 at 4:57 PM, Jeff Hardy <jdhardy at gmail.com> wrote:
>
>> I've got some functions implemented in C# that need to have optional,
>> defaulted parameters. So far I've been declaring them similar to:
>>
>>    public object cursor(CodeContext context,
>> [Optional][DefaultValue(null)]object factory)
>
>
> I think you need to use DefaultValueParameter instead of DefaultValue. It's
> an easy mistake to make -- I've made it myself. :(
>

Gah! I mean "DefaultParameterValue".

-Curt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ironpython.com/pipermail/users-ironpython.com/attachments/20100423/55fb169c/attachment.htm>


More information about the Users mailing list