Thread View: comp.lang.c
125 messages
125 total messages
Page 1 of 3
Started by fir
Wed, 21 Oct 2026 09:19
Page 1 of 3 • 125 total messages
Re: Taming The Switch-Statement
Author: fir
Date: Wed, 21 Oct 2026 09:19
Date: Wed, 21 Oct 2026 09:19
67 lines
2736 bytes
2736 bytes
Lawrence D’Oliveiro pisze:
> t to end each case-sequence in a switch statement with
> a break-statement: put the break at the same indentation level as the
> case-clause as well as the switch-expression. That way, you can scan
> your eye down a single line f
some time ago i was saying what the proper switch should like
(imo, but im not sure if my conclusions are anough to take is a s proven)
case {} case {} case {} otherwise {}
its indeed sorta needed becouse case in fact are ifs
(not if-elses) (so some in fact could write
if {} if {} if {} otherwise {}
its the same)
the problem is you got no group alse
and here this otherwise need to check all ifs
"or" them and use group else for them
this could be written in few ways, but my case case case otherwise names it
could also do
if {} or if {} or if {} else {}
so either you need logic operators here or predefined constructs like
otherwise (maybe both)
and that should be included not switch wchich is bad imo
other way is to define distionary more as data construct
dict {
'mental' {/* 1 */}
'reductionists' {/* 2 */}
'suck' {/* 3 */}
}
then you could use
dict('reductionists')
to yeld to /* 2 */
this second one parallels to switch keyword
so c switch mixes them both in bad way..they should be spitet and
upbuild as showed ;c
thats my conclusion as switch topic as far by now ;c
Re: Taming The Switch-Statement
Author: Blaine
Date: Wed, 21 Oct 2026 15:29
Date: Wed, 21 Oct 2026 15:29
68 lines
3308 bytes
3308 bytes
fir wrote:
> Lawrence D’Oliveiro pisze:
>> t to end each case-sequence in a switch statement with
>> a break-statement: put the break at the same indentation level as the
>> case-clause as well as the switch-expression. That way, you can scan
>> your eye down a single line f
>
> some time ago i was saying what the proper switch should like
> (imo, but im not sure if my conclusions are anough to take is a s proven)
>
> case {} case {} case {} otherwise {}
>
> its indeed sorta needed becouse case in fact are ifs
> (not if-elses) (so some in fact could write
>
> if {} if {} if {} otherwise {}
>
> its the same)
>
> the problem is you got no group alse
> and here this otherwise need to check all ifs
> "or" them and use group else for them
>
> this could be written in few ways, but my case case case otherwise names it
> could also do
>
>
> if {} or if {} or if {} else {}
>
> so either you need logic operators here or predefined constructs like
> otherwise (maybe both)
>
> and that should be included not switch wchich is bad imo
>
>
> other way is to define distionary more as data construct
>
> dict {
> 'mental' {/* 1 */}
> 'reductionists' {/* 2 */}
> 'suck' {/* 3 */}
> }
>
> then you could use
>
> dict('reductionists')
>
> to yeld to /* 2 */
>
> this second one parallels to switch keyword
>
>
> so c switch mixes them both in bad way..they should be spitet and
> upbuild as showed ;c
>
> thats my conclusion as switch topic as far by now ;c
>
Just start using the switch statement. It's useful in very very very
many cases. You'll get the hang of it right away. Next, it doesn't just
test variable type 'int', also notably 'char', among others.
--
Can you strip away so we may start again?
"There’s a switch and they don't
seem authentic or themselves. It
feels like I’m an unnecessary
body and it’s a waste of time to
even be there." -- Grim, playful Blaine.
Re: Taming The Switch-Statement
Author: Lawrence D’Oliveiro
Date: Thu, 22 Oct 2026 00:33
Date: Thu, 22 Oct 2026 00:33
97 lines
4655 bytes
4655 bytes
On Wed, 21 Oct 2026 09:29:24 -0600, Blaine wrote:
> Just start using the switch statement. It's useful in very very very
> many cases.
Has a well-known pitfall, though.
How not to forget to end each case-sequence in a switch statement with
a break-statement: put the break at the same indentation level as the
case-clause as well as the switch-expression. That way, you can scan
your eye down a single line for each switch-statement to be sure that
no breaks are missing. A reasonably-complex example, with a nested
switch for added interest:
real stack_calc
(
stackcalc_op op,
...
)
/* starting with an empty operand stack, carries out the specified
operations on the specified operands, at the end of which there
should be just a single value on the operand stack. This value is
popped and returned as the function result. */
{
real * opstack = NULL;
size_t
opstacklen = 0,
opstackalloc = 0;
real result;
va_list args;
va_start(args, op);
bool first = true;
bool done = false;
for (;;)
{
if (not first)
{
op = va_arg(args, stackcalc_op);
} /*if*/
first = false;
switch (op)
{
case STACKCALC_END:
done = true;
break;
case STACKCALC_PUSH:
{
if (opstacklen == opstackalloc)
{
opstackalloc += 16;
opstack = realloc(opstack, opstackalloc * sizeof(real));
bugcheck(opstack != NULL, "unable to expand operand stack beyond %d", opstacklen);
} /*if*/
opstack[opstacklen] = va_arg(args, real);
++opstacklen;
}
break;
case STACKCALC_ADD:
case STACKCALC_SUB:
case STACKCALC_MUL:
case STACKCALC_DIV:
bugcheck(opstacklen >= 2, "not enough operands for operator %d", op);
{
const real op2 = opstack[opstacklen - 1];
real op1 = opstack[opstacklen - 2];
switch (op)
{
case STACKCALC_ADD:
op1 += op2;
break;
case STACKCALC_SUB:
op1 -= op2;
break;
case STACKCALC_MUL:
op1 *= op2;
break;
case STACKCALC_DIV:
op1 /= op2;
break;
} /*switch*/
--opstacklen;
opstack[opstacklen - 1] = op1;
}
break;
default:
bugcheck(false, "invalid operator %d", op);
break;
} /*switch*/
if (done)
break;
} /*for*/
va_end(args);
bugcheck(opstacklen == 1, "expecting exactly one result left on stack");
result = opstack[0];
free(opstack);
return result;
} /*stack_calc*/
Re: Taming The Switch-Statement
Author: fir
Date: Thu, 22 Oct 2026 07:51
Date: Thu, 22 Oct 2026 07:51
69 lines
3352 bytes
3352 bytes
Blaine pisze:
> fir wrote:
>> Lawrence D’Oliveiro pisze:
>>> t to end each case-sequence in a switch statement with
>>> a break-statement: put the break at the same indentation level as the
>>> case-clause as well as the switch-expression. That way, you can scan
>>> your eye down a single line f
>>
>> some time ago i was saying what the proper switch should like
>> (imo, but im not sure if my conclusions are anough to take is a s proven)
>>
>> case {} case {} case {} otherwise {}
>>
>> its indeed sorta needed becouse case in fact are ifs
>> (not if-elses) (so some in fact could write
>>
>> if {} if {} if {} otherwise {}
>>
>> its the same)
>>
>> the problem is you got no group alse
>> and here this otherwise need to check all ifs
>> "or" them and use group else for them
>>
>> this could be written in few ways, but my case case case otherwise
>> names it
>> could also do
>>
>>
>> if {} or if {} or if {} else {}
>>
>> so either you need logic operators here or predefined constructs like
>> otherwise (maybe both)
>>
>> and that should be included not switch wchich is bad imo
>>
>>
>> other way is to define distionary more as data construct
>>
>> dict {
>> 'mental' {/* 1 */}
>> 'reductionists' {/* 2 */}
>> 'suck' {/* 3 */}
>> }
>>
>> then you could use
>>
>> dict('reductionists')
>>
>> to yeld to /* 2 */
>>
>> this second one parallels to switch keyword
>>
>>
>> so c switch mixes them both in bad way..they should be spitet and
>> upbuild as showed ;c
>>
>> thats my conclusion as switch topic as far by now ;c
>>
> Just start using the switch statement. It's useful in very very very
> many cases. You'll get the hang of it right away. Next, it doesn't just
> test variable type 'int', also notably 'char', among others.
>
how do you know i dont use it?
in fact i dont use it its not logical (as roven above) yet looks ugly
(im not using parts of c quite happily especily switch and macros
Re: Taming The Switch-Statement
Author: fir
Date: Mon, 26 Oct 2026 12:07
Date: Mon, 26 Oct 2026 12:07
25 lines
1805 bytes
1805 bytes
fir pisze:
> if {} or if {} or if {} else {}
this form in fact is not bad, it simply showst two things
1) you may use or outside the if clause (if this () can be named clause)
2) else in fact work on logical group but ias sole if is alos a case of
logical group so else work on it sole in special case
otherwiste thse keywords here if or and else are quite 'legit'
if () {}
or if () {}
or if() {}
else {}
seems quite legit and it seem to ba a switch
Re: Taming The Switch-Statement
Author: bartc
Date: Mon, 26 Oct 2026 12:11
Date: Mon, 26 Oct 2026 12:11
29 lines
1974 bytes
1974 bytes
On 26/10/2026 12:07, fir wrote:
> fir pisze:
>> if {} or if {} or if {} else {}
>
>
> this form in fact is not bad, it simply showst two things
>
> 1) you may use or outside the if clause (if this () can be named clause)
>
> 2) else in fact work on logical group but ias sole if is alos a case of
> logical group so else work on it sole in special case
>
> otherwiste thse keywords here if or and else are quite 'legit'
>
>
>
> if () {}
> or if () {}
> or if() {}
> else {}
>
>
> seems quite legit and it seem to ba a switch
Excellent. A great thing about this is, this can also be legal C, that
works now, if you just precede with this:
#define or else
Re: Taming The Switch-Statement
Author: fir
Date: Mon, 26 Oct 2026 12:20
Date: Mon, 26 Oct 2026 12:20
41 lines
2492 bytes
2492 bytes
bartc pisze:
> On 26/10/2026 12:07, fir wrote:
>> fir pisze:
>>> if {} or if {} or if {} else {}
>>
>>
>> this form in fact is not bad, it simply showst two things
>>
>> 1) you may use or outside the if clause (if this () can be named clause)
>>
>> 2) else in fact work on logical group but ias sole if is alos a case
>> of logical group so else work on it sole in special case
>>
>> otherwiste thse keywords here if or and else are quite 'legit'
>>
>>
>>
>> if () {}
>> or if () {}
>> or if() {}
>> else {}
>>
>>
>> seems quite legit and it seem to ba a switch
> Excellent. A great thing about this is, this can also be legal C, that
> works now, if you just precede with this:
>
> #define or else
>
this wouldnt work imo as far as im aware becouse this last else dont
work on "group'
the last else is what i name "otherwise" (its else in all other case"
above i said the else may be "discovered" as works on group where right
now its only use on sole if as groups are not defined
but in sucjh combination as above in clasic C the else dont work on group
Re: Taming The Switch-Statement
Author: bartc
Date: Mon, 26 Oct 2026 14:16
Date: Mon, 26 Oct 2026 14:16
59 lines
2870 bytes
2870 bytes
On 26/10/2026 12:20, fir wrote:
> bartc pisze:
>> On 26/10/2026 12:07, fir wrote:
>>> fir pisze:
>>>> if {} or if {} or if {} else {}
>>>
>>>
>>> this form in fact is not bad, it simply showst two things
>>>
>>> 1) you may use or outside the if clause (if this () can be named clause)
>>>
>>> 2) else in fact work on logical group but ias sole if is alos a case
>>> of logical group so else work on it sole in special case
>>>
>>> otherwiste thse keywords here if or and else are quite 'legit'
>>>
>>>
>>>
>>> if () {}
>>> or if () {}
>>> or if() {}
>>> else {}
>>>
>>>
>>> seems quite legit and it seem to ba a switch
>> Excellent. A great thing about this is, this can also be legal C, that
>> works now, if you just precede with this:
>>
>> #define or else
>>
> this wouldnt work imo as far as im aware becouse this last else dont
> work on "group'
This works fine:
#define or else
for (int i=0; i<=5; ++i)
if (i==1) {puts("One");}
or if (i==2) {puts("Two");}
or if (i==3) {puts("Three");}
else {puts("Other");}
Output is:
Other
One
Two
Three
Other
Other
The point is you eventually came up with syntax that is actually just C
but using 'or' in place of 'else'.
> the last else is what i name "otherwise" (its else in all other case"
You seem to have named it 'else' in your example. In any case it would
just be a slightly different choice of keyword; it buys you very little.
Re: Taming The Switch-Statement
Author: fir
Date: Mon, 26 Oct 2026 16:03
Date: Mon, 26 Oct 2026 16:03
85 lines
3716 bytes
3716 bytes
bartc pisze:
> On 26/10/2026 12:20, fir wrote:
>> bartc pisze:
>>> On 26/10/2026 12:07, fir wrote:
>>>> fir pisze:
>>>>> if {} or if {} or if {} else {}
>>>>
>>>>
>>>> this form in fact is not bad, it simply showst two things
>>>>
>>>> 1) you may use or outside the if clause (if this () can be named
>>>> clause)
>>>>
>>>> 2) else in fact work on logical group but ias sole if is alos a case
>>>> of logical group so else work on it sole in special case
>>>>
>>>> otherwiste thse keywords here if or and else are quite 'legit'
>>>>
>>>>
>>>>
>>>> if () {}
>>>> or if () {}
>>>> or if() {}
>>>> else {}
>>>>
>>>>
>>>> seems quite legit and it seem to ba a switch
>>> Excellent. A great thing about this is, this can also be legal C,
>>> that works now, if you just precede with this:
>>>
>>> #define or else
>>>
>> this wouldnt work imo as far as im aware becouse this last else dont
>> work on "group'
>
> This works fine:
>
> #define or else
>
> for (int i=0; i<=5; ++i)
> if (i==1) {puts("One");}
> or if (i==2) {puts("Two");}
> or if (i==3) {puts("Three");}
> else {puts("Other");}
>
> Output is:
>
> Other
> One
> Two
> Three
> Other
> Other
>
> The point is you eventually came up with syntax that is actually just C
> but using 'or' in place of 'else'.
>
>> the last else is what i name "otherwise" (its else in all other case"
> You seem to have named it 'else' in your example. In any case it would
> just be a slightly different choice of keyword; it buys you very little.
>
maybe try with like
case x%2==0 //2 4 6 8 10 12
case x%3==0 //3 6 9 12
default // 1 5 7 11 13
the default should run if none of above cases catch (as i remember coz i
dont use switch) and thse cases should catch each time
im maybe talkong about some more general switch here but this general
(abstract) it is more important then normal one - as thsi general covers
various possible cases
using if or you can implement i it
if(x%2==0) {}
or if(x%3==0) {}
else {}
without or (or something analogic) as i understand if im not wrong you cant
Re: Taming The Switch-Statement
Author: bartc
Date: Mon, 26 Oct 2026 16:32
Date: Mon, 26 Oct 2026 16:32
108 lines
4565 bytes
4565 bytes
On 26/10/2026 16:03, fir wrote:
> bartc pisze:
>> On 26/10/2026 12:20, fir wrote:
>>> bartc pisze:
>>>> On 26/10/2026 12:07, fir wrote:
>>>>> fir pisze:
>>>>>> if {} or if {} or if {} else {}
>>>>>
>>>>>
>>>>> this form in fact is not bad, it simply showst two things
>>>>>
>>>>> 1) you may use or outside the if clause (if this () can be named
>>>>> clause)
>>>>>
>>>>> 2) else in fact work on logical group but ias sole if is alos a
>>>>> case of logical group so else work on it sole in special case
>>>>>
>>>>> otherwiste thse keywords here if or and else are quite 'legit'
>>>>>
>>>>>
>>>>>
>>>>> if () {}
>>>>> or if () {}
>>>>> or if() {}
>>>>> else {}
>>>>>
>>>>>
>>>>> seems quite legit and it seem to ba a switch
>>>> Excellent. A great thing about this is, this can also be legal C,
>>>> that works now, if you just precede with this:
>>>>
>>>> #define or else
>>>>
>>> this wouldnt work imo as far as im aware becouse this last else dont
>>> work on "group'
>>
>> This works fine:
>>
>> #define or else
>>
>> for (int i=0; i<=5; ++i)
>> if (i==1) {puts("One");}
>> or if (i==2) {puts("Two");}
>> or if (i==3) {puts("Three");}
>> else {puts("Other");}
>>
>> Output is:
>>
>> Other
>> One
>> Two
>> Three
>> Other
>> Other
>>
>> The point is you eventually came up with syntax that is actually just
>> C but using 'or' in place of 'else'.
>>
>>> the last else is what i name "otherwise" (its else in all other case"
>> You seem to have named it 'else' in your example. In any case it would
>> just be a slightly different choice of keyword; it buys you very little.
>>
> maybe try with like
>
> case x%2==0 //2 4 6 8 10 12
> case x%3==0 //3 6 9 12
No, cases '6' and '12' are also true for x%2==0. Unless you want these
to be non-exclusive?
> default // 1 5 7 11 13
>
>
> the default should run if none of above cases catch (as i remember coz i
> dont use switch) and thse cases should catch each time
OK. C doesn't have a direct syntax for this. But it does have if-else
chains for precisely this job. What is the problem with that? You can
write it like this if you like:
if (0)
else if (x%2==0) {}
else if (x%3==0) {}
if you want consistency. There's no point in creating a slightly
different syntax for the same thing.
> im maybe talkong about some more general switch here
What does 'switch' mean to you? It seems that every day it is something
with more and more capabilities and it gets more ambiguous. At some
point it will its own AI to divine your intentions.
but this general
> (abstract) it is more important then normal one - as thsi general covers
> various possible cases
>
> using if or you can implement i it
>
> if(x%2==0) {}
> or if(x%3==0) {}
> else {}
>
> without or (or something analogic) as i understand if im not wrong you cant
You seem fixated on that 'or'. Either use 'else', or create 'or' as an
alias as I suggested.
Re: Taming The Switch-Statement
Author: fir
Date: Mon, 26 Oct 2026 16:37
Date: Mon, 26 Oct 2026 16:37
120 lines
5106 bytes
5106 bytes
bartc pisze:
> On 26/10/2026 16:03, fir wrote:
>> bartc pisze:
>>> On 26/10/2026 12:20, fir wrote:
>>>> bartc pisze:
>>>>> On 26/10/2026 12:07, fir wrote:
>>>>>> fir pisze:
>>>>>>> if {} or if {} or if {} else {}
>>>>>>
>>>>>>
>>>>>> this form in fact is not bad, it simply showst two things
>>>>>>
>>>>>> 1) you may use or outside the if clause (if this () can be named
>>>>>> clause)
>>>>>>
>>>>>> 2) else in fact work on logical group but ias sole if is alos a
>>>>>> case of logical group so else work on it sole in special case
>>>>>>
>>>>>> otherwiste thse keywords here if or and else are quite 'legit'
>>>>>>
>>>>>>
>>>>>>
>>>>>> if () {}
>>>>>> or if () {}
>>>>>> or if() {}
>>>>>> else {}
>>>>>>
>>>>>>
>>>>>> seems quite legit and it seem to ba a switch
>>>>> Excellent. A great thing about this is, this can also be legal C,
>>>>> that works now, if you just precede with this:
>>>>>
>>>>> #define or else
>>>>>
>>>> this wouldnt work imo as far as im aware becouse this last else dont
>>>> work on "group'
>>>
>>> This works fine:
>>>
>>> #define or else
>>>
>>> for (int i=0; i<=5; ++i)
>>> if (i==1) {puts("One");}
>>> or if (i==2) {puts("Two");}
>>> or if (i==3) {puts("Three");}
>>> else {puts("Other");}
>>>
>>> Output is:
>>>
>>> Other
>>> One
>>> Two
>>> Three
>>> Other
>>> Other
>>>
>>> The point is you eventually came up with syntax that is actually just
>>> C but using 'or' in place of 'else'.
>>>
>>>> the last else is what i name "otherwise" (its else in all other case"
>>> You seem to have named it 'else' in your example. In any case it
>>> would just be a slightly different choice of keyword; it buys you
>>> very little.
>>>
>> maybe try with like
>>
>> case x%2==0 //2 4 6 8 10 12
>> case x%3==0 //3 6 9 12
>
> No, cases '6' and '12' are also true for x%2==0. Unless you want these
> to be non-exclusive?
>
>> default // 1 5 7 11 13
>>
>>
>> the default should run if none of above cases catch (as i remember coz
>> i dont use switch) and thse cases should catch each time
>
> OK. C doesn't have a direct syntax for this. But it does have if-else
> chains for precisely this job. What is the problem with that? You can
> write it like this if you like:
>
> if (0)
> else if (x%2==0) {}
> else if (x%3==0) {}
you want it the above to pront "divides by 2" "divides by 3" for 6 and
12 "divides by 2" for 4 8 and 'divided by 3" for 2 9 in case it not
divides by 2 or 3 pronts "no divides "
this above will not work for 6 for example as it only will prit "divides
by 2"
>
> if you want consistency. There's no point in creating a slightly
> different syntax for the same thing.
>
>> im maybe talkong about some more general switch here
>
> What does 'switch' mean to you? It seems that every day it is something
> with more and more capabilities and it gets more ambiguous. At some
> point it will its own AI to divine your intentions.
>
> but this general
>> (abstract) it is more important then normal one - as thsi general
>> covers various possible cases
>>
>> using if or you can implement i it
>>
>> if(x%2==0) {}
>> or if(x%3==0) {}
>> else {}
>>
>> without or (or something analogic) as i understand if im not wrong you
>> cant
> You seem fixated on that 'or'. Either use 'else', or create 'or' as an
> alias as I suggested.
>
>
Re: Taming The Switch-Statement
Author: bartc
Date: Mon, 26 Oct 2026 16:42
Date: Mon, 26 Oct 2026 16:42
104 lines
4618 bytes
4618 bytes
On 26/10/2026 16:37, fir wrote:
> bartc pisze:
>> On 26/10/2026 16:03, fir wrote:
>>> bartc pisze:
>>>> On 26/10/2026 12:20, fir wrote:
>>>>> bartc pisze:
>>>>>> On 26/10/2026 12:07, fir wrote:
>>>>>>> fir pisze:
>>>>>>>> if {} or if {} or if {} else {}
>>>>>>>
>>>>>>>
>>>>>>> this form in fact is not bad, it simply showst two things
>>>>>>>
>>>>>>> 1) you may use or outside the if clause (if this () can be named
>>>>>>> clause)
>>>>>>>
>>>>>>> 2) else in fact work on logical group but ias sole if is alos a
>>>>>>> case of logical group so else work on it sole in special case
>>>>>>>
>>>>>>> otherwiste thse keywords here if or and else are quite 'legit'
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> if () {}
>>>>>>> or if () {}
>>>>>>> or if() {}
>>>>>>> else {}
>>>>>>>
>>>>>>>
>>>>>>> seems quite legit and it seem to ba a switch
>>>>>> Excellent. A great thing about this is, this can also be legal C,
>>>>>> that works now, if you just precede with this:
>>>>>>
>>>>>> #define or else
>>>>>>
>>>>> this wouldnt work imo as far as im aware becouse this last else
>>>>> dont work on "group'
>>>>
>>>> This works fine:
>>>>
>>>> #define or else
>>>>
>>>> for (int i=0; i<=5; ++i)
>>>> if (i==1) {puts("One");}
>>>> or if (i==2) {puts("Two");}
>>>> or if (i==3) {puts("Three");}
>>>> else {puts("Other");}
>>>>
>>>> Output is:
>>>>
>>>> Other
>>>> One
>>>> Two
>>>> Three
>>>> Other
>>>> Other
>>>>
>>>> The point is you eventually came up with syntax that is actually
>>>> just C but using 'or' in place of 'else'.
>>>>
>>>>> the last else is what i name "otherwise" (its else in all other case"
>>>> You seem to have named it 'else' in your example. In any case it
>>>> would just be a slightly different choice of keyword; it buys you
>>>> very little.
>>>>
>>> maybe try with like
>>>
>>> case x%2==0 //2 4 6 8 10 12
>>> case x%3==0 //3 6 9 12
>>
>> No, cases '6' and '12' are also true for x%2==0. Unless you want these
>> to be non-exclusive?
>>
>>> default // 1 5 7 11 13
>>>
>>>
>>> the default should run if none of above cases catch (as i remember
>>> coz i dont use switch) and thse cases should catch each time
>>
>> OK. C doesn't have a direct syntax for this. But it does have if-else
>> chains for precisely this job. What is the problem with that? You can
>> write it like this if you like:
>>
>> if (0)
>> else if (x%2==0) {}
>> else if (x%3==0) {}
>
> you want it the above to pront "divides by 2" "divides by 3" for 6 and
> 12 "divides by 2" for 4 8 and 'divided by 3" for 2 9 in case it not
> divides by 2 or 3 pronts "no divides "
>
> this above will not work for 6 for example as it only will prit "divides
> by 2"
So, non-exclusive. That is not clear from your case{} case{} syntax.
Then it's even simpler:
if (x%2==0) {}
if (x%3==0) {}
Here it is clear they are non-exclusive.
You're also in luck: this is exactly how C works now!
Re: Taming The Switch-Statement
Author: fir
Date: Mon, 26 Oct 2026 16:45
Date: Mon, 26 Oct 2026 16:45
20 lines
2086 bytes
2086 bytes
bartc pisze:
>> without or (or something analogic) as i understand if im not wrong you
>> cant
> You seem fixated on that 'or'. Either use 'else', or create 'or' as an
> alias as I suggested.
imo you should try to understand the example
for(int i = 1; i < 20; i++)
{
if(x%2==0) printf("\n divides by 2");
or if(x%3==0) printf("\n divides by 3");
else printf("\n no divides (by 2 or 3)");
}
you understand how this would work? i think you do
and how in normal c without this "or" it would look,
for exampel in your if else model?
Re: Taming The Switch-Statement
Author: bartc
Date: Mon, 26 Oct 2026 17:00
Date: Mon, 26 Oct 2026 17:00
30 lines
2431 bytes
2431 bytes
On 26/10/2026 16:45, fir wrote:
> bartc pisze:
>>> without or (or something analogic) as i understand if im not wrong
>>> you cant
>> You seem fixated on that 'or'. Either use 'else', or create 'or' as an
>> alias as I suggested.
>
> imo you should try to understand the example
>
> for(int i = 1; i < 20; i++)
> {
>
> if(x%2==0) printf("\n divides by 2");
> or if(x%3==0) printf("\n divides by 3");
> else printf("\n no divides (by 2 or 3)");
> }
>
> you understand how this would work? i think you do
>
> and how in normal c without this "or" it would look,
> for exampel in your if else model?
Show me exactly what the output should be, when it is written like this:
if(x%2==0) printf("\n%d divides by 2", i);
or if(x%3==0) printf("\n%d divides by 3", i);
else printf("\n%d no divides (by 2 or 3)", i);
You might also want to look at the FizzBuzz program.
Re: Taming The Switch-Statement
Author: fir
Date: Mon, 26 Oct 2026 17:06
Date: Mon, 26 Oct 2026 17:06
54 lines
3047 bytes
3047 bytes
bartc pisze:
> On 26/10/2026 16:45, fir wrote:
>> bartc pisze:
>>>> without or (or something analogic) as i understand if im not wrong
>>>> you cant
>>> You seem fixated on that 'or'. Either use 'else', or create 'or' as
>>> an alias as I suggested.
>>
>> imo you should try to understand the example
>>
>> for(int i = 1; i < 20; i++)
>> {
>>
>> if(x%2==0) printf("\n divides by 2");
>> or if(x%3==0) printf("\n divides by 3");
>> else printf("\n no divides (by 2 or 3)");
>> }
>>
>> you understand how this would work? i think you do
>>
>> and how in normal c without this "or" it would look,
>> for exampel in your if else model?
>
> Show me exactly what the output should be, when it is written like this:
>
> if(x%2==0) printf("\n%d divides by 2", i);
> or if(x%3==0) printf("\n%d divides by 3", i);
> else printf("\n%d no divides (by 2 or 3)", i);
>
> You might also want to look at the FizzBuzz program.
>
1 no divides (by 2 or 3)
2 divides by 2
3 divides by 3
4 divides by 2
5 no divides (by 2 or 3)
6 divides by 2
6 divides by 3
7 no divides (by 2 or 3)
8 divides by 2
9 divides by 3
10 divides by 2
11 no divides (by 2 or 3)
12 divides by 2
12 divides by 3
13 no divides (by 2 or 3)
14 divides by 2
15 divides by 3
16 divides by 2
17 no divides (by 2 or 3)
18 divides by 2
18 divides by 3
19 no divides (by 2 or 3)
Re: Taming The Switch-Statement
Author: fir
Date: Mon, 26 Oct 2026 17:11
Date: Mon, 26 Oct 2026 17:11
112 lines
3943 bytes
3943 bytes
fir pisze:
> bartc pisze:
>> On 26/10/2026 16:45, fir wrote:
>>> bartc pisze:
>>>>> without or (or something analogic) as i understand if im not wrong
>>>>> you cant
>>>> You seem fixated on that 'or'. Either use 'else', or create 'or' as
>>>> an alias as I suggested.
>>>
>>> imo you should try to understand the example
>>>
>>> for(int i = 1; i < 20; i++)
>>> {
>>>
>>> if(x%2==0) printf("\n divides by 2");
>>> or if(x%3==0) printf("\n divides by 3");
>>> else printf("\n no divides (by 2 or 3)");
>>> }
>>>
>>> you understand how this would work? i think you do
>>>
>>> and how in normal c without this "or" it would look,
>>> for exampel in your if else model?
>>
>> Show me exactly what the output should be, when it is written like this:
>>
>> if(x%2==0) printf("\n%d divides by 2", i);
>> or if(x%3==0) printf("\n%d divides by 3", i);
>> else printf("\n%d no divides (by 2 or 3)", i);
>>
>> You might also want to look at the FizzBuzz program.
>>
> 1 no divides (by 2 or 3)
> 2 divides by 2
> 3 divides by 3
> 4 divides by 2
> 5 no divides (by 2 or 3)
> 6 divides by 2
> 6 divides by 3
> 7 no divides (by 2 or 3)
> 8 divides by 2
> 9 divides by 3
> 10 divides by 2
> 11 no divides (by 2 or 3)
> 12 divides by 2
> 12 divides by 3
> 13 no divides (by 2 or 3)
> 14 divides by 2
> 15 divides by 3
> 16 divides by 2
> 17 no divides (by 2 or 3)
> 18 divides by 2
> 18 divides by 3
> 19 no divides (by 2 or 3)
>
in fact i had more such in my mind
for(int i=0; i<20; i++)
{
printf("\n %d,i);
if(x%2==0) printf("\n divides by 2");
or if(x%3==0) printf("\n divides by 3");
else printf("\n no divides (by 2 or 3)");
}
so the output is
1
no divides (by 2 or 3)
2
divides by 2
3
divides by 3
4
divides by 2
5
no divides (by 2 or 3)
6
divides by 2
divides by 3
7
no divides (by 2 or 3)
8
divides by 2
9
divides by 3
10
divides by 2
11
no divides (by 2 or 3)
12
divides by 2
divides by 3
13
no divides (by 2 or 3)
14
divides by 2
15
divides by 3
16
divides by 2
17
no divides (by 2 or 3)
18
divides by 2
divides by 3
19
no divides (by 2 or 3)
Re: Taming The Switch-Statement
Author: fir
Date: Mon, 26 Oct 2026 17:37
Date: Mon, 26 Oct 2026 17:37
115 lines
4214 bytes
4214 bytes
fir pisze:
> fir pisze:
>> bartc pisze:
>>> On 26/10/2026 16:45, fir wrote:
>>>> bartc pisze:
>>>>>> without or (or something analogic) as i understand if im not wrong
>>>>>> you cant
>>>>> You seem fixated on that 'or'. Either use 'else', or create 'or' as
>>>>> an alias as I suggested.
>>>>
>>>> imo you should try to understand the example
>>>>
>>>> for(int i = 1; i < 20; i++)
>>>> {
>>>>
>>>> if(x%2==0) printf("\n divides by 2");
>>>> or if(x%3==0) printf("\n divides by 3");
>>>> else printf("\n no divides (by 2 or 3)");
>>>> }
>>>>
>>>> you understand how this would work? i think you do
>>>>
>>>> and how in normal c without this "or" it would look,
>>>> for exampel in your if else model?
>>>
>>> Show me exactly what the output should be, when it is written like this:
>>>
>>> if(x%2==0) printf("\n%d divides by 2", i);
>>> or if(x%3==0) printf("\n%d divides by 3", i);
>>> else printf("\n%d no divides (by 2 or 3)", i);
>>>
>>> You might also want to look at the FizzBuzz program.
>>>
>> 1 no divides (by 2 or 3)
>> 2 divides by 2
>> 3 divides by 3
>> 4 divides by 2
>> 5 no divides (by 2 or 3)
>> 6 divides by 2
>> 6 divides by 3
>> 7 no divides (by 2 or 3)
>> 8 divides by 2
>> 9 divides by 3
>> 10 divides by 2
>> 11 no divides (by 2 or 3)
>> 12 divides by 2
>> 12 divides by 3
>> 13 no divides (by 2 or 3)
>> 14 divides by 2
>> 15 divides by 3
>> 16 divides by 2
>> 17 no divides (by 2 or 3)
>> 18 divides by 2
>> 18 divides by 3
>> 19 no divides (by 2 or 3)
>>
>
>
>
> in fact i had more such in my mind
>
> for(int i=0; i<20; i++)
> {
> printf("\n %d,i);
> if(x%2==0) printf("\n divides by 2");
> or if(x%3==0) printf("\n divides by 3");
> else printf("\n no divides (by 2 or 3)");
>
> }
>
> so the output is
> 1
> no divides (by 2 or 3)
> 2
> divides by 2
> 3
> divides by 3
> 4
> divides by 2
> 5
> no divides (by 2 or 3)
> 6
> divides by 2
> divides by 3
> 7
> no divides (by 2 or 3)
> 8
> divides by 2
> 9
> divides by 3
> 10
> divides by 2
> 11
> no divides (by 2 or 3)
> 12
> divides by 2
> divides by 3
> 13
> no divides (by 2 or 3)
> 14
> divides by 2
> 15
> divides by 3
> 16
> divides by 2
> 17
> no divides (by 2 or 3)
> 18
> divides by 2
> divides by 3
> 19
> no divides (by 2 or 3)
>
...and.....?
Re: Taming The Switch-Statement
Author: Janis Papanagnou
Date: Mon, 26 Oct 2026 18:39
Date: Mon, 26 Oct 2026 18:39
51 lines
3049 bytes
3049 bytes
On 2026-10-26 17:42, bartc wrote:
> On 26/10/2026 16:37, fir wrote:
>> bartc pisze:
>>> On 26/10/2026 16:03, fir wrote:
>>>> bartc pisze:
>>>>> On 26/10/2026 12:20, fir wrote:
>>>>>> bartc pisze:
>>>>>>> On 26/10/2026 12:07, fir wrote:
>>>>>>>> fir pisze:
>>>>>>>>> if {} or if {} or if {} else {}
[...]
>>>>>>>> if () {}
>>>>>>>> or if () {}
>>>>>>>> or if() {}
>>>>>>>> else {}
[...]
>>>>> #define or else
>>>>>
>>>>> for (int i=0; i<=5; ++i)
>>>>> if (i==1) {puts("One");}
>>>>> or if (i==2) {puts("Two");}
>>>>> or if (i==3) {puts("Three");}
>>>>> else {puts("Other");}
[...]
>>>> case x%2==0 //2 4 6 8 10 12
>>>> case x%3==0 //3 6 9 12
>>>> default // 1 5 7 11 13
[...]
>>> if (0)
>>> else if (x%2==0) {}
>>> else if (x%3==0) {}
[...]
> if (x%2==0) {}
> if (x%3==0) {}
>
> Here it is clear they are non-exclusive.
>
> You're also in luck: this is exactly how C works now!
I'm not sure what fir actually wants; I cannot decipher his writings
quoted by you. But, given that he not yet seems satisfied with your
replies and suggestions, could it, by any chance, be that what he
wants is some non-deterministic construct like Dijkstra's Guards?
I.e., that with two guards 'x%2==0' and 'x%3==0' and an input of "6"
only _one_ of the two gets _arbitrarily_ triggered?
(Otherwise his post appears quite pointless to me.)
Janis
Re: Taming The Switch-Statement
Author: fir
Date: Mon, 26 Oct 2026 19:03
Date: Mon, 26 Oct 2026 19:03
135 lines
4678 bytes
4678 bytes
Janis Papanagnou pisze:
> On 2026-10-26 17:42, bartc wrote:
>> On 26/10/2026 16:37, fir wrote:
>>> bartc pisze:
>>>> On 26/10/2026 16:03, fir wrote:
>>>>> bartc pisze:
>>>>>> On 26/10/2026 12:20, fir wrote:
>>>>>>> bartc pisze:
>>>>>>>> On 26/10/2026 12:07, fir wrote:
>>>>>>>>> fir pisze:
>>>>>>>>>> if {} or if {} or if {} else {}
> [...]
>>>>>>>>> if () {}
>>>>>>>>> or if () {}
>>>>>>>>> or if() {}
>>>>>>>>> else {}
> [...]
>>>>>> #define or else
>>>>>>
>>>>>> for (int i=0; i<=5; ++i)
>>>>>> if (i==1) {puts("One");}
>>>>>> or if (i==2) {puts("Two");}
>>>>>> or if (i==3) {puts("Three");}
>>>>>> else {puts("Other");}
> [...]
>>>>> case x%2==0 //2 4 6 8 10 12
>>>>> case x%3==0 //3 6 9 12
>>>>> default // 1 5 7 11 13
> [...]
>>>> if (0)
>>>> else if (x%2==0) {}
>>>> else if (x%3==0) {}
> [...]
>> if (x%2==0) {}
>> if (x%3==0) {}
>>
>> Here it is clear they are non-exclusive.
>>
>> You're also in luck: this is exactly how C works now!
>
> I'm not sure what fir actually wants; I cannot decipher his writings
> quoted by you. But, given that he not yet seems satisfied with your
> replies and suggestions, could it, by any chance, be that what he
> wants is some non-deterministic construct like Dijkstra's Guards?
>
> I.e., that with two guards 'x%2==0' and 'x%3==0' and an input of "6"
> only _one_ of the two gets _arbitrarily_ triggered?
>
> (Otherwise his post appears quite pointless to me.)
>
> Janis
>
i quite defined the problem see the simple program
for(int i=0; i<20; i++)
{
printf("\n %d,i);
if(x%2==0)
printf("\n divides by 2");
or if(x%3==0)
printf("\n divides by 3");
else
printf("\n no divides (by 2 or 3)");
}
keyword or resloves problem here the problem is if you add or the else
works on grpup of previous ifs
here in cases
0 or 0 else {}
1 or 0 else {}
0 or 1 else {}
1 or 1 else {}
else works on fales so here olse works like default
in switch only on all zeros
write such above program without or so it giver the desired result
1
no divides (by 2 or 3)
2
divides by 2
3
divides by 3
4
divides by 2
5
no divides (by 2 or 3)
6
divides by 2
divides by 3
7
no divides (by 2 or 3)
8
divides by 2
9
divides by 3
10
divides by 2
11
no divides (by 2 or 3)
12
divides by 2
divides by 3
13
no divides (by 2 or 3)
14
divides by 2
15
divides by 3
16
divides by 2
17
no divides (by 2 or 3)
18
divides by 2
divides by 3
19
no divides (by 2 or 3)
my thoughts are general as o abstract switch concept and its a bit
multidimensional ;c maybe but specifically
ut shows that if and elses not cover all logical cases when
if you add such or and and (or some different analogies) those cases
would be covered
Re: Taming The Switch-Statement
Author: bartc
Date: Mon, 26 Oct 2026 19:03
Date: Mon, 26 Oct 2026 19:03
92 lines
4165 bytes
4165 bytes
On 26/10/2026 17:06, fir wrote:
> bartc pisze:
>> On 26/10/2026 16:45, fir wrote:
>>> bartc pisze:
>>>>> without or (or something analogic) as i understand if im not wrong
>>>>> you cant
>>>> You seem fixated on that 'or'. Either use 'else', or create 'or' as
>>>> an alias as I suggested.
>>>
>>> imo you should try to understand the example
>>>
>>> for(int i = 1; i < 20; i++)
>>> {
>>>
>>> if(x%2==0) printf("\n divides by 2");
>>> or if(x%3==0) printf("\n divides by 3");
>>> else printf("\n no divides (by 2 or 3)");
>>> }
>>>
>>> you understand how this would work? i think you do
>>>
>>> and how in normal c without this "or" it would look,
>>> for exampel in your if else model?
>>
>> Show me exactly what the output should be, when it is written like this:
>>
>> if(x%2==0) printf("\n%d divides by 2", i);
>> or if(x%3==0) printf("\n%d divides by 3", i);
>> else printf("\n%d no divides (by 2 or 3)", i);
>>
>> You might also want to look at the FizzBuzz program.
>>
> 1 no divides (by 2 or 3)
> 2 divides by 2
> 3 divides by 3
> 4 divides by 2
> 5 no divides (by 2 or 3)
> 6 divides by 2
> 6 divides by 3
> 7 no divides (by 2 or 3)
> 8 divides by 2
> 9 divides by 3
> 10 divides by 2
> 11 no divides (by 2 or 3)
> 12 divides by 2
> 12 divides by 3
> 13 no divides (by 2 or 3)
> 14 divides by 2
> 15 divides by 3
> 16 divides by 2
> 17 no divides (by 2 or 3)
> 18 divides by 2
> 18 divides by 3
> 19 no divides (by 2 or 3)
OK, thanks. So the pattern you're talking about is this:
case (c1) {s1}
case (c2) {s2}
case (c3) {s3}
else {s4}
where each of s1/s2/s3 is executed if the corresponding c1/c2/c3 is
true, independently of the others. At least one statement will be
executed in 7 of the 8 possible boolean combinations in this example.
s4 is only executed when each of c1/c2/c3 is false. In other words:
if (c1) {s1}
if (c2) {s2}
if (c3) {s3}
if (!c1 && !c2 && !c3) {s4}
Assuming c1/c2/c3 are not modified by s1/s2/s3, but this is also partly
the case with your proposal.
Or maybe it can be done like this:
if (c1 || c2 || c3) {
s4
else if (c1) {s1)
....
The syntax will anyway need some work to tie all those case/if parts
together (as s2 for example could contain nested versions).
Or you can forget about having to create a hard-to-grasp and
awkward-to-implement feature like this, and either use workarounds like
my C examples, or use another approach to the problem.
Re: Taming The Switch-Statement
Author: fir
Date: Mon, 26 Oct 2026 19:39
Date: Mon, 26 Oct 2026 19:39
98 lines
4621 bytes
4621 bytes
bartc pisze:
> On 26/10/2026 17:06, fir wrote:
>> bartc pisze:
>>> On 26/10/2026 16:45, fir wrote:
>>>> bartc pisze:
>>>>>> without or (or something analogic) as i understand if im not wrong
>>>>>> you cant
>>>>> You seem fixated on that 'or'. Either use 'else', or create 'or' as
>>>>> an alias as I suggested.
>>>>
>>>> imo you should try to understand the example
>>>>
>>>> for(int i = 1; i < 20; i++)
>>>> {
>>>>
>>>> if(x%2==0) printf("\n divides by 2");
>>>> or if(x%3==0) printf("\n divides by 3");
>>>> else printf("\n no divides (by 2 or 3)");
>>>> }
>>>>
>>>> you understand how this would work? i think you do
>>>>
>>>> and how in normal c without this "or" it would look,
>>>> for exampel in your if else model?
>>>
>>> Show me exactly what the output should be, when it is written like this:
>>>
>>> if(x%2==0) printf("\n%d divides by 2", i);
>>> or if(x%3==0) printf("\n%d divides by 3", i);
>>> else printf("\n%d no divides (by 2 or 3)", i);
>>>
>>> You might also want to look at the FizzBuzz program.
>>>
>> 1 no divides (by 2 or 3)
>> 2 divides by 2
>> 3 divides by 3
>> 4 divides by 2
>> 5 no divides (by 2 or 3)
>> 6 divides by 2
>> 6 divides by 3
>> 7 no divides (by 2 or 3)
>> 8 divides by 2
>> 9 divides by 3
>> 10 divides by 2
>> 11 no divides (by 2 or 3)
>> 12 divides by 2
>> 12 divides by 3
>> 13 no divides (by 2 or 3)
>> 14 divides by 2
>> 15 divides by 3
>> 16 divides by 2
>> 17 no divides (by 2 or 3)
>> 18 divides by 2
>> 18 divides by 3
>> 19 no divides (by 2 or 3)
>
> OK, thanks. So the pattern you're talking about is this:
>
> case (c1) {s1}
> case (c2) {s2}
> case (c3) {s3}
> else {s4}
>
> where each of s1/s2/s3 is executed if the corresponding c1/c2/c3 is
> true, independently of the others. At least one statement will be
> executed in 7 of the 8 possible boolean combinations in this example.
>
> s4 is only executed when each of c1/c2/c3 is false. In other words:
>
> if (c1) {s1}
> if (c2) {s2}
> if (c3) {s3}
> if (!c1 && !c2 && !c3) {s4}
>
> Assuming c1/c2/c3 are not modified by s1/s2/s3, but this is also partly
> the case with your proposal.
>
> Or maybe it can be done like this:
>
> if (c1 || c2 || c3) {
> s4
> else if (c1) {s1)
> ....
>
> The syntax will anyway need some work to tie all those case/if parts
> together (as s2 for example could contain nested versions).
>
> Or you can forget about having to create a hard-to-grasp and
> awkward-to-implement feature like this, and either use workarounds like
> my C examples, or use another approach to the problem.
>
>
>
hahaha
lol ye use worakarounds instead of simple right solution
(this solution may come in some plavours as i said before, but this or
ketword for reasons mentioned is not bad)
Re: Taming The Switch-Statement
Author: bartc
Date: Mon, 26 Oct 2026 19:59
Date: Mon, 26 Oct 2026 19:59
94 lines
4385 bytes
4385 bytes
On 26/10/2026 19:39, fir wrote:
> bartc pisze:
>>> 1 no divides (by 2 or 3)
>>> 2 divides by 2
>>> 3 divides by 3
>>> 4 divides by 2
>>> 5 no divides (by 2 or 3)
>>> 6 divides by 2
>>> 6 divides by 3
>>> 7 no divides (by 2 or 3)
>>> 8 divides by 2
>>> 9 divides by 3
>>> 10 divides by 2
>>> 11 no divides (by 2 or 3)
>>> 12 divides by 2
>>> 12 divides by 3
>>> 13 no divides (by 2 or 3)
>>> 14 divides by 2
>>> 15 divides by 3
>>> 16 divides by 2
>>> 17 no divides (by 2 or 3)
>>> 18 divides by 2
>>> 18 divides by 3
>>> 19 no divides (by 2 or 3)
>>
>> OK, thanks. So the pattern you're talking about is this:
>>
>> case (c1) {s1}
>> case (c2) {s2}
>> case (c3) {s3}
>> else {s4}
>>
>> where each of s1/s2/s3 is executed if the corresponding c1/c2/c3 is
>> true, independently of the others. At least one statement will be
>> executed in 7 of the 8 possible boolean combinations in this example.
>>
>> s4 is only executed when each of c1/c2/c3 is false. In other words:
>>
>> if (c1) {s1}
>> if (c2) {s2}
>> if (c3) {s3}
>> if (!c1 && !c2 && !c3) {s4}
>>
>> Assuming c1/c2/c3 are not modified by s1/s2/s3, but this is also
>> partly the case with your proposal.
>>
>> Or maybe it can be done like this:
>>
>> if (c1 || c2 || c3) {
>> s4
>> else if (c1) {s1)
>> ....
>>
>> The syntax will anyway need some work to tie all those case/if parts
>> together (as s2 for example could contain nested versions).
>>
>> Or you can forget about having to create a hard-to-grasp and awkward-
>> to-implement feature like this, and either use workarounds like my C
>> examples, or use another approach to the problem.
>>
>>
>>
> hahaha
>
> lol ye use worakarounds instead of simple right solution
The right solution to what problem? It took multiple posts before you
even managed to explain how your proposal is supposed to behave.
(And then tomorrow it'll probably do something else.)
> (this solution may come in some plavours as i said before, but this or
> ketword for reasons mentioned is not bad)
OK, try a simple experiment: convert some code using your 'or' keyword
to regular C syntax and post it here. Preferably on a real example.
Because I've not convinced it comes up often enough to be worth a
dedicated feature.
Then, consider examples like this:
case (a==b and c==d) {}
case (a==b and e==f) {}
case (a<b) {}
case (a>=b) {}
case (c==d) {}
You'll find, when converting to regular C, that detecting the case of
all false will mean checking all conditions, but now those will contain
duplicates. It is hard to cleanly express, which is a bad sign as a
prospective language feature.
Re: Taming The Switch-Statement
Author: fir
Date: Mon, 26 Oct 2026 20:13
Date: Mon, 26 Oct 2026 20:13
104 lines
4959 bytes
4959 bytes
bartc pisze:
> On 26/10/2026 19:39, fir wrote:
>> bartc pisze:
>
>>>> 1 no divides (by 2 or 3)
>>>> 2 divides by 2
>>>> 3 divides by 3
>>>> 4 divides by 2
>>>> 5 no divides (by 2 or 3)
>>>> 6 divides by 2
>>>> 6 divides by 3
>>>> 7 no divides (by 2 or 3)
>>>> 8 divides by 2
>>>> 9 divides by 3
>>>> 10 divides by 2
>>>> 11 no divides (by 2 or 3)
>>>> 12 divides by 2
>>>> 12 divides by 3
>>>> 13 no divides (by 2 or 3)
>>>> 14 divides by 2
>>>> 15 divides by 3
>>>> 16 divides by 2
>>>> 17 no divides (by 2 or 3)
>>>> 18 divides by 2
>>>> 18 divides by 3
>>>> 19 no divides (by 2 or 3)
>>>
>>> OK, thanks. So the pattern you're talking about is this:
>>>
>>> case (c1) {s1}
>>> case (c2) {s2}
>>> case (c3) {s3}
>>> else {s4}
>>>
>>> where each of s1/s2/s3 is executed if the corresponding c1/c2/c3 is
>>> true, independently of the others. At least one statement will be
>>> executed in 7 of the 8 possible boolean combinations in this example.
>>>
>>> s4 is only executed when each of c1/c2/c3 is false. In other words:
>>>
>>> if (c1) {s1}
>>> if (c2) {s2}
>>> if (c3) {s3}
>>> if (!c1 && !c2 && !c3) {s4}
>>>
>>> Assuming c1/c2/c3 are not modified by s1/s2/s3, but this is also
>>> partly the case with your proposal.
>>>
>>> Or maybe it can be done like this:
>>>
>>> if (c1 || c2 || c3) {
>>> s4
>>> else if (c1) {s1)
>>> ....
>>>
>>> The syntax will anyway need some work to tie all those case/if parts
>>> together (as s2 for example could contain nested versions).
>>>
>>> Or you can forget about having to create a hard-to-grasp and awkward-
>>> to-implement feature like this, and either use workarounds like my C
>>> examples, or use another approach to the problem.
>>>
>>>
>>>
>> hahaha
>>
>> lol ye use worakarounds instead of simple right solution
>
> The right solution to what problem? It took multiple posts before you
> even managed to explain how your proposal is supposed to behave.
>
well i was surprised how slow you think it is the reason you get things
slow - and that s why it took multiple posts - still you far from
getting it more it seems - it may take years maybe ;c
and i make laugh becouse its funny how some slowly take some things and
how bad answer thay give - its kinda laughable
> (And then tomorrow it'll probably do something else.)
>
>> (this solution may come in some plavours as i said before, but this or
>> ketword for reasons mentioned is not bad)
>
> OK, try a simple experiment: convert some code using your 'or' keyword
> to regular C syntax and post it here. Preferably on a real example.
>
> Because I've not convinced it comes up often enough to be worth a
> dedicated feature.
>
> Then, consider examples like this:
>
> case (a==b and c==d) {}
> case (a==b and e==f) {}
>
> case (a<b) {}
> case (a>=b) {}
> case (c==d) {}
>
> You'll find, when converting to regular C, that detecting the case of
> all false will mean checking all conditions, but now those will contain
> duplicates. It is hard to cleanly express, which is a bad sign as a
> prospective language feature.
Re: Taming The Switch-Statement
Author: fir
Date: Mon, 26 Oct 2026 20:32
Date: Mon, 26 Oct 2026 20:32
125 lines
5609 bytes
5609 bytes
bartc pisze:
> On 26/10/2026 19:39, fir wrote:
>> bartc pisze:
>
>>>> 1 no divides (by 2 or 3)
>>>> 2 divides by 2
>>>> 3 divides by 3
>>>> 4 divides by 2
>>>> 5 no divides (by 2 or 3)
>>>> 6 divides by 2
>>>> 6 divides by 3
>>>> 7 no divides (by 2 or 3)
>>>> 8 divides by 2
>>>> 9 divides by 3
>>>> 10 divides by 2
>>>> 11 no divides (by 2 or 3)
>>>> 12 divides by 2
>>>> 12 divides by 3
>>>> 13 no divides (by 2 or 3)
>>>> 14 divides by 2
>>>> 15 divides by 3
>>>> 16 divides by 2
>>>> 17 no divides (by 2 or 3)
>>>> 18 divides by 2
>>>> 18 divides by 3
>>>> 19 no divides (by 2 or 3)
>>>
>>> OK, thanks. So the pattern you're talking about is this:
>>>
>>> case (c1) {s1}
>>> case (c2) {s2}
>>> case (c3) {s3}
>>> else {s4}
>>>
>>> where each of s1/s2/s3 is executed if the corresponding c1/c2/c3 is
>>> true, independently of the others. At least one statement will be
>>> executed in 7 of the 8 possible boolean combinations in this example.
>>>
>>> s4 is only executed when each of c1/c2/c3 is false. In other words:
>>>
>>> if (c1) {s1}
>>> if (c2) {s2}
>>> if (c3) {s3}
>>> if (!c1 && !c2 && !c3) {s4}
>>>
>>> Assuming c1/c2/c3 are not modified by s1/s2/s3, but this is also
>>> partly the case with your proposal.
>>>
>>> Or maybe it can be done like this:
>>>
>>> if (c1 || c2 || c3) {
>>> s4
>>> else if (c1) {s1)
>>> ....
>>>
>>> The syntax will anyway need some work to tie all those case/if parts
>>> together (as s2 for example could contain nested versions).
>>>
>>> Or you can forget about having to create a hard-to-grasp and awkward-
>>> to-implement feature like this, and either use workarounds like my C
>>> examples, or use another approach to the problem.
>>>
>>>
>>>
>> hahaha
>>
>> lol ye use worakarounds instead of simple right solution
>
> The right solution to what problem? It took multiple posts before you
> even managed to explain how your proposal is supposed to behave.
>
> (And then tomorrow it'll probably do something else.)
>
>> (this solution may come in some plavours as i said before, but this or
>> ketword for reasons mentioned is not bad)
>
> OK, try a simple experiment: convert some code using your 'or' keyword
> to regular C syntax and post it here. Preferably on a real example.
>
you cant properly convert this or/and groups to c in good way becouse
there is flaw in c you cannot express all needed combinations generally
with sole if 's and else's
as was showed here
> Because I've not convinced it comes up often enough to be worth a
> dedicated feature.
>
> Then, consider examples like this:
>
> case (a==b and c==d) {}
> case (a==b and e==f) {}
>
> case (a<b) {}
> case (a>=b) {}
> case (c==d) {}
>
> You'll find, when converting to regular C, that detecting the case of
> all false will mean checking all conditions, but now those will contain
> duplicates. It is hard to cleanly express, which is a bad sign as a
> prospective language feature.
i dont like get what you talk here..overally this is a work for compiler
to simplify it in output
btw you think i should defend the things i was talking about -
i more see its a waste of time if someone dont understand things
it is for him if he understoods or not, i have not so much time to
defend obvious things against the people who not care to much to
understand things
i would sy like its taking hours repairing a code that is
good - whou would like to do it?
generally such time spanding that you got good code and some weird
people come nad put a bulshit its wrong and expect me to explain this is
not its not a good time spending imo
i would rather expect if some will find some 'bug ' in code then he
first should understand it
Re: Taming The Switch-Statement
Author: fir
Date: Mon, 26 Oct 2026 20:47
Date: Mon, 26 Oct 2026 20:47
165 lines
6503 bytes
6503 bytes
fir pisze:
> bartc pisze:
>> On 26/10/2026 19:39, fir wrote:
>>> bartc pisze:
>>
>>>>> 1 no divides (by 2 or 3)
>>>>> 2 divides by 2
>>>>> 3 divides by 3
>>>>> 4 divides by 2
>>>>> 5 no divides (by 2 or 3)
>>>>> 6 divides by 2
>>>>> 6 divides by 3
>>>>> 7 no divides (by 2 or 3)
>>>>> 8 divides by 2
>>>>> 9 divides by 3
>>>>> 10 divides by 2
>>>>> 11 no divides (by 2 or 3)
>>>>> 12 divides by 2
>>>>> 12 divides by 3
>>>>> 13 no divides (by 2 or 3)
>>>>> 14 divides by 2
>>>>> 15 divides by 3
>>>>> 16 divides by 2
>>>>> 17 no divides (by 2 or 3)
>>>>> 18 divides by 2
>>>>> 18 divides by 3
>>>>> 19 no divides (by 2 or 3)
>>>>
>>>> OK, thanks. So the pattern you're talking about is this:
>>>>
>>>> case (c1) {s1}
>>>> case (c2) {s2}
>>>> case (c3) {s3}
>>>> else {s4}
>>>>
>>>> where each of s1/s2/s3 is executed if the corresponding c1/c2/c3 is
>>>> true, independently of the others. At least one statement will be
>>>> executed in 7 of the 8 possible boolean combinations in this example.
>>>>
>>>> s4 is only executed when each of c1/c2/c3 is false. In other words:
>>>>
>>>> if (c1) {s1}
>>>> if (c2) {s2}
>>>> if (c3) {s3}
>>>> if (!c1 && !c2 && !c3) {s4}
>>>>
>>>> Assuming c1/c2/c3 are not modified by s1/s2/s3, but this is also
>>>> partly the case with your proposal.
>>>>
>>>> Or maybe it can be done like this:
>>>>
>>>> if (c1 || c2 || c3) {
>>>> s4
>>>> else if (c1) {s1)
>>>> ....
>>>>
>>>> The syntax will anyway need some work to tie all those case/if parts
>>>> together (as s2 for example could contain nested versions).
>>>>
>>>> Or you can forget about having to create a hard-to-grasp and
>>>> awkward- to-implement feature like this, and either use workarounds
>>>> like my C examples, or use another approach to the problem.
>>>>
>>>>
>>>>
>>> hahaha
>>>
>>> lol ye use worakarounds instead of simple right solution
>>
>> The right solution to what problem? It took multiple posts before you
>> even managed to explain how your proposal is supposed to behave.
>>
>> (And then tomorrow it'll probably do something else.)
>>
>>> (this solution may come in some plavours as i said before, but this
>>> or ketword for reasons mentioned is not bad)
>>
>> OK, try a simple experiment: convert some code using your 'or' keyword
>> to regular C syntax and post it here. Preferably on a real example.
>>
>
> you cant properly convert this or/and groups to c in good way becouse
> there is flaw in c you cannot express all needed combinations generally
> with sole if 's and else's
>
> as was showed here
>
>
>> Because I've not convinced it comes up often enough to be worth a
>> dedicated feature.
>>
>> Then, consider examples like this:
>>
>> case (a==b and c==d) {}
>> case (a==b and e==f) {}
>>
>> case (a<b) {}
>> case (a>=b) {}
>> case (c==d) {}
>>
>> You'll find, when converting to regular C, that detecting the case of
>> all false will mean checking all conditions, but now those will
>> contain duplicates. It is hard to cleanly express, which is a bad sign
>> as a prospective language feature.
>
>
> i dont like get what you talk here..overally this is a work for compiler
> to simplify it in output
>
>
> btw you think i should defend the things i was talking about -
> i more see its a waste of time if someone dont understand things
> it is for him if he understoods or not, i have not so much time to
> defend obvious things against the people who not care to much to
> understand things
>
> i would sy like its taking hours repairing a code that is
> good - whou would like to do it?
>
>
> generally such time spanding that you got good code and some weird
> people come nad put a bulshit its wrong and expect me to explain this is
> not its not a good time spending imo
>
> i would rather expect if some will find some 'bug ' in code then he
> first should understand it
overally instead of dwelling in this timewaste some could consider more
interesting things, for example if normal switch is like
"some true" then {} else {}
there could be considered usability of more cases
"all true" then {} else {}
"none true" then {} else {}
"only one true" then {} else {}
"only one false" then {} else {}
im not sure as to usability of this but if its usable then
it maybe can be encoded by more keywords instead of then
and else
like
case a<2 {}
case a>4 {}
case a==0 {}
case none {} //like default
case all {}
case some {}
so it seems that switch can be extended thsi way
(not sure as to usability of this)
Re: Taming The Switch-Statement
Author: bartc
Date: Mon, 26 Oct 2026 20:56
Date: Mon, 26 Oct 2026 20:56
104 lines
5081 bytes
5081 bytes
On 26/10/2026 20:13, fir wrote:
> bartc pisze:
>> On 26/10/2026 19:39, fir wrote:
>>> bartc pisze:
>>
>>>>> 1 no divides (by 2 or 3)
>>>>> 2 divides by 2
>>>>> 3 divides by 3
>>>>> 4 divides by 2
>>>>> 5 no divides (by 2 or 3)
>>>>> 6 divides by 2
>>>>> 6 divides by 3
>>>>> 7 no divides (by 2 or 3)
>>>>> 8 divides by 2
>>>>> 9 divides by 3
>>>>> 10 divides by 2
>>>>> 11 no divides (by 2 or 3)
>>>>> 12 divides by 2
>>>>> 12 divides by 3
>>>>> 13 no divides (by 2 or 3)
>>>>> 14 divides by 2
>>>>> 15 divides by 3
>>>>> 16 divides by 2
>>>>> 17 no divides (by 2 or 3)
>>>>> 18 divides by 2
>>>>> 18 divides by 3
>>>>> 19 no divides (by 2 or 3)
>>>>
>>>> OK, thanks. So the pattern you're talking about is this:
>>>>
>>>> case (c1) {s1}
>>>> case (c2) {s2}
>>>> case (c3) {s3}
>>>> else {s4}
>>>>
>>>> where each of s1/s2/s3 is executed if the corresponding c1/c2/c3 is
>>>> true, independently of the others. At least one statement will be
>>>> executed in 7 of the 8 possible boolean combinations in this example.
>>>>
>>>> s4 is only executed when each of c1/c2/c3 is false. In other words:
>>>>
>>>> if (c1) {s1}
>>>> if (c2) {s2}
>>>> if (c3) {s3}
>>>> if (!c1 && !c2 && !c3) {s4}
>>>>
>>>> Assuming c1/c2/c3 are not modified by s1/s2/s3, but this is also
>>>> partly the case with your proposal.
>>>>
>>>> Or maybe it can be done like this:
>>>>
>>>> if (c1 || c2 || c3) {
>>>> s4
>>>> else if (c1) {s1)
>>>> ....
>>>>
>>>> The syntax will anyway need some work to tie all those case/if parts
>>>> together (as s2 for example could contain nested versions).
>>>>
>>>> Or you can forget about having to create a hard-to-grasp and
>>>> awkward- to-implement feature like this, and either use workarounds
>>>> like my C examples, or use another approach to the problem.
>>>>
>>>>
>>>>
>>> hahaha
>>>
>>> lol ye use worakarounds instead of simple right solution
>>
>> The right solution to what problem? It took multiple posts before you
>> even managed to explain how your proposal is supposed to behave.
>>
>
> well i was surprised how slow you think it is the reason you get things
> slow - and that s why it took multiple posts
Mainly from you failing to explain? You wrote comments like this:
"this wouldnt work imo as far as im aware becouse this last else dont
work on "group'"
IMO? It either works or it doesn't, and if not, explain why 'or' was not
just an alias for 'else'.
> and i make laugh becouse its funny how some slowly take some things and
> how bad answer thay give - its kinda laughable
Well, this is the thing: given a well-specified, well-thought-out
feature, I can probably implement it in one of my compilers within a day.
That can serve as a proof-of-concept, and can be used to see how well it
stands up and how useful it actually is.
This one wouldn't pass that bar. But also, I've not convinced that you
put much thought into it. If I implemented it, you'd change your mind
about it, or add new twists, or get bored and think up something else.
It would be a waste of time.
So what's the purpose of these hundreds of wacky, random ideas: do you
expect someone else to implement them for you? If so, in which language?
Today was a bit of fun, but I can't take your ideas seriously.
Re: Taming The Switch-Statement
Author: bartc
Date: Mon, 26 Oct 2026 21:11
Date: Mon, 26 Oct 2026 21:11
62 lines
3742 bytes
3742 bytes
On 26/10/2026 20:32, fir wrote:
> bartc pisze:
>> OK, try a simple experiment: convert some code using your 'or' keyword
>> to regular C syntax and post it here. Preferably on a real example.
>>
>
> you cant properly convert this or/and groups to c in good way becouse
> there is flaw in c you cannot express all needed combinations generally
> with sole if 's and else's
>
> as was showed here
There are a couple of reasons to express it in C:
* To illustrate exactly how you want the semantics to work, via
an existing language whose behaviour is well known
* To highlight the problem areas
For example:
if (f1()) {}
if (f2()) {}
...
if (!f1() && !f2()) {}
Here f1/f2 are called twice. This means making internal copies or
setting flags.
>> You'll find, when converting to regular C, that detecting the case of
>> all false will mean checking all conditions, but now those will
>> contain duplicates. It is hard to cleanly express, which is a bad sign
>> as a prospective language feature.
>
>
> i dont like get what you talk here..overally this is a work for compiler
> to simplify it in output
In my case the compiler is my job too!
> btw you think i should defend the things i was talking about -
> i more see its a waste of time if someone dont understand things
> it is for him if he understoods or not, i have not so much time to
> defend obvious things against the people who not care to much to
> understand things
>
> i would sy like its taking hours repairing a code that is
> good - whou would like to do it?
>
>
> generally such time spanding that you got good code and some weird
> people come nad put a bulshit its wrong and expect me to explain this is
> not its not a good time spending imo
> i would rather expect if some will find some 'bug ' in code then he
> first should understand it
Why bother posting in a public forum if you don't care about people
understand what you're on about? Do you not want people to engage?
Then post to alt.test instead.
Re: Taming The Switch-Statement
Author: Chris M. Thomasson
Date: Mon, 26 Oct 2026 21:17
Date: Mon, 26 Oct 2026 21:17
69 lines
4066 bytes
4066 bytes
On 10/26/2026 2:11 PM, bartc wrote:
> On 26/10/2026 20:32, fir wrote:
>> bartc pisze:
>
>>> OK, try a simple experiment: convert some code using your 'or'
>>> keyword to regular C syntax and post it here. Preferably on a real
>>> example.
>>>
>>
>> you cant properly convert this or/and groups to c in good way becouse
>> there is flaw in c you cannot express all needed combinations
>> generally with sole if 's and else's
>>
>> as was showed here
> There are a couple of reasons to express it in C:
>
> * To illustrate exactly how you want the semantics to work, via
> an existing language whose behaviour is well known
>
> * To highlight the problem areas
>
> For example:
>
> if (f1()) {}
> if (f2()) {}
> ...
> if (!f1() && !f2()) {}
>
> Here f1/f2 are called twice. This means making internal copies or
> setting flags.
So you call f1 and f2, then call if (!f1() && !f2()) {}. So, that is
your choice. Not the fault of C, right?
>
>
>>> You'll find, when converting to regular C, that detecting the case of
>>> all false will mean checking all conditions, but now those will
>>> contain duplicates. It is hard to cleanly express, which is a bad
>>> sign as a prospective language feature.
>>
>>
>> i dont like get what you talk here..overally this is a work for compiler
>> to simplify it in output
>
> In my case the compiler is my job too!
>
>> btw you think i should defend the things i was talking about -
>> i more see its a waste of time if someone dont understand things
>> it is for him if he understoods or not, i have not so much time to
>> defend obvious things against the people who not care to much to
>> understand things
>>
>> i would sy like its taking hours repairing a code that is
>> good - whou would like to do it?
>>
>>
>> generally such time spanding that you got good code and some weird
>> people come nad put a bulshit its wrong and expect me to explain this
>> is not its not a good time spending imo
>
>> i would rather expect if some will find some 'bug ' in code then he
>> first should understand it
>
> Why bother posting in a public forum if you don't care about people
> understand what you're on about? Do you not want people to engage?
>
> Then post to alt.test instead.
Re: Taming The Switch-Statement
Author: fir
Date: Mon, 26 Oct 2026 21:37
Date: Mon, 26 Oct 2026 21:37
152 lines
6855 bytes
6855 bytes
bartc pisze:
> On 26/10/2026 20:13, fir wrote:
>> bartc pisze:
>>> On 26/10/2026 19:39, fir wrote:
>>>> bartc pisze:
>>>
>>>>>> 1 no divides (by 2 or 3)
>>>>>> 2 divides by 2
>>>>>> 3 divides by 3
>>>>>> 4 divides by 2
>>>>>> 5 no divides (by 2 or 3)
>>>>>> 6 divides by 2
>>>>>> 6 divides by 3
>>>>>> 7 no divides (by 2 or 3)
>>>>>> 8 divides by 2
>>>>>> 9 divides by 3
>>>>>> 10 divides by 2
>>>>>> 11 no divides (by 2 or 3)
>>>>>> 12 divides by 2
>>>>>> 12 divides by 3
>>>>>> 13 no divides (by 2 or 3)
>>>>>> 14 divides by 2
>>>>>> 15 divides by 3
>>>>>> 16 divides by 2
>>>>>> 17 no divides (by 2 or 3)
>>>>>> 18 divides by 2
>>>>>> 18 divides by 3
>>>>>> 19 no divides (by 2 or 3)
>>>>>
>>>>> OK, thanks. So the pattern you're talking about is this:
>>>>>
>>>>> case (c1) {s1}
>>>>> case (c2) {s2}
>>>>> case (c3) {s3}
>>>>> else {s4}
>>>>>
>>>>> where each of s1/s2/s3 is executed if the corresponding c1/c2/c3 is
>>>>> true, independently of the others. At least one statement will be
>>>>> executed in 7 of the 8 possible boolean combinations in this example.
>>>>>
>>>>> s4 is only executed when each of c1/c2/c3 is false. In other words:
>>>>>
>>>>> if (c1) {s1}
>>>>> if (c2) {s2}
>>>>> if (c3) {s3}
>>>>> if (!c1 && !c2 && !c3) {s4}
>>>>>
>>>>> Assuming c1/c2/c3 are not modified by s1/s2/s3, but this is also
>>>>> partly the case with your proposal.
>>>>>
>>>>> Or maybe it can be done like this:
>>>>>
>>>>> if (c1 || c2 || c3) {
>>>>> s4
>>>>> else if (c1) {s1)
>>>>> ....
>>>>>
>>>>> The syntax will anyway need some work to tie all those case/if
>>>>> parts together (as s2 for example could contain nested versions).
>>>>>
>>>>> Or you can forget about having to create a hard-to-grasp and
>>>>> awkward- to-implement feature like this, and either use workarounds
>>>>> like my C examples, or use another approach to the problem.
>>>>>
>>>>>
>>>>>
>>>> hahaha
>>>>
>>>> lol ye use worakarounds instead of simple right solution
>>>
>>> The right solution to what problem? It took multiple posts before you
>>> even managed to explain how your proposal is supposed to behave.
>>>
>>
>> well i was surprised how slow you think it is the reason you get
>> things slow - and that s why it took multiple posts
>
> Mainly from you failing to explain? You wrote comments like this:
>
> "this wouldnt work imo as far as im aware becouse this last else dont
> work on "group'"
>
> IMO? It either works or it doesn't, and if not, explain why 'or' was not
> just an alias for 'else'.
>
i was already talked on it how many times i need to repeat it you think
if you personally take it a hundred times you think i need to reperat it
100 times ?
else dont work becouse you dont need a group else this is else who woork on
som elogical expresion on group of ifs
"a else {}" work on sole a (where a is "if () {}"
you need else who works on group of ifs tied with thse logicel operators
( if() {} or if() {} and if() {} ) else {}
this else work on group and in case of implementing some things properly
you need such group else
instead of else you can also have some other keywords
i mean of group produce binary logical value then two will
suffice (than and else) but you evetually also not use logical operators
and and r but use some more keywords alternatively
if if if if if all {}
if if if if if none {} //none works here as this ors and group else
whats the point of me getteing to those various conclusions - point is
so called "science"... thiose various conclusion make some deeper view
on language specifficely on what i call deeper C
i may say its generally surprising some people dont underrstand many
things here such bad.. but what people understand is somewhat side
thing, sine specialised content shallow group of people understoods
as i said i got no time to explain things you specifically dont
understand for hours - i can explain it to you by putting one post or
two but answering if for hours a day is too much
>> and i make laugh becouse its funny how some slowly take some things
>> and how bad answer thay give - its kinda laughable
>
> Well, this is the thing: given a well-specified, well-thought-out
> feature, I can probably implement it in one of my compilers within a day.
>
> That can serve as a proof-of-concept, and can be used to see how well it
> stands up and how useful it actually is.
>
> This one wouldn't pass that bar. But also, I've not convinced that you
> put much thought into it. If I implemented it, you'd change your mind
> about it, or add new twists, or get bored and think up something else.
>
> It would be a waste of time.
>
> So what's the purpose of these hundreds of wacky, random ideas: do you
> expect someone else to implement them for you? If so, in which language?
>
> Today was a bit of fun, but I can't take your ideas seriously.
>
Re: Taming The Switch-Statement
Author: fir
Date: Mon, 26 Oct 2026 21:40
Date: Mon, 26 Oct 2026 21:40
12 lines
2150 bytes
2150 bytes
bartc pisze:
> Today was a bit of fun, but I can't take your ideas seriously.
definitely was not it was boring and a time waste ..i could do much
btter things
escept maybe cooking this example with if {} or if {} else {}
this example is good as its small and shows the lacks of ifs and elses
logic in c (so its quite otable example)
but besides that it was timewaste
Re: Taming The Switch-Statement
Author: Chris M. Thomasson
Date: Mon, 26 Oct 2026 21:43
Date: Mon, 26 Oct 2026 21:43
40 lines
2748 bytes
2748 bytes
On 10/26/2026 2:11 PM, bartc wrote:
> On 26/10/2026 20:32, fir wrote:
>> bartc pisze:
>
>>> OK, try a simple experiment: convert some code using your 'or'
>>> keyword to regular C syntax and post it here. Preferably on a real
>>> example.
>>>
>>
>> you cant properly convert this or/and groups to c in good way becouse
>> there is flaw in c you cannot express all needed combinations
>> generally with sole if 's and else's
>>
>> as was showed here
> There are a couple of reasons to express it in C:
>
> * To illustrate exactly how you want the semantics to work, via
> an existing language whose behaviour is well known
>
> * To highlight the problem areas
>
> For example:
>
> if (f1()) {}
> if (f2()) {}
> ...
> if (!f1() && !f2()) {}
>
> Here f1/f2 are called twice. This means making internal copies or
> setting flags.
Also, if f1 succeeds, then f2 might not have to be called at all because
it already broke the contract?
[...]
Re: Taming The Switch-Statement
Author: Chris M. Thomasson
Date: Mon, 26 Oct 2026 21:46
Date: Mon, 26 Oct 2026 21:46
15 lines
2266 bytes
2266 bytes
On 10/26/2026 2:40 PM, fir wrote:
> bartc pisze:
>> Today was a bit of fun, but I can't take your ideas seriously.
>
> definitely was not it was boring and a time waste ..i could do much
> btter things
>
> escept maybe cooking this example with if {} or if {} else {}
> this example is good as its small and shows the lacks of ifs and elses
> logic in c (so its quite otable example)
>
> but besides that it was timewaste
>
Why are you wasting your time here on comp.lang.c?
Re: Taming The Switch-Statement
Author: bartc
Date: Mon, 26 Oct 2026 21:50
Date: Mon, 26 Oct 2026 21:50
59 lines
3655 bytes
3655 bytes
On 26/10/2026 21:17, Chris M. Thomasson wrote:
> On 10/26/2026 2:11 PM, bartc wrote:
>> On 26/10/2026 20:32, fir wrote:
>>> bartc pisze:
>>
>>>> OK, try a simple experiment: convert some code using your 'or'
>>>> keyword to regular C syntax and post it here. Preferably on a real
>>>> example.
>>>>
>>>
>>> you cant properly convert this or/and groups to c in good way becouse
>>> there is flaw in c you cannot express all needed combinations
>>> generally with sole if 's and else's
>>>
>>> as was showed here
>> There are a couple of reasons to express it in C:
>>
>> * To illustrate exactly how you want the semantics to work, via
>> an existing language whose behaviour is well known
>>
>> * To highlight the problem areas
>>
>> For example:
>>
>> if (f1()) {}
>> if (f2()) {}
>> ...
>> if (!f1() && !f2()) {}
>>
>> Here f1/f2 are called twice. This means making internal copies or
>> setting flags.
>
> So you call f1 and f2, then call if (!f1() && !f2()) {}. So, that is
> your choice. Not the fault of C, right?
It's not the fault of C. But the C illustrates the logic of this new
feature: it must only call the 'else' clause when none of the conditions
are true.
But if the most direct way of expressing it has this issue, then extra
workarounds are needed, for example:
flag=1;
if f1() {flag=0;...)
if f2() {flag=0;...)
if (flag) {}
(Note the logic here is slightly different: the else block is executed
when none of the previous blocks have been entered. Because conditionals
may have different values at this point. But we don't know the proper spec.)
This actually isn't too bad, but in that case, why do we even need this
new feature?
My main problem with it is that it is unintuitive and that its use-cases
are limited. It's also likely to morph into something else when fir gets
bored with it.
Re: Taming The Switch-Statement
Author: fir
Date: Mon, 26 Oct 2026 21:51
Date: Mon, 26 Oct 2026 21:51
123 lines
5962 bytes
5962 bytes
bartc pisze:
> On 26/10/2026 20:13, fir wrote:
>> bartc pisze:
>>> On 26/10/2026 19:39, fir wrote:
>>>> bartc pisze:
>>>
>>>>>> 1 no divides (by 2 or 3)
>>>>>> 2 divides by 2
>>>>>> 3 divides by 3
>>>>>> 4 divides by 2
>>>>>> 5 no divides (by 2 or 3)
>>>>>> 6 divides by 2
>>>>>> 6 divides by 3
>>>>>> 7 no divides (by 2 or 3)
>>>>>> 8 divides by 2
>>>>>> 9 divides by 3
>>>>>> 10 divides by 2
>>>>>> 11 no divides (by 2 or 3)
>>>>>> 12 divides by 2
>>>>>> 12 divides by 3
>>>>>> 13 no divides (by 2 or 3)
>>>>>> 14 divides by 2
>>>>>> 15 divides by 3
>>>>>> 16 divides by 2
>>>>>> 17 no divides (by 2 or 3)
>>>>>> 18 divides by 2
>>>>>> 18 divides by 3
>>>>>> 19 no divides (by 2 or 3)
>>>>>
>>>>> OK, thanks. So the pattern you're talking about is this:
>>>>>
>>>>> case (c1) {s1}
>>>>> case (c2) {s2}
>>>>> case (c3) {s3}
>>>>> else {s4}
>>>>>
>>>>> where each of s1/s2/s3 is executed if the corresponding c1/c2/c3 is
>>>>> true, independently of the others. At least one statement will be
>>>>> executed in 7 of the 8 possible boolean combinations in this example.
>>>>>
>>>>> s4 is only executed when each of c1/c2/c3 is false. In other words:
>>>>>
>>>>> if (c1) {s1}
>>>>> if (c2) {s2}
>>>>> if (c3) {s3}
>>>>> if (!c1 && !c2 && !c3) {s4}
>>>>>
>>>>> Assuming c1/c2/c3 are not modified by s1/s2/s3, but this is also
>>>>> partly the case with your proposal.
>>>>>
>>>>> Or maybe it can be done like this:
>>>>>
>>>>> if (c1 || c2 || c3) {
>>>>> s4
>>>>> else if (c1) {s1)
>>>>> ....
>>>>>
>>>>> The syntax will anyway need some work to tie all those case/if
>>>>> parts together (as s2 for example could contain nested versions).
>>>>>
>>>>> Or you can forget about having to create a hard-to-grasp and
>>>>> awkward- to-implement feature like this, and either use workarounds
>>>>> like my C examples, or use another approach to the problem.
>>>>>
>>>>>
>>>>>
>>>> hahaha
>>>>
>>>> lol ye use worakarounds instead of simple right solution
>>>
>>> The right solution to what problem? It took multiple posts before you
>>> even managed to explain how your proposal is supposed to behave.
>>>
>>
>> well i was surprised how slow you think it is the reason you get
>> things slow - and that s why it took multiple posts
>
> Mainly from you failing to explain? You wrote comments like this:
>
> "this wouldnt work imo as far as im aware becouse this last else dont
> work on "group'"
>
> IMO? It either works or it doesn't, and if not, explain why 'or' was not
> just an alias for 'else'.
>
>> and i make laugh becouse its funny how some slowly take some things
>> and how bad answer thay give - its kinda laughable
>
> Well, this is the thing: given a well-specified, well-thought-out
> feature, I can probably implement it in one of my compilers within a day.
>
> That can serve as a proof-of-concept, and can be used to see how well it
> stands up and how useful it actually is.
>
> This one wouldn't pass that bar. But also, I've not convinced that you
> put much thought into it. If I implemented it, you'd change your mind
> about it, or add new twists, or get bored and think up something else.
>
> It would be a waste of time.
>
> So what's the purpose of these hundreds of wacky, random ideas: do you
> expect someone else to implement them for you? If so, in which language?
>
> Today was a bit of fun, but I can't take your ideas seriously.
>
implementation is not so much importand..as i said more than once here
the implementation is far easier that obtaining some of the observations
and conclusions
do make some implementation one nedd to do a dose of relatively shallow
work (not totally as imlementation also has its depth) but to go to
some conclusion imo needs more deep and open work
thse ideas are also not random
for example noticing that if else sytem in c is generally flawed
is quite notable..i wouldnt say its random idea
overally c as language some could say is drafted with a hundreds of
random ideas (in such sense of random)
Re: Taming The Switch-Statement
Author: bartc
Date: Mon, 26 Oct 2026 21:55
Date: Mon, 26 Oct 2026 21:55
43 lines
3083 bytes
3083 bytes
On 26/10/2026 21:43, Chris M. Thomasson wrote:
> On 10/26/2026 2:11 PM, bartc wrote:
>> On 26/10/2026 20:32, fir wrote:
>>> bartc pisze:
>>
>>>> OK, try a simple experiment: convert some code using your 'or'
>>>> keyword to regular C syntax and post it here. Preferably on a real
>>>> example.
>>>>
>>>
>>> you cant properly convert this or/and groups to c in good way becouse
>>> there is flaw in c you cannot express all needed combinations
>>> generally with sole if 's and else's
>>>
>>> as was showed here
>> There are a couple of reasons to express it in C:
>>
>> * To illustrate exactly how you want the semantics to work, via
>> an existing language whose behaviour is well known
>>
>> * To highlight the problem areas
>>
>> For example:
>>
>> if (f1()) {}
>> if (f2()) {}
>> ...
>
>
>
>
>> if (!f1() && !f2()) {}
>>
>> Here f1/f2 are called twice. This means making internal copies or
>> setting flags.
> Also, if f1 succeeds, then f2 might not have to be called at all because
> it already broke the contract?
No, the 'if f2(){}' line must be executed whether f1() was true or also.
As I understand the feature: they are independent conditional blocks.
But the final else{} must be executed if all were false.
I think if you have to explain it, then it's a bad sign!
Re: Taming The Switch-Statement
Author: Chris M. Thomasson
Date: Mon, 26 Oct 2026 22:01
Date: Mon, 26 Oct 2026 22:01
48 lines
3343 bytes
3343 bytes
On 10/26/2026 2:55 PM, bartc wrote:
> On 26/10/2026 21:43, Chris M. Thomasson wrote:
>> On 10/26/2026 2:11 PM, bartc wrote:
>>> On 26/10/2026 20:32, fir wrote:
>>>> bartc pisze:
>>>
>>>>> OK, try a simple experiment: convert some code using your 'or'
>>>>> keyword to regular C syntax and post it here. Preferably on a real
>>>>> example.
>>>>>
>>>>
>>>> you cant properly convert this or/and groups to c in good way
>>>> becouse there is flaw in c you cannot express all needed
>>>> combinations generally with sole if 's and else's
>>>>
>>>> as was showed here
>>> There are a couple of reasons to express it in C:
>>>
>>> * To illustrate exactly how you want the semantics to work, via
>>> an existing language whose behaviour is well known
>>>
>>> * To highlight the problem areas
>>>
>>> For example:
>>>
>>> if (f1()) {}
>>> if (f2()) {}
>>> ...
>>
>>
>>
>>
>>> if (!f1() && !f2()) {}
>>>
>>> Here f1/f2 are called twice. This means making internal copies or
>>> setting flags.
>> Also, if f1 succeeds, then f2 might not have to be called at all
>> because it already broke the contract?
> No, the 'if f2(){}' line must be executed whether f1() was true or also.
>
> As I understand the feature: they are independent conditional blocks.
> But the final else{} must be executed if all were false.
>
> I think if you have to explain it, then it's a bad sign!
Oh shit. I was isolating the following line, not the two previous calls:
if (!f1() && !f2()) {}
Re: Taming The Switch-Statement
Author: David Brown
Date: Mon, 26 Oct 2026 22:37
Date: Mon, 26 Oct 2026 22:37
79 lines
4349 bytes
4349 bytes
On 26/10/2026 22:50, bartc wrote:
> On 26/10/2026 21:17, Chris M. Thomasson wrote:
>> On 10/26/2026 2:11 PM, bartc wrote:
>>> On 26/10/2026 20:32, fir wrote:
>>>> bartc pisze:
>>>
>>>>> OK, try a simple experiment: convert some code using your 'or'
>>>>> keyword to regular C syntax and post it here. Preferably on a real
>>>>> example.
>>>>>
>>>>
>>>> you cant properly convert this or/and groups to c in good way
>>>> becouse there is flaw in c you cannot express all needed
>>>> combinations generally with sole if 's and else's
>>>>
>>>> as was showed here
>>> There are a couple of reasons to express it in C:
>>>
>>> * To illustrate exactly how you want the semantics to work, via
>>> an existing language whose behaviour is well known
>>>
>>> * To highlight the problem areas
>>>
>>> For example:
>>>
>>> if (f1()) {}
>>> if (f2()) {}
>>> ...
>>> if (!f1() && !f2()) {}
>>>
>>> Here f1/f2 are called twice. This means making internal copies or
>>> setting flags.
>>
>> So you call f1 and f2, then call if (!f1() && !f2()) {}. So, that is
>> your choice. Not the fault of C, right?
>
> It's not the fault of C. But the C illustrates the logic of this new
> feature: it must only call the 'else' clause when none of the conditions
> are true.
>
> But if the most direct way of expressing it has this issue, then extra
> workarounds are needed, for example:
>
> flag=1;
> if f1() {flag=0;...)
> if f2() {flag=0;...)
> if (flag) {}
>
> (Note the logic here is slightly different: the else block is executed
> when none of the previous blocks have been entered. Because conditionals
> may have different values at this point. But we don't know the proper
> spec.)
>
> This actually isn't too bad, but in that case, why do we even need this
> new feature?
>
> My main problem with it is that it is unintuitive and that its use-cases
> are limited. It's also likely to morph into something else when fir gets
> bored with it.
>
>
#define fir_switch _Bool flag = 1; {
#define or_if(...) } if (__VA_ARGS__) { flag = 0;
#define otherwise } if (!flag)
Then Fir can write :
fir_switch
or_if (x % 2 == 0) printf("\n divides by 2");
or_if (x % 3 == 0) printf("\n divides by 3");
otherwise printf("\n does not divide by 2 or 3");
I haven't tested the defines, and I think it is a terrible idea (it
should at least be called "and_if"), but it comes very close to the
syntax and semantics Fir appears to want.
Re: Taming The Switch-Statement
Author: fir
Date: Mon, 26 Oct 2026 23:01
Date: Mon, 26 Oct 2026 23:01
125 lines
5716 bytes
5716 bytes
David Brown pisze:
> On 26/10/2026 22:50, bartc wrote:
>> On 26/10/2026 21:17, Chris M. Thomasson wrote:
>>> On 10/26/2026 2:11 PM, bartc wrote:
>>>> On 26/10/2026 20:32, fir wrote:
>>>>> bartc pisze:
>>>>
>>>>>> OK, try a simple experiment: convert some code using your 'or'
>>>>>> keyword to regular C syntax and post it here. Preferably on a real
>>>>>> example.
>>>>>>
>>>>>
>>>>> you cant properly convert this or/and groups to c in good way
>>>>> becouse there is flaw in c you cannot express all needed
>>>>> combinations generally with sole if 's and else's
>>>>>
>>>>> as was showed here
>>>> There are a couple of reasons to express it in C:
>>>>
>>>> * To illustrate exactly how you want the semantics to work, via
>>>> an existing language whose behaviour is well known
>>>>
>>>> * To highlight the problem areas
>>>>
>>>> For example:
>>>>
>>>> if (f1()) {}
>>>> if (f2()) {}
>>>> ...
>>>> if (!f1() && !f2()) {}
>>>>
>>>> Here f1/f2 are called twice. This means making internal copies or
>>>> setting flags.
>>>
>>> So you call f1 and f2, then call if (!f1() && !f2()) {}. So, that is
>>> your choice. Not the fault of C, right?
>>
>> It's not the fault of C. But the C illustrates the logic of this new
>> feature: it must only call the 'else' clause when none of the
>> conditions are true.
>>
>> But if the most direct way of expressing it has this issue, then extra
>> workarounds are needed, for example:
>>
>> flag=1;
>> if f1() {flag=0;...)
>> if f2() {flag=0;...)
>> if (flag) {}
>>
>> (Note the logic here is slightly different: the else block is executed
>> when none of the previous blocks have been entered. Because
>> conditionals may have different values at this point. But we don't
>> know the proper spec.)
>>
>> This actually isn't too bad, but in that case, why do we even need
>> this new feature?
>>
>> My main problem with it is that it is unintuitive and that its
>> use-cases are limited. It's also likely to morph into something else
>> when fir gets bored with it.
>>
>>
>
> #define fir_switch _Bool flag = 1; {
> #define or_if(...) } if (__VA_ARGS__) { flag = 0;
> #define otherwise } if (!flag)
>
> Then Fir can write :
>
> fir_switch
> or_if (x % 2 == 0) printf("\n divides by 2");
> or_if (x % 3 == 0) printf("\n divides by 3");
> otherwise printf("\n does not divide by 2 or 3");
>
> I haven't tested the defines, and I think it is a terrible idea (it
> should at least be called "and_if"), but it comes very close to the
> syntax and semantics Fir appears to want.
>
>
totally no, its not also i want this i just makec conclusion if-else
system is flawed
you may ment it on some ways lik
if {}
or
if {}
else {}
or
case {}
case {}
otherwise {}
in first case you got heneral system of logic operators applied to group
of ifs (coz you may use not olny or but also and or not etc),
in second you got like predefined keywords for "or or or" case
(here in fact otherwise keyword means use or for cases and of 0
evaluate otherwise)
i thing you will nned a general but predefined may be also handy so
eventually language could implement both (such as it has many forms for
loops to increase intentions readability)
flag is a nonsense its liek implementing else with flag
int not = 1;
if (a>2) {not =0; //...}
if(not) {}
;C
NOTE btw this case not only shows flaw in if rlse system but is just
natural fom of switch (both of them i mean "if or if else" and "case
case otherwise"..and imo thsi form is better than switch as its more
natural its grounded -its also shows lacks of switch so it shows both
if-else system is flawed and switch is flawed too
Re: Taming The Switch-Statement
Author: fir
Date: Mon, 26 Oct 2026 23:28
Date: Mon, 26 Oct 2026 23:28
207 lines
7098 bytes
7098 bytes
fir pisze:
> David Brown pisze:
>> On 26/10/2026 22:50, bartc wrote:
>>> On 26/10/2026 21:17, Chris M. Thomasson wrote:
>>>> On 10/26/2026 2:11 PM, bartc wrote:
>>>>> On 26/10/2026 20:32, fir wrote:
>>>>>> bartc pisze:
>>>>>
>>>>>>> OK, try a simple experiment: convert some code using your 'or'
>>>>>>> keyword to regular C syntax and post it here. Preferably on a
>>>>>>> real example.
>>>>>>>
>>>>>>
>>>>>> you cant properly convert this or/and groups to c in good way
>>>>>> becouse there is flaw in c you cannot express all needed
>>>>>> combinations generally with sole if 's and else's
>>>>>>
>>>>>> as was showed here
>>>>> There are a couple of reasons to express it in C:
>>>>>
>>>>> * To illustrate exactly how you want the semantics to work, via
>>>>> an existing language whose behaviour is well known
>>>>>
>>>>> * To highlight the problem areas
>>>>>
>>>>> For example:
>>>>>
>>>>> if (f1()) {}
>>>>> if (f2()) {}
>>>>> ...
>>>>> if (!f1() && !f2()) {}
>>>>>
>>>>> Here f1/f2 are called twice. This means making internal copies or
>>>>> setting flags.
>>>>
>>>> So you call f1 and f2, then call if (!f1() && !f2()) {}. So, that is
>>>> your choice. Not the fault of C, right?
>>>
>>> It's not the fault of C. But the C illustrates the logic of this new
>>> feature: it must only call the 'else' clause when none of the
>>> conditions are true.
>>>
>>> But if the most direct way of expressing it has this issue, then
>>> extra workarounds are needed, for example:
>>>
>>> flag=1;
>>> if f1() {flag=0;...)
>>> if f2() {flag=0;...)
>>> if (flag) {}
>>>
>>> (Note the logic here is slightly different: the else block is
>>> executed when none of the previous blocks have been entered. Because
>>> conditionals may have different values at this point. But we don't
>>> know the proper spec.)
>>>
>>> This actually isn't too bad, but in that case, why do we even need
>>> this new feature?
>>>
>>> My main problem with it is that it is unintuitive and that its
>>> use-cases are limited. It's also likely to morph into something else
>>> when fir gets bored with it.
>>>
>>>
>>
>> #define fir_switch _Bool flag = 1; {
>> #define or_if(...) } if (__VA_ARGS__) { flag = 0;
>> #define otherwise } if (!flag)
>>
>> Then Fir can write :
>>
>> fir_switch
>> or_if (x % 2 == 0) printf("\n divides by 2");
>> or_if (x % 3 == 0) printf("\n divides by 3");
>> otherwise printf("\n does not divide by 2 or 3");
>>
>> I haven't tested the defines, and I think it is a terrible idea (it
>> should at least be called "and_if"), but it comes very close to the
>> syntax and semantics Fir appears to want.
>>
>>
>
> totally no, its not also i want this i just makec conclusion if-else
> system is flawed
>
> you may ment it on some ways lik
>
> if {}
> or
> if {}
> else {}
>
> or
>
> case {}
> case {}
> otherwise {}
>
> in first case you got heneral system of logic operators applied to group
> of ifs (coz you may use not olny or but also and or not etc),
>
> in second you got like predefined keywords for "or or or" case
> (here in fact otherwise keyword means use or for cases and of 0
> evaluate otherwise)
>
> i thing you will nned a general but predefined may be also handy so
> eventually language could implement both (such as it has many forms for
> loops to increase intentions readability)
>
>
> flag is a nonsense its liek implementing else with flag
>
> int not = 1;
>
> if (a>2) {not =0; //...}
> if(not) {}
>
> ;C
>
> NOTE btw this case not only shows flaw in if rlse system but is just
> natural fom of switch (both of them i mean "if or if else" and "case
> case otherwise"..and imo thsi form is better than switch as its more
> natural its grounded -its also shows lacks of switch so it shows both
> if-else system is flawed and switch is flawed too
>
overally switch in c imo is in fact quite like goto not like if
but even if so its not general as it should bcouse if so then you should
also be jumping back
switch n //goto 1 2 3 if other goto default
case 1:
case 2:
case 4:
default:
//if so it should allow amany switches and jumps back
int s =1;
case 2:
switch s
case 1:
int b =2
case 3:
case 4:
switch b
case 5:
such switch i would more like as its much ore logical and right
but if so switch sjould be eventually named goto
(eventually goto() to make difference withh jumping under labe a and
value of (a) (though it also may staj switch for illustration here) and
case may be removed, defaul should be ranemed by other which more fits
the meaning
foo()
{
int s =1;
2:
switch s
1:
int b =2
3:
4:
switch b
other:
}
it illustrates soe things, like this c swich syntax should be
switch s;
1:
2:
3:
other:
break is not a part of it indeed it just is to make jump outside a block
*could eventually be also continue
if so some could at block at free will
switch s;
1: {2:
3: break;
other: continue; }
Re: Taming The Switch-Statement
Author: fir
Date: Mon, 26 Oct 2026 23:55
Date: Mon, 26 Oct 2026 23:55
154 lines
6582 bytes
6582 bytes
fir pisze:
> David Brown pisze:
>> On 26/10/2026 22:50, bartc wrote:
>>> On 26/10/2026 21:17, Chris M. Thomasson wrote:
>>>> On 10/26/2026 2:11 PM, bartc wrote:
>>>>> On 26/10/2026 20:32, fir wrote:
>>>>>> bartc pisze:
>>>>>
>>>>>>> OK, try a simple experiment: convert some code using your 'or'
>>>>>>> keyword to regular C syntax and post it here. Preferably on a
>>>>>>> real example.
>>>>>>>
>>>>>>
>>>>>> you cant properly convert this or/and groups to c in good way
>>>>>> becouse there is flaw in c you cannot express all needed
>>>>>> combinations generally with sole if 's and else's
>>>>>>
>>>>>> as was showed here
>>>>> There are a couple of reasons to express it in C:
>>>>>
>>>>> * To illustrate exactly how you want the semantics to work, via
>>>>> an existing language whose behaviour is well known
>>>>>
>>>>> * To highlight the problem areas
>>>>>
>>>>> For example:
>>>>>
>>>>> if (f1()) {}
>>>>> if (f2()) {}
>>>>> ...
>>>>> if (!f1() && !f2()) {}
>>>>>
>>>>> Here f1/f2 are called twice. This means making internal copies or
>>>>> setting flags.
>>>>
>>>> So you call f1 and f2, then call if (!f1() && !f2()) {}. So, that is
>>>> your choice. Not the fault of C, right?
>>>
>>> It's not the fault of C. But the C illustrates the logic of this new
>>> feature: it must only call the 'else' clause when none of the
>>> conditions are true.
>>>
>>> But if the most direct way of expressing it has this issue, then
>>> extra workarounds are needed, for example:
>>>
>>> flag=1;
>>> if f1() {flag=0;...)
>>> if f2() {flag=0;...)
>>> if (flag) {}
>>>
>>> (Note the logic here is slightly different: the else block is
>>> executed when none of the previous blocks have been entered. Because
>>> conditionals may have different values at this point. But we don't
>>> know the proper spec.)
>>>
>>> This actually isn't too bad, but in that case, why do we even need
>>> this new feature?
>>>
>>> My main problem with it is that it is unintuitive and that its
>>> use-cases are limited. It's also likely to morph into something else
>>> when fir gets bored with it.
>>>
>>>
>>
>> #define fir_switch _Bool flag = 1; {
>> #define or_if(...) } if (__VA_ARGS__) { flag = 0;
>> #define otherwise } if (!flag)
>>
>> Then Fir can write :
>>
>> fir_switch
>> or_if (x % 2 == 0) printf("\n divides by 2");
>> or_if (x % 3 == 0) printf("\n divides by 3");
>> otherwise printf("\n does not divide by 2 or 3");
>>
>> I haven't tested the defines, and I think it is a terrible idea (it
>> should at least be called "and_if"), but it comes very close to the
>> syntax and semantics Fir appears to want.
>>
>>
>
> totally no, its not also i want this i just makec conclusion if-else
> system is flawed
>
> you may ment it on some ways lik
>
> if {}
> or
> if {}
> else {}
>
> or
>
> case {}
> case {}
> otherwise {}
>
> in first case you got heneral system of logic operators applied to group
> of ifs (coz you may use not olny or but also and or not etc),
>
> in second you got like predefined keywords for "or or or" case
> (here in fact otherwise keyword means use or for cases and of 0
> evaluate otherwise)
>
> i thing you will nned a general but predefined may be also handy so
> eventually language could implement both (such as it has many forms for
> loops to increase intentions readability)
>
>
> flag is a nonsense its liek implementing else with flag
>
> int not = 1;
>
> if (a>2) {not =0; //...}
> if(not) {}
>
> ;C
>
> NOTE btw this case not only shows flaw in if rlse system but is just
> natural fom of switch (both of them i mean "if or if else" and "case
> case otherwise"..and imo thsi form is better than switch as its more
> natural its grounded -its also shows lacks of switch so it shows both
> if-else system is flawed and switch is flawed too
>
>
>
btw example for and
if(x>0) printf("right"); and if(x<w) printf("left"); else printf("
outside");
this if im not wrong will print
"right"
"right outside"
"left"
"left outside"
"right left"
if im not wrong also this you will not whow with normal if elses
of witch c switch wiyhout more complex code
(i not checked it though)
if so it just shows that small additions of or and and genarating that
usecases justify those additions and its omitions are kinda flaw in if
else system
you may rarely need that but there are cases when you may need that
so the lack of it its arrtificial (as if-else is not complete)
Re: Taming The Switch-Statement
Author: bartc
Date: Tue, 27 Oct 2026 01:12
Date: Tue, 27 Oct 2026 01:12
81 lines
4700 bytes
4700 bytes
On 26/10/2026 22:37, David Brown wrote:
> On 26/10/2026 22:50, bartc wrote:
>> On 26/10/2026 21:17, Chris M. Thomasson wrote:
>>> On 10/26/2026 2:11 PM, bartc wrote:
>>>> On 26/10/2026 20:32, fir wrote:
>>>>> bartc pisze:
>>>>
>>>>>> OK, try a simple experiment: convert some code using your 'or'
>>>>>> keyword to regular C syntax and post it here. Preferably on a real
>>>>>> example.
>>>>>>
>>>>>
>>>>> you cant properly convert this or/and groups to c in good way
>>>>> becouse there is flaw in c you cannot express all needed
>>>>> combinations generally with sole if 's and else's
>>>>>
>>>>> as was showed here
>>>> There are a couple of reasons to express it in C:
>>>>
>>>> * To illustrate exactly how you want the semantics to work, via
>>>> an existing language whose behaviour is well known
>>>>
>>>> * To highlight the problem areas
>>>>
>>>> For example:
>>>>
>>>> if (f1()) {}
>>>> if (f2()) {}
>>>> ...
>>>> if (!f1() && !f2()) {}
>>>>
>>>> Here f1/f2 are called twice. This means making internal copies or
>>>> setting flags.
>>>
>>> So you call f1 and f2, then call if (!f1() && !f2()) {}. So, that is
>>> your choice. Not the fault of C, right?
>>
>> It's not the fault of C. But the C illustrates the logic of this new
>> feature: it must only call the 'else' clause when none of the
>> conditions are true.
>>
>> But if the most direct way of expressing it has this issue, then extra
>> workarounds are needed, for example:
>>
>> flag=1;
>> if f1() {flag=0;...)
>> if f2() {flag=0;...)
>> if (flag) {}
>>
>> (Note the logic here is slightly different: the else block is executed
>> when none of the previous blocks have been entered. Because
>> conditionals may have different values at this point. But we don't
>> know the proper spec.)
>>
>> This actually isn't too bad, but in that case, why do we even need
>> this new feature?
>>
>> My main problem with it is that it is unintuitive and that its use-
>> cases are limited. It's also likely to morph into something else when
>> fir gets bored with it.
>>
>>
>
> #define fir_switch _Bool flag = 1; {
> #define or_if(...) } if (__VA_ARGS__) { flag = 0;
> #define otherwise } if (!flag)
>
> Then Fir can write :
>
> fir_switch
> or_if (x % 2 == 0) printf("\n divides by 2");
> or_if (x % 3 == 0) printf("\n divides by 3");
> otherwise printf("\n does not divide by 2 or 3");
>
> I haven't tested the defines, and I think it is a terrible idea (it
> should at least be called "and_if"), but it comes very close to the
> syntax and semantics Fir appears to want.
It looks pretty good and it seems to work (the !flag needs the reverse
logic). The 'and_if' makes more sense too.
But of course it's not good enough for fir; there's always something.
Re: Taming The Switch-Statement
Author: Chris M. Thomasson
Date: Tue, 27 Oct 2026 01:43
Date: Tue, 27 Oct 2026 01:43
86 lines
4976 bytes
4976 bytes
On 10/26/2026 6:12 PM, bartc wrote:
> On 26/10/2026 22:37, David Brown wrote:
>> On 26/10/2026 22:50, bartc wrote:
>>> On 26/10/2026 21:17, Chris M. Thomasson wrote:
>>>> On 10/26/2026 2:11 PM, bartc wrote:
>>>>> On 26/10/2026 20:32, fir wrote:
>>>>>> bartc pisze:
>>>>>
>>>>>>> OK, try a simple experiment: convert some code using your 'or'
>>>>>>> keyword to regular C syntax and post it here. Preferably on a
>>>>>>> real example.
>>>>>>>
>>>>>>
>>>>>> you cant properly convert this or/and groups to c in good way
>>>>>> becouse there is flaw in c you cannot express all needed
>>>>>> combinations generally with sole if 's and else's
>>>>>>
>>>>>> as was showed here
>>>>> There are a couple of reasons to express it in C:
>>>>>
>>>>> * To illustrate exactly how you want the semantics to work, via
>>>>> an existing language whose behaviour is well known
>>>>>
>>>>> * To highlight the problem areas
>>>>>
>>>>> For example:
>>>>>
>>>>> if (f1()) {}
>>>>> if (f2()) {}
>>>>> ...
>>>>> if (!f1() && !f2()) {}
>>>>>
>>>>> Here f1/f2 are called twice. This means making internal copies or
>>>>> setting flags.
>>>>
>>>> So you call f1 and f2, then call if (!f1() && !f2()) {}. So, that is
>>>> your choice. Not the fault of C, right?
>>>
>>> It's not the fault of C. But the C illustrates the logic of this new
>>> feature: it must only call the 'else' clause when none of the
>>> conditions are true.
>>>
>>> But if the most direct way of expressing it has this issue, then
>>> extra workarounds are needed, for example:
>>>
>>> flag=1;
>>> if f1() {flag=0;...)
>>> if f2() {flag=0;...)
>>> if (flag) {}
>>>
>>> (Note the logic here is slightly different: the else block is
>>> executed when none of the previous blocks have been entered. Because
>>> conditionals may have different values at this point. But we don't
>>> know the proper spec.)
>>>
>>> This actually isn't too bad, but in that case, why do we even need
>>> this new feature?
>>>
>>> My main problem with it is that it is unintuitive and that its use-
>>> cases are limited. It's also likely to morph into something else when
>>> fir gets bored with it.
>>>
>>>
>>
>> #define fir_switch _Bool flag = 1; {
>> #define or_if(...) } if (__VA_ARGS__) { flag = 0;
>> #define otherwise } if (!flag)
>>
>> Then Fir can write :
>>
>> fir_switch
>> or_if (x % 2 == 0) printf("\n divides by 2");
>> or_if (x % 3 == 0) printf("\n divides by 3");
>> otherwise printf("\n does not divide by 2 or 3");
>>
>> I haven't tested the defines, and I think it is a terrible idea (it
>> should at least be called "and_if"), but it comes very close to the
>> syntax and semantics Fir appears to want.
> It looks pretty good and it seems to work (the !flag needs the reverse
> logic). The 'and_if' makes more sense too.
>
> But of course it's not good enough for fir; there's always something.
The never ending story?
https://youtu.be/lHytjEj7B9g?list=RDlHytjEj7B9g
Re: Taming The Switch-Statement
Author: fir
Date: Tue, 27 Oct 2026 08:37
Date: Tue, 27 Oct 2026 08:37
87 lines
5093 bytes
5093 bytes
bartc pisze:
> On 26/10/2026 22:37, David Brown wrote:
>> On 26/10/2026 22:50, bartc wrote:
>>> On 26/10/2026 21:17, Chris M. Thomasson wrote:
>>>> On 10/26/2026 2:11 PM, bartc wrote:
>>>>> On 26/10/2026 20:32, fir wrote:
>>>>>> bartc pisze:
>>>>>
>>>>>>> OK, try a simple experiment: convert some code using your 'or'
>>>>>>> keyword to regular C syntax and post it here. Preferably on a
>>>>>>> real example.
>>>>>>>
>>>>>>
>>>>>> you cant properly convert this or/and groups to c in good way
>>>>>> becouse there is flaw in c you cannot express all needed
>>>>>> combinations generally with sole if 's and else's
>>>>>>
>>>>>> as was showed here
>>>>> There are a couple of reasons to express it in C:
>>>>>
>>>>> * To illustrate exactly how you want the semantics to work, via
>>>>> an existing language whose behaviour is well known
>>>>>
>>>>> * To highlight the problem areas
>>>>>
>>>>> For example:
>>>>>
>>>>> if (f1()) {}
>>>>> if (f2()) {}
>>>>> ...
>>>>> if (!f1() && !f2()) {}
>>>>>
>>>>> Here f1/f2 are called twice. This means making internal copies or
>>>>> setting flags.
>>>>
>>>> So you call f1 and f2, then call if (!f1() && !f2()) {}. So, that is
>>>> your choice. Not the fault of C, right?
>>>
>>> It's not the fault of C. But the C illustrates the logic of this new
>>> feature: it must only call the 'else' clause when none of the
>>> conditions are true.
>>>
>>> But if the most direct way of expressing it has this issue, then
>>> extra workarounds are needed, for example:
>>>
>>> flag=1;
>>> if f1() {flag=0;...)
>>> if f2() {flag=0;...)
>>> if (flag) {}
>>>
>>> (Note the logic here is slightly different: the else block is
>>> executed when none of the previous blocks have been entered. Because
>>> conditionals may have different values at this point. But we don't
>>> know the proper spec.)
>>>
>>> This actually isn't too bad, but in that case, why do we even need
>>> this new feature?
>>>
>>> My main problem with it is that it is unintuitive and that its use-
>>> cases are limited. It's also likely to morph into something else when
>>> fir gets bored with it.
>>>
>>>
>>
>> #define fir_switch _Bool flag = 1; {
>> #define or_if(...) } if (__VA_ARGS__) { flag = 0;
>> #define otherwise } if (!flag)
>>
>> Then Fir can write :
>>
>> fir_switch
>> or_if (x % 2 == 0) printf("\n divides by 2");
>> or_if (x % 3 == 0) printf("\n divides by 3");
>> otherwise printf("\n does not divide by 2 or 3");
>>
>> I haven't tested the defines, and I think it is a terrible idea (it
>> should at least be called "and_if"), but it comes very close to the
>> syntax and semantics Fir appears to want.
> It looks pretty good and it seems to work (the !flag needs the reverse
> logic). The 'and_if' makes more sense too.
>
> But of course it's not good enough for fir; there's always something.
blame the scienco fo doing just like tat
(one solution is a solution untill you find better one) ..im just doing
science here so its science to blame, i got no problem with that
Re: Taming The Switch-Statement
Author: fir
Date: Tue, 27 Oct 2026 08:50
Date: Tue, 27 Oct 2026 08:50
38 lines
2570 bytes
2570 bytes
fir pisze:
> if(x>0) printf("right"); and if(x<w) printf("left"); else printf("
> outside");
this shows bytw one thing
such things as
if(x>0 and x<w) inside() else outside()
are limited becouse this reduces whole expresion in clase to one binary
so if you use such conventions as
if(x>0) and if(x<w)
of
if(x>0, x<w)
you gave more options to define predefined keywords like all/none/some/one
or even some my write its own function though as the function also
reduces it is then not possible in such case to do
if(x>0, x<w) all {} none {} some {}
it is add more branches at once
Re: Taming The Switch-Statement
Author: fir
Date: Tue, 27 Oct 2026 10:51
Date: Tue, 27 Oct 2026 10:51
30 lines
2664 bytes
2664 bytes
Chris M. Thomasson pisze:
> On 10/26/2026 2:40 PM, fir wrote:
>> bartc pisze:
>>> Today was a bit of fun, but I can't take your ideas seriously.
>>
>> definitely was not it was boring and a time waste ..i could do much
>> btter things
>>
>> escept maybe cooking this example with if {} or if {} else {}
>> this example is good as its small and shows the lacks of ifs and elses
>> logic in c (so its quite otable example)
>>
>> but besides that it was timewaste
>>
maybe to say - general discussion activity on clc is not a timewaste its
quality time (sorta)
the waste is if someone dwells into a false things about things and you
not talk abour real things but false things and soeme here
can fund you such ride
then its a timewaste
>
> Why are you wasting your time here on comp.lang.c?
Re: Taming The Switch-Statement
Author: bartc
Date: Tue, 27 Oct 2026 11:51
Date: Tue, 27 Oct 2026 11:51
46 lines
3495 bytes
3495 bytes
On 27/10/2026 08:37, fir wrote:
> bartc pisze:
>> On 26/10/2026 22:37, David Brown wrote:
>>> #define fir_switch _Bool flag = 1; {
>>> #define or_if(...) } if (__VA_ARGS__) { flag = 0;
>>> #define otherwise } if (!flag)
>>>
>>> Then Fir can write :
>>>
>>> fir_switch
>>> or_if (x % 2 == 0) printf("\n divides by 2");
>>> or_if (x % 3 == 0) printf("\n divides by 3");
>>> otherwise printf("\n does not divide by 2 or 3");
>>>
>>> I haven't tested the defines, and I think it is a terrible idea (it
>>> should at least be called "and_if"), but it comes very close to the
>>> syntax and semantics Fir appears to want.
>> It looks pretty good and it seems to work (the !flag needs the reverse
>> logic). The 'and_if' makes more sense too.
>>
>> But of course it's not good enough for fir; there's always something.
>
> blame the scienco fo doing just like tat
>
> (one solution is a solution untill you find better one) ..im just doing
> science here so its science to blame, i got no problem with that
I've no idea what you mean. And I've no idea what it is you're actually
after. I doubt anyone has. I doubt /you/ do!
You suggest some new statement type, in a C language forum, somebody
shows how to implement it in standard C, but your response is:
"blame the scienco fo doing just like tat"
Not:
"Wow, thanks! That's perfect."
My guess is that you're not interested in actual solutions. You're just
thinking up one random idea after another. You don't care for anyone
else's opinion or input.
So again, why bother posting here?
Re: Taming The Switch-Statement
Author: fir
Date: Tue, 27 Oct 2026 11:57
Date: Tue, 27 Oct 2026 11:57
62 lines
4178 bytes
4178 bytes
bartc pisze:
> On 27/10/2026 08:37, fir wrote:
>> bartc pisze:
>>> On 26/10/2026 22:37, David Brown wrote:
>
>>>> #define fir_switch _Bool flag = 1; {
>>>> #define or_if(...) } if (__VA_ARGS__) { flag = 0;
>>>> #define otherwise } if (!flag)
>>>>
>>>> Then Fir can write :
>>>>
>>>> fir_switch
>>>> or_if (x % 2 == 0) printf("\n divides by 2");
>>>> or_if (x % 3 == 0) printf("\n divides by 3");
>>>> otherwise printf("\n does not divide by 2 or 3");
>>>>
>>>> I haven't tested the defines, and I think it is a terrible idea (it
>>>> should at least be called "and_if"), but it comes very close to the
>>>> syntax and semantics Fir appears to want.
>>> It looks pretty good and it seems to work (the !flag needs the
>>> reverse logic). The 'and_if' makes more sense too.
>>>
>>> But of course it's not good enough for fir; there's always something.
>>
>> blame the scienco fo doing just like tat
>>
>> (one solution is a solution untill you find better one) ..im just
>> doing science here so its science to blame, i got no problem with that
>
> I've no idea what you mean. And I've no idea what it is you're actually
> after. I doubt anyone has. I doubt /you/ do!
>
> You suggest some new statement type, in a C language forum, somebody
> shows how to implement it in standard C, but your response is:
>
> "blame the scienco fo doing just like tat"
>
> Not:
>
> "Wow, thanks! That's perfect."
>
> My guess is that you're not interested in actual solutions. You're just
> thinking up one random idea after another. You don't care for anyone
> else's opinion or input.
>
as to ideas I got an idea. Is your goal to stir up trouble here
coz what yu say is like that and this is making bad content here
science does that science is finding a solution then it finds another
solution so you may blame science and say you got idea what science is
actually after
im just doin science - come to some conclusions than after that come to
another conclusion...
why your should problems with science should interest me? im here for
doin science not to analyse personal problems of clc users
Re: Taming The Switch-Statement
Author: fir
Date: Tue, 27 Oct 2026 12:10
Date: Tue, 27 Oct 2026 12:10
84 lines
5148 bytes
5148 bytes
fir pisze:
> bartc pisze:
>> On 27/10/2026 08:37, fir wrote:
>>> bartc pisze:
>>>> On 26/10/2026 22:37, David Brown wrote:
>>
>>>>> #define fir_switch _Bool flag = 1; {
>>>>> #define or_if(...) } if (__VA_ARGS__) { flag = 0;
>>>>> #define otherwise } if (!flag)
>>>>>
>>>>> Then Fir can write :
>>>>>
>>>>> fir_switch
>>>>> or_if (x % 2 == 0) printf("\n divides by 2");
>>>>> or_if (x % 3 == 0) printf("\n divides by 3");
>>>>> otherwise printf("\n does not divide by 2 or 3");
>>>>>
>>>>> I haven't tested the defines, and I think it is a terrible idea (it
>>>>> should at least be called "and_if"), but it comes very close to the
>>>>> syntax and semantics Fir appears to want.
>>>> It looks pretty good and it seems to work (the !flag needs the
>>>> reverse logic). The 'and_if' makes more sense too.
>>>>
>>>> But of course it's not good enough for fir; there's always something.
>>>
>>> blame the scienco fo doing just like tat
>>>
>>> (one solution is a solution untill you find better one) ..im just
>>> doing science here so its science to blame, i got no problem with that
>>
>> I've no idea what you mean. And I've no idea what it is you're
>> actually after. I doubt anyone has. I doubt /you/ do!
>>
>> You suggest some new statement type, in a C language forum, somebody
>> shows how to implement it in standard C, but your response is:
>>
>> "blame the scienco fo doing just like tat"
>>
>> Not:
>>
>> "Wow, thanks! That's perfect."
>>
>> My guess is that you're not interested in actual solutions. You're
>> just thinking up one random idea after another. You don't care for
>> anyone else's opinion or input.
>>
> as to ideas I got an idea. Is your goal to stir up trouble here
>
im not tsure as this translation - in polish it is "robić piane" (make
foam), "bić piane" (it is making nonsense fights/tryin to make nonsense
fights/rumbles) like some drunkyard in a bar
generalli is like i say sin 90 degrees is 1 and some come say "i dont
understand it!" "i sucpect your goal is bla bla bla" "i dont know what
youre after" ..."you say that but later you get bored and will go say
something other!"
its kinda limitedly preposterous and funny but if it consumes hours its
timewaste and making useles foam (over wuite scientific statements here )
youre like more interesting to make foam instead of core topics -
a bit of foam is not always something totally bad (depends) but
if it takes hours i become pity for hours wasted where i could generate
models or write some procedures or just rest
> coz what yu say is like that and this is making bad content here
>
>
> science does that science is finding a solution then it finds another
> solution so you may blame science and say you got idea what science is
> actually after
>
>
> im just doin science - come to some conclusions than after that come to
> another conclusion...
>
> why your should problems with science should interest me? im here for
> doin science not to analyse personal problems of clc users
>
>
Re: Taming The Switch-Statement
Author: bartc
Date: Tue, 27 Oct 2026 12:14
Date: Tue, 27 Oct 2026 12:14
46 lines
3661 bytes
3661 bytes
On 27/10/2026 11:57, fir wrote: > bartc pisze: >> On 27/10/2026 08:37, fir wrote: >>> blame the scienco fo doing just like tat >>> >>> (one solution is a solution untill you find better one) ..im just >>> doing science here so its science to blame, i got no problem with that >> >> I've no idea what you mean. And I've no idea what it is you're >> actually after. I doubt anyone has. I doubt /you/ do! >> >> You suggest some new statement type, in a C language forum, somebody >> shows how to implement it in standard C, but your response is: >> >> "blame the scienco fo doing just like tat" >> >> Not: >> >> "Wow, thanks! That's perfect." >> >> My guess is that you're not interested in actual solutions. You're >> just thinking up one random idea after another. You don't care for >> anyone else's opinion or input. >> > coz what yu say is like that and this is making bad content here > > > science does that science is finding a solution then it finds another > solution so you may blame science and say you got idea what science is > actually after > > > im just doin science - come to some conclusions than after that come to > another conclusion... > > why your should problems with science should interest me? im here for > doin science not to analyse personal problems of clc usersYour 'science' seems to be writing mostly meaningless drivel and then posting reams of it in comp.lang.c as though it was your personal blog. You don't seem to expect any feedback either, and tend to attack people who offer opinions or try to make sense of some of your ideas. I should have known from past experience that that never ends well. 'There's always something'.
Re: Taming The Switch-Statement
Author: fir
Date: Tue, 27 Oct 2026 12:22
Date: Tue, 27 Oct 2026 12:22
59 lines
4264 bytes
4264 bytes
bartc pisze: > On 27/10/2026 11:57, fir wrote: >> bartc pisze: >>> On 27/10/2026 08:37, fir wrote: > >>>> blame the scienco fo doing just like tat >>>> >>>> (one solution is a solution untill you find better one) ..im just >>>> doing science here so its science to blame, i got no problem with that >>> >>> I've no idea what you mean. And I've no idea what it is you're >>> actually after. I doubt anyone has. I doubt /you/ do! >>> >>> You suggest some new statement type, in a C language forum, somebody >>> shows how to implement it in standard C, but your response is: >>> >>> "blame the scienco fo doing just like tat" >>> >>> Not: >>> >>> "Wow, thanks! That's perfect." >>> >>> My guess is that you're not interested in actual solutions. You're >>> just thinking up one random idea after another. You don't care for >>> anyone else's opinion or input. >>> > >> coz what yu say is like that and this is making bad content here >> >> >> science does that science is finding a solution then it finds another >> solution so you may blame science and say you got idea what science is >> actually after >> >> >> im just doin science - come to some conclusions than after that come >> to another conclusion... >> >> why your should problems with science should interest me? im here for >> doin science not to analyse personal problems of clc usersYour >> 'science' seems to be writing mostly meaningless drivel and then > posting reams of it in comp.lang.c as though it was your personal blog. > > You don't seem to expect any feedback either, and tend to attack people > who offer opinions or try to make sense of some of your ideas. > > I should have known from past experience that that never ends well. > 'There's always something'. im not posting as personal blog and i answe a lot... the problem is you should first make soem work and understand what im talkin about and then answer it not just "i dont understand it so i will make z 10 hours of foam here" imagine what would come if anybody would start doing that agains ant book move piece of science in book etc... the amounts of foam would cover the sun :/ that would be word of foam
Re: Taming The Switch-Statement
Author: fir
Date: Tue, 27 Oct 2026 12:30
Date: Tue, 27 Oct 2026 12:30
79 lines
5160 bytes
5160 bytes
fir pisze: > bartc pisze: >> On 27/10/2026 11:57, fir wrote: >>> bartc pisze: >>>> On 27/10/2026 08:37, fir wrote: >> >>>>> blame the scienco fo doing just like tat >>>>> >>>>> (one solution is a solution untill you find better one) ..im just >>>>> doing science here so its science to blame, i got no problem with that >>>> >>>> I've no idea what you mean. And I've no idea what it is you're >>>> actually after. I doubt anyone has. I doubt /you/ do! >>>> >>>> You suggest some new statement type, in a C language forum, somebody >>>> shows how to implement it in standard C, but your response is: >>>> >>>> "blame the scienco fo doing just like tat" >>>> >>>> Not: >>>> >>>> "Wow, thanks! That's perfect." >>>> >>>> My guess is that you're not interested in actual solutions. You're >>>> just thinking up one random idea after another. You don't care for >>>> anyone else's opinion or input. >>>> >> >>> coz what yu say is like that and this is making bad content here >>> >>> >>> science does that science is finding a solution then it finds another >>> solution so you may blame science and say you got idea what science >>> is actually after >>> >>> >>> im just doin science - come to some conclusions than after that come >>> to another conclusion... >>> >>> why your should problems with science should interest me? im here for >>> doin science not to analyse personal problems of clc usersYour >>> 'science' seems to be writing mostly meaningless drivel and then >> posting reams of it in comp.lang.c as though it was your personal blog. >> >> You don't seem to expect any feedback either, and tend to attack >> people who offer opinions or try to make sense of some of your ideas. >> >> I should have known from past experience that that never ends well. >> 'There's always something'. > > > im not posting as personal blog and i answe a lot... the problem is you > should first make soem work and understand what im talkin about and then > answer it not just "i dont understand it so i will make z 10 hours of > foam here" > > imagine what would come if anybody would start doing that agains ant > book move piece of science in book etc... > > the amounts of foam would cover the sun :/ that would be word of foam also note i got a break (i dont know maybe like whole week a week a go and not posted here the group het ess active far ore bored becouse not much interesting topics appear so its better for me post some things and keep it more active/alive especially i got weary will make some few months of break again probbaly and it may be even dangerous for this group livehood maybe (esp now its no easy to get to usenet i think) so the attemots f keeping it more alive should be imo treated as good not bad but sparkling new topics and making foam is not the same.. as i sait i will try to code and post here up till end of year - what comes later i dont know (im not fully sure if i realize those plans being here yet whole 2 months as i may get weary also)
Page 1 of 3 • 125 total messages
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads