File: 030-call.ml

package info (click to toggle)
perl4caml 0.9.5-5
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 512 kB
  • ctags: 788
  • sloc: ml: 1,572; ansic: 957; makefile: 186; perl: 45
file content (12 lines) | stat: -rw-r--r-- 245 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
(* Basic subroutine call.
 * $Id: 030-call.ml,v 1.1 2005/01/28 23:09:33 rich Exp $
 *)

open Perl

let () =
  ignore (eval "sub test { 42 + $_[0] }");
  let sv = call ~fn:"test" [sv_of_int 10] in
  assert (52 = int_of_sv sv);;

Gc.full_major ()