Article View: comp.lang.c
Article #1381Re: p = {1,0,0}
From: fir
Date: Sun, 08 Nov 2026 11:44
Date: Sun, 08 Nov 2026 11:44
115 lines
4425 bytes
4425 bytes
bartc pisze:
> 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'?
>
C ad A arestructures and functions at once
C() {2} (Or
C{2} is the same as you may skip () in definiton if they are empty)
you may both call or read its value
C(); ///you call it //it has no code so it do nothing
int a = C*C ; //you read it
now function not return values so if you call C code
it just sets the value of C which you may use and reuse but there is no
return in this examples
>>
>> 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?
>
A is both a function and a variable (structure/module)
its like say "int a" you know what int a is? but you mayy ad code to it
int a (int b) { a=2<<b }
now
a; //means you declare a (if first time in scope)
a(10); // means you declare and call, a(10) will set it to 1024
printf("%d", a*3); //printfs 3072
> 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.
>
no i dont think so it has something to do with it it just a function
calls involved
int A(int B) {A = C()*B}
its like in classic c
int C() {return 2}
int A(int B)
{
return C()*B;
}
the difference is you not return values but you assign it to A (which is
like "int A" ) and then you may use A as int..also difference is you can
do more here (on which i was writing a lot before)
Technical Details
Message-ID:
<11cpnbb$97kp$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> <11cplsf$8nc4$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: fir <profesor.fir@gmail.com>
Newsgroups: comp.lang.c
Subject: Re: p = {1,0,0}
Date: Sun, 8 Nov 2026 12:44:28 +0100
Organization: A noiseless patient Spider
Lines: 115
Message-ID: <11cpnbb$97kp$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>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 08 Nov 2026 11:44:43 +0000 (UTC)
Injection-Info: dont-email.me;
logging-data="302745"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/aOUmTl4+7EGjXZ8UHIFyrdGhi+uOrHVw="; posting-host="9324e5ef4bfce41eb124a57241b8befc"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:140.0) Gecko/20100101
Firefox/140.0 SeaMonkey/2.53.24
Cancel-Lock: sha1:QmcpwP5g0wTyz9vryQTsdYwk5N8= sha256:4qzHqVY4yl4D1uWbb9n9H87NT3gjuvLvUaoES2slBtU=
sha1:gMp48jc/DmwmAwS7zqRdIn5MHcA= sha256:/gnhc19c20cQa/qEOZw0qhrkI507r1rfIGQXLJzTT/s=
In-Reply-To: <11cplsf$8nc4$1@dont-email.me>