Gordon programming language

Salih Dincer salihdb at hotmail.com
Wed Nov 17 13:44:42 UTC 2021


On Sunday, 24 October 2021 at 10:13:14 UTC, Tero Hänninen wrote:
> Hello,
>
> decided I'd post about my primarily D-influenced programming 
> language here.
> ...
> Website:
> https://tjhann.github.io/gordon-web/

```d
  1 // The default enum base type is ubyte to not bloat structs 
(better for cache use).
  2 enum MODE : int {
  3     FAST,
  4     DEEP,
  5     ADAPTIVE,
  6 }
  7
  8 int main()
  9 {
10     auto m = MODE.DEEP;
11
12     // A switch on enum must be exhaustive of course.
13     switch (m) {
14         case MODE.FAST:
15             break;  // empty case falls through by default – 
use break to avoid
16         case MODE.DEEP:
17             int a = 1234;
18             goto;   // fall through
19         case MODE.ADAPTIVE:
20             // do something
21     }
22
23     return 0;
24 }
```
Where does "goto ..." branch to in [example 
code](https://tjhann.github.io/gordon-web/ex2.html) above, line 
18? In D, it can be an external identifier: ```22 EXTERNAL:``` // 
from switch...

Does Gordon have it? Also isn't there a scope hierarchy, line 17?

Because a defined inside scope cannot be accessed from outside 
scope.

Finally, we use ```final switch``` in D, if there is no 
```default```.

I wish you accomplish everything...





More information about the Digitalmars-d-announce mailing list