Article View: comp.lang.c
Article #1380Re: p = {1,0,0}
From: bartc
Date: Sun, 08 Nov 2026 11:19
Date: Sun, 08 Nov 2026 11:19
56 lines
3027 bytes
3027 bytes
On 08/11/2026 03:36, fir wrote:
> fir pisze:
>>
>> No, try it like this first:
>>
>> int A() {B = C()}
>
> no this should be
>
> int A() {A = C()}
>
> now its ok
> if
>
> C(){2} //in clasic c its colose to int C() {return 2}
So C is a function name, and 'C(){2}' (which seems to be something new)
defines that function to return '2' with a type of 'int'?
>
> then
>
> A()
>
> calls C() and assigns 2 to A so A is 2 now
And A is ... a variable? A function? An alias for function C? An alias
for whatever C happens to return?
Forget C, this is one of best esolangs I've seen described. But this is
the wrong forum for it.
> or take it
>
> int A(int B) {A = C()*B}
>
> A(3) assigns 6 to a so
Are these higher-order functions, so that calling A() returns a new
function (a closure in this case)?
In that case you're calling it wrong. You need:
F = A(3) # generate a new function equivalent to C()*3
F() # returns C()*3
But this is more interesting when F takes an argument too.
So you've just discovered functional programming. But then, most of this
stuff I believe is already possible in C++, if you were to learn it
properly.
Technical Details
Message-ID:
<11cplsf$8nc4$1@dont-email.me>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!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>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: bartc <bc@freeuk.com>
Newsgroups: comp.lang.c
Subject: Re: p = {1,0,0}
Date: Sun, 8 Nov 2026 11:19:43 +0000
Organization: A noiseless patient Spider
Lines: 56
Message-ID: <11cplsf$8nc4$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>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 08 Nov 2026 11:19:43 +0000 (UTC)
Injection-Info: dont-email.me;
logging-data="286084"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19rtaaae8LsU4J3X7K4ct+s"; posting-host="3716eac09d12f8836fa5d8ab619fb416"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:anQcRsfiMTAXnBlCZ+Qof31mKuI= sha256:TYJCPertmIhrRN4HrknZOrFktt9IGqs8mmr0YrSfFr4=
sha1:Do5TgTfcskekTKnarRcUnU3DndY= sha256:SId0lfgCHsreTIbbh/r5gLXFg6Y9rco3ZjcbT9/xcQg=
In-Reply-To: <11coqot$1236$1@dont-email.me>
Content-Language: en-GB