Settings

Theme

C3 0.8.4: The Last Keyword Renaming Before the Syntax Freeze

c3-lang.org

8 points by lerno · 6 comments

Reader

1 thread
stefanos82

The only thing I would like to see changing is C-style type casting: `(int)myage`

...for some reason, I can't stand this syntax! I find it visually intrusive lol! But if we could allow something like `int(myage)`, it makes it clearer, to me at least.

  • lernoOP

    It works visually poorly with things like `int*(ptr)` and `int[2]*(arr)` though.

    • stefanos82

      Yeah, I just came here to write "on the other hand though...what about types, such as `(int*)myage`?" and got irritated with myself lol!

      I guess I can define my own way of casting with a macro, `castAs(int *, myage);` and that should work just fine.

      • lernoOP

        Or `cast{int*}(myage)`

        • stefanos82

          Ew...that looks so ugly! LOL!

          How about `cast<int*>(myage)`?

          • lernoOP

            <> is the worst choice for generic syntax in a language with C-like syntax. It's not surprising that it was introduced by C++. It is very ambiguous.

            Some short examples: `foo<1> * a` – is this `(foo < 1) > (a)` or `(foo<1>) a`? What about `foo<1>>2>a`? Is that `(foo<1> > 2) > a` or `foo<(1>>2)> a`?

            Just horrid.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection