]> ocean-lang.org Git - ocean-D/blob - notes
updates
[ocean-D] / notes
1 Random thoughts:
2
3  - go encourages a return type of 
4         foo, err = func(whatever)
5
6    but that is wrong because you want to return 'foo' *or* an
7    'err', not both.
8    We almost want a type that is like boolean but contains
9    an error.
10    So if the response is treated like that type no exception
11    is thrown, else it is.
12
13    if err func(asdad) ....
14    if noerr func
15    or_err int myvar;
16    myvar = int_func(asdf)
17
18    The big thing we want to avoid here is deep nesting
19    for a sequence of failable.  Would goto work?
20
21    a = func(sss) on_err label;
22
23    a = f1
24    b = f2(a)
25    c = f3
26    on_err label;
27
28    once an error happens, nothing depending on the error
29    gets called??
30
31  - it is really nice if extra statements and clauses can always be added
32    with no syntax fiddling.
33    For statements, that means always have braketing:
34     if (whatever) {
35          statement1
36     }
37
38    adding statement2 is just a oneline change.
39
40    for clauses..
41      if test
42        statement1
43    to
44      if test
45        && test2
46       statement1
47
48    is awkward to manage.
49    It would need:
50     if
51       test1
52       and test2
53     then
54       statement1
55       statement2
56     endif
57
58     or
59
60     if test1
61     ifand test2
62      then statement1
63      then statement2
64
65    Both horrible.
66
67    Probably best compromise is
68
69    if test1
70       and test2
71    then statement1
72         statement2
73
74    while test3
75          or test4
76    then
77         statement5
78
79    ? test1
80    : statement1
81
82    do
83    while
84    then
85    else??