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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:25:45+00:00 2026-05-31T23:25:45+00:00

I am reading in the F# specification – the most recent one that I

  • 0

I am reading in the F# specification – the most recent one that I could find, found here – in an effort to learn the language in what is arguably the hard way. In section “3.6 Symbolic Keywords,” the specification states that:

The following symbolic or partially symbolic character sequences are treated as keywords:

token symbolic-keyword =
    let! use! do! yield! return!
    | -> <- . : ( ) [ ] [< >] [| |] { }
    ' # :?> :? :> .. :: := ;; ; =
    _ ? ?? (*) <@ @> <@@ @@>

In the next section, “3.7 Symbolic Operators,” it states that:

User-defined and library-defined symbolic operators are sequences of characters as shown below, except where the sequence of characters is a symbolic keyword (§3.6).

regexp first-op-char = !%&*+-./<=>@^|~
regexp op-char = first-op-char | ?
token quote-op-left =
    | <@ <@@
token quote-op-right =
    | @> @@>
token symbolic-op =
    | ?
    | ?<-
    | first-op-char op-char*
    | quote-op-left
    | quote-op-right

I might be missing something obvious, but it seems to me that the specification is stating that the operators/keywords ?, @>, @@>, <@, and <@@ are both symbolic keywords and symbolic operators. So… which one are they? How do I know weather to use a symbolic keyword token, or a symbolic operator token?

Thanks in advance,
Brandon

EDIT To be clear, I want to know why the specification states that symbolic operators can be these symbols immediately after stating that they can’t be.

  • 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-31T23:25:46+00:00Added an answer on May 31, 2026 at 11:25 pm

    The concept that helps to answer this question is keyword. A keyword is a reserved word. Also check your Dragon book.

    A reserved word is basically a word that cannot be used by the programmer as an identifier, in this case a word such as if, or an operator such as ->. In other words if you try to use “let (if) =” or “let (->) =” you will get an error because you are using a reserved word.

    For this question interpret Section 3.6 as, these are keywords reserved for use by F#. Section 3.7 as, you can create your own operators as long as they follow these rules and are not the same as one of the reserved keywords in section 3.6.

    So if you want to create the operator –> you can, but you cannot create the operator ->

    To answer your question “So… which one are they?” They are keywords and they are operators defined by the system, they cannot be used as user defined operators.

    EDIT

    Lets come at this from a different direction. All lexer rules are called by parser rules. It is easy to find uses of symbolic-op rule, i.e. op-name, but look for symbolic-keyword and you will find “such as 34.. are post-filtered to two tokens: one int and one symbolic-keyword, ―..‖.” Helpful but it doesn’t answer your question and now you are wondering why is there a lexer rule not called by a parser rule. I don’t know, this is a spec and not a formal grammar definition. If you take a look at the F# source you may find that the spec and grammar do not match up as you would like. In other words, the spec is meant to help you understand the language, I would not use it as a definitive set of rules for building a compiler.

    Putting spec in terms or a car, the specs tell you what you can expect from the car, how the car should function, or the limits for a parameter, it does not tell you how to build the car.

    If I were writing a compiler I would interpret the case of 34.. to mean, don’t create tokens for symbolic-keywords on the first pass, but use post processing to filter them out into appropriate tokens. In other words, rewrite the token stream in a second pass. If it were me I would verify that the spec is a complete grammar before using it to build a compiler. If however you want to press on, then I would probably skip looking for symbolic-keywords on the first pass, and use stream rewriting after the token stream is created on the first pass.

    If you want to understand more about token filtering in F# see section 15 of the spec, “Lexical Filtering”; it gives a descent explanation of how light syntax is converted to regular syntax by rewriting the token stream.

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

Sidebar

Related Questions

I am reading ECMAScript Language Specification Function Calls section Can someone rephrase or detailed
I have been studying the ECMAScript specification and have found that it is extremely
Today, reading Servlet 3.0 specification, I've come across a sentence: We emphasize that this
My understanding from reading the specification ( http://www.ietf.org/rfc/rfc2445.txt ) is that the : character
There is one thing I am confused by reading WS-I profile specification. WS-I institute
I have been reading through the specification of openGL 1.5, and saw that any
I've been reading the SVG specification and trying to find out whether you can
The C# Specification says that reading and writing is atomic for 32bit types and
I'm reading through the w3c.org Visual Formatting specification . Could anyone explain to me
I remember reading something about a formal specification language for C a while ago,

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.