Changeset 8543
- Timestamp:
- 02/12/05 03:25:00 (18 years ago)
- Location:
- trunk/j/src/org/armedbear/lisp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/j/src/org/armedbear/lisp/LispObject.java
r8516 r8543 3 3 * 4 4 * Copyright (C) 2002-2005 Peter Graves 5 * $Id: LispObject.java,v 1.11 6 2005-02-10 01:49:01piso Exp $5 * $Id: LispObject.java,v 1.117 2005-02-12 03:25:00 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 39 39 } 40 40 41 public String describe() throws ConditionThrowable42 {43 StringBuffer sb = new StringBuffer(writeToString());44 sb.append(" is an object of type ");45 sb.append(typeOf().writeToString());46 sb.append('.');47 return sb.toString();48 }49 50 41 public LispObject getDescription() throws ConditionThrowable 51 42 { -
trunk/j/src/org/armedbear/lisp/Symbol.java
r8421 r8543 3 3 * 4 4 * Copyright (C) 2002-2005 Peter Graves 5 * $Id: Symbol.java,v 1.17 0 2005-01-31 16:31:32piso Exp $5 * $Id: Symbol.java,v 1.171 2005-02-12 03:24:26 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 264 264 } 265 265 266 public String describe() throws ConditionThrowable267 {268 StringBuffer sb = new StringBuffer(writeToString());269 sb.append(" is an ");270 if (pkg == NIL)271 sb.append("uninterned");272 else if (((Package)pkg).findExternalSymbol(getName()) == this)273 sb.append("external");274 else275 sb.append("internal");276 sb.append(" symbol");277 if (pkg != NIL) {278 sb.append(" in the ");279 sb.append(pkg.getName());280 sb.append(" package");281 }282 sb.append(".\n");283 LispObject value = getSymbolValue();284 if (isSpecialVariable()) {285 sb.append("It is a ");286 sb.append(isConstant() ? "constant" : "special variable");287 sb.append("; ");288 if (value != null) {289 sb.append("its value is ");290 sb.append(value.writeToString());291 } else292 sb.append("it is unbound");293 sb.append(".\n");294 } else if (value != null) {295 sb.append("It is an undefined variable; its value is ");296 sb.append(value.writeToString());297 sb.append(".\n");298 }299 LispObject function = getSymbolFunction();300 if (function != null) {301 sb.append("Its function binding is ");302 sb.append(function.writeToString());303 sb.append(".\n");304 if (function instanceof Function) {305 LispObject arglist = ((Function)function).getArglist();306 if (arglist != null) {307 LispThread thread = LispThread.currentThread();308 Binding lastSpecialBinding = thread.lastSpecialBinding;309 thread.bindSpecial(_PRINT_ESCAPE_, NIL);310 sb.append("Function argument list:\n ");311 if (arglist instanceof AbstractString)312 sb.append(arglist.getStringValue());313 else314 sb.append(arglist.writeToString());315 sb.append('\n');316 thread.lastSpecialBinding = lastSpecialBinding;317 }318 }319 LispObject documentation = getFunctionDocumentation();320 if (documentation instanceof AbstractString) {321 sb.append("Function documentation:\n ");322 sb.append(documentation.getStringValue());323 sb.append('\n');324 }325 }326 LispObject plist = getPropertyList();327 if (plist != NIL) {328 sb.append("Its property list has these indicator/value pairs:\n");329 LispObject[] array = plist.copyToArray();330 for (int i = 0; i < array.length; i += 2) {331 sb.append(" ");332 sb.append(array[i].writeToString());333 sb.append(' ');334 sb.append(array[i+1].writeToString());335 sb.append('\n');336 }337 }338 return sb.toString();339 }340 341 266 public LispObject getDescription() throws ConditionThrowable 342 267 {
Note: See TracChangeset
for help on using the changeset viewer.