diff --git a/Jellyfin.Plugin.SmartPlaylist/Lisp/Interpreter.cs b/Jellyfin.Plugin.SmartPlaylist/Lisp/Interpreter.cs index 5ca8df6..7027c09 100644 --- a/Jellyfin.Plugin.SmartPlaylist/Lisp/Interpreter.cs +++ b/Jellyfin.Plugin.SmartPlaylist/Lisp/Interpreter.cs @@ -503,6 +503,9 @@ namespace Jellyfin.Plugin.SmartPlaylist.Lisp { switch (expression) { case Symbol s: if (_environment.Find(s.Name()) is not IEnvironment env) { + if (builtins.ContainsKey(s.Name()) || builtinsLater.ContainsKey(s.Name())) { + return s; + } throw new ApplicationException($"Could not find '{s.Name()}'"); } var r_ = env.Get(s.Name()); diff --git a/Tests/Tests.cs b/Tests/Tests.cs index 3f358d1..1b4714d 100644 --- a/Tests/Tests.cs +++ b/Tests/Tests.cs @@ -258,6 +258,7 @@ namespace Tests //Assert.Equal("", e.eval("(rand)").ToString()); //Assert.Equal("", e.eval("(shuf (list 0 1 2 3 4 5 6))").ToString()); Assert.Equal("(1 2 3 4 5 6 7)", e.eval("(qsort (lambda (a b) (> a b)) '(5 4 7 3 2 6 1))").ToString()); + Assert.Equal("(1 2 3 4 5 6 7)", e.eval("(qsort > (list 5 4 7 3 2 6 1))").ToString()); } } }