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

*To*: jinx%hpesogg@sde.hp.com*Subject*: Re: Multiple values for R4RS.*From*: R. Kent Dybvig <dyb@iuvax.cs.indiana.edu>*Date*: Tue, 22 Aug 89 13:51:43 -0500*Cc*: rrrs-authors@life.ai.mit.edu

Let me take a stab at "quotient-and-maybe-remainder": (define quotient-and-maybe-remainder (lambda (n1 n2) (call/cc (lambda (k) (if (accepts? k 2) (let ([q (quotient n1 n2)]) (let ([r (- n1 (* q n2))]) (k q r))) (k (quotient n1 n2))))))) Unless I'm missing something and there is a different way to do this, I guess I'm not too excited about "accepts?". The predicate "accepts?" seems a little like the (rejected) predicate "continuation?". A procedure may not complain "up front" about a given number of arguments, but may complain at some later time. Or it may accept any number of arguments, but ignore all but the first few. I don't see how "accepts?" can be generally useful if it breaks down in these cases. (define kons (lambda l (apply cons l))) (accepts? cons 3) => #f (accepts? kons 3) => #t Kent

**Follow-Ups**:**Multiple values for R4RS.***From:*Guillermo J. Rozas <jinx@hpesogg.hp.com>

- Prev by Date:
**Multiple values for R4RS.** - Next by Date:
**Multiple values for R4RS.** - Prev by thread:
**Amended WITH-VALUES and VALUES.** - Next by thread:
**Multiple values for R4RS.** - Index(es):