Commit 19760485 authored by Pietro Abate's avatar Pietro Abate

[r2004-07-08 18:11:04 by cmiachon] Empty log message

Original author: cmiachon
Date: 2004-07-08 18:11:04+00:00
parent 75fc1ebd
......@@ -666,11 +666,13 @@ let query_avg = function
let query_count = function
| Pair(Integer i,p) ->
let rec aux l n = match l with
| Pair(Integer _,r) -> aux r (n+1)
| Pair(_,r) -> aux r (n+1)
| Atom(_) -> n
| _ -> assert false
in Integer(Intervals.V.from_int(aux p 1))
| Atom a when a = Sequence.nil_atom -> Integer (Intervals.V.from_int 0)
|_ -> assert false
(* todo : sum, avg, min and max [Int+] instead of [Int*] *)
(* todo : sum, avg, min and max [Int+] instead of [Int*]
min and max : ne pas se restreindre a Int
*)
......@@ -328,6 +328,6 @@ register_fun "sum" Sequence.int int
register_fun "avg" Sequence.int int
(Value.query_avg );;
register_fun "count" Sequence.int int
register_fun "count" Sequence.any int
(Value.query_count );;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment