Re: Range Expressions

Any reason not to have our cake and eat it too?

_________________
Tomos Hillman
eXpertML Ltd
+44 7793 242058
On 30 Nov 2020, 15:49 +0000, Christian Grün <cg@basex.org>, wrote:
> "by" is more common to me as well; but maybe we should throw the dice.
> ____________________________________
>
> On Mon, Nov 30, 2020 at 4:09 PM Michael Kay <mike@saxonica.com> wrote:
> >
> > From
> >
> > http://rigaux.org/language-study/syntax-across-languages.html#CntrFlowLoop
> >
> > both "by" and "step" are used in multiple languages. Visual Basic and Ruby use "step"; Smalltalk, Maple, Common Lisp, Rexx, and CoffeeScript use "by".
> >
> > Not a big deal, either would work.
> >
> > Michael Kay
> > Saxonica
> >
> > On 30 Nov 2020, at 14:07, Dave Pawson <dave.pawson@gmail.com> wrote:
> >
> > 1 to 10 step 2 (may be) more common / familiar?
> >
> > regards
> >
> > On Mon, 30 Nov 2020 at 14:05, Michael Kay <mike@saxonica.com> wrote:
> >
> >
> > Someone, I forget who, gave feedback suggesting making "by" a binary operator so
> >
> > 1 to 10 by 2 means ((1 to 10) by 2) i.e. 1, 3, 5, 7, 9
> > 1 to 10 by -1 gives 10, 9, 8, 7, 6, 5, 4, 3, 2, 1
> > ("A", "B", "C", "D") by 2 gives ("A", "C")
> > ("A", "B", "C", "D") by -2 gives ("D", "B")
> >
> > I've adopted this suggestion in my latest draft.
> >
> > Michael Kay
> > Saxonica
> >
> >
> >
> >
> > --
> > Dave Pawson
> > XSLT XSL-FO FAQ.
> > Docbook FAQ.
> >
> >
>

Received on Monday, 30 November 2020 15:52:50 UTC