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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:46:36+00:00 2026-06-17T15:46:36+00:00

Question is simple. How to access a tuple by using Index variable in SML?

  • 0

Question is simple.

How to access a tuple by using Index variable in SML?

val index = 5;
val tuple1 = (1,2,3,4,5,6,7,8,9,10);

val correctValue = #index tuple1 ??

I hope, somebody would be able to help out.
Thanks in advance!

  • 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-17T15:46:38+00:00Added an answer on June 17, 2026 at 3:46 pm

    There doesn’t exist a function which takes an integer value and a tuple, and extracts that element from the tuple. There are of course the #1, #2, … functions, but these do not take an integer argument. That is, the name of the “function” is #5, it is not the function # applied to the value 5. As such, you cannot substitute the name index instead of the 5.

    If you don’t know in advance at which place in the tuple the element you want will be at, you’re probably using them in a way they’re not intended to be used.

    You might want a list of values, for which the 'a list type is more natural. You can then access the nth element using List.nth.

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

Sidebar

Related Questions

Simple question: In Tomcat7, what's the difference between using extraResourcePaths and aliases to access
This may be a simple question. I need to access an html element using
Good day, I have a simple question (I hope). How do I access the
Simple question. I have a C# application that access an IMAP server using the
A simple question: what is the more efficient way to access a db in
Following on from my previous question: Simple inner join in linq How would I
A simple question, doing my head in... I have a large access database to
Fairly simple question. I have a text field in a form that I would
Simple question really. Can a webapp access a config file I define and put
A fairly simple question I guess.. I'm trying to access a list in a

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.