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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:46:32+00:00 2026-06-05T10:46:32+00:00

This is a followup to Clojure: Compile time insertion of pre/post functions My goal

  • 0

This is a followup to Clojure: Compile time insertion of pre/post functions

My goal is to call a debug function instead of throwing an exception. I am looking for the best way to store a list of stack frames, function calls and their arguments, to accomplish this.

I want to have a function (my-uber-debug), so that when I call it (instead of throwing an exception), the following things happen:

  • a new Java window pops up
  • there is a record of the current clojure stack frame
  • for each stack frame, there is a record of the argument passed to the function

This is so that I can move up/down the stack frames, and examine the arguments passed to get to this current point. [If somehow, magically, we can get the variables defined in “let” environments, that’d be awesome too.]

Current Idea

I’m going to have a thread local variable uber-debug, which has type:
List of StackFrames
where StackFrame = function + arguments

At each function call, it’s going to push (cons the current function + arguments to uber-debug), then at the end of a function call, it’s going to remove the first element from uber-debug

Then, when I call (my-uber-debug), it just pops up a new java window, and lets me interact with uber-debug

Question

The ideas I’ve had so far are probably not ideal for setting this up. What is the right way to solve this problem?

Edit:

The question is NOT about the Swing/GUI part. It’s about how to store the stack frames.

Thanks!

  • 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-05T10:46:34+00:00Added an answer on June 5, 2026 at 10:46 am

    Your answer may depend on a lot of factors, so I am going to answer this by giving you my thoughts.

    If you merely want to store function calls and their parameters when an exception occurs, then either write a macro or function as a wrapper to accomplish this. You would then have to pass all functions to be called to this wrapper. The wrapper would perform the try catch operation and whatever else you need.

    You might also want to look into Clojure meta data in addition to writing the wrapper, because your running code could look at its meta-data and make some decisions based on that as well. I have never used meta data, but the information at the link looks promising.

    As a final thought, it might be helpful for you to further delineate what you want to accomplish by doing this by editing your original post and putting the information there.

    For example, are these stack traces for a library or a main program?

    As to storing all this information, are multiple threads going to need it, or just one?

    Can you get by storing the information in a let binding at the highest level of your program, or do you need something like a ref?

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

Sidebar

Related Questions

This is a followup to Clojure: pre post functions Goal For every Clojure function,
This is a followup to this post: findViewById in a subclassed SurfaceView throwing RuntimeException
class Followup < ActiveRecord::Base belongs_to :post belongs_to :comment end This model needs to only
This is a followup/post question to another question; as I have discovered a solution
This is a followup from another post at here . Problem: The code below
This is a followup from another post at here . Problem: links aren't been
This is a followup to this question. A 2002 paper on the function forwarding
This is a followup to an earlier question ( Help Refining RegEx ("\b\d{6}([ ]{1,15})\d{7}\b")
This is a followup on the question: ASP.NET next/previous buttons to display single row
This is a followup question to my other widget-related question . I'd like to

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.