http://qs321.pair.com?node_id=718230


in reply to Re^2: Challenge: Simple algorithm for continuing series of integers (confidence)
in thread Challenge: Simple algorithm for continuing series of integers

I agree, the magic-star should generally only identify a sequence that is nicely overspecified. But in the interest of Huffman coding the language I think that if anything warrants an exception, it should be arithmetic sequences (including constant sequences), since these would be the most common use cases (including 1,2,3,4...). Many times I've wanted to iterate over the multiples of N. I think "1,1,..*" or "2,4,6,..*" is just fine, and overspecifying the sequences by one more seems overkill because the rule is so simple/common.

blokhead

  • Comment on Re^3: Challenge: Simple algorithm for continuing series of integers (confidence)

Replies are listed 'Best First'.
Re^4: Challenge: Simple algorithm for continuing series of integers (confidence)
by tye (Sage) on Oct 20, 2008 at 15:53 UTC

    If I meant to write 1,2,4 but typo'd the "4" and wrote 1,2,3, then I would like to know about the typo. Having 1,2,4...* not work will help with that, but my experience is that people will expect 1,2,4...* to work because it will seem obvious while they are writing it (and I just typed "1,2,3" and had to delete the 3 and type 4).

    I figured there would be an exception for simple counting lists so that just "2 ... *" would be sufficient for "2,3,4,5 ... *". So 1,1...* vs 1.1...* would be another ugly typo that I would like detected. 100,101...* vs 100_101...*?

    So I respectfully disagree. But I figured it would be an up-hill fight against the common Perl mindset of making things rediculously terse.

    - tye