aboutsummaryrefslogtreecommitdiff
path: root/docs/notes/syntax_changes.txt
blob: bb8b56155dd11344db9cce30ad7e9e2af3ff04dd (plain)
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


syntax changes
==============

replace "here"
--------------
This keyword might be confusing and is probably unnessecary.

    Current syntax:
    
        typedef here = (int x, int y);

    
    Alternative 1 - Remove keyword:

        typedef = (int x, int y);
        
        // cons:
        //  can't create forward definition (but can use "private")
        //  can't create variables and functions with "here".
    
    Alternative 2 - Replace with namespace:
    
        typedef namespace = (int x, int y);


change "own" keyword
--------------------
It's ugly, occupies a lot of space (4 chars) and not obvious that it should
be placed on the pointer. Note that it's not possible to use binary operators,
such as "*" for this purpose.

    //  <> = owned pointer
    //   ^ = unowned pointer
    var thing<> t = :new();
    string^ s = t.get_name();
    t.free();


keyword renames
---------------
Some keywords can be shortened:

typedef --> type
undefined --> undef