texmacs-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Texmacs-dev] Applied patches for TeXmacs 1.0.1.2


From: david
Subject: Re: [Texmacs-dev] Applied patches for TeXmacs 1.0.1.2
Date: Mon, 27 Jan 2003 15:56:36 +0100
User-agent: Mutt/1.4i

On Sun, Jan 26, 2003 at 12:42:09PM +0100, Joris van der Hoeven wrote:
> 1004: Should be modified
>   I agree with all changes, except with the permutation
>   in the ordering of l and pred? in filter, separate, etc.
>   Please stick to the same ordering as the one used for
>   the other routines. As a general rule, I prefer to pass
>   the principal object of a routine as the first parameter
>   (in this case: the list on which we perform some operation).
>   Your passing style should rather be used for operators,
>   like in ((separate pred?) l).

I am very sad with this requirement. The rest of the world uses the
parameter ordering which is set by "Structure and Interpretation of
Computer Programs" (the Book of Scheme). Also, that is consistent with
the ordering used by map and for-each.

When any Scheme programmer reads "(filter ..." the expected parameter
ordering is pred and *then* list. Additionnaly that ordering makes it
simpler to use other Scheme code with TeXmacs; one reason why I made
this change was to accomodate sxml-tools which uses filter function
which is compliant with the definition of SICP.

Another reason I can find to do things that way is that pred is either
a named procedure or a short lambda and the list can be the value of
long expression. When writing code it is good practise to place short
parameters first in the same way that when writing in a natural
language it is good practise to put small grammatical groups before
long ones.

I know you do not care how the rest of the world do things. Sometimes
that is reasonable (when it can be argued that the rest of the world
is wrong and when doing thing differently brings a real improvement)
but sometimes that just reduces the usefulness of the software.

Sometimes I am wrong and I change my mind after some time. When I
first wrote the filter function for menu.scm, I was wrong. Since that
time, my understanding of lispishness has improved a lot. Now I want
to fix the mistake.

PS: they were other wrong things with menu.scm, some were fixed and
some are still there. For example the cleanup pass is not needed
because one can use splicing operations to produce trees whose
structure is marginally different than the tree traversal path, but I
will fix that later.

-- 
David Allouche         | GNU TeXmacs -- Writing is a pleasure
Free software engineer |    http://www.texmacs.org
   http://ddaa.net     |    http://alqua.com/tmresources
   address@hidden  |    address@hidden
TeXmacs is NOT a LaTeX front-end and is unrelated to emacs.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]