diff --git a/src/core/FunctionArgument.cs b/src/core/FunctionArgument.cs index c4c33cd..44fed30 100644 --- a/src/core/FunctionArgument.cs +++ b/src/core/FunctionArgument.cs @@ -10,5 +10,11 @@ namespace csmic { public required string Name { get; set; } public required FunctionValue Value { get; set; } + + public FunctionArgument(string name, FunctionValue fv) + { + this.Name = name; + this.Value = fv; + } } } diff --git a/src/core/NuGetPublish.targets b/src/core/NuGetPublish.targets new file mode 100644 index 0000000..4feeb24 --- /dev/null +++ b/src/core/NuGetPublish.targets @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/core/core.csproj b/src/core/core.csproj index 7fdff38..9ddca4e 100644 --- a/src/core/core.csproj +++ b/src/core/core.csproj @@ -1,14 +1,19 @@  - - net9.0 - cs_mic.core - enable - enable - + + net9.0 + cs_mic.core + enable + enable + False + 2.0.0-beta-01 + cs-mic + - - - + + + + + diff --git a/src/cs-mic.sln b/src/cs-mic.sln index eab7569..e021e8e 100644 --- a/src/cs-mic.sln +++ b/src/cs-mic.sln @@ -12,6 +12,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tests", "tests\tests.csproj", "{F356A0E2-1338-43FE-B4C0-1AE7C9F0685F}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "stdlib", "stdlib\stdlib.csproj", "{F7AD600D-4247-49CE-9A26-B20C6F2FF6AE}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -27,6 +29,10 @@ Global {F356A0E2-1338-43FE-B4C0-1AE7C9F0685F}.Debug|Any CPU.Build.0 = Debug|Any CPU {F356A0E2-1338-43FE-B4C0-1AE7C9F0685F}.Release|Any CPU.ActiveCfg = Release|Any CPU {F356A0E2-1338-43FE-B4C0-1AE7C9F0685F}.Release|Any CPU.Build.0 = Release|Any CPU + {F7AD600D-4247-49CE-9A26-B20C6F2FF6AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F7AD600D-4247-49CE-9A26-B20C6F2FF6AE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F7AD600D-4247-49CE-9A26-B20C6F2FF6AE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F7AD600D-4247-49CE-9A26-B20C6F2FF6AE}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/stdlib/Constants.cs b/src/stdlib/Constants.cs new file mode 100644 index 0000000..1d332f0 --- /dev/null +++ b/src/stdlib/Constants.cs @@ -0,0 +1,21 @@ +namespace csmic.stdlib +{ + public class Constants + { + public void Initialize(InputInterpreter inputInterpreter) + { + if(inputInterpreter == null) + { + throw new ArgumentNullException("inputInterpreter", "Cannot initialize a null InputInterpreter."); + } + + inputInterpreter.Interpret("pi :: 3.1415926535897931"); + inputInterpreter.Interpret("e :: 2.7182818284590451"); + inputInterpreter.Interpret("tau :: 6.2831853071795862"); + inputInterpreter.Interpret("phi :: 1.6180339887498948"); + inputInterpreter.Interpret("goldenratio :: 1.6180339887498948"); + inputInterpreter.Interpret("eurler :: 0.5772156649015329"); + inputInterpreter.Interpret("omega :: 0.5671432904097839"); + } + } +} diff --git a/src/stdlib/functions/AbsoluteValue.cs b/src/stdlib/functions/AbsoluteValue.cs new file mode 100644 index 0000000..a350abb --- /dev/null +++ b/src/stdlib/functions/AbsoluteValue.cs @@ -0,0 +1,27 @@ +using csmic; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace stdlib.functions +{ + public class AbsoluteValue : ICodedFunction + { + public IEnumerable ExpectedArguments + { + get + { + yield return new FunctionArgument() { }; + } + } + + public FunctionValue ReturnValue => throw new NotImplementedException(); + + public FunctionValue Execute(params FunctionArgument[] args) + { + throw new NotImplementedException(); + } + } +} diff --git a/src/stdlib/stdlib.csproj b/src/stdlib/stdlib.csproj new file mode 100644 index 0000000..302b8c2 --- /dev/null +++ b/src/stdlib/stdlib.csproj @@ -0,0 +1,17 @@ + + + + net9.0 + enable + enable + + + + + + + + + + +