We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
最典型的,如java8 Stream流式编程。 假设,我注册了几个自定义函数,分别为: trim(charSequence),对字符串进行trim处理 toStream( listOrArray, fn1, fn2, ...fnN ) ,最终输出非空Stream toList( Stream ),最终输出为List
则,java代码: List<String> strings = Arrays.asList("a", "b ", " c"); List<String> trimedStrings = strings.stream().map(String::trim).toList(); 可以用表达式表示为: toList( toStream(strings, 'trim(this)') )。此处this是中间迭代时临时变量,trim(this)是表达式
List<String> strings = Arrays.asList("a", "b ", " c"); List<String> trimedStrings = strings.stream().map(String::trim).toList();
toList( toStream(strings, 'trim(this)') )。此处this是中间迭代时临时变量,trim(this)是表达式
这种配置,个人是觉得阅读起来相对比较反直觉,期望类似形式为: toStream(strings, 'trim(this)').toList()。此处,上一个toStream函数的输出,默认为下一个函数toList的第1个输入。
toStream(strings, 'trim(this)').toList()。此处,上一个toStream函数的输出,默认为下一个函数toList的第1个输入。
或者,类似java8 Stream类似编程,假设我再新增一个自定义的map函数,作用等同于Stream.map,则写成: toStream(strings).map('trim()').toList()
toStream(strings).map('trim()').toList()
类似的玩法还可以是: trim(string).replace('a', 'b'),表示,先对string变量进行trim处理,再进行字符a替换成字符b。
The text was updated successfully, but these errors were encountered:
实际的表达式案例类似如图。 底下是我格式化后(接手的老系统,表达式存json格式属性里的,故不好格式化),并加了红色翻译描述的。 如果没有格式化+解释描述,是不是很反直觉呢,>_<。
Sorry, something went wrong.
No branches or pull requests
最典型的,如java8 Stream流式编程。
假设,我注册了几个自定义函数,分别为:
trim(charSequence),对字符串进行trim处理
toStream( listOrArray, fn1, fn2, ...fnN ) ,最终输出非空Stream
toList( Stream ),最终输出为List
则,java代码:
List<String> strings = Arrays.asList("a", "b ", " c"); List<String> trimedStrings = strings.stream().map(String::trim).toList();
可以用表达式表示为:
toList( toStream(strings, 'trim(this)') )。此处this是中间迭代时临时变量,trim(this)是表达式
这种配置,个人是觉得阅读起来相对比较反直觉,期望类似形式为:
toStream(strings, 'trim(this)').toList()。此处,上一个toStream函数的输出,默认为下一个函数toList的第1个输入。
或者,类似java8 Stream类似编程,假设我再新增一个自定义的map函数,作用等同于Stream.map,则写成:
toStream(strings).map('trim()').toList()
类似的玩法还可以是:
trim(string).replace('a', 'b'),表示,先对string变量进行trim处理,再进行字符a替换成字符b。
The text was updated successfully, but these errors were encountered: