If all lisp functions can be defined or redefined by the user,
then in order to make using those lisp functions readable to an editor in
the end, the functions would need to be designed with extra functions that
serve as in-line comments to their arguments

for example, wrapping a then() and else() function for an if-expression
function, no matter if the symbol is 'if' or not

when a symbol 'if' is used to do something else, the author could just use
different functions to explain what is going on, and the software would
just format it like any other lisp, the author controls what helper-text is
generated when they author a function using defun or whatever is used to
define functions in that lisp.

however by removing the parentheses, adding in whitespace, etc, in an
editor, these more complex definitions start to look like english

one functionality that lisp may not have (I'm not sure) is the ability to
make up a new function like "then()" without defining it, and automatically
have it do nothing but return what's inside it (a "comment function")
this might have to be implemented like they implemented "quote", for
example prefixing a function with $then() would mean it just returns whats
inside it (and evaluates it) but requires no function definition to use it

in the general solution this would work like this,
you create an if-expression function with the symbol 'if'

its first argument is wrapped in this-is-true() function (or omitted if the
context for 'if' is clear)
its second argument is wrapped in a then() function
its third argument is wrapped in an else() function
but both of those functions are just returning what's inside them - they
have no complex functionality, their purpose is to help a software editor
auto-complete the symbol 'if' with its first two arguments, which are
then() and else()
anything written after "then" and before "else" goes inside the then()
anything written after "else" goes inside the else()
anything two lines down in the editor does not belong to either (closes the

so it would look like this in practice:


then the user writes

this-is-true 5 + x = 10
then save-file
else close-file

one empty line down, the 'if' symbol is closed...

now if a user redefines 'if' to mean something else, they can wrap the
function arguments in other function names to explain the arguments, or if
there is only one argument, omit it

for example a mouse-move-xy(x,y) function might look like

mouse-move(x(int) y(int))

which in the editor would format as

x 10
y 5

one empty line down, the mouse-move is closed...
Readable-discuss mailing list

Reply via email to