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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:21:19+00:00 2026-05-24T21:21:19+00:00

All my favorite languages have a goto command. That is, you can create a

  • 0

All my favorite languages have a goto command. That is, you can create a label, and then later interrupt the flow of the program to go to the label. One of the more useful applications of this construct is to create an infinite loop, like this:

 start:
 goto start

Unfortunately, if I undertstand the compiler errors correctly, I can’t use this same syntax in F#. So, since it doesn’t seem to be supported natively, how can I implement the goto command in F#?

Surely, F# is a powerful enough language to implement a feature as simple as this. Other languages, such as Javascript, which do not natively support goto, are still able to implement it through a plug-in.

Further, I feel that F#, as one of the languages in the functional programming paradigm, should be able to support higher-level gotos: where you can pass gotos to gotos.

  • 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-24T21:21:21+00:00Added an answer on May 24, 2026 at 9:21 pm

    A label has a lot in common with a function: they both act as entry points to some code to be executed. Given that similarity, you can do the following:

    let goto f = f()
    
    let test() =
      let label = (fun () ->
        //rad code
        )
      //tight code
      goto label
    

    One minor drawback is having to wrap all your code in closures. I don’t know–doesn’t seem too bad for getting something as handy as goto.

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

Sidebar

Related Questions

Given 2 tables: Person PersonsFavoriteColors A person can have one or more favorite colors.
In the site I am currently working on members can favorite other members. Then
I like to watch my favorite TV shows on the go. I have all
With so many languages and frameworks that exist, and with new ones appearing all
The more and more advanced compilers, languages, and frameworks we have that either automate
One of my favorite features about python is that you can write configuration files
I want to implement a 'favorite list' and let's assume that I have got
Vim is my favorite tool for programming in OSX, but my team mate all
All front-end developers know the pain of coding for Firefox, then viewing our then
All too often I want a WPF slider that behaves like the System.Windows.Forms.TrackBar of

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.