3 Description: basic data type in the vectorial faust interpreter.
5 Created: 31/05/2013 Modified: 17/07/2013
11 let convert : (basic -> 'a) -> basic -> 'a =
12 fun oper -> fun b -> oper b;;
14 class value : basic -> value_type =
15 fun (b_init : basic) ->
17 val mutable b = b_init
19 method normalize = b <- basic_normalize self#get
21 method to_float = convert basic_to_float self#get
22 method to_int = convert basic_to_int self#get
23 method to_float_array = convert basic_to_float_array self#get
24 method to_string = convert basic_to_string self#get
26 method private prim1 : (basic -> basic) -> value =
28 new value (oper self#get)
30 method neg = self#prim1 basic_neg
31 method recip = self#prim1 basic_recip
32 method zero = self#prim1 basic_zero
33 method floor = self#prim1 basic_floor
34 method int = self#prim1 basic_int
35 method sin = self#prim1 basic_sin
36 method cos = self#prim1 basic_cos
37 method atan = self#prim1 basic_atan
38 method sqrt = self#prim1 basic_sqrt
40 method private prim2 : (basic -> basic -> basic) -> value -> value =
43 new value (oper self#get v#get)
45 method add = self#prim2 basic_add
46 method sub = self#prim2 basic_sub
47 method mul = self#prim2 basic_mul
48 method div = self#prim2 basic_div
49 method atan2 = self#prim2 basic_atan2
50 method _mod = self#prim2 basic_mod
51 method larger = self#prim2 basic_larger
52 method smaller = self#prim2 basic_smaller