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
There's nothing like posting and finding your mistake an instant later.

The printf was causing the error.

But why was the error on p=v.(i) and not on the printf line itself ?

Thanks

Brian

>>>>> "briand" == briand  <briand@aracnet.com> writes:

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

  briand> Here's the source:


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

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

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

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

  briand> Brian

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

-------------------
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