W3C home > Mailing lists > Public > public-qt-comments@w3.org > June 2012

[Bug 17600] Range predicates

From: <bugzilla@jessica.w3.org>
Date: Tue, 26 Jun 2012 14:50:28 +0000
Message-Id: <E1SjX64-0007pf-Of@jessica.w3.org>
To: public-qt-comments@w3.org
https://www.w3.org/Bugs/Public/show_bug.cgi?id=17600

--- Comment #6 from John Snelson <john.snelson@marklogic.com> 2012-06-26 14:50:31 UTC ---
(In reply to comment #5)
> Does it have to be a sequence of numeric values for every item in the input?

No.

> $seq[if (f(.)) then number(@min) to number(@max) else is-married(.)]
> 
> I think the overloading of predicates is bad enough already without introducing
> this.

It might be slightly more complicated to evaluate, but it's actually extremely
useful to users. The full semantics of a predicate expression "SEQ[PRED]" under
this proposal could be expressed as such:

for $s at $p in SEQ
where
  typeswitch($s)
  case op:numeric+ return $p = $s
  default return fn:boolean($s)
return $s

This is not a very big departure from the present semantics:

for $s at $p in SEQ
where
  typeswitch($s)
  case op:numeric return $p eq $s
  default return fn:boolean($s)
return $s

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Received on Tuesday, 26 June 2012 14:50:37 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:57:39 UTC