POV-Ray : Newsgroups : povray.off-topic : C# 4.0 Default parameters : Re: C# 4.0 Default parameters Server Time
9 Oct 2024 16:15:38 EDT (-0400)
  Re: C# 4.0 Default parameters  
From: nemesis
Date: 4 Feb 2009 12:06:42
Message: <4989cb22@news.povray.org>
Darren New escreveu:
> Mike Raiford wrote:
>> That is how C# is now. Sometimes it would be nice just to have one 
>> function with defaults, rather than 3 overloads of the same function 
>> that simply delegate back to the "full featured" function.
> 
> No, i mean instead of
>   job.print(orient:landscape, copies:2, paper:A4)
> the suggestion it that it's much more OO to say
>   job.initialize()
>   job.orient(landscape)
>   job.copies(2)
>   job.paper(A4)
>   job.print()

More OO, or more assemblyish?  I mean, you individually feed the stack 
and then call a function using those arguments already in the stack. ;)

seems we're going full cycle here... :P

Of course, assembly (and function currying in Haskell for that matter) 
expect arguments in the right order.  Named arguments and the above more 
OO and barroque way do not.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.