texmacs-dev
[Top][All Lists]
Advanced

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

[Texmacs-dev] edit_main_rep::show_tree


From: Salman Khilji
Subject: [Texmacs-dev] edit_main_rep::show_tree
Date: Wed, 25 Jun 2003 19:43:00 -0700
User-agent: KMail/1.5.1

In edit_main.cc, I see a function:

edit_main_rep::show_tree()

This function seems to be the one that dumps the edit tree of the
editor.  The question is how do I call this function at runtime to see
the edit-tree?

glue_editor.cc has the following line:

gh_new_procedure ("show-tree", (FN) tmg_show_tree, 0, 0, 0);

This indicates that somehow I should be able to call this function from
an interactive scheme session from TeXmacs itself.

The only way that I figured out of calling this function to use gdb. I
put a breakpoint in the function: edit_main_rep::focus_on_this_editor ()
and when this breakpoint was hit, I could type call show_tree().  This
displays the output in gdb window. This to me seems like an overkill.
There must be a way to "visually" see the data structures of TeXmacs in
memory.

THE FOLLOWING IS FLAME.  SO DON'T READ IT IF YOU DON'T WANT.

I think its very important for a programmer to "visualize" the data structures 
of some code which he is trying to understand.  The "Schemish" programming 
style really does hinder me from doing so.  Everything seems to be a "tree".  
How in the world am I supposed to figure out how it looks like for a test 
case of my interest.  Only when the programmer has a rough idea as how the 
data structure looks like can he actually write a procedure that modifies 
that data structure.

I went thru the link that David recommended for Scheme.  After skimming thru 
the link, I refuse to learn Scheme.  Period.  Maybe after understanding some 
of the logic (and only if I can ever understand it), I'll create a project 
from scratch using C++ and Qt.  Scheme programmers seem to think that its a 
versatile language and has a cleaner syntax.  I, however, found that loads of 
perenthesis like )))))))) everywhere make it hard to understand.  Eventhough 
the indentation really does not help.  Afterall, who has time to count the # 
of ')' characters.

Salman




reply via email to

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