Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / October 2007

Tip: Looking for answers? Try searching our database.

Anonymous Method vs. Anonymous Delegate

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Robert Howells - 21 Oct 2007 04:46 GMT
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!
Nicholas Paldino [.NET/C# MVP] - 21 Oct 2007 05:47 GMT
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.

Signature

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

> 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!
Jon Skeet [C# MVP] - 21 Oct 2007 07:41 GMT
>     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 :)

Signature

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

Bob Cramer - 21 Oct 2007 08:08 GMT
<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

:-)

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.