By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,979 Members | 960 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,979 IT Pros & Developers. It's quick & easy.

Anonymous Method vs. Anonymous Delegate

P: n/a
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!
Oct 21 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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]
- mv*@spam.guard.caspershouse.com

"Robert Howells" <A@B.COMwrote in message
news:ea**************@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!
Oct 21 '07 #2

P: n/a
Nicholas Paldino [.NET/C# MVP] <mv*@spam.guard.caspershouse.comwrote:
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 - <sk***@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
Oct 21 '07 #3

P: n/a
<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

:-)
Oct 21 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.