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

The Archive Base Latest Questions

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

another noob question regarding F#. If I have the following code… let ExeC =

  • 0

another noob question regarding F#.

If I have the following code…

let ExeC =
    printfn "c"
    3

let ExeB b = 
    printfn "b"
    2

let ExeA = 
    printfn "a"
    1

printfn "Example %d " ExeA
printfn "Example %d " (ExeB 1)
printfn "Example %d " ExeC

The output is as follows…

c
a
Example 1
b
Example 2
Example 3

What seems unusual here is the order that the code is executing in. In a previous question Brian mentioned something about expressions, I was hoping someone could explain this a bit more. It almost seems like the compiler is intelligently pre-executing things to calculate values… but I don’t know?

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

    ExeA and ExeC aren’t functions, but single values. The compiler ensures that values initialise in the order in which they’re declared in the source file, so what’s happening here is:

    1. ExeC initialises
    2. ExeA initialises
    3. Example 1 is printed, using ExeA‘s initialised value
    4. The ExeB function is called as normal
    5. Example 3 is printed, using ExeC‘s initialised value

    If you want ExeA and ExeC to be truly lazy — that is, to control when their side effects run — you could turn them into functions that accept unit:

    let ExeC () =
        printfn "c"
        3
    
    let ExeB b = 
        printfn "b"
        2
    
    let ExeA () = 
        printfn "a"
        1
    
    printfn "Example %d " (ExeA ())
    printfn "Example %d " (ExeB 1)
    printfn "Example %d " (ExeC ())
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A noob question. I'm putting together my first database and have the following design
noob question regarding ios development. In a previous project, I have a UITableViewController, to
Another jQuery noob question - what am I doing wrong?? I have some HTML
Noob Question. Stuck on the following code. Getting Default constructor cannot handle exception type
I'm a perl noob and I have a very basic question regarding the @INC
Another noob regex problem/question. I'm probably doing something silly so I thought I'd exploit
another newbie-question regarding rails and bootstrap. I am using something like this: <div class=tabbable
Another git question... I am in the following situation: A1 ---- B1 ---- C1
Another noob question that seems like it should be simple: Thanks to the help
This might be a noob question, but can't find an answer anywhere. I have

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.