POV-Ray : Newsgroups : povray.off-topic : C# 4.0 Default parameters : Re: C# 4.0 Default parameters Server Time
6 Sep 2024 15:21:23 EDT (-0400)
  Re: C# 4.0 Default parameters  
From: Orchid XP v8
Date: 4 Feb 2009 14:05:30
Message: <4989e6fa$1@news.povray.org>
Darren New wrote:
> Technically, I would think you could have a curried function in a 
> language with named parameters pretty easily.

Yeah, I don't see why not. It's only a shortcut for creating a closure...

>>> Lambda expressions are darned convenient. I used them in my little 
>>> FFT toy app:
>>>
>>> RealInput.Data = GenerateWave(x => cos((Math.Pi*2*x)/(DataLen-1)));
>>
>> They're also damned useful when you want to curry a function:
>>   bar = foo (...my random lambda function that I only just here...)
> 
> That's where they're used in C#.

I didn't think C# had curried functions like my example.

> This is how the mechanisms for 
> querying SQL from C# work - you can write something like
>   db.table["customers"].select(x => x.Name > "Henry")
> and the "select()" function takes the AST describing that condition, 
> translates it to SQL, and sends it to the database.

Lisp would be proud.

Does this transformation happen at compile-time or runtime?

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

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