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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:48:39+00:00 2026-06-15T20:48:39+00:00

So I was reading http://www.podval.org/~sds/ocaml-sucks.html , which includes this quote (in the context of

  • 0

So I was reading http://www.podval.org/~sds/ocaml-sucks.html, which includes this quote (in the context of problems with ocaml):

there are actually three mildly different syntaxes:

  • the official one is described in the manual
  • a superset thereof is accepted by the compiler ocamlc
  • something similar (but ever so slightly different) is accepted by the preprocessor Camlp4 (e.g., it accepts List.map [1;2;3]
    ~f:fun x -> x, which is also accepted by the top-level, but not
    the compiler)

What are examples of ocaml code fragments that are accepted by the ocamlc but do not match the manual?

PS – I’m mainly interested in OCaml 4.00.1, but previous versions are also interesting…

  • 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-06-15T20:48:40+00:00Added an answer on June 15, 2026 at 8:48 pm

    One funny example, in the interest of curiosity only:

                      OCaml version 4.00.0
    
    # type 'a weird_list =
        | ()
        | :: of 'a * 'a weird_list;;
    type 'a weird_list = () | :: of 'a * 'a weird_list
    # 1::2::3::();;
    - : int weird_list = :: (1, :: (2, :: (3, ())))
    

    The differences between Camlp4 and the OCaml compiler are sometimes bugs, but most often explained by the difference in parser technology: if you write an idiomatic LR parser and a LL parser for the same language with mildly annoying syntax subtleties, you should not expect both to match perfectly. I don’t think this is a problem in practice (but in practice most people don’t use Camlp4).

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

Sidebar

Related Questions

I was reading this article on Coding Horror: http://www.codinghorror.com/blog/2008/04/setting-up-subversion-on-windows.html I went to the downloads
I was reading http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35 and trying to figure out how to continue a file
I was reading through this: http://www.postgresql.org/about/ And I saw this: An enterprise class database,
While reading http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html , I found that the caching algorithm is more complex than
I was reading this: http://www.gameprogrammer.com/fractal.html#diamond And it says: This is the starting-point for the
I am reading this: http://www.panoramio.com/api/widget/api.html#photo-widget to build a JavaScript photo widget. Under Request ->
I was reading http://www.kernel.org/pub/software/scm/git/docs/v1.7.10/gitignore.html and the 6 points used to explain the ignore patterns
Reading http://www.scala-lang.org/docu/files/ScalaByExample.pdf This piece of code : def While (p: => Boolean) (s: =>
Im reading this page http://www.scala-lang.org/node/137 , I understand what covariance is and lower bounds
Check this example before reading the question - http://www.sqlfiddle.com/#!2/fcf3e/8 The following data comes from

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.