Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[OT] An if any and if all blocks

48 views
Skip to first unread message

rick.c...@gmail.com

unread,
Aug 6, 2020, 9:51:07 PM8/6/20
to
CAlive will introduce the [if any] and [if all] blocks.

The [if any] block allows a group of tests to be conducted, and if
any of them pass it will enter the block, and if all fail it will
fall through to the else.

The if all block allows a group of tests to be conducted, and if
all of them pass it will enter the block, and if any of them fail
it will fall through to the else.

The succeed and fail portions are optional.

Each (expression) can be written as any valid, boolean expression.
They do not require parentheses.

https://groups.google.com/d/msg/caliveprogramminglanguage/IEb6wVv9cW0/XTBcF7CqAgAJ

if any
| (expression1) succeed name1s fail name1f
| (expression2) succeed expression2 fail expression2
| (expression3) succeed expression3 fail expression3
| (expression4) succeed expression4 fail expression4
{
// Code here if all of them pass

} else {
// Code here if it fails

} flow name1s {
// Code here for the expression1 success

} flow name1f {
// Code here for the expression1 fail
}

Note: The if all block is identical, except it uses the "if all" header.

I mention it here because such a feature could be added to C/C++.

--
Rick C. Hodgin

woodb...@gmail.com

unread,
Aug 6, 2020, 10:53:34 PM8/6/20
to
This looks like some syntax sugar -- slightly
useful, imo.


Brian
Ebenezer Enterprises - Enjoying programming again.
https://github.com/Ebenezer-group/onwards

Mr Flibble

unread,
Aug 7, 2020, 10:04:51 AM8/7/20
to
You are off your meds again, spammer.

/Flibble

--
"Snakes didn't evolve, instead talking snakes with legs changed into snakes." - Rick C. Hodgin

“You won’t burn in hell. But be nice anyway.” – Ricky Gervais

“I see Atheists are fighting and killing each other again, over who doesn’t believe in any God the most. Oh, no..wait.. that never happens.” – Ricky Gervais

"Suppose it's all true, and you walk up to the pearly gates, and are confronted by God," Byrne asked on his show The Meaning of Life. "What will Stephen Fry say to him, her, or it?"
"I'd say, bone cancer in children? What's that about?" Fry replied.
"How dare you? How dare you create a world to which there is such misery that is not our fault. It's not right, it's utterly, utterly evil."
"Why should I respect a capricious, mean-minded, stupid God who creates a world that is so full of injustice and pain. That's what I would say."

rick.c...@gmail.com

unread,
Aug 7, 2020, 10:43:44 AM8/7/20
to
On Friday, August 7, 2020 at 10:04:51 AM UTC-4, Mr Flibble wrote:
> [snip]

Another way to be is to be helpful, loving, compassionate, not biting
and hateful, mean and a jerk.

I've met a few people like you in my life. I don't see how people can
live like that. It's an existence with so much pain, so much anger, so
much hurt.

It doesn't have to be that way.

--
Rick C. Hodgin

Mr Flibble

unread,
Aug 7, 2020, 2:25:53 PM8/7/20
to
Fuck off, spammer.
0 new messages