octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Implementing show_source function


From: Jordi Gutiérrez Hermoso
Subject: Implementing show_source function
Date: Wed, 4 May 2011 09:55:27 -0500

Right now that I'm starting to work with Sage at the Sage Days 30
workshop, I've found that it has a nice feature. If you type
"edit(foo)" where foo is any symbol that Python knows about, Sage will
open an editor at the file and line number where this Python object is
defined. So it's very convenient for inspecting the source. And it
seems to be working, observe how many non-expert programmers but able
mathematicians are contributing to Sage.

Octave has a few mechanisms sort of in place to do this partially,
like the edit function and the help function, but they don't work for
compiled code (I don't know if Sage has solved this problem for
compiled code either). I can see how to do this for m-scripts, but how
could something comparable be done for compiled-in functions? I'm
thinking it should be possible to modify the DEFUN family of macros to
include __LINE__ and __FILE__ so that this information is available to
the interpreter. Would this be feasible? I haven't really tried to
untangle the magic behind DEFUN.

Thanks,
- Jordi G. H.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]