I was thinking that "hey, what's wrong with map" but then I reread your code and found an answer: you are producing a list of 1 000 001 elements. Having an operator that just uses a count operand instead of a range with equally many elements can indeed have its use.

Though, I think introducing another operator or somesuch that would be a "reevaluating x operator" would border to operator bloating (as we have map which isn't unreadable if you know map). That could be said about a lot of the features and operators we love in Perl today (e.g. for (LIST) compared to C-style for (;;)), so I shouldn't say too much. But just because "we" are designing a language almost from scratch doesn't mean we should tuck in every feature we want. I think cleanlyness is good in a language, but so is DWIM and adaption for common tasks. These and other factors should be weighted against each other or we might end up with any of the extremes we dislike today.

But of course, it's always good to ponder and discuss issues like this if the question isn't "how should we tuck it in" but rather "does this provide real value and how would it fit".

Just my thought,
ihb


In reply to Re^3: Using x to build data structures considered harmful by ihb
in thread Using x to build data structures considered harmful by dws

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.