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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:03:07+00:00 2026-05-11T19:03:07+00:00

I just read the information on this page , and while a new ?

  • 0

I just read the information on this page, and while a new ? operator is mentioned, it’s quite unclear to me what would its usage be.
Could anyone please provide a quick explanation, post a code snipped of how would this operator be used and possibly mention a use case?
Edit: this is really awkward, I’ve noticed that the ? operator is no longer mentioned in Don’s release notes. Any idea of why is that?

  • 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-11T19:03:07+00:00Added an answer on May 11, 2026 at 7:03 pm

    There are two new “special” operators in this F# release, (?) and (?<-). They are not defined, but they are available for overloading, so you can define them yourself. The special bit is how they treat their 2nd operand: they require it to be a valid F# identifier, but pass it to function implementing the operator as a string. In other words:

    a?b
    

    is desugared to:

    (?) a "b"
    

    and:

    a?b <- c
    

    is desugared to:

     (?<-) a "b" c
    

    A very simple definition of those operators could be:

    let inline (?) (obj: 'a) (propName: string) : 'b =
        let propInfo = typeof<'a>.GetProperty(propName)
        propInfo.GetValue(obj, null) :?> 'b
    
    let inline (?<-) (obj: 'a) (propName: string) (value: 'b) =
        let propInfo = typeof<'a>.GetProperty(propName)
        propInfo.SetValue(obj, value, null)
    

    Note that since the return type for the gettor is generic, you’ll have to specify it at use site in most cases, i.e.:

    let name = foo?Name : string
    

    though you can still chain-call (?) (since first argument of (?) is also generic):

    let len = foo?Name?Length : int
    

    Another, more interesting, implementation is to re-use CallByName method provided by VB:

    open Microsoft.VisualBasic    
    
    let inline (?) (obj: 'a) (propName: string) : 'b =
        Interaction.CallByName(obj, propName, CallType.Get, null) :?> 'b //'
    
    let inline (?<-) (obj: 'a) (propName: string) (value: 'b) =
        Interaction.CallByName(obj, propName, CallType.Set, [| (value :> obj) |])
        |> ignore
    

    The advantage of that is that it will handle both properties and fields correctly, work with IDispatch COM objects, etc.

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

Sidebar

Ask A Question

Stats

  • Questions 146k
  • Answers 146k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The problem is that you're mistaking property syntax for a… May 12, 2026 at 8:58 am
  • Editorial Team
    Editorial Team added an answer You can use the sp_who stored procedure. Provides information about… May 12, 2026 at 8:58 am
  • Editorial Team
    Editorial Team added an answer Think you can simple drop the jar in the plugins… May 12, 2026 at 8:58 am

Related Questions

I have an ASP.NET page that requires the ability to have users enter multiple
I've written an entire app pretty successfully in Django but I have this nagging
My boss has come to me and asked how to enure a file uploaded
I ran Perl::Critic on one of my scripts, and got this message: Regular expression

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.