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

Re: Have one-argument '<? et al function as 'make<? et al

This page is part of the web mail archives of SRFI 114 from before July 7th, 2015. The new archives for SRFI 114 contain all messages, not just those from before July 7th, 2015.



On Fri, Feb 28, 2014 at 2:00 PM, Alan Manuel Gloria <almkglor@xxxxxxxxx> wrote:
I don't quite see how.  Like this?

((cute . {v-find <> v}) (make<? c))

Could you give an example?  I don't quite grok what you mean.

If I understand correctly, you want to be able to take a comparison predicate such as <? and a comparator, and produce a comparison procedure that uses that comparator without having to explicitly pass it as as an argument. (Please correct me if I misunderstand.) You can do that with cute, for example if c is a comparator, the _expression_

(cute <? c <> <>)

yields a procedure that takes two arguments and compares them according to <? with comparator c. So after

(define c< (cute <? c <> <>))

You can use <c as a predicate, e.g. (<c 3 4).

PS, Sorry for the late reply.

Kevin Wortman