From 5129f6c17bb029a753480d146d0a2f01aea21deb Mon Sep 17 00:00:00 2001 From: Mike Cifelli Date: Mon, 27 Feb 2017 14:54:31 -0500 Subject: [PATCH] Minor cleanup in SYMBOL-FUNCTION --- src/function/builtin/SYMBOL_FUNCTION.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/function/builtin/SYMBOL_FUNCTION.java b/src/function/builtin/SYMBOL_FUNCTION.java index 1dbf27b..d7eb4d0 100644 --- a/src/function/builtin/SYMBOL_FUNCTION.java +++ b/src/function/builtin/SYMBOL_FUNCTION.java @@ -25,18 +25,18 @@ public class SYMBOL_FUNCTION extends LispFunction { LispFunction function = FunctionTable.lookupFunction(symbol.toString()); if (function != null) - return createSymbolRepresentation(symbol, function); + return createRepresentation(symbol, function); throw new UndefinedSymbolFunctionException(symbol); } - private SExpression createSymbolRepresentation(SExpression symbol, LispFunction function) { + private SExpression createRepresentation(SExpression symbol, LispFunction function) { if (function instanceof UserDefinedFunction) return ((UserDefinedFunction) function).getLambdaExpression(); - else if (function instanceof LispSpecialFunction) - return new Symbol(MessageFormat.format("#", symbol.toString())); - return new Symbol(MessageFormat.format("#", symbol.toString())); + String typeIndicator = function instanceof LispSpecialFunction ? "SPECIAL-FUNCTION" : "FUNCTION"; + + return new Symbol(MessageFormat.format("#<{0} {1}>", typeIndicator, symbol)); } public static class UndefinedSymbolFunctionException extends LispException {