Re: What's so great about lisp?



Jon Harrop <usenet@xxxxxxxxxxxxxx> writes:

> Joe Marshall wrote:
>> I like this example:
>>
>> (defun sort (x predicate)
>> x)
>
> Is that:
>
> let sort x predicate = x
>
> So you're looking for a warning because "predicate" was bound but never
> used?

No, I wanted a warning that the output isn't sorted.

Yeah, I expect a warning that predicate isn't used, and of course I
can't redefine the built-in sort, but that's not the point.

.



Relevant Pages

  • Re: Name For - Functions that indicate order?
    ... earlier in a sequence and false if not. ... At the moment the function is called CompareItem, I am trying to come up ... Predicate used to sort entire vector". ...
    (comp.programming)
  • Re: randomize-list
    ... implementations of sort can either ... If the key and predicate always return, ... and does not require predicate or key to be consistent: ...
    (comp.lang.lisp)
  • Am I abusing SORT? It sure aint working for me....
    ... According to the CLHS in re SORT: ... "Predicate should return true if and only if the first argument is strictly less than the second. ... My only requirement on the sort result is that no node precede any of its ancestors (its parent or its parent's parent or etc). ... So nil means either that arg2 is an ascendant of arg1, or that neither is an ascendant of the other. ...
    (comp.lang.lisp)
  • sorting std::list with function predicate
    ... I need to sort elements of a std::list using a function predicate, ... So since I must not call std::sort on a list, how can I sort it in a way ...
    (comp.lang.cpp)
  • Re: How Best to Randomize a List?
    ... It wouldn't work with bubble sort -- ... the poor thing would terminate only by accident. ... predicate is consistent, that makes them do what we want given this ... result of sorting a sequence by a random predicate will produce all ...
    (comp.lang.lisp)