On Mon, 10 Mar 2014 15:27:06 +0100
Shahbaz Youssefi <shab...@gmail.com> wrote:

> Feedback
> ========
> 
> Please let me know what you think. In particular, what would be the
> limitations of such a syntax? Would you be interested in seeing this
> extension to the GNU C language? What alternative symbols do you think
> would better show the intention/simplify parsing/look more beautiful?

I suggest you think about how this is better than C++ exceptions, and
also consider alternatives like OCaml's option types that can be used
to achieve similar ends.

For your suggested syntax at function call sites, consider that
functions can be called in more complicated ways than simply as "bar =
foo();" statements, and the part following the "!!" in your examples
appears to be a statement itself: in more complicated expressions, that
interleaving of expressions and statements going to get very ugly very
quickly. E.g.:

x = foo() + bar();

would need to become something like:

x = (foo() !! goto label1) + (bar () !! goto label2);

And there are all sorts of issues with that.

Anyway, I quite like the idea of rationalising error-code returns in C
code, but I don't think this is the right way of going about it.

HTH,

Julian

Reply via email to