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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:42:19+00:00 2026-06-16T03:42:19+00:00

While experimenting with gambit’s gsi (4.6.6), I ran into an odd situation when I

  • 0

While experimenting with gambit’s gsi (4.6.6), I ran into an odd situation when I typed in something invalid inside let.

Doing it the normal way, everything is as expected. i andj are not visible.

> (let ((i 4) (j 3)) (display (+ i j)) (newline))
7
> i
*** ERROR IN (console)@2.1 -- Unbound variable: i
1> j
*** ERROR IN (console)@3.1 -- Unbound variable: j

However, if I flub up in the let block, i andj are visible. It’s almost as if I’m still inside the scope of the let form. Is that what’s going on? Also, looking at the numbers on the prompt e.g. >1> `2> etc. It looks like there’s information there as well. If so, what is that? Maybe something related to nesting or an error mode?

2> (let ((i 2) (j 3)) (display + i j) (newline))
*** ERROR IN (console)@4.20 -- Wrong number of arguments passed to procedure
(display '#<procedure #2 +> 2 3)
3> i
2
3> j
3

This is a little different than in clojure. e.g.

user=> (defn display [n] (print n))
#'user/one-arg-function
user=> (let [i 2 j 3] (display + i j) (println))
ArityException Wrong number of args (3) passed to: user$one-arg-function clojure.lang.AFn.throwArity (AFn.java:437)

user=> i 
CompilerException java.lang.RuntimeException: Unable to resolve symbol: i in this context, compiling:(NO_SOURCE_PATH:0) 

user=> j
CompilerException java.lang.RuntimeException: Unable to resolve symbol: j in this context, compiling:(NO_SOURCE_PATH:0) 
  • 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-16T03:42:20+00:00Added an answer on June 16, 2026 at 3:42 am

    This is a feature of Gambit’s interactive debugger.

    From the manual: http://www.iro.umontreal.ca/~gambit/doc/gambit-c.html#Debugging

    A nested REPL is then initiated in the context of the point of
    execution where the evaluation was stopped. The nested REPL’s
    continuation and evaluation environment are the same as the point
    where the evaluation was stopped. For example when evaluating the
    expression ‘(let ((y (- 1 1))) (* (/ x y) 2))’, a “divide by zero”
    error is reported and the nested REPL’s continuation is the one that
    takes the result and multiplies it by two. The REPL’s lexical
    environment includes the lexical variable ‘y’. This allows the
    inspection of the evaluation context (i.e. the lexical and dynamic
    environments and continuation), which is particularly useful to
    determine the exact location and cause of an error.

    In your case, the nested REPL started inside the let and thus had i and j bound.

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

Sidebar

Related Questions

I ran into the following algorithmic problem while experimenting with classification algorithms. Elements are
While experimenting with pixel shaders in WPF I decided to draw some pixels onto
I am currently working through Michael Hartl's Rails Tutorial while experimenting with some other
I'm experimenting with a lexer, and I found that switching from a while-loop to
While deveoping a site (using Forms authentication and InProc sessionstate) a frequently run into
While experimenting with some stuff on the REPL, I got to a point where
While experimenting a bit with C++ templates I managed to produce this simple code,
While experimenting with iPhone app development, we have several AppIDs which should be deleted
I'm stuck while experimenting with captcha handler in asp.net, any help would be appreciated.
I'm experimenting with a visual studio addon and have come across very odd behaviour.

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.