Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cduce
cduce
Commits
19760485
Commit
19760485
authored
Jul 10, 2007
by
Pietro Abate
Browse files
[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
Changes
2
Hide whitespace changes
Inline
Side-by-side
runtime/value.ml
View file @
19760485
...
...
@@ -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
*)
types/builtin.ml
View file @
19760485
...
...
@@ -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
);;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment