A recent question about g.getScript got me thinking...

The OP was asking for information that I couldn't possibly know, but is 
trivial to discover.

First, you find the node that defines g.getScript in leoPy.leo, aka 
leoPyRef.leo. The "trick" if you can even call it that, is to *look at the 
child nodes.*  This will show you the subsidiary tasks.

In this case, there is a helper called g.extractExecutableString, which has 
a "language" kwarg, so surely weirdness involving language must involve 
this method.  I have just created #1071 
<https://github.com/leo-editor/leo-editor/issues/1071> for this bug.

When I awoke this morning I realized that many Leonistas might not 
understand the first and most important Aha's about Leo and literate 
programming.  This is documented here 
<http://leoeditor.com/history.html#apple-and-yellowbox>, in the History of 
Leo <http://leoeditor.com/history.html>:

"Late in 1997 I wrote a Print command to typeset an outline. Printing 
(Weaving) is supposedly a key feature of literate programming. Imagine my 
surprise when I realized that such a “beautiful” program listing was almost 
unintelligible; all the structure inherent in the outline was lost! I saw 
clearly that typesetting, no matter how well done, is no substitute for 
explicit structure."

As I reread this, I see that this quote obscures the main idea:

*    Outline structure tells programmers almost everything they need to 
know.*

This is a general principle!  For example, I could try to document all of 
Leo's important classes, but why bother?  leoPy.leo contains all of Leo's 
core classes, organized.  It's easy to skim through the outline looking for 
files and their classes.  Once you find the relevant file, you can expand 
its outline to see the file's components.  You continue the process until 
you find what you are looking for.

It's really that simple.  This is what I *always* do when answering a 
question.

*Summary*

More than 20 years ago I saw that Leo's outline structure reveals almost 
all the relationships needed to understand any file, class or method. Fancy 
documentation adds almost nothing.

Every Leonine programmer should know and use this crucial Aha.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to