Paul_J
Member
Registered: 6th Jun 02
Location: London
User status: Offline
|
quote: Originally posted by Richard Lee
quote: Originally posted by Paul_J
what book?
the bible
I'm going to need to pray as I have no idea how the fuck to do this work... everything I type just says error...
bjective Caml version 3.08.0
jective Caml version 3.08.0
let addcomp (a,b)(c,d) = (a+c) + (b+d);;
al addcomp : int * int -> int * int -> int = <fun>
let subcomp (a,b)(c,d) = (a-c) + (b-d);;
al subcomp : int * int -> int * int -> int = <fun>
let mulcomp (a,b)(c,d) = ((a*c)-(b*d)) + ((b*c)+(a*d));;
al mulcomp : int * int -> int * int -> int = <fun>
mulcomp (4,5)(3,5);;
: int = 22
mulcomp (3,4)(2,6);;
: int = 8
addcomp (4,3)(6,4);;
: int = 17
let addcomp (a,b)(c,d) = (a+c),(b+d);;
al addcomp : int * int -> int * int -> int * int = <fun>
addcomp (4,3)(6,4);;
: int * int = (10, 7)
let subcomp (a,b)(c,d) = (a-c),(b-d);;
al subcomp : int * int -> int * int -> int * int = <fun>
subcomp (4,3)(6,4);;
: int * int = (-2, -1)
let add = fun (a,b)(c,d) -> a+b+c+d;;
al add : int * int -> int * int -> int = <fun>
add (4,3)(6,4);;
: int = 17
let addcomp = fun (a,b)(c,d) -> (a+c),(b+d);;
al addcomp : int * int -> int * int -> int * int = <fun>
let subcomp = fun (a,b)(c,d) -> (a-c),(b-d);;
al subcomp : int * int -> int * int -> int * int = <fun>
let mulcomp = fun (a,b)(c,d) -> ((a*c)-(b*d)),((b*c)+(a*d));;
al mulcomp : int * int -> int * int -> int * int = <fun>
mulcomp (4,3)(6,4);;
: int * int = (12, 34)
let divcomp = fun (a,b)(c,d) -> ((((a*c)+(b*d))+((b*c)-(a*d)))/((c*c)+(d*d)));;
al divcomp : int * int -> int * int -> int = <fun>
divcomp (4,3)(6,4);;
: int = 0
divcomp (8,3)(4,3);;
: int = 1
divcomp (19,3)(5,3);;
: int = 1
divcomp (10,6)(5,3);;
: int = 2
divcomp (12,10)(5,1);;
: int = 4
sqrt 5;;
haracters 5-6:
sqrt 5;;
^
his expression has type int but is here used with type float
sqrt 5.6;;
: float = 2.3664319132398464
let abscomp = fun (a,b) -> sqrt((a*a)+(b*b));;
haracters 31-44:
let abscomp = fun (a,b) -> sqrt((a*a)+(b*b));;
^^^^^^^^^^^^^
his expression has type int but is here used with type float
let abscomp = fun (a,b) -> sqrt((a*.a)+.(b*.b));;
al abscomp : float * float -> float = <fun>
abscomp (4,5);;
haracters 8-13:
abscomp (4,5);;
^^^^^
his expression has type int * int but is here used with type float * float
abscomp (4.3,5.6);;
: float = 7.0604532432415406
let abscomp = fun (a,b) -> sqrt((a*.a),(b*.b));;
haracters 31-46:
let abscomp = fun (a,b) -> sqrt((a*.a),(b*.b));;
^^^^^^^^^^^^^^^
his expression has type float * float but is here used with type float
let abscomp = fun (a,b) -> sqrt((a*.a)+.(b*.b));;
al abscomp : float * float -> float = <fun>
abscomp (9.532,5.742);;
: float = 11.127874370246998
bjective Caml version 3.08.0
jective Caml version 3.08.0
let addmoney = fun (po1,sh1,pe1)(po2,sh2,pe2) -> something;;
haracters 49-58:
let addmoney = fun (po1,sh1,pe1)(po2,sh2,pe2) -> something;;
^^^^^^^^^
nbound value something
let value1 = fun (po1,sh1,pe1) -> (po1+sh1,+pe1);;
al value1 : int * int * 'a -> int * 'a = <fun>
value1 (1,2,3);;
: int * int = (3, 3)
let value1 = fun (po1,sh1,pe1) -> (po1+sh1+pe1);;
al value1 : int * int * int -> int = <fun>
let value2 = fun (po2,sh2,pe2) -> (po2+sh2+pe2);;
al value2 : int * int * int -> int = <fun>
let addvalue = fun -> (value1+value2);;
haracters 19-21:
let addvalue = fun -> (value1+value2);;
^^
yntax error
let addvalue = fun (value1+value2);;
haracters 19-20:
let addvalue = fun (value1+value2);;
^
yntax error: ')' expected, the highlighted '(' might be unmatched
let addvalue = (value1+value2);;
haracters 16-22:
let addvalue = (value1+value2);;
^^^^^^
his expression has type int * int * int -> int but is here used with type
int
value1;;
: int * int * int -> int = <fun>
let addvalue = fun (value1,value2) -> value1+value2;;
al addvalue : int * int -> int = <fun>
value1 (1,2,3);;
: int = 6
let value1 = fun (po1,sh1,pe1) -> ((po1*20*12)+(sh1*12)+pe1);;
al value1 : int * int * int -> int = <fun>
value1 (1,2,3);;
: int = 267
let value2 = fun (po2,sh2,pe2) -> ((po2*20*12)+(sh2*12)+pe2);;
al value2 : int * int * int -> int = <fun>
value2 (0,0,5);;
: int = 5
value2(0,2,5);;
: int = 29
let addvalue = value1 + value2;;
haracters 15-21:
let addvalue = value1 + value2;;
^^^^^^
his expression has type int * int * int -> int but is here used with type
int
let addvalue = value1(po1,sh1,pe1) + value2(po2,sh2,pe2);;
haracters 22-25:
let addvalue = value1(po1,sh1,pe1) + value2(po2,sh2,pe2);;
^^^
nbound value po1
let addvalue = value1(po1,sh1,pe1) + value2(po2,sh2,pe2);;
haracters 22-25:
let addvalue = value1(po1,sh1,pe1) + value2(po2,sh2,pe2);;
^^^
nbound value po1
let addvalue = fun (po1,sh1,pe1)(po2,sh2,pe2) -> (((po1*20*12)+(sh1*12)+pe1)+((pol2*20*12)+(sh2*12)+pe2));;
haracters 79-83:
let addvalue = fun (po1,sh1,pe1)(po2,sh2,pe2) -> (((po1*20*12)+(sh1*12)+pe1)+((pol2*20*12)+(sh2*12)+pe2));;
^^^^
nbound value pol2
let addvalue = fun (po1,sh1,pe1)(po2,sh2,pe2) -> (((po1*20*12)+(sh1*12)+pe1)+((po2*20*12)+(sh2*12)+pe2));;
al addvalue : int * int * int -> int * int * int -> int = <fun>
addvalue (2,3,4)(3,4,5);;
: int = 1293
5/2;;
: int = 2
1293/240;;
: int = 5
5*240;;
: int = 1200
93/12;;
: int = 7
12*7;;
: int = 84
93-84;;
: int = 9
addvalue (9,11,9)(9,5,4);;
: int = 4525
4525/240;;
: int = 18
18*240;;
: int = 4320
4525-4320;;
: int = 205
205/12;;
: int = 17
12*17;;
: int = 204
205-204;;
: int = 1
let addmoney = addvalue;;
al addmoney : int * int * int -> int * int * int -> int = <fun>
addmoney;;
: int * int * int -> int * int * int -> int = <fun>
addmoney (9,11,9)(9,5,4);;
: int = 4525
let addmoney = addvalue/240;;
haracters 15-23:
let addmoney = addvalue/240;;
^^^^^^^^
his expression has type int * int * int -> int * int * int -> int
ut is here used with type int
let addmoney = addvalue x;;
haracters 24-25:
let addmoney = addvalue x;;
^
nbound value x
let addmoney (po1,sh1,pe1)(po2,sh2,pe2) =
let addvalue = (((po1*20*12)+(sh1*12)+pe1)+((po2*20*12)+(sh2*12)+pe2));;
haracters 115-117:
let addvalue = (((po1*20*12)+(sh1*12)+pe1)+((po2*20*12)+(sh2*12)+pe2));;
^^
yntax error
let addmoney (po1,sh1,pe1)(po2,sh2,pe2) =
let addvalue = ((po1*20*12)+(sh1*12)+pe1)+((po2*20*12)+(sh2*12)+pe2));;
haracters 113-114:
let addvalue = ((po1*20*12)+(sh1*12)+pe1)+((po2*20*12)+(sh2*12)+pe2));;
^
yntax error
let addmoney (po1,sh1,pe1)(po2,sh2,pe2) =
let addvalue = (((po1*20*12)+(sh1*12)+pe1)+((po2*20*12)+(sh2*12)+pe2)));;
haracters 115-116:
let addvalue = (((po1*20*12)+(sh1*12)+pe1)+((po2*20*12)+(sh2*12)+pe2)));;
^
yntax error
let addmoney (po1,sh1,pe1)(po2,sh2,pe2) =
let addvalue = (((po1*20*12)+(sh1*12)+pe1)+((po2*20*12)+(sh2*12)+pe2);;
haracters 60-61:
let addvalue = (((po1*20*12)+(sh1*12)+pe1)+((po2*20*12)+(sh2*12)+pe2);;
^
yntax error: ')' expected, the highlighted '(' might be unmatched
let addmoney po1 sh1 pe1 po2 sh2 pe2 =
let addvalue = (((po1*20*12)+(sh1*12)+pe1)+((po2*20*12)+(sh2*12)+pe2));;
haracters 115-117:
let addvalue = (((po1*20*12)+(sh1*12)+pe1)+((po2*20*12)+(sh2*12)+pe2));;
^^
yntax error
let addmoney (po1,sh1,pe1)(po2,sh2,pe2) =
let sum = (((po1*20*12)+(sh1*12)+pe1)+((po2*20*12)+(sh2*12)+pe2));;
haracters 110-112:
let sum = (((po1*20*12)+(sh1*12)+pe1)+((po2*20*12)+(sh2*12)+pe2));;
^^
yntax error
let addmoney (po1,sh1,pe1)(po2,sh2,pe2) =
let sum = (((po1*20*12)+(sh1*12)+pe1)+((po2*20*12)+(sh2*12)+pe2));;
let addmoney (po1,sh1,pe1)(po2,sh2,pe2) =
let sum = (((po1*20*12)+(sh1*12)+pe1)+((po2*20*12)+(sh2*12)+pe2));;
haracters 2-5:
# let addmoney (po1,sh1,pe1)(po2,sh2,pe2) =
^^^
yntax error
let addmoney (po1,sh1,pe1)(po2,sh2,pe2) =
let sum = (((po1*20*12)+(sh1*12)+pe1)+((po2*20*12)+(sh2*12)+pe2));;
haracters 110-112:
let sum = (((po1*20*12)+(sh1*12)+pe1)+((po2*20*12)+(sh2*12)+pe2));;
^^
yntax error
let addmoney (po1,sh1,pe1)(po2,sh2,pe2) =
let sum = (((po1*20*12)+(sh1*12)+pe1)+((po2*20*12)+(sh2*12)+pe2))
in sum / 240;;
al addmoney : int * int * int -> int * int * int -> int = <fun>
addmoney(2,4,5)(4,5,7);;
: int = 6
let addmoney (po1,sh1,pe1)(po2,sh2,pe2) =
let sum = (((po1*20*12)+(sh1*12)+pe1)+((po2*20*12)+(sh2*12)+pe2))
in if sum > 240 then sum / 240 else
if sum > 12 then sum / 12 else sum;;
al addmoney : int * int * int -> int * int * int -> int = <fun>
addmoney(2,4,5)(4,6,5);;
: int = 6
let rec addmoney (po1,sh1,pe1)(po2,sh2,pe2) =
let sum = (((po1*20*12)+(sh1*12)+pe1)+((po2*20*12)+(sh2*12)+pe2))
in if sum > 240 then sum / 240 else
if sum > 12 then sum / 12 else sum;;
al addmoney : int * int * int -> int * int * int -> int = <fun>
addmoney(2,4,5)(4,6,5);;
: int = 6
addmoney(5,6,2)(5,6,2);;
: int = 10
let rec addmoney (po1,sh1,pe1)(po2,sh2,pe2) =
let sum = (((po1*20*12)+(sh1*12)+pe1)+((po2*20*12)+(sh2*12)+pe2))
in if sum > 240 then sum / 240 else
if (sum-((sum/240)*240)) > 12 then sum / 12 else sum;;
al addmoney : int * int * int -> int * int * int -> int = <fun>
addmoney(5,6,2)(5,6,2);;
: int = 10
addmoney(0,11,1)(0,11,2);;
: int = 1
let addmoney (po1,sh1,pe1)(po2,sh2,pe2) =
let rec sum = (((po1*20*12)+(sh1*12)+pe1)+((po2*20*12)+(sh2*12)+pe2))
in if sum > 240 then sum / 240 else
if (sum-((sum/240)*240)) > 12 then sum / 12 else sum;;
al addmoney : int * int * int -> int * int * int -> int = <fun>
addmoney(0,11,1)(0,11,2);;
: int = 1
let addmoney (po1,sh1,pe1)(po2,sh2,pe2) -> (pound,shill,pence) = let rec sum = (((po1*20*12)+(sh1*12)+pe1)+((po2*20*12)+(sh2*12)+pe2))
in if sum > 240 then sum / 240 else
if (sum-((sum/240)*240)) > 12 then sum / 12 else sum;;
haracters 40-42:
let addmoney (po1,sh1,pe1)(po2,sh2,pe2) -> (pound,shill,pence) = let rec sum = (((po1*20*12)+(sh1*12)+pe1)+((po2*20*12)+(sh2*12)+pe2))
^^
yntax error
let addmoney (po1,sh1,pe1)(po2,sh2,pe2) = (pound,shill,pence) = let rec sum = (((po1*20*12)+(sh1*12)+pe1)+((po2*20*12)+(sh2*12)+pe2))
in if sum > 240 then sum / 240 else
if (sum-((sum/240)*240)) > 12 then sum / 12 else sum;;
haracters 43-48:
let addmoney (po1,sh1,pe1)(po2,sh2,pe2) = (pound,shill,pence) = let rec sum = (((po1*20*12)+(sh1*12)+pe1)+((po2*20*12)+(sh2*12)+pe2))
^^^^^
nbound value pound
let addmoney (po1,sh1,pe1)(po2,sh2,pe2) = let rec sum = (((po1*20*12)+(sh1*12)+pe1)+((po2*20*12)+(sh2*12)+pe2))
in if sum > 240 then sum / 240 else
if (sum-((sum/240)*240)) > 12 then sum / 12 else sum;;
al addmoney : int * int * int -> int * int * int -> int = <fun>
let addmoney (po1,sh1,pe1)(po2,sh2,pe2) = let rec sum = (((po1*20*12)+(sh1*12)+pe1)+((po2*20*12)+(sh2*12)+pe2))
in if sum > 240 then sum / 240
if (sum-((sum/240)*240)) > 12 then sum / 12 else sum;;
haracters 155-157:
if (sum-((sum/240)*240)) > 12 then sum / 12 else sum;;
^^
yntax error
let addmoney (po1,sh1,pe1)(po2,sh2,pe2) = let rec sum = (((po1*20*12)+(sh1*12)+pe1)+((po2*20*12)+(sh2*12)+pe2))
in if sum > 240 then sum / 240
if (sum-((sum/240)*240)) > 12 then sum / 12 else su;;
haracters 155-157:
if (sum-((sum/240)*240)) > 12 then sum / 12 else su;;
^^
yntax error
let addmoney (po1,sh1,pe1)(po2,sh2,pe2) =
haracters 46-48:
in if sum > 240 then sum / 240
^^
yntax error
let addmoney (po1,sh1,pe1)(po2,sh2,pe2) =
let rec sum = (((po1*20*12)+(sh1*12)+pe1)+((po2*20*12)+(sh2*12)+pe2))
in if sum > 240 then sum / 240
if (sum-((sum/240)*240)) > 12 then sum / 12 else sum;;
haracters 160-162:
if (sum-((sum/240)*240)) > 12 then sum / 12 else sum;;
^^
yntax error
let addmoney (po1,sh1,pe1)(po2,sh2,pe2) =
let rec sum = (((po1*20*12)+(sh1*12)+pe1)+((po2*20*12)+(sh2*12)+pe2))
in (Pound(sum),Shil(sum),Pence(sum));;
haracters 125-135:
in (Pound(sum),Shil(sum),Pence(sum));;
^^^^^^^^^^
nbound constructor Pound
let Pound = fun (sum) -> if sum > 240 then sum / 240;;
haracters 4-9:
let Pound = fun (sum) -> if sum > 240 then sum / 240;;
^^^^^
nbound constructor Pound
let pound = fun (sum) -> if sum > 240 then sum / 240;;
haracters 43-52:
let pound = fun (sum) -> if sum > 240 then sum / 240;;
^^^^^^^^^
his expression has type int but is here used with type unit
let pound = fun (x) -> if x > 240 then x / 240;;
haracters 39-46:
let pound = fun (x) -> if x > 240 then x / 240;;
^^^^^^^
his expression has type int but is here used with type unit
let pound = fun x -> if x > 240 then x / 240;;
haracters 37-44:
let pound = fun x -> if x > 240 then x / 240;;
^^^^^^^
his expression has type int but is here used with type unit
let pound (sum) = if sum > 240 then sum / 240;;
haracters 36-45:
let pound (sum) = if sum > 240 then sum / 240;;
^^^^^^^^^
his expression has type int but is here used with type unit
sum;;
haracters 0-3:
sum;;
^^^
nbound value sum
let pound = fun (sum) x -> sum = x
in if sum > 240 then x / 240;;
haracters 46-49:
in if sum > 240 then x / 240;;
^^^
nbound value sum
let pound(sum) x = (sum = x)
in if sum > 240 then x / 240;;
haracters 19-20:
let pound(sum) x = (sum = x
^
yntax error: ')' expected, the highlighted '(' might be unmatched
let pound(sum) = x = sum
in if sum > 240 then x / 240;;
haracters 23-24:
let pound(sum) = sum = x
^
nbound value x
let pound(sum) x = sum = x
in if sum > 240 then x / 240;;
haracters 23-24:
let pound(sum) = sum = x
^
nbound value x
let x = 0;;
al x : int = 0
Characters 5-7:
in if sum > 240 then x / 240;;
^^
yntax error
let x = 0;;
al x : int = 0
let pound(sum) = x in
if sum > 240 then x / 240;;
haracters 29-32:
if sum > 240 then x / 240;;
^^^
nbound value sum
let pound sum = x in
if sum > 240 then x / 240;;
haracters 29-32:
if sum > 240 then x / 240;;
^^^
nbound value sum
let pound sum = x in
if sum > 240 then x / 240;;
haracters 28-31:
if sum > 240 then x / 240;;
^^^
nbound value sum
let pound = fun (sum) = x in
if sum > 240 then x / 240;;
haracters 22-23:
let pound = fun (sum) = x in
^
yntax error
let pound = fun (sum) -> x in
if sum > 240 then x / 240;;
haracters 22-23:
let pound = fun (sum) = x in
^
yntax error
let pound = fun (sum) -> x in
if sum > 240 then x / 240;;
haracters 37-40:
if sum > 240 then x / 240;;
^^^
nbound value sum
let pound (sum) = fun x -> in
if sum > 240 then x / 240;;
haracters 37-40:
if sum > 240 then x / 240;;
^^^
nbound value sum
let pound = fun (sum) -> x in
if sum > 240 then x / 240;;
This is all the shite I have typed in recently, mostly experimenting to try to figure it out - but as soon as I think I have unstood it - it starts throwing up gay errors
|