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 {