Egg.Lark
16.2.2303.17
dotnet add package Egg.Lark --version 16.2.2303.17
NuGet\Install-Package Egg.Lark -Version 16.2.2303.17
<PackageReference Include="Egg.Lark" Version="16.2.2303.17" />
paket add Egg.Lark --version 16.2.2303.17
#r "nuget: Egg.Lark, 16.2.2303.17"
// Install Egg.Lark as a Cake Addin #addin nuget:?package=Egg.Lark&version=16.2.2303.17 // Install Egg.Lark as a Cake Tool #tool nuget:?package=Egg.Lark&version=16.2.2303.17
百灵鸟函数式脚本(Egg.Lark)
Egg开发套件中关于百灵鸟函数式脚本引擎(Lark Script Engine)支持的可选组件;
函数式脚本
脚本整体就是一个函数,但函数的参数可以是另一个函数定义,由此自由展开形成丰富的功能实现;
脚本示例
以下为一个计算累加并输出的简单脚本:
@(
# while 循环 #
let(num, 100)
let(a, 1)
let(sum, 0)
while(small_equal(a, num), @(
let(sum, !(sum + a))
let(a, !(a + 1))
))
)
基础函数
为了能让脚本工作更为顺利,引擎中内置了一些基础函数;
逐句执行函数(@)
使用此函数可以让函数中的参数依次执行:
@(func1, func2, ... , fnucN)
赋值函数(let)
使用此函数可以让后参数的内容赋值给前函数:
let(var, value)
运算函数(+-*/)与四则混合运算语法糖(!)
使用此类函数可以进行数值运算并返回结果:
+(num1, num2, ... , numN)
-(num1, num2, ... , numN)
*(num1, num2, ... , numN)
/(num1, num2, ... , numN)
使用!函数定义可触发四则混合运算解析,如以下第一句脚本将会被解析为第二句:
!((a + 1) * 2)
*(+(a, 1), 2)
字符串连接函数($)
使用此函数可以让函数中的参数依次拼接为一个新的字符串:
$(var1, var2, ... , varN)
判断函数(if)
使用判断函数可以通过判断首参数的值来决定执行第二个参数还是第三个参数中的函数:
if(var, funcTrue, funcFalse)
判断循环函数(while)
使用判断循环函数可以通过循环判断首参数的值来循环执行第二个参数中的函数:
while(var, func)
规律循环函数(for)
使用规律循环函数可以通过设置初始值、终点值、每次变化值来循环执行参数中的函数:
for(var, start, end, change, func)
依次循环函数(foreach)
使用依次循环函数可以通过遍历列表/字典来循环执行参数中的函数:
for(var, list, func)
相等判断函数(equal)
使用相等判断函数可以对比两个参数值是否相等并返回结果:
equal(var1, var2)
比较函数(compare)
使用相等判断函数可以对比两个数字参数值,前函数较大则返回1,相同则返回0,较小则返回-1:
compare(var1, var2)
取反函数(not)
使用取反函数可以取参数的反结果:
not(var1)
同时成立函数(and)
使用同时成立函数将对比所有参数值,均为真时才返回为真:
and(var1, var2, ... , varN)
单一成立函数(or)
使用单一成立函数将对比所有参数值,只需有一个为真时即返回为真:
or(var1, var2, ... , varN)
注释关键字(#)
使用#来定义注释或结束注释定义,如:
# 这是整行注释
let(a, 1)
# 这是部分注释 # let(a, 1)
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- Egg (>= 16.2.2303.17)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
16.2.2303.17 | 723 | 3/28/2023 |
16.2.2303.16 | 683 | 3/25/2023 |
16.2.2303.15 | 723 | 3/16/2023 |
16.2.2303.14 | 678 | 3/11/2023 |
16.2.2303.13 | 698 | 3/4/2023 |
16.1.2301.12 | 815 | 1/19/2023 |
16.1.2301.11 | 753 | 1/18/2023 |
16.1.2301.10 | 772 | 1/18/2023 |
16.1.2301.9 | 742 | 1/18/2023 |
16.1.2301.8 | 755 | 1/15/2023 |
12.3.2206.59 | 915 | 6/1/2022 |
6.2.2201.58 | 934 | 1/13/2022 |
6.1.2112.57 | 637 | 1/7/2022 |
6.1.2112.56 | 635 | 12/29/2021 |
6.1.2112.55 | 741 | 12/29/2021 |
6.1.2112.54 | 719 | 12/29/2021 |
6.1.2112.53 | 700 | 12/29/2021 |
6.1.2112.52 | 747 | 12/27/2021 |
6.1.2112.51 | 693 | 12/26/2021 |
6.1.2112.50 | 657 | 12/26/2021 |
6.1.2112.49 | 724 | 12/26/2021 |
6.1.2112.48 | 669 | 12/26/2021 |
6.1.2112.47 | 714 | 12/26/2021 |
6.1.2112.46 | 679 | 12/26/2021 |
6.1.2112.45 | 739 | 12/24/2021 |
6.1.2112.44 | 737 | 12/24/2021 |
6.1.2112.43 | 758 | 12/24/2021 |
6.1.2112.42 | 703 | 12/24/2021 |
6.1.2112.41 | 780 | 12/24/2021 |
6.1.2112.40 | 720 | 12/24/2021 |
6.1.2112.39 | 692 | 12/23/2021 |
6.1.2112.38 | 730 | 12/23/2021 |
6.1.2112.36 | 711 | 12/22/2021 |
6.1.2112.35 | 709 | 12/22/2021 |
6.1.2112.34 | 696 | 12/21/2021 |
6.1.2112.33 | 705 | 12/21/2021 |
6.1.2112.32 | 712 | 12/17/2021 |
6.1.2112.31 | 772 | 12/17/2021 |
6.1.2112.30 | 684 | 12/17/2021 |
6.1.2112.29 | 691 | 12/16/2021 |
6.1.2112.28 | 740 | 12/15/2021 |
6.1.2112.27 | 737 | 12/8/2021 |
6.1.2112.26 | 999 | 12/8/2021 |
6.1.2112.25 | 972 | 12/8/2021 |
6.1.2112.24 | 745 | 12/7/2021 |
6.1.2112.23 | 700 | 12/7/2021 |
6.1.2112.22 | 989 | 12/6/2021 |
6.0.2111.20 | 760 | 11/22/2021 |
1.1.2111.18 | 761 | 11/7/2021 |
1.0.2110.17 | 799 | 10/29/2021 |
1.0.2110.16 | 763 | 10/26/2021 |
1.0.2110.15 | 817 | 10/25/2021 |
1.0.2110.14 | 878 | 10/23/2021 |
1.0.2110.13 | 783 | 10/22/2021 |
1.0.2110.12 | 772 | 10/20/2021 |
1.0.2110.11 | 748 | 10/20/2021 |
1.0.2110.10 | 784 | 10/20/2021 |
1.0.2110.9 | 846 | 10/16/2021 |
1.0.2110.8 | 773 | 10/13/2021 |
1.0.2110.7 | 743 | 10/13/2021 |
1.0.2110.6 | 778 | 10/13/2021 |
1.0.2110.5 | 810 | 10/12/2021 |
1.0.2110.4 | 766 | 10/9/2021 |
1.0.2110.3 | 743 | 10/9/2021 |
1.0.2110.2 | 770 | 10/7/2021 |
1.0.2110.1 | 784 | 10/4/2021 |