Cniles have no answer to this - /g/ (#105905538) [Archived: 325 hours ago]

Anonymous
7/14/2025, 8:39:32 PM No.105905538
IMG_6712
IMG_6712
md5: 1a54a7412350de3555bff4d20194f06d🔍
.
Replies: >>105905553 >>105905612 >>105905625 >>105905651 >>105905700 >>105905952 >>105907228 >>105907243 >>105907405 >>105907700 >>105907755 >>105908150 >>105908845 >>105909162 >>105909286 >>105909305 >>105909365 >>105909434 >>105909445 >>105909548 >>105909577 >>105910145 >>105911523 >>105911682 >>105911690 >>105911854 >>105912413 >>105913652 >>105913838 >>105914080 >>105914120 >>105914130 >>105914439 >>105914755 >>105915071 >>105915114 >>105919062 >>105919168 >>105921914 >>105922056 >>105922383 >>105922434 >>105922447 >>105922684 >>105923335 >>105925365
Anonymous
7/14/2025, 8:40:54 PM No.105905553
>>105905538 (OP)
I will use D once they unify their minds on which compiler and which standard library is "the default"
Replies: >>105921299
Anonymous
7/14/2025, 8:41:07 PM No.105905556
1752518458057
1752518458057
md5: efd88813bc4cbb08d8d65bca9b4667fc🔍
>reinventing pipes
Anonymous
7/14/2025, 8:45:59 PM No.105905612
>>105905538 (OP)
>completely arbitrary example that no one ever will encounter in the wild
Smells like common CS degree bs.
Replies: >>105908527
Anonymous
7/14/2025, 8:46:55 PM No.105905625
>>105905538 (OP)
D would be good if it stopped trying to be Java and remained marketing itself to C++ users.
Replies: >>105905719
Anonymous
7/14/2025, 8:48:29 PM No.105905651
>>105905538 (OP)
Cniles don't have to answer to that because many imperative programming languages copied syntax from C. That includes Java, C#, and C++.

That is not a very good system because it turns out to be inflexible. Let's say I have add(a,b) and now I come from math and would like to do add(4) which would return another function where the first argument is always 4 and the other whatever I want. Can I do that with such syntax? No. It doesn't even make sense. The arguments are a tuple and all have to exist.

Now take something like Haskell. The signature is add -> a -> b (it's missing the return type but whatever). You can do what I mentioned because every single function in Haskell only has one argument.

Universal is not always the best.
Replies: >>105905718 >>105905943 >>105908428 >>105914384 >>105921286 >>105922428
Anonymous
7/14/2025, 8:52:58 PM No.105905700
>>105905538 (OP)
D is actually pretty based, full of good idea. I'm surprised it never really caught on.
Anonymous
7/14/2025, 8:54:20 PM No.105905718
>>105905651
even if your particular currying add(4) which arbitrarily assumes commutativity were part of a C-like standard, it would not be overridden by 2.add(4) because of the 2.

by the way, very cool that you stan haskell in 2025, I thought you trannys had all kys
Replies: >>105905745
Anonymous
7/14/2025, 8:54:24 PM No.105905719
>>105905625
D only really created a workaround to have currying. It's not flexible either. Scala did the same thing.
Anonymous
7/14/2025, 8:56:16 PM No.105905745
>>105905718
You can flip it like you do with D. There's no real order of argumenta in Haskell. I understand the logic of D but it's not the most flexible approach. It's still better than inflexible C though but I think Scala did this slightly better. Not by much granted.
Anonymous
7/14/2025, 9:12:53 PM No.105905943
>>105905651
Wtf are you talking about retard, you can just define another function add4
Anonymous
7/14/2025, 9:13:17 PM No.105905952
>>105905538 (OP)
Haskell $ composition is better
Replies: >>105921905
Anonymous
7/14/2025, 11:12:06 PM No.105907228
>>105905538 (OP)
>a.b.c.d(3).e.f.g
is not clear. c.d(3) makes sense but for the rest of them it looks like you're accessing fields instead of calling functions
>a().b().c().d(3).e().f().g()
would be more clear
Replies: >>105907264 >>105908511 >>105908527 >>105921905
Anonymous
7/14/2025, 11:13:07 PM No.105907243
>>105905538 (OP)
That is not a dramatic improvement in clarity.
Replies: >>105908273
Anonymous
7/14/2025, 11:14:58 PM No.105907264
>>105907228
This is why Rust is better.
:: for accessing namespace
. for method call.
Replies: >>105908282 >>105908364 >>105911682
Anonymous
7/14/2025, 11:27:32 PM No.105907405
18
18
md5: 8a76961667577dfd2202271c6a5256ba🔍
>>105905538 (OP)
It's actually not that bad, I think scripting languages could benefit from this
Consider this random example I made up with real function names (not a real language, just a fictitious made up example):
>log(clamp(1, 10, tonumber(assert(input()))))
Rewritten with the proposed syntax:
>input.assert.tostring.clamp(1, 10).log()
It's very intuitive
Replies: >>105911690 >>105915087
Anonymous
7/14/2025, 11:53:21 PM No.105907700
>>105905538 (OP)
it seems like a nice addition but i don't think it needs an answer
Anonymous
7/14/2025, 11:58:37 PM No.105907755
1686855193812350
1686855193812350
md5: bb137b8cde4dd0187ba5848456a4b85a🔍
>>105905538 (OP)
padleft("urmom, "-", 6)
"urmom".padleft("-", 6)
ok that is pretty neat
don't need it tho
Anonymous
7/15/2025, 12:41:07 AM No.105908150
>>105905538 (OP)
(+ 1 2)
(1 + 2)

at long last! we have solved lisp
thank you walter
Replies: >>105908332
Anonymous
7/15/2025, 12:49:05 AM No.105908273
>>105907243
longer UFCS chains work a lot better with the right formatting
a
.b
.c
.d(3)
.e

With that you can now freely comment out/extend/iterate, etc.
But a lot of programmers often struggle to see the value in less-popular styles.
Replies: >>105911690
Anonymous
7/15/2025, 12:50:10 AM No.105908282
>>105907264
broken bot
Anonymous
7/15/2025, 12:55:49 AM No.105908332
Screenshot 2025-07-14 175518
Screenshot 2025-07-14 175518
md5: ed13742b8faaf6242c0f1b7b5bf29b14🔍
>>105908150
done
Anonymous
7/15/2025, 12:59:47 AM No.105908364
>>105907264
C++ did that first
Replies: >>105908740
Anonymous
7/15/2025, 1:07:16 AM No.105908428
>>105905651
>Let's say I have add(a,b) and now I come from math and would like to do add(4) which would return another function where the first argument is always 4 and the other whatever I want
then you are just fucking wrong, are you a fucking LLM or something?
>let's say I have no relevant knowledge how to do this and just hallucinated how it should work when I do something, am I right?
Probably fucking not. You are presupposing not knowing the language. Do understand that save for including a mind reading device, there's literally nothing that can be designed into a language that can fix your problem of not knowing it? Because whatever solution is in the language would require you to know the language to make use of it, making it a catch-22

Languages are not designed for randoms off the fucking street and whatever they came up that they'd "like to" do. They are designed for people that use it, which is a subset of people that know it.
Anonymous
7/15/2025, 1:14:40 AM No.105908511
>>105907228
youi can do both
Anonymous
7/15/2025, 1:16:43 AM No.105908527
>>105905612
I get frustrated by not having this all the time. Ever tried using itertools python? It sucks because it doesn't have this (and only single line lambdas).
C would especially benefit since it you can't associate functions with structs.
>>105907228
most of the time, it's clear from context if it's a function call or not. Otherwise, using parenthesis makes sense, yeah.
Replies: >>105909455 >>105921753 >>105921965
Anonymous
7/15/2025, 1:34:53 AM No.105908700
>invents situation that never happens
>"solves" it
Anonymous
7/15/2025, 1:40:18 AM No.105908740
>>105908364
C++ has no UFCS.
Anonymous
7/15/2025, 1:52:26 AM No.105908845
1750995670818575
1750995670818575
md5: 7ec68f6077ff06dfc4a2d967519b07d7🔍
>>105905538 (OP)
any time your code looks like
>g(f(e(d(c(b(a))),3))))
i can say with complete confidence you are doing something that breaks fundamental code principles.
Replies: >>105908866 >>105908899 >>105909013
Anonymous
7/15/2025, 1:54:45 AM No.105908866
>>105908845
java people do that shit all the time, only with much longer function / method names.
Replies: >>105908879 >>105908899 >>105909246
Anonymous
7/15/2025, 1:56:00 AM No.105908879
>>105908866
doesn't mean it's right. java has so much boiler plate that java devs try to avoid adding any more with horrible code. but it's still horrible
Anonymous
7/15/2025, 1:58:29 AM No.105908899
>>105908845
>i can say with complete confidence you are doing something that breaks fundamental code principles.
factual

>>105908866
>java
that language is a mess.
Anonymous
7/15/2025, 2:10:03 AM No.105909013
>>105908845
did you never do a shell pipeline with more than 3 steps?
Once the syntax facilitates doing this easily, it's not bad anymore and you tend to use it more. No need to introduce unnecessary throwaway variables anymore.
Anonymous
7/15/2025, 2:28:42 AM No.105909162
sticking_with_nim
sticking_with_nim
md5: b5ef63b61e65288176e14e4ad42c5a28🔍
>>105905538 (OP)
I like D but Nim has the same feature.
Anonymous
7/15/2025, 2:39:47 AM No.105909246
>>105908866
It isn't "Java people" who do this. It is wagies, and wagies do this because they are shitty programmers.
Replies: >>105909393
Anonymous
7/15/2025, 2:43:27 AM No.105909286
>>105905538 (OP)
Just use rainbow brackets in your ide.
Anonymous
7/15/2025, 2:45:22 AM No.105909305
>>105905538 (OP)
In what fucking universe are you going to nest 6 functions like that?
Replies: >>105909393 >>105909982
Anonymous
7/15/2025, 2:52:21 AM No.105909365
>>105905538 (OP)
No shit it's hard to figure out what's going on you have mismatched parens. He has 6 ( parentheses and 7 ) parentheses.
Anonymous
7/15/2025, 2:55:35 AM No.105909393
file
file
md5: 51ed9c0a5d97e67fe1c8dfe2c824830c🔍
>>105909246
>>105909305
https://github.com/openjdk/jdk/blob/master/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ModuleSorter.java#L72
Replies: >>105911690 >>105912479
Anonymous
7/15/2025, 3:00:21 AM No.105909434
>>105905538 (OP)
who the fuck writes code like that? i would fire any of my reports that pulled that shit
Anonymous
7/15/2025, 3:01:55 AM No.105909445
>>105905538 (OP)
what happens if one of those returns null
Replies: >>105909467 >>105909493
Anonymous
7/15/2025, 3:02:34 AM No.105909455
>>105908527
nigger what? you can put a function pointer in a struct. look at python's c source
Replies: >>105913807
Anonymous
7/15/2025, 3:03:42 AM No.105909467
1716911964607133
1716911964607133
md5: 04b77a35b4eb71af0d8bb71c8d3a4358🔍
>>105909445
a tranny gets its wings
Replies: >>105922063
Anonymous
7/15/2025, 3:06:20 AM No.105909493
>>105909445
In D you'd use native contract programming features, so you could either catch the null getting returned out, or passed in, or turn it into an Optional
HTMXEnjoyer
7/15/2025, 3:12:27 AM No.105909548
>>105905538 (OP)
hey look. python classes.
Anonymous
7/15/2025, 3:16:03 AM No.105909577
>>105905538 (OP)
c.u.rr.y is as unreadable as n(i(gg(e(r)))). Why not just assign a few results from those functions to variables in the first place?
Replies: >>105921905
Anonymous
7/15/2025, 3:17:04 AM No.105909589
you should never call more than 2 functions deep to start with
Anonymous
7/15/2025, 4:00:05 AM No.105909982
>>105909305
rust universe
Replies: >>105911682
Anonymous
7/15/2025, 4:17:54 AM No.105910145
>>105905538 (OP)
g . f . e . flip d 3 . c . b $ a
haskell!
Replies: >>105911690
Anonymous
7/15/2025, 7:35:03 AM No.105911523
>>105905538 (OP)
Please tell me this is a troll.
Replies: >>105911698
Anonymous
7/15/2025, 7:56:05 AM No.105911682
>>105905538 (OP)
>>105907264
>>105909982
How do you feel about the proposal for Rust with infix pattern matching?
https://github.com/rust-lang/rust/issues/121618
https://github.com/rust-lang/rfcs/pull/3295
https://github.com/conradludgate/rfcs/blob/postfix-match/text/0000-postfix-match.md

foo.bar().baz.match {
_ => {}
}


(Yes, they misnamed it as postfix when it is actually infix).
Replies: >>105912071 >>105913469
Anonymous
7/15/2025, 7:57:29 AM No.105911690
🔴 HOW TO BUILD TWITTER CLONE PROJECT WITH REACT JS FOR BEGINNERS
>>105905538 (OP)
>>105908273
>>105907405
>>105909393
>>105910145
Anonymous
7/15/2025, 7:58:42 AM No.105911698
>>105911523
C++ wanted something similar, but backwards compatibility and unanswered questions caused problems.
One difficulty is that "a.b" in some languages imply namespacing, as per usual OOP. As in, "b" is not global, but specific to whatever the type or runtime object that the expression "a" has.

In Haskell, there are sometimes various annoyances in practical code with not having this kind of OOP namespacing of functions.

Different trade-offs.
Replies: >>105911840
Anonymous
7/15/2025, 8:21:19 AM No.105911840
>>105911698
>C++ wanted something similar, but backwards compatibility and unanswered questions caused problems.
Thank fuck. C saves the day again.
Anonymous
7/15/2025, 8:23:47 AM No.105911854
>>105905538 (OP)
Forth doesn't have this problem.
Anonymous
7/15/2025, 8:52:30 AM No.105912071
>>105911682
ehh, kinda ok...
Anonymous
7/15/2025, 9:36:35 AM No.105912413
>>105905538 (OP)
> a.f(x) same as f(a,x)
Is this where Python got that self insanity from?
>def f(self,x):
Replies: >>105912866
Anonymous
7/15/2025, 9:42:11 AM No.105912450
How about
a
|> b()
|> c()
|> d()
|> e(3)
|> f()
|> g()
Replies: >>105913784
Anonymous
7/15/2025, 9:47:42 AM No.105912479
>>105909393
That's a lambda. That isn't even the same language construct the OP is talking about.
Anonymous
7/15/2025, 9:48:40 AM No.105912483
>But what about this c cniles
What about it? This is terrible code and would be called out if anyone with a brain was reviewing this code. Its a cool bike shed, but considering the computer is doing the same thing either way spreading this out to make it more clear, is the correct call. Doing fifty things in one line is just code golf bullshit that just makes reviewing code harder for no real benefit.
Anonymous
7/15/2025, 10:53:42 AM No.105912866
>>105912413
c++ has a implicit "this" as the first argument of any method.
implicit anything in programming is retarded. we learned this 70 years ago with fortran.
Anonymous
7/15/2025, 11:33:53 AM No.105913105
Why do tech trannies spend their whole lives arguing about HOW something should be written? Is it because they write nothing of interest? It would be like shitty fanfic writers arguing about Oxford commas to no end.
Replies: >>105913487
Anonymous
7/15/2025, 12:29:48 PM No.105913469
>>105911682
Give me for else
Replies: >>105913484
Anonymous
7/15/2025, 12:31:25 PM No.105913484
>>105913469
Explain what "for else" means.
Replies: >>105913585
Anonymous
7/15/2025, 12:31:49 PM No.105913487
>>105913105
Your brain is small and ill, and your penis is crooked and tiny. Sperging at people online won't change these things.
Anonymous
7/15/2025, 12:46:41 PM No.105913585
>>105913484
A for loop can finish by either reaching the end of the iterator or breaking
For else lets you add an else clause to the for loop, to be executed if you reaxhed the end without breaking
This allows for loops to evaluate to a value, either by breaking from the main loop body or evaluating to a guard in else. "loop" loops in rust can already do this, since you have to break out of them, so there's no path where they exit with no value
Basically, if you've ever used
>found = false; for { ... }; if !found
Or a method chain that went collection -> option -> or_else/default
That's where for else would be used
Replies: >>105915043 >>105915118
Anonymous
7/15/2025, 12:59:23 PM No.105913652
>>105905538 (OP)
Stop being a clean code modulating anti dry fucking retard and write ONE function that does a() b() c() d() e() f() g() instead.
Anonymous
7/15/2025, 1:16:47 PM No.105913784
>>105912450
based elixirchad
Anonymous
7/15/2025, 1:20:53 PM No.105913807
>>105909455
in what world is obj->f(obj) better than just obj.f()?
Anonymous
7/15/2025, 1:26:44 PM No.105913838
1732451748776761
1732451748776761
md5: cb99a365992890a9cb888b8094da0d53🔍
>>105905538 (OP)
Nim does it better, but it's nothing more than a syntax nicety.
Howeverthoughbeit, method chaining niggers should be culled for their disgusting mockery of piping.
Anonymous
7/15/2025, 2:02:49 PM No.105914080
>>105905538 (OP)
this will get very confusing very fast if you have more than one argument
also, stop golfing in production, fucking black gorilla niggers
Anonymous
7/15/2025, 2:10:01 PM No.105914120
>>105905538 (OP)
How about you just stop nesting 50 function calls?
Replies: >>105914703
Anonymous
7/15/2025, 2:12:26 PM No.105914130
>>105905538 (OP)
There is never any practical reason to nest that many calls on a single line. I add in local variables just to make the code more readable so that this never happens in the first place.
Anonymous
7/15/2025, 2:50:56 PM No.105914384
>>105905651
>Math faggot
>Useless programmer
A tale as old as time.
Anonymous
7/15/2025, 2:57:21 PM No.105914439
>>105905538 (OP)
That is a really bad idea and it can only lead to more irregular code.
Anonymous
7/15/2025, 3:28:58 PM No.105914703
>>105914120
hmm no I don't think I will
Anonymous
7/15/2025, 3:34:27 PM No.105914755
>>105905538 (OP)
Parenthesis version is clearer. But either way it's retarded code.
Anonymous
7/15/2025, 3:49:35 PM No.105914876
for me it's
#define E_COEFF 3
result_type tmp = a;
tmp = b(a);
tmp = c(tmp);
tmp = d(tmp);
tmp = e(tmp, E_COEFF);
tmp = f(tmp);
tmp = g(tmp);

Because that looks like the kind of code you want to print intermediate values to verify that it's working and maybe return early once you actually see the code in action.
Replies: >>105915357 >>105915719 >>105917469
Anonymous
7/15/2025, 4:00:39 PM No.105914972
That looks even more cancerous than a normal function chaining.
Anonymous
7/15/2025, 4:10:09 PM No.105915043
>>105913585
Isn't that just a snippet at the end of the loop saying if(value==lastvalue){}
Replies: >>105915058
Anonymous
7/15/2025, 4:12:28 PM No.105915058
>>105915043
No.
Anonymous
7/15/2025, 4:14:08 PM No.105915071
>>105905538 (OP)
What kind of a retard would write this code? If you are writing this no programming language will save you from rope.
Anonymous
7/15/2025, 4:17:16 PM No.105915087
>>105907405
i want to kiss this child on the lips beautiful baby please have sex with me and we can cuddle afterwards
Anonymous
7/15/2025, 4:21:53 PM No.105915114
>>105905538 (OP)
ufcs should use a different operator than dot otherwise the lsp spergs out and spams the autocompletion window for all matching function which sucks. Idk maybe > or some other pipe operator.
Anonymous
7/15/2025, 4:22:35 PM No.105915118
>>105913585
lisp has this
Replies: >>105915369
Anonymous
7/15/2025, 4:55:33 PM No.105915357
1751892064666658
1751892064666658
md5: e61a09988cc9046908b087153004fdc8🔍
>>105914876
>tmp
pick better names
Replies: >>105917469 >>105919566
Anonymous
7/15/2025, 4:56:55 PM No.105915369
>>105915118
yes. so does python. it is a useful construct.
Anonymous
7/15/2025, 5:39:55 PM No.105915719
>>105914876
What if the functions all return different types?
Anonymous
7/15/2025, 8:49:17 PM No.105917469
>>105914876
based

>>105915357
I'd use ret
Anonymous
7/15/2025, 11:16:30 PM No.105919062
>>105905538 (OP)
No idea why you bring up C when that is the last language where you would even see this example. C programmers are overwhelmingly religious 80 char small function zealots. This is more applicable to J(eet)ava.
Anonymous
7/15/2025, 11:24:41 PM No.105919168
>>105905538 (OP)
g ( f ( e ( d ( c ( b (a
) ) ) ) ) ) )<-
Anonymous
7/16/2025, 12:07:41 AM No.105919566
>>105915357
nig
Anonymous
7/16/2025, 3:10:20 AM No.105921173
nesting function calls is like having transitive dependencies
Anonymous
7/16/2025, 3:28:19 AM No.105921286
>>105905651
>would like to do add(4) which would return another function where the first argument is always 4 and the other whatever I want
Not the first argument, but def add(a, b=4)?
Anonymous
7/16/2025, 3:30:49 AM No.105921299
>>105905553
We don't do that, anymore. We can't even agree on a standard Wayland compositor
Anonymous
7/16/2025, 4:39:25 AM No.105921753
>>105908527
>I get frustrated by not having this all the time. Ever tried using itertools python? It sucks because it doesn't have this (and only single line lambdas).
you know understand why Perl's syntax makes sense
sort { ... } grep { ... } map { ... }
Replies: >>105921804
Anonymous
7/16/2025, 4:40:27 AM No.105921766
*now
Anonymous
7/16/2025, 4:44:30 AM No.105921804
>>105921753
>perl
>make sense
what
Replies: >>105922028
Anonymous
7/16/2025, 4:57:23 AM No.105921905
>>105907228
>>105909577
excel formula chad here
g(f(e(d(c(b(a))),3)))) is the only correct way
anyone who says or thinks otherwise must chop his cock off
>>105905952
langType <- "toy lang"
Anonymous
7/16/2025, 4:59:43 AM No.105921914
>>105905538 (OP)
https://godbolt.org/z/8nTbro4aj
#define λx(...) [](const auto& x) { return __VA_ARGS__; }

auto operator * (auto a, auto b) {
return [=](auto x){ return b(a(x));};
};

int main() {
auto a = λx(x + 1);
auto b = λx(x + 2);
auto c = λx(x + 4);
auto d = λx(λx(x * 3));
auto e = λx(x + 8);
auto f = λx(x + 16);
auto g = λx(x + 32);
auto h = a * b * c * d(3) * e * f * g;
return h(0);
}

Simple as.
Anonymous
7/16/2025, 5:09:25 AM No.105921965
>>105908527
>most of the time, it's clear from context if it's a function call or not.
What if your have polymorphic function or the function itself has methods?
print(value.method.hash)

Are you printing hash of a return of that function or maybe hash of the function, or maybe the method hash of method or maybe the method hash of the return of method.
Replies: >>105921980
Anonymous
7/16/2025, 5:11:31 AM No.105921980
>>105921965
Or even worse
value.method.hash.print
Anonymous
7/16/2025, 5:20:30 AM No.105922028
>>105921804
generic troll post #1231432345245

are you paid enough to eat what you want?
Anonymous
7/16/2025, 5:24:07 AM No.105922056
>>105905538 (OP)
https://godbolt.org/z/P8dEjf3Ev
#define λ(x, ...) [=](auto x) { return __VA_ARGS__; }

