|
N46LzUbYtD2y37RNJan 13, 2023
1
恭喜阁下已经入门了 FP (函数式编程)思维
|
|
eccstartupJan 13, 2023
2
不然呢
|
|
zhy0216Jan 13, 2023
3
python lambda 不能做 iife (因为缩进语法原因?)
一点小遗憾 |
|
5
#3 @zhy0216 可以吧
https://pythonsimplified.com/everything-you-need-to-know-about-python-lambda-functions/ > Another way you can invoke the Lambda function is through Immediately Invoked Function Expression (IIFE). However, this is not a recommended use of calling lambda expression. You don’t see this method being used anywhere. I have mentioned this for informational purposes only. > >>> print((lambda x: x**2)(5)) > 25 https://elfi-y.medium.com/python-lambda-%CE%BB-6c62a5427913 > We can invoke them directly in Immediately Invoked Function Expressions (IIFE) like: > (function (a, b) {return a + b })(1, 2); // 3 > ((a,b) => (a+b))(1, 2); // 3 |
|
julyclydeJan 16, 2023
6
reduce 是不是那个什么“柯里化”什么偏函数之类的
|
|
NoOneNoBodyJan 16, 2023
7
python 一些内置函数,性能还不如表达式,当然前者简洁和阅读性强一些
不懂源码,只感觉 python 的循环表达式比较神奇,看上去只是循环,却比一段循环代码高效很多 |
|
stonesirsirJan 17, 2023
8
为啥看不到了呢?
|