Saturday, November 19, 2016

accountlessness

A major reason I'm writing a theory of the web is because I'm annoyed.

I'm annoyed when I want to do something and it's not immediately obvious how to do it. This happens all the time. I know other people are doing it, so apparently they figured out how, and if I asked them about it they would say I can't figure it out because I'm stupid and lazy. I say it's because they are cheaters and liar, but I'm not really in a position to argue. Why, though, should people be treated this way. To the extent that I'm creating the web, I want to create a web that's immediately obvious.

If I'm convinced something is going to work for me, I don't mind setting up an account, or installing something, and even paying for the advantage of doing those things, sometimes. Sometimes I'll try one of these expedients just because I'm desperate, too. But there are things on the web that just work. I don't have to do anything, I can just use them. I've decided I want my DE to be one of those things.

In my DE I'm going to build a string which is the code for my program. I'll access the DE by visiting a web page, and I'll build the code by typing into an element on the page. To save my code, I'll copy it from an element on the page, and paste it somewhere.

How in hell does this Blogger interface work?! I'm typing in an element on the page, but what kind of element is it, and why am I able to type in it? How can I get an answer to that question?

Try this experiment: in the Blogger editor, in compose mode, click somewhere outside of the editing box, in the editor background, and the press Ctrl A. Click and drag the highlighted page into the editor box. The result is astonishing.

This is an example of being able to put something someplace.

In my DE, the program begins

setupthewindows()
setupthecontrols()

These function calls are typed into the editing field, and then clicking on a function name takes you to a fresh editing field where you can type the code for the function. If you type a function call in that field, clicking it again takes you to a fresh field, and whatever field you are in, other than the root, a back button takes you to the parent, that is, the field from which the function was called. Here I am not addressing the problem of scope. That is to say, if a function is called in some other function, a descendant of the root, and that function has been declared in some ancestor of the function calling it, that is, of the function currently in the editing field, will the focus shift to a fresh field, or to the field for the existing function by that name (if that existing function is in the scope of the function calling it).

Also, earlier I described an experiment which demonstrated something about scope, but I just realized there's a question that wasn't answered. If a function call calls a function with a certain name, and that function is not defined in the function calling that function, but a function by that name is defined in the calling functions parent, the function defined in the parent is called, but what if the a function by that name is not called in the parent, but is, for example, called in the grandparent, is the function called from the grandparent? Does the interpreter search all the levels of ancestry for a function by that name until it finds one?

<div id="console" style="background-color:lightgrey;color:pink;font-size:10em"></div>
<script>
function testfunctioncall() {document.getElementById("console").innerHTML = "A"}
function child() {
grandchild()
function grandchild() {
testfunctioncall()}}
</script>

In that my DE only displays one function at a time, it is an implementation of Postulate 1.

When I am done, a button labelled get the code puts the code into a console (as defined above) and I can copy it from there into my text editor, for local use, or into the blogger editor's HTML editing field, which is the free web hosting resource.