There seem to be some more 1 argument inconsistencies that would be nice to see get addressed too like the following.

I'm in favour of allowing 1 argument without parenthesis for every construct in the language,

since that's already allowed in most cases and would be the most consistent for a functional language. ML/Haskell like language.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// Explicit Constructors


type Exp1 =


    val mutable x : int 


    new v = { x = v }   // Good : no tuple parenthesis around "v"


let exp1 = Exp1 9


type Exp2 =


    val mutable x : int 


    new (v) = { x = v }  // Good


let exp2 = Exp2 (9)


// Implicit Constructors


type Imp1 (x) =     // Good


let imp1 = Imp1 (9) 


type Imp2 x =       // Error FS0010: Unexpected identifier in type definition. Expected '(' or other token.


let imp2 = Imp2 9


// Inheriting


type B (x : int) =


type D1 (x : int) =


    inherit B 9   // Good : no tuple parenthesis around "9" because it is a literal


type D2 (x : int) =


    inherit B (x)  // Good


type D3 (x : int) =


    inherit B x    (* Error FS0191: This 'inherit' declaration specifies the inherited type but no arguments.


                     Consider supplying arguments, e.g. 'inherit BaseType(args)' *)

By on 7/25/2009 6:49 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper