Article View: comp.lang.c
Article #1411Re: p = {1,0,0}
From: David Brown
Date: Tue, 10 Nov 2026 12:50
Date: Tue, 10 Nov 2026 12:50
75 lines
5373 bytes
5373 bytes
On 10/11/2026 13:08, bartc wrote: > On 10/11/2026 08:24, David Brown wrote: >> On 10/11/2026 02:11, bartc wrote: > >>> Have you looked at /any/ other at languages at all? Take some ideas >>> from those. >> >> Or look at C. It is not exactly a challenge to have : >> >> #define For(_var, _limit) for (int _var = 0; _var < _limit; _var++) >> >> and then you can write : >> >> For(i, 100) >> >> With a little more effort, you can even make a single macro that could >> handle : >> >> For(100) // Automatic anonymous variable >> >> and >> >> For(i, 1, 100) // If you don't want to start at 0 > > This is stuff I used to do. Then I realised then using a private macro > library to refine the language doesn't work (when posting code on forums > for example). Well, it works perfectly well in that it does exactly what you are asking for here. It is common to have small libraries with functions, headers, macros, typedefs, inline static functions, etc., that you re-use between projects. And if you really want such a "For" feature, because you really don't like C's "for" loops, and its your code, then use it. No one else gets to tell you how you write your own code. But if the code is to be shared with others, then you have to consider what suits those other people. And if you are sharing small bits of code on Usenet (or other discussion forum), it is a lot easier if the code is written in a fashion familiar to other people, without extra abstractions, and certainly without extra dependencies. That's nothing special about C or macros - it's just basic communication skills. > > They are vaguely C-like, but whatever fir is planning is a long way from > C anyway. He's not interested in workarounds using actual C. > Agreed. I have no idea what he is actually interested in, and don't bother replying to him. (I might follow-up on a post he makes if I think it is interesting in the C context or could be of interest to someone else here, but I think trying to figure out what he wants or trying to help him directly is a lost cause.) >> it is far more difficult as you have to consider all conceivable >> corner cases or strange usage. (For your languages, Bart, you have a >> middle ground - since you are the only user, you can easily ensure >> that all users stay away from awkward corner cases. > > A language only needs to be real, not widespread, for the syntax choices > to be valid. There is nothing wrong or ambiguous about the grammar used > for my loop constructs. > > This kind of feature is one of the simplest to get right in a language, > especially when it is 1-based. The very fact that you think this is something to "get right" shows where you go wrong in language design, language comparison, and language discussions. It is one of the key reasons why you get in arguments with so many people here (the other being that your language has no relevance to comp.lang.c, or anyone other than yourself). It is fine to /prefer/ one construct or syntax over another, or to think that one fits better in a given language. It is quite a different matter to claim that your way is "right" and everyone else is "wrong".
Technical Details
Message-ID:
<11cv3vb$257i8$1@dont-email.me>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailReferences:
<11c7f1j$20b9h$1@dont-email.me> <11c7fj6$20gab$1@dont-email.me> <11cae5m$318tq$1@dont-email.me> <11calrt$34gq3$1@dont-email.me> <11carqs$36m0o$1@dont-email.me> <11cb4hs$3a13l$1@dont-email.me> <11ccnkq$3pjhd$1@dont-email.me> <11ccobd$3ps4l$1@dont-email.me> <11cctee$3rtjh$1@dont-email.me> <11ccu0t$3s54f$1@dont-email.me> <11ccv4n$3sjn5$1@dont-email.me> <11cd05l$3t1er$1@dont-email.me> <11cd0q3$3ta28$1@dont-email.me> <11cd1vs$3tpfp$1@dont-email.me> <11cnve1$3ofei$1@dont-email.me> <11co8d4$3rpvm$1@dont-email.me> <14be9ea5-918f-5871-1bba-11e29e6e25d5@gmail.com> <11coqot$1236$1@dont-email.me> <11cplsf$8nc4$1@dont-email.me> <11cpnbb$97kp$1@dont-email.me> <11cpo21$9fji$1@dont-email.me> <11cpov5$9q2h$1@dont-email.me> <11cq3hb$dnf9$1@dont-email.me> <11ctijh$1mb1u$1@dont-email.me> <11ctr0o$1or07$1@dont-email.me> <11cukc4$1vnj7$1@dont-email.me> <11cv1ft$24amr$1@dont-email.me>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: David Brown <david.brown@hesbynett.no>
Newsgroups: comp.lang.c
Subject: Re: p = {1,0,0}
Date: Tue, 10 Nov 2026 13:50:50 +0100
Organization: A noiseless patient Spider
Lines: 75
Message-ID: <11cv3vb$257i8$1@dont-email.me>
References: <11c7f1j$20b9h$1@dont-email.me> <11c7fj6$20gab$1@dont-email.me>
<11cae5m$318tq$1@dont-email.me> <11calrt$34gq3$1@dont-email.me>
<11carqs$36m0o$1@dont-email.me> <11cb4hs$3a13l$1@dont-email.me>
<11ccnkq$3pjhd$1@dont-email.me> <11ccobd$3ps4l$1@dont-email.me>
<11cctee$3rtjh$1@dont-email.me> <11ccu0t$3s54f$1@dont-email.me>
<11ccv4n$3sjn5$1@dont-email.me> <11cd05l$3t1er$1@dont-email.me>
<11cd0q3$3ta28$1@dont-email.me> <11cd1vs$3tpfp$1@dont-email.me>
<11cnve1$3ofei$1@dont-email.me> <11co8d4$3rpvm$1@dont-email.me>
<14be9ea5-918f-5871-1bba-11e29e6e25d5@gmail.com>
<11coqot$1236$1@dont-email.me> <11cplsf$8nc4$1@dont-email.me>
<11cpnbb$97kp$1@dont-email.me> <11cpo21$9fji$1@dont-email.me>
<11cpov5$9q2h$1@dont-email.me> <11cq3hb$dnf9$1@dont-email.me>
<11ctijh$1mb1u$1@dont-email.me> <11ctr0o$1or07$1@dont-email.me>
<11cukc4$1vnj7$1@dont-email.me> <11cv1ft$24amr$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 10 Nov 2026 12:50:52 +0000 (UTC)
Injection-Info: dont-email.me;
logging-data="2268744"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18UIiDpCGNqQQRG0f1Gpte1Vi5d7xkGA2E="; posting-host="a907b94bf0fcbfeffbc81a62ebe9823d"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:UmmePeWzfLagwz4BFTBN1v92kK4= sha256:Z0VuoiBlEOfDiCtSXTgfSVgCrsoLkMjE5aDziqe4khg=
sha1:lGAvFti8ZZuIy8OWQAS7COSyD1c= sha256:9Wfiy7c7oPcTRssBiUAfBtrsaGPAjHBxAoZRnb5zcA8=
In-Reply-To: <11cv1ft$24amr$1@dont-email.me>
Content-Language: en-GB, nb-NO