Re: Function minimization and random numbers
- From: Jon Harrop <usenet@xxxxxxxxxxxxxx>
- Date: Thu, 07 Feb 2008 00:28:47 +0000
Marc Gravell wrote:
C#'s type system makes the distinction, not me.
minor point, but surely the CLR spec defines the type system, not the
language
If that were true then F# would suffer the same fate as C# but it doesn't.
Indeed, this is a Turing argument: you can wrap anything up in the CLR so
it doesn't actually impose anything on your type system.
That is not how F# supports closures.OK, I'm *really, really* struggling to see the difference, and I am
genuinely interested (heck, I went to the F# lectures at TechEd...);
can you please explain to me what the F# closures do that isn't easily
achievable in C#. Your point about having to manually translate simply
doesn't work for me, since naming a method to use as a Func [etc]
doesn't strike me as odiously manual; of course a lambda is just as
easy and probably closer to what we are talking about...
No. My point is that F# requires no code whatsoever to do the same thing. No
lambda, nothing. You look at a member invocation:
foo.Bar(3)
and say "I want that Bar member as a closure" and you just write:
foo.Bar
to get it. That's it. All done. That is a functional value. You can't even
tell that it came from a member rather than a delegate.
However, that doesn't express just how important it is to remove this
artificial distinction. Until you do that, you're delegates will only ever
be second-class closures because you cannot manipulate all functions in the
same way: you need to know how the function was defined.
--
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/products/?u
.
- Follow-Ups:
- Re: Function minimization and random numbers
- From: Marc Gravell
- Re: Function minimization and random numbers
- From: Jon Skeet [C# MVP]
- Re: Function minimization and random numbers
- References:
- Re: Function minimization and random numbers
- From: Jon Harrop
- Re: Function minimization and random numbers
- From: Marc Gravell
- Re: Function minimization and random numbers
- From: Jon Harrop
- Re: Function minimization and random numbers
- From: Marc Gravell
- Re: Function minimization and random numbers
- From: Jon Harrop
- Re: Function minimization and random numbers
- From: Jon Skeet [C# MVP]
- Re: Function minimization and random numbers
- From: Jon Harrop
- Re: Function minimization and random numbers
- From: Jon Skeet [C# MVP]
- Re: Function minimization and random numbers
- From: Jon Harrop
- Re: Function minimization and random numbers
- From: Marc Gravell
- Re: Function minimization and random numbers
- Prev by Date: Re: Generic object manipulation
- Next by Date: Re: Invisible App Run
- Previous by thread: Re: Function minimization and random numbers
- Next by thread: Re: Function minimization and random numbers
- Index(es):
Relevant Pages
|