Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2019-11-21 10:26:10

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,137
GitHub

Re: Ranges

+1 for square brackets, but I’m not in a position to know where negative ranges would be used on my fleet, so it’s a heavy pencil +1. Looks clean, too.

Offline

#14 2019-11-21 10:28:12

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,137
GitHub

Re: Ranges

Bloke wrote #320174:

Köffee? :)

I’m a bit light on sleep in recent days, it must be said. I don’t think the chocolate-covered coffee beans I munched a few minutes ago were the smartest idea, but they’re getting the job done!

Offline

#15 2019-11-21 11:44:04

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,079
Website

Re: Ranges

Bloke wrote #320168:

Just playing devil’s advocate here, but have we got any concrete use cases in mind where we, or someone using Textpattern, might legitimately use ranges with negative numbers?

Interesting question (more from a theoretical POV), because I don’t think it would be frequent in everyday usage. Hmm, maybe as the result of a <txp:evaluate /> calculation? I don’t know, just thinking aloud.

I kinda like the [ ] suggestion that came later in the thread. Still quite readable and understandable.

Last edited by phiw13 (2019-11-21 11:44:40)


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#16 2019-11-21 11:59:55

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

Re: Ranges

gaekwad wrote #320169:

Out of curiosity: what’s a real-world example of a negative range in Textpattern terms? Bullet point is fine, I’m clearly missing something obvious.

Negative values are rare animals in txp word, but do exist. For example, shift attribute of <txp:older /> can be a range of negative values:

<txp:older link shift="-3,-2,-1">
    Page <txp:yield item="page" />
</txp:older>

will output three oldest pages (4.8 only). But I agree, that’s an exotic usage and large negative ranges are unlikely to be ever needed. So we could stay with the standard 1-9 notation and add -9- -1-ish patterns parsing as Stef suggests just in case.

Offline

Board footer

Powered by FluxBB