Lists, Tables, Psets

Kyle Lahnakoski
Fri, 31 Mar 2000 12:43:03 -0500 wrote:

> > But as the caller how do I know what order the function use the
> > parameters?
> Hmm... I'm starting to get a bit confused...
> If you're the caller, then you'll have to put the parameters in the
> correct order (the order that the function requires them to come in),
> and don't have to know what order the function will actually use them;
> but, if you're designing a new function, and get to decide what order
> the parameters come in, then it might be wise to make the ones that
> will be used first be required top on the stack. Otherwise, you'll
> end up having to use "swap", "dip", or something like it.

To have the caller put the parameters in the right order may require
many "swaps" and "dips" by it.

> > You say clutter, I say loss of intent.
> Hmm... I don't quite understand... are you saying that you also think
> that the "(", "=", ")", ",", and ";"s are obscuring the program?
> Or, are you saying the opposite, that they are essential to
> the "intent" of the program and that taking them away destroys intent.

The latter: the "(", "=", ")", ",", and ";" increase readability.

> I'm still not sure what exactly you mean by "intent",
> or why you find it such a valuable thing to have?
> Does it make the system fast, small, or good in some other way?

Intent is the ease at which a program can be reverse engineered,
preferably by a machine.  The more intent stated in a program, the
easier it is to reverse engineer.  
Comments do not count because they are not the code.  Comments,
technically, have nothing to do with code.

Intent is good because of the reverse engineer aspect.  There must be a
reason why people prefer higher level languages.  The average human
being is not a memory machine.  I know a couple of people that have
incredible memories, and maybe Joy is for them.  But I would never
remember parameter order, especially if that order is dependent on
implementation.  Most of my time will be spent looking up parameter
order in the help file, again and again.  In C or Java, the parameters
have order, but at least a fairly consistent and logical order.  I
propose the next step, remove order, and use parameter names.  When I
call a function I find it much easier to remember the parameters
required than recalling order too.

Maybe I am making a point on human interfacing.  Our memories are
associative; given a trigger, the associated thought is easy to recall. 
The association between parameter name and the parameter concept is very
easy to recall.  Communication with a human can be more efficient of
there is redundancy in the communication.

Why then, may you ask, should this redundancy be modeled in the
machine?  I propose that it is not.  Like I said before, once you have
all the data structures in place that describe the structure of a Joy
program you will see that it is no better off than what I propose.  We
both have the same amount of information in a particular program.  I
have normalized the database containing these structures, so there is no
redundancy; my code is as small as it can get, for the information it

Thanks again

Kyle Lahnakoski                                  Arcavia Software Ltd.
(416) 892-7784