Terry's code is super cool. I'm paying close attention now that I am
writing a tutorial. For the cognoscenti, the <;; abbreviation is work of
genius, and shows how flexible Terry's abbreviations are.
A simple change to how Leo handles @data nodes will eliminate the need for
the \: convention presently required in @data abbreviations-subst-env nodes!
Previously, Leo removed blank lines and comment lines (lines starting with
'#') from the list of lines returned by the @data parser. Now, Leo simply
removes comment lines, and does just an rstrip on each resulting line::
def doData (self,p,kind,name,val):
data = [z.rstrip() for z in g.splitLines(p.b) if not
z.startswith('#')]
self.set(p,kind,name,data)
Stripping lines in @data nodes was a very bad idea: it looses potentially
essential information. In the new scheme, code in @data
abbreviations-subst-env can be executed *as is*, without the need for
leading \: characters on each line!
However, some convention is still needed for @data global-abbreviations and
@data abbreviations nodes, because the code that scans abbreviations needs
to know where each abbreviation ends. I propose that lines consisting only
of the characters \n will indicate a blank line that appears in an
abbreviation. For example, instead of::
# template for a def
def;;=def {|{x=ask("function
name",default=c.p.h)}|}({|{x=in_class()}|}{|{x=ask("Params, comma
sep.")}|}):
\: """{|{x=get("function name")}|} - Return
<|return|>{|{x=param_doc()}|}
\: """
\:
\: <|code|>
We would use this::
# template for a def
def;;=def {|{x=ask("function
name",default=c.p.h)}|}({|{x=in_class()}|}{|{x=ask("Params, comma
sep.")}|}):
"""{|{x=get("function name")}|} - Return
<|return|>{|{x=param_doc()}|}
"""
\n
<|code|>
This looks like a nice improvement. What do you think?
Nothing pushed yet. I'll be reveling in the possibilities for awhile.
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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/groups/opt_out.