auto operator * (auto a, auto b) {
return [=]{ return b(a());};
};

int main() {
auto a = []{return 1;};
auto b = λ(x, x + 2);
auto c = λ(x, x + 4);
auto d = λ(x, λ(y, x * y));
auto e = λ(x, x + 10);
auto f = λ(x, x + 20);
auto g = λ(x, x + 40);
auto h = a * b * c * d(3) * e * f * g;
return h();
}
Replies: >>105922076
Anonymous
7/16/2025, 5:25:10 AM No.105922063
>>105909467
Redbull sisters… our response ?
Anonymous
7/16/2025, 5:26:19 AM No.105922076
>>105922056
What did he mean by this? Kek
Replies: >>105922183
Anonymous
7/16/2025, 5:41:21 AM No.105922183
>>105922076
https://godbolt.org/z/Wz77WY4PW
Replies: >>105922702
Anonymous
7/16/2025, 6:14:39 AM No.105922383
>>105905538 (OP)
I disagree with the premise that it is unclear. Noisy maybe, but clear if you read it slowly. What it actually is is a painfully contrived example. If you have code that calls 7 functions in a row like that you are either retarded or should use a functional language where that is the point. FP syntax is much more elegant than that abuse of the dot operator.
Replies: >>105922426
Anonymous
7/16/2025, 6:21:47 AM No.105922426
>>105922383
holy shit finally a reasonable and logical reply in this shitsmear of a thread.
You can't just imagine a problem and come up with a ''solution'' that only promotes bad code
Replies: >>105922437
Anonymous
7/16/2025, 6:21:56 AM No.105922428
>>105905651
Why would I want to do any of that?
Anonymous
7/16/2025, 6:22:35 AM No.105922434
>>105905538 (OP)
It's hard to figure out what's happening because there are seven functions with non-obvious return values being called in one line of code. It's absolutely ludicrous.

