Beispiel #1
0
        public LispObjectReader(LispHost host)
        {
            _host = host;

            _host.AddFunction("SET-MACRO-CHARACTER", (__host, executionState, args) =>
            {
                if (args.Length == 2 &&
                    args[0] is LispCharacter character &&
                    args[1] is LispFunctionReference functionRef)
                {
                    _macroFunctions.Add(character.Value, functionRef);
                    return(__host.Nil);
                }

                return(new LispError("Expected character and function reference"));
            });