all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Clément Pit--Claudel" <clement.pit@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: bug#24514: 24.5; Lispy backtraces
Date: Sun, 04 Dec 2016 22:41:35 +0200	[thread overview]
Message-ID: <83a8cbl94w.fsf@gnu.org> (raw)
In-Reply-To: <143c480c-a9db-7053-4b70-175633197981@gmail.com> (message from Clément Pit--Claudel on Sun, 4 Dec 2016 14:27:59 -0500)

> Cc: emacs-devel@gnu.org
> From: Clément Pit--Claudel <clement.pit@gmail.com>
> Date: Sun, 4 Dec 2016 14:27:59 -0500
> 
> >> The C implementation of backtrace-frame seems to be linear in the index of the requested frame, so a Lisp implementation of backtrace would be quadratic in the depth of the stack trace.  Would a new function backtrace-frames that returns all frames at once be acceptable?
> > 
> > But such a backtrace-frames function would have to be implemented in
> > C, right?  And you wanted to move the implementation of "backtrace" to
> > Lisp, AFAIU.  So it sounds like we will be replacing one C primitive
> > with another, or did I miss something?
> 
> I think you're correct. It would seem good to have the flexible primitive backtrace-frames available, and it must be in C; then we can move backtrace itself to lisp.
> 
> The idea is that enumerating frames must be done in C, but printing them doesn't need to be done there.

So would it perhaps make sense to rename 'backtrace' into something
like 'backtrace--internal', and make it accept one more argument, the
function to apply to each frame, which is now hard-coded as 'prin1'?
Would that allow you to implement 'backtrace' in Lisp and also
implement whatever application you had in mind, by calling
'backtrace--internal' passing it your own function instead of 'prin1'?



  reply	other threads:[~2016-12-04 20:41 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-22 23:14 bug#24514: 24.5; [WIP][PATCH] Lispy backtraces Vasilij Schneidermann
2016-09-23  2:22 ` Clément Pit--Claudel
2016-09-23  7:51   ` Vasilij Schneidermann
2016-09-23 13:22     ` Clément Pit--Claudel
     [not found]     ` <82e39377-f31b-698c-5a9a-343868686799@gmail.com>
     [not found]       ` <20161202005226.GA4215@odonien.localdomain>
2016-12-02  1:23         ` bug#24514: 24.5; " Clément Pit--Claudel
2016-12-02  2:24           ` Stefan Monnier
2016-12-03 22:15             ` Clément Pit--Claudel
2016-12-04 15:30               ` Eli Zaretskii
2016-12-04 19:27                 ` Clément Pit--Claudel
2016-12-04 20:41                   ` Eli Zaretskii [this message]
2016-12-04 22:14                     ` Clément Pit--Claudel
2016-12-05  3:30                       ` Eli Zaretskii
2016-12-05  6:02                         ` Lisp-friendly backtraces [was: Lispy backtraces] Clément Pit--Claudel
2016-12-05 13:20                           ` Stefan Monnier
2016-12-05 14:14                             ` Clément Pit--Claudel
2016-12-05 14:37                               ` Stefan Monnier
2016-12-05 16:31                                 ` Clément Pit--Claudel
2016-12-05 16:54                                   ` Eli Zaretskii
2016-12-05 16:23                               ` Eli Zaretskii
2016-12-05 18:59                                 ` Clément Pit--Claudel
2016-12-06 18:55                                   ` Eli Zaretskii
2016-12-07  8:27                                     ` Clément Pit--Claudel
2016-12-12 22:42                                       ` Clément Pit--Claudel
2016-09-23  8:12   ` bug#24514: 24.5; [WIP][PATCH] Lispy backtraces Vasilij Schneidermann
2016-09-23  9:44   ` Eli Zaretskii
2016-09-23  9:55     ` bug#24515: " Vasilij Schneidermann
2016-09-23 10:06       ` Eli Zaretskii
2016-09-23 13:25       ` Clément Pit--Claudel
2016-09-23 16:33         ` John Wiegley
     [not found] ` <mailman.2864.1474586229.22741.bug-gnu-emacs@gnu.org>
2016-09-23 18:47   ` Alan Mackenzie
2016-09-23 20:43 ` Richard Stallman
2016-09-27 19:16 ` Vasilij Schneidermann
2016-09-28 15:28   ` Eli Zaretskii
2016-09-30 10:29     ` Vasilij Schneidermann
2016-09-30 13:26       ` Eli Zaretskii
2016-10-12 15:34   ` Vasilij Schneidermann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83a8cbl94w.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=clement.pit@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.