Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] function application is partial
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: briand@a...
Subject: [Caml-list] function application is partial

File "sweep.ml", line 30, characters 6-115:
Warning: this function application is partial,
maybe some arguments are missing.

Here's the source:


type sweep_data = { freq: float; data: Complex.t };;

let print_sweep (v: sweep_data array) =
  let n = Array.length v in
 (* print out the magnitude data in dB *)
    for i = 0 to n-1 do
      let p = v.(i) in
      let f = p.freq in
      let z = p.data in
	Printf.printf "%.3e %.3e\n" (number_db (Complex.norm2 z));
    done;
    print_newline();
    (* print the phase data *)
    for i = 0 to n-1 do
      let p = v.(i) in
      let f = p.freq in
      let z = p.data in
	Printf.printf "%.3e %.3e\n" (rad_deg (Complex.arg z));
    done;
;;

Array.get can only take two arguments (duh).

If it is getting two arguments how can it possibly be interpreted as a
partial application ?

Brian

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners