EMPTY? is defined as a synomyn for TAIL? and so TAIL? can be used to
terminate loops and such.
Now to test if an entire series is empty, we must say EMPTY? HEAD (or
use the synomyous TAIL? HEAD).
Right now, EMPTY? is just that, an empty synomyn for TAIL?. If it were
redefined as a synomyn for TAIL? HEAD it would serve the purpose of
brevity and (IMHO) clarity.
Nearly all the other functions start at the variable's current index,
APPEND being the notable exception. And since we made an exception for
APPEND (e.g. INSERT TAIL), why not the same exception for EMPTY (e.g.
TAIL? HEAD)?
-Ted.
*********** REPLY SEPARATOR ***********
On 12/15/1999 at 3:15 PM [EMAIL PROTECTED] wrote:
See below:
Russell [EMAIL PROTECTED]
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, December 15, 1999 11:42 AM
Subject: [REBOL] "logical" value referencing ... Re:(3)
[skip]
> Personally, I'm also trying to beginning to question why APPEND
> automatically jumps to the TAIL, but EMPTY? doesn't automatically
jump
> to the HEAD. May submit that one. Doesn't seem consistent.
As 'append and 'empty? perform different functions, one adding
something to
a series, the other providing info about a series, why should they be
"consistent"? 'append certainly should 'insert at 'tail. If you want
to
insert somewhere else in the series, 'insert can do it. Having 'empty?
report on the series from the index to the tail is a convenience. If
it
didn't, someone would surely ask for a variety of empty? that did! To
look
at the whole series, use 'empty? 'head <some series variable>. As it
is,
'empty? could be useful as a loop termination test where each step of
the
loop 'remove's something and one needs to know if all the items have
been
removed. IMO, submission isn't needed.