This only makes any sense as a workaround for a language that wants to have objects and methods but hasn't made them a language feature. As soon as you have them, you no longer need this nonsense.

Just imagine how impossible it is to read the equivalent of this where b, c, e, f, and g all have multiple arguments, some of which derive from their own functions. a.b(true).c(1, "Test").d(3).e(a.h(x), a.i(y)).f.g GOOD FUCKING LUCK
Anonymous
7/16/2025, 6:22:57 AM No.105922437
>>105922426
My coworker literally does that all day
Replies: >>105923229
Anonymous
7/16/2025, 6:24:07 AM No.105922447
>>105905538 (OP)
>g(f(e(d(c(b(a))),3))))
>It's a little hard to figure out what is happening
Only if your mom drank when you were a fetus.

*POTENTIALLY* saving an extra second reading the code carefully is not worth the massive extra bloat with any of the more "readable" languages and the readability issue is not even an issue if you have/follow good code style formats.
Replies: >>105922492
Anonymous
7/16/2025, 6:31:40 AM No.105922492
>>105922447
>massive extra bloat
it's mostly just a change in the syntax, retard
Anonymous
7/16/2025, 6:42:09 AM No.105922548
1743989409862891
1743989409862891
md5: e13ae07d6e2ef28f43f77a61cf44a3f2🔍
>it's another "clojure wins" episode
Anonymous
7/16/2025, 7:08:41 AM No.105922684
>>105905538 (OP)
static int a() {return 1;}
static int b(int x) {return x + 2;}
static int c(int x) {return x + 4;}
static int d(int x, int y) {return x * y;}
static int e(int x) {return x + 10;}
static int f(int x) {return x + 20;}
static int g(int x) {return x + 40;}
#define ٠(o) ;x = o(x)
#define ٠2(o, c) ;x = o(x, c)
int main() {
int x = a()٠(b)٠(c)٠2(d, 3)٠(e)٠(f)٠(g);
return x;
}

