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

  • SEARCH
  • Home
  • 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 958399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T00:51:34+00:00 2026-05-16T00:51:34+00:00

In my principles of programming class we are talking about different calling methods. Some

  • 0

In my principles of programming class we are talking about different calling methods. Some we discussed were:

  • call by value
  • call by reference
  • call by value/result
  • and call by name

I can’t find an example of how call by name works. Anyone care to give me an example? I think that when you take an xml file as input this is similar to call by name. Could someone give me a more traditional example?

  • 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-16T00:51:35+00:00Added an answer on May 16, 2026 at 12:51 am

    I’ll work in a hypothetical programming language. Let’s assume we have a function p(x) that prints out x and then returns it. Now let’s define a function:

    function foo(x, y) { return y+1; }
    

    Now let’s call it with some arguments:

    foo(p(123),p(456))
    

    x and y are going to be substituted for the parameters, so the call to foo above is going to result in:

    return p(456)+1;
    

    So we’re going to print 456 to the screen and return 457. In another evaluation strategy, we would evaluate the function parameters first (printing 123 and 456 to the screen in the process) and then substitute 456 for y in the function body, eventually returning 457.

    It’s contrived, but I hope you get the idea. It’s all about substitution.

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

Sidebar

Related Questions

I'm currently learning about pointers in my C++ book (Programming: Principles and Practice using
I am taking a principals of programming class right now. We are learning about
OOP is about programming with interface, not the implementation. Objects are talking to each
I am taking a principles of programming languages course right now but I cannot
Hey. I'm taking a course titled Principles of Programming Languages, and I need to
I'm reading Stroustrup's Programming: Principles and Practice and came across this code: int main()
Normally when programming in C# I architect my project after the domain driven principles.
This problem arose when trying to compile a sample program from Stroustrup's Programming Principles
I'm kind of new in PHP. For some reason in other types of programming
I'm aware of the principles behind event driven programming but would nevertheless try to

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.