[plt-scheme] Should < work with just one argument?

From: Jacob Matthews (jacobm at cs.uchicago.edu)
Date: Mon Apr 18 11:17:09 EDT 2005

On Sun, 2005-04-17 at 15:13, Eric Hanchrow wrote:
> R5RS says
>          - procedure: < x1 x2 x3 ...
> and
>          <thing1> <thing2> ...
>         indicates one or more occurrences of a <thing>.
> So I read R5RS as saying that the procedure < should accept one or
> more arguments, but mzscheme's < seems to demand two.  Is this a bug?

No. If it were

procedure: < x1 x2 ...

that would mean that < was required to accept one argument, but

procedure: < x1 x2 x3 ...

requires at least two. 

The way they've described their notation in section 1.3.3 may be a bit
confusing; the right way to read these things is that <thing> ... means
0 or more occurences of <thing>. It's just an implication of that fact
that <thing1> <thing2> ... means 1 or more, since <thing1> must match
exactly one occurence and then <thing2> matches 0 or more additional
occurences. Similarly x1 x2 x3 ... matches exactly one x, then exactly
one more x, then 0 or more additional xs, for a total of two or more xs.
That's exactly the mzscheme behavior.


Posted on the users mailing list.