This Engineering Notebook post contains notes to myself about #632 
<https://github.com/leo-editor/leo-editor/issues/632>, mostly so I can 
forget about them and concentrate on what matters.  Feel free to ignore, 
but this post contains two important Ahas.

Yesterday, as a form of unwinding, I tweaked the prototype in various 
ways.  This was actually a fairly stupid thing to do, for these reasons:

1. *The only thing that matters is getting the resolve* methods correct*. 
This is the heart of type inference. Errors in this code call into question 
the entire enterprise. I will work *only *on this in the hours/days to come.

2. A few lines of new code converted the algorithm to a two-pass approach. 
But this just *complicated *the prototype, without affecting the resolve* 
algorithms in any way! I won't be too hard on myself on this one.  The 
effect was surprising.

3. Only ast-based code can correct the prototype's flaws.  These flaws are 
*unimportant 
*in the prototype! There is no way, using the regex-based code, to handle 
nested classes and defs correctly.

4. I can always devise test code (for the prototype) so that using one pass 
will give the same results as using two passes.

*Ahas*

*Scope resolutions issues probably don't matter*. I realized this only 
recently.  The convention checker *doesn't care about scope*. It only 
checks that *names comply with usage*. The prototype has already shown it 
can check the types of function arguments.  It should be possible to do the 
same with some kinds of assignments.

*The production tool might use user-supplied regex patterns*. For example, 
the ast visitor for assignments might apply user-supplied patterns in 
exactly the same way that the prototype code does. I never dreamed that the 
technique that works so well in the prototype might also work, in a 
rigorous way, in the production tool.

*Summary*

I can't put this project down now.  It would be unbearable not to complete 
the resolve* code now that the prototype provides such an excellent test 
bed.

The production tool should be simpler, faster and more flexible than first 
imagined.

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