当前位置:网站首页>Pass anonymous function to simplification principle
Pass anonymous function to simplification principle
2022-06-30 09:26:00 【Orangejuicer】
Anonymous functions
** explain :** Functions without names are anonymous functions .
(x:Int) => { The body of the function }
x: Represents the input parameter type ;Int: Represents the input parameter type ; The body of the function : Represents specific code logic
Pass anonymous functions to the simplicity principle :
The type of parameter can be omitted , Will automatically deduce according to the formal parameters
After type omission , It turns out that there's only one parameter , The parentheses can be omitted ;
Other situations : There are no parameters and parameters beyond 1 You can never omit the parentheses .
If anonymous function has only one line , The braces can also be omitted
If the parameter appears only once , Then the parameters are omitted and the following parameters can be used _ Instead of
边栏推荐
- Esp32 things (x): other functions
- Deep understanding of kotlin collaboration context coroutinecontext
- 12. problem set: process, thread and JNI architecture
- Flink sql -- No factory implements ‘org. apache. flink. table. delegation. ExecutorFactory‘.
- I once met a girl whom I most wanted to take care of all my life. Later... No later
- 2021-10-20
- asdsadadsad
- 100 lines of code and a voice conversation assistant
- Row column (vertical and horizontal table) conversion of SQL
- Interpretation of orientedrcnn papers
猜你喜欢

Opencv learning notes -day4 image pixel reading and writing operations (array traversal and pointer traversal implementation, uchar vec3b data type and mat class functions mat:: at(), mat:: ptr())

Pytorch BERT

Advanced technology management -- how managers design and build echelons

Maxiouassigner of mmdet line by line interpretation

Electron, which can wrap web page programs into desktop applications

Rew acoustic test (VI): signal and measurement

Handwriting sorter component

Opencv learning notes -day10 logical operation of image pixels (usage of rectangle function and rect function and bit related operation in openCV)

Guilin robust medical acquired 100% equity of Guilin Latex to fill the blank of latex product line

Installation, use and explanation of vulnerability scanning tool OpenVAS
随机推荐
Talk about how the kotlin process started?
[cmake] make command cannot be executed normally
桂林 稳健医疗收购桂林乳胶100%股权 填补乳胶产品线空白
Differences between the notify(), notifyall(), notifydatasetchanged(), notifydatasetinvalidated() methods in the adapter
float
Why must redis exist in distributed systems?
Summary of Android knowledge points and common interview questions
Express - static resource request
Deep Learning with Pytorch- neural network
Abstract factory pattern
Opencv learning notes-day9 opencv's own color table operation (colormap coloraptypes enumeration data types and applycolormap() pseudo color function)
5. Messager framework and imessager interface
Esp32 (IX): OTA function of function development
Niuke IOI weekly competition 20 popularization group (problem solving)
Handwriting sorter component
Do you want the dialog box that pops up from the click?
Express file upload
Raspberry pie 4B no screen installation system and networking using VNC wireless projection function
Pytorch for former Torch users - Tensors
Opencv learning notes-day14 drawing of image geometry (rect class rotatedrect class, rectangle drawing rectangle circle drawing circular function line drawing line function ellipse drawing elliptic fu