Sujet : Re: on named blocks concept
De : fir (at) *nospam* grunge.pl (fir)
Groupes : comp.lang.cDate : 07. Nov 2024, 17:30:31
Autres entêtes
Organisation : i2pn2 (i2pn.org)
Message-ID : <672CEB27.7010907@grunge.pl>
References : 1 2 3 4 5 6
User-Agent : Mozilla/5.0 (Windows NT 5.1; rv:27.0) Gecko/20100101 Firefox/27.0 SeaMonkey/2.24
fir wrote:
Bonita Montero wrote:
Am 06.11.2024 um 20:46 schrieb fir:
>
a {}
b{ }
c{}
>
int x = a*b+c;
>
where a,b,c are blocks of code (though here it would probably mean
"run a" get value and mul by "run b" take value , tun c and add
>
Use C++ and lambdas.
>
c++ has so many structural errors it makes it sh*t
(overaly all c++ is structural errors .. prbably one and only
thing interesting in c++ is operator overloading but it also is badly
done ofc)
>
besides you could do more than this lambda does , i guess
(i dont quite remember what this lambda is)
like some can define operators on this blocks for more than arithmetic on return values
like this "inject " a<-b
a is called and it cals b from inside
b {beep();}
a(block f) {
for(int i=0; i<10; i++) f()
}
or something more complex in this spirit (i dont know what hoveve)
maybe also thiose blocks simply could be used to allow code be shorter, i dont know