On Monday, March 27, 2017 at 3:50:39 AM UTC-4, Edward K. Ream wrote:
>
> On Sun, Mar 26, 2017 at 11:00 AM, Eric S. Johansson <[email protected]
> <javascript:>> wrote:
>
> Here is how I would speak it:
>>
>> def write (self, root,
>> kind = '@unknown',
>> no sentinels = False,
>> perfect import flag = False,
>> script write = False,
>> thin file = False,
>> two string = False,
>> ):
>>
>> After going through the whole toggle name transformation process, I would
>> end up with your example:
>>
>> def write(self, root,
>> kind='@unknown', # Should not happen.
>> nosentinels=False,
>> perfectImportFlag=False,
>> scriptWrite=False,
>> thinFile=False,
>> toString=False,
>> ):
>>
>>
>
> Thanks for this example.
>
>
> normally, this transformation is bidirectional in that I can transform
>> from string name codename and then back again. I should emphasize that the
>> transformation between string naming codename is a database lookup, not a
>> calculation.
>>
>
> I'm not sure I understand the details of what you are doing, but any time
> there is a database involved you should think of using uA's
> <http://leoeditor.com/customizing.html#adding-extensible-attributes-to-nodes-and-leo-files>,
>
> accessed via p.u.
>
Some days I'm not either... :-) hopefully a few more explanations may help.
wrt the database, I think your is a good one. But for now I'm going to stay
with SQLite just because I need to make functionality work in the short
term.
Here's how toggle name looks at the input. The code doesn't really do
anything. Just there to show you how the transformation works. Toggle name
looks at the text as code and not code (aka string names). The analysis is
not sophisticated. Anything that's punctuation in language or reserve
keywords is considered code. Everything else is not code. Orange is code,
everything green is not code.
.
def write turnips (self, root vegetable):
local vegetables = root vegetable
no sentinels = False,
perfect garden flag = False,
turns out the definition of code is a slightly more complicated. It also
includes any string of characters that make up a legal symbol name. So for
example "no sentinels" is considered a string name but "no_sentinels" is
considered a codename and therefore part of code. Being able to separately
identify codenames is important because it allows you to convert from a
codename back to a string name if the data is in the database.
The toggle name process runs to the text, and with every string name tries
to figure out if it's already known. If it's not, it marks it so an
association between codename and string name can be formed as a separate
user interaction. Waving my hands, here's a partial transformation using
the same notation as I did when running toggle name as part of Emacs.
def wrTrnps (self, root vegetable!!unknown):
local_vegetables = root vegetable!!unknown
noSentinels = False,
perfectGardenFlag = False,
the string name "root vegetables" has not been associated with any codename
and is marked as unknown. The "!!unknown" notation was an artifact of
convenience working within Emacs. However, it is useful to note when an
association is undefined. The verbal command "fix unknown" would go through
the body of text, after the !!. After you put in something to complete the
association like "root_veg", the verbal command "fix next" would make the
association, go through and substitute every root_vegetable" for its
codename and then move onto the next unknown instance. In this example
here, once I defined "root vegetable", the second use would be transformed
as well.
Yes, it does sound weird but it is surprisingly useful and flows very well
when using speech recognition. As an aside, this is why people who are not
disabled should never ever try to write user interfaces for disabled
people. They just don't have the experience.
Now this is where the hairballs come in and I want to see if your
recommendations still hold. I believe that it's important to walk the tree
created by section references to catch all of the unknown string names. For
me the question is when? We have two options depending on how the mapping
is handled. First is on command ("fix unknown", "fix next") or when the
@file node is saved. The command driven option is really to me and would
require changing the contents of a node to reflect the mapping of string
name codename. The second is intriguing because it allows us to store the
code text in its meta-form and only perform the transformation during the
tangling process. I like the second option because it opens up more
possibilities for programming by speech but it will increase the
friction/distance between the pre-disability programmer and the
post-disability programmer. Is there a way to "import" changes made to code
text reliably?
Part of the reason for my thinking is that when I'm writing code, I am
using string names everywhere and only just before I'm going to test do I
apply the transformation of string name to codename. I can see myself with
a dozen or more nodes that haven't been transformed and to go to each one
manually to transform it is best described as a royal pain. Hence my desire
for a "do it in one go" solution.
Now this is where I need your guidance. Which solution would be the
"better"?
--
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.