diff --git a/PorygonSharp/EvalValues/EvalValueCreator.cs b/PorygonSharp/EvalValues/EvalValueCreator.cs index c585254..8d8b900 100644 --- a/PorygonSharp/EvalValues/EvalValueCreator.cs +++ b/PorygonSharp/EvalValues/EvalValueCreator.cs @@ -10,6 +10,8 @@ namespace PorygonSharp.EvalValues { public static EvalValue CreateValue(object o) { + if (o == null) + return new EvalValue(CreateNilEvalValue()); var type = o.GetType(); if (type.IsEnum && !type.IsGenericParameter) { @@ -64,6 +66,8 @@ namespace PorygonSharp.EvalValues return new EvalValue(ptr); } + [DllImport("libPorygonLang", EntryPoint = "CreateNilEvalValue",CallingConvention = CallingConvention.Cdecl)] + internal static extern IntPtr CreateNilEvalValue(); [DllImport("libPorygonLang", EntryPoint = "CreateIntegerEvalValue",CallingConvention = CallingConvention.Cdecl)] internal static extern IntPtr CreateIntegerEvalValue(long l); [DllImport("libPorygonLang", EntryPoint = "CreateFloatEvalValue",CallingConvention = CallingConvention.Cdecl)] diff --git a/PorygonSharp/libPorygonLang.so b/PorygonSharp/libPorygonLang.so index 4100788..a0cafda 100755 Binary files a/PorygonSharp/libPorygonLang.so and b/PorygonSharp/libPorygonLang.so differ