projects
/
Faustine.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Bug of vector wave output error fixed.
[Faustine.git]
/
interpretor
/
basic.ml
diff --git
a/interpretor/basic.ml
b/interpretor/basic.ml
index
cda0c6b
..
3131231
100644
(file)
--- a/
interpretor/basic.ml
+++ b/
interpretor/basic.ml
@@
-28,17
+28,17
@@
let fun_ternary oper f g h = fun x -> oper (f x) (g x) (h x);;
let memorize : int -> (index -> basic) -> (index -> basic) =
fun size ->
fun vec ->
let memorize : int -> (index -> basic) -> (index -> basic) =
fun size ->
fun vec ->
- let memory
_array
= Array.create size Error in
- let
index_array
= Array.create size false in
+ let memory = Array.create size Error in
+ let
filled
= Array.create size false in
let vec_mem : index -> basic =
fun i ->
if i >= 0 && i < size then (
let vec_mem : index -> basic =
fun i ->
if i >= 0 && i < size then (
- if
index_array
.(i) then
- memory
_array
.(i)
+ if
filled
.(i) then
+ memory.(i)
else
let result = vec i in
else
let result = vec i in
- let () = memory
_array
.(i) <- result in
- let () =
index_array
.(i) <- true in
+ let () = memory.(i) <- result in
+ let () =
filled
.(i) <- true in
result)
else raise (Invalid_argument "vector overflow.") in
vec_mem;;
result)
else raise (Invalid_argument "vector overflow.") in
vec_mem;;
@@
-79,9
+79,9
@@
let basic_to_float_array : basic -> float array =
fun v ->
match v with
|Vec vec ->
fun v ->
match v with
|Vec vec ->
- let
result
: basic array =
+ let
basics
: basic array =
Array.init vec#size vec#nth in
Array.init vec#size vec#nth in
- Array.map basic_to_float
result
+ Array.map basic_to_float
basics
|_ -> [| (basic_to_float v)|];;
|_ -> [| (basic_to_float v)|];;