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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:38:13+00:00 2026-05-30T07:38:13+00:00

I have a F# DLL and a C# DLL. The C# library has a

  • 0

I have a F# DLL and a C# DLL.

The C# library has a namespace Library with a class Toolbox that contains a member FUND_BITS like so:

namespace Library {
    public static class Toolbox {
        public static uint FUND_BITS = 0;
    }
}

and then in the F# library I have a binding:

let bf = Library.Toolbox.FUND_BITS

Now, I use bf in several functions defined in the library. When I change the value of FUND_BITS, I would expect that all of the F# functions would then use the updated value because I’ve binded bf to refer to Library.Toolbox.FUND_BITS, and have not declared it to be a mutable copy or anything. However, I have found that the functions use a stale value of FUND_BITS rather than the updated value.

Am I misunderstanding how F# creates immutable bindings to values? If so, I have not been able to find a way to bind in a manner that will update with changes, for instance:

let bf = &Library.Toolbox.FUND_BITS
  • 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-30T07:38:14+00:00Added an answer on May 30, 2026 at 7:38 am

    Unfortunately, “bind” in this case isn’t the same thing as “bind” in the user-interface data binding sense. The line let bf = Library.Toolbox.FUND_BITS is basically a simple assignment statement. You’ll find that type inference shows that the value bf is an instance of uint32.

    If you want to read the value dynamically, you’d need to use a function that reads the value of the static variable each time it is invoked.

    let bf = (function () -> Library.Toolbox.FUND_BITS)
    

    EDIT This more concise version is due to Guvante

    let bf() = Library.Toobox.FUND_BITS
    

    In this case, bf will have a type of unit -> uint32.

    If you want a two-way link between the values, then you could declare a property getter and setter that use the static field as a backing store, but that just scares me. A better approach would be just to reference the field directly whenever you need to read from it or write to it.

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

Sidebar

Related Questions

I have an application that uses (has referenced) a class library (myLib.dll private assembly).
I have a class library project that references the version 4.1 Microsoft.Practices.Common dll. I
I have a class library that has it's own model and connectionstring to the
I have a Library ( DLL ) that has a method with the following:
I have written a C# class library (DLL) and wondering the quickest way to
I have build a c# class library verification.dll using OpenCVSharp. This references OpenCvSharp.dll in
I have an ASP.NET application that uses a custom .NET library (a .DLL file).
I have a managed class library (say mylib.dll) and a 3rd party managed app
I have a Silverlght library project that produces a dll output. This project utilises
I have a class library project which uses a namespace (e.g., Cosmos.Creator.Util). I then

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.