[r6rs-discuss] gcd & lcm argument requirements

Eli Barzilay eli at barzilay.org
Sun Mar 23 21:28:11 EDT 2008


On Mar 23, Eli Barzilay wrote:
> On Mar 23, Llewellyn Pritchard wrote:
> > Hi
> > 
> > It appears what valid arguments are for gcd and lcm are undefined. Should 
> > rationals be allowed or is this behavior unspecified?
> > 
> > Most Scheme's (R6RS and otherwise) seems to choke on the following:
> > 
> > (lcm 12/5 6 4)
> > and
> > (gcd 12/5 6 4)
> > 
> > If indeed that should be allowed, can the behaviour be described? (I get 12 
> > and 2/5 respectively).
> 
> The PLT docs for these indicate integers:
> 
>   http://docs.plt-scheme.org/reference/numbers.html#(def~20(~23~25kernel~20gcd))

(Apologies for the PLT-specific reply, I completely missed the fact
that it was sent on the r6rs list.  I should be ticketed for PUF
(posting under the fever).)

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!



More information about the r6rs-discuss mailing list