Namespace, Psets, Order, IDs, Joy (was: Intent)
iepos@tunes.org
iepos@tunes.org
Tue, 11 Apr 2000 11:07:20 -0700 (PDT)
> >Anyhow, a similar technique could be used in a Joy-like system,
> >so that if the system had a function named "divide" and the programmer
> >wanted to call it "quotient", it could be renamed with something
> >like this:
>
> > [divide] "quotient" rename
>
> There's no reason to do this -- instead, use definition:
>
> quotient == divide.
Yeah. That would require sugar for "==", but that's no problem.
I'm not sure why I called the word "rename" up there; it would
make more sense to be called "def", as it does not destroy
the original name.
> >Or if he had still liked the name "divide" but just wanted the change
> >the order:
>
> > [swap divide] "divide" rename
>
> divide == swap divide.
Yes... That'd be fine too...
> >Anyway, this example just refers to a mythical Joy-like system;
> >this type of thing is not possible in the existing Joy.
>
> Eh? Why not? Function naming and definition is part of the system.
I meant that within the interpreter it is not possible to dynamically
undefine and redefine names. But now I see that it is actually
possible to redefine a name just by using "==" again. But
there doesn't seem to be a way to undefine a name; well, actually
in the current system Joy just silently ignores words it doesn't
understand instead of complaining about them. So, I guess you
could achieve the effect of undefinition by just redefining
to "id".
> >I guess I'd agree with that. I like the idea of a system not keeping
> >source code around, but instead just keeping an internal version
> >(possibly using something like your ID's instead of English-text
> >function names) that can be more easily manipulated; then, if a coder
> >wants to see a program, the system would generate the text on-the-fly
> >to match the coder's preferences, such as the names and order of
> >functions and pretty-printing styles, and the column width of his
> >terminal.
>
> Chuck Moore tried that with his OK system (he also called it 3/4th), and
> decided that it had been a mistake. Perhaps he oversimplified; you can read
> about it in general on http://www.ultratechnology.com.
>
> I _do_ agree, though, that the programming tools (especially the
> configuration management) ought to have _complete_ control over code
> formatting. It's ridiculous to have a mere formatting change mess up diffs.
> Not even renamings should mess up diffs -- the configuration manager should
> understand the source.
Yeah... sounds like a good idea...
> >Of course, there might be some cases where the coder really does
> >want control over the exact layout of the code; for instance, this
> >may be the case if one is writing a program for some Obfuscated
> >Coding contest. In this case, some mechanism should still be provided
> >so that the textual source code can still be worked with.
>
> It's called a "text editor". Don't use the language's tools to do that; I
> don't want to make the tools too smart.
Yes. A text editor would work fine. I don't see where the disagreement is.
The point I was trying to get across was that it is not good for
a system to always have the policy of changing the source code,
even in small ways, behind the programmer's back.
There seems to me to be a pretty simple way to get the best of both
worlds... Let the user decide whether he wants to hang on to the
textual source code or just the program. In the type of system I'm
thinking of, if a user was going to write a program, it would probably
be done with a text editor, like in other systems; then, one would
use a compiler to convert the text into a program. But then, the
text could be safely discarded, because all the important information
in it could be reconstructed from the program.
But, maybe that would be making the tools too smart, as you say...
> >- "iepos" (Brent Kerby)
>
> -Billy