https://godbolt.org/z/8a71xx9Kd
Are you happy now?
Anonymous
7/16/2025, 7:11:25 AM No.105922702
>>105922183
What are you trying to say?
Replies: >>105922710
Anonymous
7/16/2025, 7:12:14 AM No.105922710
>>105922702
Anon, this stuff is not for you.
Replies: >>105923271
Anonymous
7/16/2025, 8:55:45 AM No.105923229
>>105922437
smear shit?
Anonymous
7/16/2025, 9:07:02 AM No.105923271
>>105922710
Why is it so difficult for you to express your efforts into English words?
Replies: >>105923310
Anonymous
7/16/2025, 9:13:47 AM No.105923310
>>105923271
everything is assembly and everyone in this thread and on this board that argues over languages is retarded
Replies: >>105924036
Anonymous
7/16/2025, 9:19:40 AM No.105923335
>>105905538 (OP)
That's not even valid, there are 6 opening parens and 7 closing.

g(f(e(d(c(b(a))),3))))

expands to
g(
f(
e(
d(
c(
b(a)) # <-- ?
),
3
)
)
)
)

so it should be
g(f(e(d(c(b(a)), 3))))
Anonymous
7/16/2025, 10:05:10 AM No.105923600
I think C# can do this with type extension.
Replies: >>105924476
Anonymous
7/16/2025, 11:05:26 AM No.105924036
>>105923310
based
Anonymous
7/16/2025, 12:27:15 PM No.105924476
>>105923600
Thought it'd be cool but it's actually kinda meh.
Writing the templates wasn't fun.
I guess F# is more appropriate for something like this.
class Program
{

static void Main()
{
int n = 5;
n.Inc().Mul(6).ConvertTo<double...>().Sum(10, 20, 5, 10.5).Div(5).Print();
}

static int Inc(this int a)
{
return a + 1;
}

static T Mul<T>(this T a, T b) where T : operator T * T
{
return a * b;
}

static T ConvertTo<T, TFrom>(this TFrom a) where T : operator explicit TFrom
{
return (T)a;
}

static T Div<T>(this T a, T b) where T : operator T / T
{
return a / b;
}

static T Sum<T>(this T a, params T[] nums) where T : operator T + T
{
T sum = a;
for (let n in nums)
{
sum += n;
}
return sum;
}

static void Print<T>(this T a)
{
Console.WriteLine("{}", a);
}
}
Anonymous
7/16/2025, 2:24:09 PM No.105925365
>>105905538 (OP)
it's just a (bad) version of diagrammatic order. We use it in category theory all the time.
Anonymous
7/16/2025, 5:58:44 PM No.105927198
In non functional programming languages (but also in pure functional one) it doesn't happen to have a chain of more than 3 functions
If it does happen, there's something wrong with your code
Still the problem should be solve something else, like with a pipe operator instead of this retardation

So this is basically
> What about this scenario that basically never happen? We solved that
This is a clear example on why D never took off really. There's no amount of competence that will solve being retarded