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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:33:54+00:00 2026-06-18T08:33:54+00:00

When I run this code in the REPL, it throws Error: syntax error: inserting

  • 0

When I run this code in the REPL, it throws Error: syntax error: inserting DOT. I would like to know what that error message means.

I have since fixed the code and still want to know the meaning of that message for future reference.

part_dir is function that returns a custom datatype direction with possible patterns Left and Right.

fun same (fs)=
    case fs of
         (f1::f2::fs') => case (part_dir(f1),part_dir(f2)) of
                               (dir1=dir2) => same (f2::fs')
                             | _           => false
        | _            => true
  • 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-18T08:33:55+00:00Added an answer on June 18, 2026 at 8:33 am

    “syntax error: inserting DOT” means that there’s an unexpected token at the position it’s complaining about and that a dot would be legal at that position. However that does not mean that a dot would be the only thing allowed in that position or that replacing the token with a dot would fix your error.

    For the most part the error message is useless beyond telling you that there’s a syntax error at that position. You should probably just ignore the “inserting DOT” part as it generally doesn’t lead you in the right direction. Just look at the line and column it’s complaining about and try to find what the syntax error is there.

    In your case the problem is that dir1=dir2 is not a legal pattern. A legal pattern would be the constructor of a datatype with patterns for each of its argument, a variable name, _ or a constant or a tuple of patterns. There is no pattern to say “a tuple that contains two elements that are equal”. For that you need the pattern (dir1, dir2) and then the condition dir1=dir2 in an if.

    In your case you don’t even need an if though. You can just write:

    (dir1, dir2) => dir1 = dir2 andalso same (f2 :: fs)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've a code like this. I can run this in repl but can't from
I would like to run this code which I found in Mahout In Action:
I'm trying to run this code but this error appear: Uncaught TypeError: string is
When I run this code, the output is 11, 10. Why on earth would
When run this code, it gives me a strange error. I have a class
If I run this code: http://www.danny92.pastebin.com/m1f84b972 You will see that my Database connection connects
When I run this code in the dev_appserver it gives me the Invalid syntax
I'm trying to run this code that was supposed to be a cut and
When i try to run this code i get the error: Warning: mysql_fetch_array() expects
Please run this code, and explain me why the output is like: table[0]=3 table[1]=-858993567

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.