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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:33:08+00:00 2026-06-13T00:33:08+00:00

Whenever I define a function say funct(n), then can I assign value of n

  • 0

Whenever I define a function say funct(n), then can I assign value of n to a different variable such as m so that I can compare value of n which changes within the function with the initial value of m. Further, since I have nested and sometimes independent other functions, is there a way to make the m variable universal?

What I did is:

fun funct(n)= let val m=n in if (condition) then...

Further, here funct calls funct1 and funct1 calls funct2. The error message reads

Error: unbound variable or constructor: m

for funct2

Error: unbound variable or constructor: funct1

for funct1

Error: unbound variable or constructor: funct1

for funct

I suppose the single correction of m would solve the wholse cascade of errors.

  • 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-13T00:33:09+00:00Added an answer on June 13, 2026 at 12:33 am

    You can access any identifier from scopes which are deeper than the one the identifer has been defined in. E.g.

    fun funct(n) =
      let fun funct1(x, y, z) = if n < 1 then ...
      ...
    

    In this example, funct1 has access to n, which has been defined in an outer scope (namely as a parameter of funct).

    Be careful though, in functional languages like ML, identifiers have a different meaning from those in imperative languages like C. In your example, n and m are not variables, meaning the values denoted by the identifiers will not change. You can only redefine the identifiers; however, code that uses an identifier before its redefinition will always refer to the original value of that identifier.

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

Sidebar

Related Questions

Using RhinoMocks - how can I say whenever some function is called from now
Let f transform one value to another, then I'm writing a function that repeats
I know how to do a global variable, but whenever I try to define
On my 8-bit Freescale HCS08 micro, whenever I call a library function that returns
I have to set a function pointer in a library API, such that it
Is there a way I can define __autoload in a class, so whenever I
Whenever I close XCode, the User Info entries that I set for attributes in
Whenever the activity that initiates the scan happens, the android application force closes. It
I need some very basic advice on how to define a working -main function
How to rearrange javascript function execution order independent of include order. A question that

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.