[REBOL] Re: On list! inconsistency [was Re: WYSIWYG programming]
From: joel:neely:fedex at: 1-Nov-2000 12:46
Ladislav Mecir wrote:
> I would like to make a few points:
> 1) my hat's off to RT for their implementation of lists
I wholeheartedly concur -- in the sense that I'm glad that
list! hash! and block! types give use containers that are
optimized for different purposes.
> 2) there's a spec lists *must* comply to to be called lists:
> insert and remove *must* be elementary operations for lists
Again, total agreement.
> 3) your requirements are in contradiction with the spec
I don't think I'm laying down "requirements". Remember the
history of this thread. (Skip indented text if you aren't
interested in the history part...)
I made the comment that there are inconsistencies in the
design of REBOL, and that comment was challenged. I tried
to give examples of such inconsistencies.
I also tried to make it clear that I do not regard all
inconsistencies as necessarily "evil", and used the result
values of Append and Change (applied to blocks) to illustrate
that point. The difference in their returned values (original
position or adjusted position) has a benefit for the most
common uses, and the benefit is related to the *concept* of
container, and *not* to the implementation details of the
differently-optimized containers. Therefore, IMHO the mild
inconsistency is reasonable.
That isn't always the case, however.
The spec (RCUG) states the differences between result values
for some operations applied to list! values vs. block! and
hash! values, but there's no explanation of *why* those
differences are of any benefit to the programmer.
A REBOL programmer who writes a function with an any-block!
argument will very possibly have to write/debug/maintain extra
code to deal with the variances in behavior of list! vs. block!
and hash!. You're right that those differences are documented,
but I think it is reasonable to ask whether there's any benefit
to the programmer to offset the cost of the exceptions
If there is no benefit, then I think it's fair to call the
design decision into question as being less than perfect.
PS: Ladislav is due credit for inspiring the latest sig block!
; Joel Neely [joel--neely--fedex--com] 901-263-4460 38017/HKA/9677
REBOL  foreach [order string] sort/skip reduce [ true "!"
false head reverse "rekcah" none "REBOL " prin "Just " "another "
] 2 [prin string] print ""