From: Norbert_Paul on
Zach Beane wrote:
> It's a rite of passage, I think, to write from scratch functions that
> already exist in the CL standard. Your NEGATE is the same as
> CL:COMPLEMENT.
>
> Zach

So which CL standard functions did you reimplement at your rite of passage?
From: Zach Beane on
Norbert_Paul <norbertpauls_spambin(a)yahoo.com> writes:

> Zach Beane wrote:
>> It's a rite of passage, I think, to write from scratch functions that
>> already exist in the CL standard. Your NEGATE is the same as
>> CL:COMPLEMENT.
>>
>> Zach
>
> So which CL standard functions did you reimplement at your rite of passage?

Too many to remember.

Zach
From: Tomas Zellerin on
On Jan 13, 11:47 pm, Kaz Kylheku <kkylh...(a)gmail.com> wrote:
> If the sequence is a vector, it is sorted by permuting the elements in place
> (the vector is returned, and so the return value is EQ to the argument).

The note in CLHS (http://www.lispworks.com/documentation/lw50/CLHS/
Body/f_sort_.htm) says that this is not guaranteed:

If sequence is a vector, the result might or might not be simple, and
might or might not be identical to sequence.
From: Pillsy on
On Jan 14, 3:42 am, Norbert_Paul <norbertpauls_spam...(a)yahoo.com>
wrote:
> Zach Beane wrote:

> > It's a rite of passage, I think, to write from scratch functions that
> > already exist in the CL standard. Your NEGATE is the same as
> > CL:COMPLEMENT.

> So which CL standard functions did you reimplement at your rite of passage?

Two I remember implementing are MISMATCH (though I think I did it only
for lists at the time) and the bizarrely-named SUBLIS. MISMATCH in
particular is an extremely useful function, and the standard version
has an impressive array of useful keyword arguments.

Cheers,
Pillsy
From: Waldek Hebisch on
Barry Margolin <barmar(a)alum.mit.edu> wrote:
> In article <hikrkk$m7j$1(a)news.eternal-september.org>,
> Joshua Taylor <tayloj(a)cs.rpi.edu> wrote:
>
> >
> > Note that the negation, or complement, of dates-in-lists< is not
> > dates-in-lists>, but rather dates-in-lists>=. If dates-in-lists>= is OK
> > for your purposes, then you can use COMPLEMENT [1]. E.g.,
>
> Unless you're using STABLE-SORT, what difference does it make? It only
> affects the equivalent list elements, and SORT doesn't specify how
> they're reordered in the first place.
>

Using complement is a bug: SORT may depend on predicate giving
NIL for equal arguments and may do anything for wrong predicate.
I do not know of Lisp which would give such problem, but it
happened to me in C that predicate producing wrong values
for equal keys led to wrong result from sort (the keys were distinct).


--
Waldek Hebisch
hebisch(a)math.uni.wroc.pl