TechTalkz.com Logo

Go Back   TechTalkz.com Technology & Computer Troubleshooting Forums > Tech Support Archives > Programing Languages > C#(C Sharp)

Notices

Reply
 
Thread Tools Display Modes
Old 21-10-2007, 10:32 AM   #1
Robert Howells
Guest
 
Posts: n/a
Anonymous Method vs. Anonymous Delegate

Is there any such thing as an "anonymous delegate"? I understand what an
anonymous method is, but I'm unclear of the concept of anonymous delegate
(if it is even a valid term to be using). Is an "anoymous delegate" simply
an anonymous method used in conjunction with a delegate declaration?

Thanks!


  Reply With Quote
Old 21-10-2007, 11:31 AM   #2
Nicholas Paldino [.NET/C# MVP]
Guest
 
Posts: n/a
Re: Anonymous Method vs. Anonymous Delegate

Robert,

I haven't heard the term "anonymous method" used at all. It's usually
"anonymous delegate" since the only way you can access it is through a
delegate instance.

When the compiler comes across the anonymous delegate, it will create a
method on a class which the delegate will then point to with a
compiler-generated name.


--
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com

"Robert Howells" <A@B.COM> wrote in message
news:eaxFuT5EIHA.4476@TK2MSFTNGP06.phx.gbl...
> Is there any such thing as an "anonymous delegate"? I understand what an
> anonymous method is, but I'm unclear of the concept of anonymous delegate
> (if it is even a valid term to be using). Is an "anoymous delegate" simply
> an anonymous method used in conjunction with a delegate declaration?
>
> Thanks!
>


  Reply With Quote
Old 21-10-2007, 01:29 PM   #3
Jon Skeet [C# MVP]
Guest
 
Posts: n/a
Re: Anonymous Method vs. Anonymous Delegate

Nicholas Paldino [.NET/C# MVP] <mvp@spam.guard.caspershouse.com> wrote:
> I haven't heard the term "anonymous method" used at all. It's usually
> "anonymous delegate" since the only way you can access it is through a
> delegate instance.


I'd say it's the other way round, actually. I've only ever seen
"anonymous delegate" here on the newsgroup, used loosely. It doesn't
appear anywhere in the spec.

"Anonymous method" is the term used in the spec. "Anonymous function"
is also used in the C# 3 spec to cover both anonymous methods and
lambda expressions.

> When the compiler comes across the anonymous delegate, it will create a
> method on a class which the delegate will then point to with a
> compiler-generated name.


Nah, that's what happens when the compiler comes across an anonymous
method

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
  Reply With Quote
Old 21-10-2007, 02:30 PM   #4
Bob Cramer
Guest
 
Posts: n/a
Re: Anonymous Method vs. Anonymous Delegate

<snip>

RE:
> I'd say it's the other way round, actually. I've only ever seen
> "anonymous delegate" here on the newsgroup, used loosely. It doesn't
> appear anywhere in the spec.


Google agrees with you. A search for...

"anonymous method" returns 10,500,000 hits
"anonymous delegate" returns 1,340,000 hits

.... and we all know that Google is The Final Authority

:-)


  Reply With Quote
Reply

Thread Tools
Display Modes




New To Site? Need Help?

All times are GMT +5.5. The time now is 02:56 PM.


vBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO
Copyright © 2005-2009, TechTalkz.com. All Rights Reserved - Privacy Policy
Valid XHTML 1.0 Transitional