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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:14:34+00:00 2026-06-13T19:14:34+00:00

I have read the current draft of the forthcoming R7RS scheme standard (small language)

  • 0

I have read the current draft of the forthcoming R7RS scheme standard (small language), but I don’t understand under which conditions it is not an error to redefine top-level bindings.

I guess that it is possible to define or set! a binding that has been introduced at the top-level of a program a second time. But what about imported bindings from an external library? Is it possible to override these bindings by the standard?

On page 26/27 of the report, it says:

The top level of a program may also include import declarations.
In a library declaration, it is an error to import
the same identifier more than once with different bindings,
or to redefine or mutate an imported binding with define,
define-syntax or set!. However, a REPL should permit
these actions.

Does it mean that redefining is only an error when it does happen in libraries for imported bindings?

I understand that it prohibits optimisations by compilers if the compiler does not know whether, say + still means the built-in addition or is any other user-specified error. But from this perspective, it does not make sense to restrict forbidding to rebind on the library level, when it would also make sense (at least) for imported bindings in programs.

P.S.: As this is all about the environment of a scheme program: am I right in saying that environments are not first class citizens because one cannot get hold of the current environment? (Which, in turn, allows a compiled program to forget about the chosen names of the bindings.)

  • 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-13T19:14:35+00:00Added an answer on June 13, 2026 at 7:14 pm

    The general principle is that a binding declared in a library can only be portably mutated in that same library. If the bindings of a library are imported into a program (or into another library), they can’t be mutated there. Thus, if a program imports (scheme base), the identifier + always refers to the standard addition routine (except in a region where it is locally shadowed by lambda, let, let*, or what have you, of course).

    At the REPL, or in a script being executed by a REPL, this restriction does not apply. In addition, an implementation may extend the standard language by lifting the restriction.

    The nearest equivalent to the current global environment is the result of (interaction-environment), which represents the mutable environment of the REPL if there is one. If the REPL is not in use or doesn’t exist, you can simulate a current, but immutable, environment by calling environment on arguments corresponding to whatever the current set of imports may be. R7RS, like its predecessors, does not have any representation of lexical environments.

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

Sidebar

Related Questions

I have read many posts about this now but I do not still understand
I have read the topic Mysql query: retrieve current date query ., but my
My current situation is: I have to read a file and put the contents
I have the current powershell script $release = read-host enter release $fullPath = 10.0.0.3
I have read few articles about table partioning but still I am bit confused
I have read some of the questions and answers here, but it none match
I have read a bunch of forums on this but none have solved my
I have read Apple Scroll View Programming Guide for iOS but still confused about
I have read several tutorials, but I just can't this to work. My apache
I am interested in changing the structure folder. I have read many articles, but

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.