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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:28:31+00:00 2026-05-24T03:28:31+00:00

Why does it seem like the order of the arguments matters for F#? It

  • 0

Why does it seem like the order of the arguments matters for F#? It doesn’t matter for C# (which uses the same compilation model). When I try this:

# main.fs
module Main
let main = Printer.print_repeatedly 5 "hello, world"

# printer.fs
module Printer
let print_repeatedly n str = for x in 1..n do printfn "%s" str

And I execute the compiler (both Microsoft’s and Mono’s) with main.fs preceding printer.fs, I get an error:

main.fs(4,12): error FS0039: The namespace or module 'Printer' is not defined

If I do printer.fs before main.fs on the command line, it’s fine. Is there a reason the compiler requires this for F#?

  • 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-24T03:28:33+00:00Added an answer on May 24, 2026 at 3:28 am

    In F#, the order of files passed to the compiler absolutely does matter: the F# compiler reads programs strictly left-to-right and top-to-bottom. Variables and types may only refer to those defined before them, unless you explicitly indicate a mutually recursive relationship via and.

    If you come from C#, this may seem like a limitation at first. But you learn that in practice it is actually an incredibly effective enforcement of code organization and prevents recursive reference madness.

    Note that forward references are actually a fairly modern feature of programming languages and compilers (you don’t get them for “free”), if you’ve ever had to work with early C++ compilers you may remember the need for forward declarations to enable this (having the compiler do the work cost memory which has not always been so abundant).

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

Sidebar

Related Questions

Does this seem right, the dataFilePath is on disk and contains the right data,
My script does not seem to be working. Every time i try to use
It does not seem that SendGrid has a free account that one could use
It does not seem to be documented very much: hsh.merge(other_hash){|key, oldval, newval| block} →
Does anyone know why .hide(normal) does not seem to be working in jQuery 1.4.2?
dblink does not seem to work when I use a named connection to a
Imagick::queryFontMetrics does not seem to be working. When I use the metrics provided by
Maven 2 does not seem to consider my @Test and @Ignore annotations. How do
Serialized varibale does not seem to retain its state from classes that were extended.
Inherited properties and MetadataType does not seem to work with client side validation in

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.