Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 245671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:06:29+00:00 2026-05-11T21:06:29+00:00

What are useful definitions for the common methods of passing a method or function

  • 0

What are useful definitions for the common methods of passing a method or function as data, such as:

  • Delegates
  • Closures
  • Function pointers
  • Invocation by dynamic proxy and
  • First class methods?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T21:06:30+00:00Added an answer on May 11, 2026 at 9:06 pm

    Function pointers lets you pass functions around like variables. Function pointer is basically legacy method to pass function around in languages that don’t support first-class methods, such as C/C++.

    First class methods Basically means you can pass functions around like variables. Methods (loosely) mean functions. So this basically means first class functions. In simplest terms, it means functions are treated as “first class citizens”, like variables. In the old days (C/C++), because we can’t directly pass a function around, and we had to resort to workarounds like function pointers, we said functions weren’t first-class citizens.

    Delegates is C#’s answer to first-class methods. Delegates are somewhat more powerful because it involves closures, consider the following code snippet:

    void foo( int a )
    {
       void bar() { writefln( a ); }
       call( &bar );
    }
    
    void call( void delegate() dg  ) { dg(); }
    int main( char[][] args ) {
       foo( 100 );
    }
    

    Notice that bar can reference the local variable a because delegates can use closures.

    Closures can be very confusing at first. But the lazy-man’s definition can be really simple. It basically means a variable can be available in the human-expected way. Put in other words, a variable can be referenced in places where they look like they would be present, by reading the structure of the source code. For example, looking at the code fragment above. If we didn’t have closure, bar would not be able to reference a because a was only local to foo, but not bar, which is another function.

    Dynamic Proxy is the odd one out. It doesn’t belong to these items. Explaining it requires some very long text. It stems from the famous Proxy Pattern. The problem with Proxy Pattern was that the Proxy class needs to be implementing the same interface as the Subject. Dynamic Proxy basically means using reflective approach to discover the Subject’s method so that the ProxyPattern can be freed from being tied to the Subject’s interface.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 118k
  • Answers 118k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Data bindings are tough because they tend to fail silently,… May 11, 2026 at 11:32 pm
  • Editorial Team
    Editorial Team added an answer Dan Bornstein gave a presentation on Dalvik at Google I/O.… May 11, 2026 at 11:32 pm
  • Editorial Team
    Editorial Team added an answer If you're using Windsor 2.0, there's no need to modify… May 11, 2026 at 11:32 pm

Related Questions

Is there a way to enforce/limit the types that are passed to primitives? (bool,
I am trying to use the random forests package for classification in R. The
I'm scouring the internet for a definition of the term "Internal Node." I cannot
In a project that I've been involved with for many years, I've gradually evolved

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.