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 915417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T17:53:02+00:00 2026-05-15T17:53:02+00:00

I have a question on why I am getting certain results in F#. I

  • 0

I have a question on why I am getting certain results in F#. I have the following code…

let lHelloWorld = lazy(printfn "Lazy Hello World"; 30+30)
let aHelloWorld = (printfn "Active Hello World"; 30+30)

printfn "lazy value is %d"  lHelloWorld.Value 
printfn "lazy value is %d"  lHelloWorld.Value
printfn "active value is %d"  aHelloWorld
printfn "active value is %d"  aHelloWorld

My output is as follows…

Active Hello World
Lazy Hello World
lazy value is 60
lazy value is 60
active value is 60
active value is 60

What I can’t understand is this… Why is active hello world’s printfn being shown before lazy hello word? I would have expected “Lazy Hello World” to have been shown before “Active Hello World”?

If anyone can help explain this it would be much appreciated.

  • 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-15T17:53:02+00:00Added an answer on May 15, 2026 at 5:53 pm

    Well I am not a big F# person but with lazy patterns it is set so they don’t do anything until they are request. So when you wrap that in lazy it won’t run until you actually use it. But since you didn’t use that for the active one it performed the function as soon as it was assigned.

    This is just a guess though as I am not a F# guy.

    Here is an article that explains it as well.
    http://weblogs.asp.net/podwysocki/archive/2008/03/21/adventures-in-f-f-101-part-6-lazy-evaluation.aspx

    Sorry forgot to attach the link.

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

Sidebar

Related Questions

I have a question about getting DLL's directory on Windows system. The situation is
i have another question on getting my XML serialization neat, which i can't seem
I have question. I have some app on facebook and getting this error Fatal
I have a question - I'm using CURL and PROXY. I'm getting list with
I am just getting into Sharepoint, and I have a question about having a
I have seen this question that talks about getting the last part of a
I'm just getting started with Require.JS and I have a (hopefully) simple question. I'm
I have an instance where certain URLs are getting malformed with equal signs and
This question was helpful for getting a count of a certain pattern in Vim,
I am just getting into responsive design, and have a question about displaying content.

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.