[uf-discuss] hReview feedback

Mark Rickerby maetl at mcs.vuw.ac.nz
Mon Jan 16 13:46:59 PST 2006

On 1/16/06, Paul Bryson <paul at msn.com> wrote:
> "Paul Bryson" wrote...
> > "Ryan King" wrote...
> >> Yeah, AFAICT, there's no commonly used format for ranges used on the  web
> >> (or elsewhere, for that matter), so we have little prior art in  terms of
> >> previous formats. However, we still have prior art in terms  of examples
> >> of emergent human behavior on the web.
> > On the web, no.  Elsewhere?  Most certainly.  I think staticians would be a
> > little frustrated if they didn't have a common way to share information.
> > Now if that way is useful to us is something entirely different.
> The way to express a number exists in a specific range is:
> x ∈ [y,z]
> The format I would suggest is:
> x [y,z]
> So in practice, to represent a rating of 4.3 in a range of 1 to 5 inclusive
> would be:
> "4.3 [1,5]"
> With the lower limit dropped as a default value:
> "4.3 [5]"

Note that the Ruby language has native support for ranges, and it uses
a syntax like:

x = 1..5
y = 1...5
z = 'a'..'e'

x.to_a   #=> [1,2,3,4,5]
y.to_a   #=> [1,2,3,4]
z.to_a   #=> ['a','b','c','d','e']

So the common case of integers wouldn't necessarily work directly for
your example:

x.member? 4.3    #=> false
x === 4.3            #=> false

That's probably less relevant for the purposes of expression in HTML
though. It's unlikely someone would review something 4.3 stars out of
5 unless they were dragging a slider bar, or similar kind of UI input,
and not picking the rating directly.

The start..end syntax is quite a nice shorthand for defining a range,
more typographic than mathematical though.


More information about the microformats-discuss mailing list