On Tue, Mar 11, 2014 at 1:26 PM, David Brown wrote:
> On 10/03/14 18:26, Shahbaz Youssefi wrote:
> You can tell the compiler about the likely paths:
>
> struct option_float inverse(int x) {
> if (__builtin_expect(x != 0, 1)) {
> return (struct option_float){ .value = 1.0f
On 10/03/14 18:26, Shahbaz Youssefi wrote:
> I'm mostly interested in C. Nevertheless, you can of course also do
> the same in C:
>
> struct option_float
> {
> float value;
> int error_code;
> bool succeeded;
> };
>
> struct option_float inverse(int x) {
> if (x == 0)
> return (
On 03/10/2014 05:26 PM, Shahbaz Youssefi wrote:
> I'm mostly interested in C. Nevertheless, you can of course also do
> the same in C:
>
> struct option_float
> {
> float value;
> int error_code;
> bool succeeded;
> };
>
> struct option_float inverse(int x) {
> if (x == 0)
> ret
I'm mostly interested in C. Nevertheless, you can of course also do
the same in C:
struct option_float
{
float value;
int error_code;
bool succeeded;
};
struct option_float inverse(int x) {
if (x == 0)
return (struct option_float){ .succeeded = false, .error_code = EDOM };
ret
On 03/10/2014 03:09 PM, Shahbaz Youssefi wrote:
> Regarding C++ exceptions: exceptions are not really nice. They can
> just make your function return without you even knowing it (forgetting
> a `try/catch` or not knowing it may be needed, which is C++'s fault
> and probably could have been done bet
Thanks for the hint. I would try to learn how to do that and
experiment on the idea if/when I get the time. I could imagine why the
community isn't interested in new syntax in general. Still, you may
never know if an idea would be attractive enough to generate some
attention! :)
On Mon, Mar 10, 20
10.03.2014 18:27, Shahbaz Youssefi пишет:
FILE *fin = fopen("filename", "r") !! goto exit_no_file;
Or maybe permission denied? ;-)
On Mon, Mar 10, 2014 at 03:27:06PM +0100, Shahbaz Youssefi wrote:
> Hi,
>
> First, let me say that I'm not subscribed to the mailing list, so
> please CC myself when responding.
>
> This post is to discuss a possible extension to the GNU C language.
> Note that this is still an idea and not refin
Hi Julian,
Thanks for the feedback.
Regarding C++ exceptions: exceptions are not really nice. They can
just make your function return without you even knowing it (forgetting
a `try/catch` or not knowing it may be needed, which is C++'s fault
and probably could have been done better). Also, they r
On Mon, 10 Mar 2014 15:27:06 +0100
Shahbaz Youssefi 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
Hi,
First, let me say that I'm not subscribed to the mailing list, so
please CC myself when responding.
This post is to discuss a possible extension to the GNU C language.
Note that this is still an idea and not refined.
Background
==
In C, the following code structure is ubiquitous:
11 matches
Mail list logo