Changeset 3539
- Timestamp:
- 08/28/03 00:00:15 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/j/src/org/armedbear/lisp/Primitives.java
r3538 r3539 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: Primitives.java,v 1.35 8 2003-08-27 17:28:27piso Exp $5 * $Id: Primitives.java,v 1.359 2003-08-28 00:00:15 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 2339 2339 // ### funcall 2340 2340 private static final Primitive FUNCALL = new Primitive("funcall") { 2341 public LispObject execute(LispObject first) throws Condition2341 public LispObject execute(LispObject arg) throws Condition 2342 2342 { 2343 2343 LispObject fun; 2344 if (first instanceof Symbol) { 2345 fun = first.getSymbolFunction(); 2346 if (fun instanceof SpecialOperator) 2347 throw new UndefinedFunctionError(first); 2348 } else 2349 fun = first; 2344 if (arg instanceof Symbol) 2345 fun = arg.getSymbolFunction(); 2346 else 2347 fun = arg; 2350 2348 if (fun instanceof Function) 2351 2349 return funcall0(fun, LispThread.currentThread()); 2352 throw new TypeError(fun, "function");2350 throw new UndefinedFunctionError(arg); 2353 2351 } 2354 2352 public LispObject execute(LispObject first, LispObject second) … … 2356 2354 { 2357 2355 LispObject fun; 2358 if (first instanceof Symbol) {2356 if (first instanceof Symbol) 2359 2357 fun = first.getSymbolFunction(); 2360 if (fun instanceof SpecialOperator) 2361 throw new UndefinedFunctionError(first); 2362 } else 2358 else 2363 2359 fun = first; 2364 2360 if (fun instanceof Function) 2365 2361 return funcall1(fun, second, LispThread.currentThread()); 2366 throw new TypeError(fun, "function");2362 throw new UndefinedFunctionError(first); 2367 2363 } 2368 2364 public LispObject execute(LispObject first, LispObject second, 2369 LispObject third) throws Condition 2365 LispObject third) 2366 throws Condition 2370 2367 { 2371 2368 LispObject fun; 2372 if (first instanceof Symbol) {2369 if (first instanceof Symbol) 2373 2370 fun = first.getSymbolFunction(); 2374 if (fun instanceof SpecialOperator) 2375 throw new UndefinedFunctionError(first); 2376 } else 2371 else 2377 2372 fun = first; 2378 2373 if (fun instanceof Function) 2379 2374 return funcall2(fun, second, third, LispThread.currentThread()); 2380 throw new TypeError(fun, "function");2375 throw new UndefinedFunctionError(first); 2381 2376 } 2382 2377 public LispObject execute(LispObject[] args) throws Condition … … 2384 2379 if (args.length < 1) 2385 2380 throw new WrongNumberOfArgumentsException(this); 2386 LispObject fun = args[0]; 2387 if (fun instanceof Symbol) { 2388 fun = fun.getSymbolFunction(); 2389 if (fun instanceof SpecialOperator) 2390 throw new UndefinedFunctionError(args[0]); 2391 } 2381 LispObject fun; 2382 if (args[0] instanceof Symbol) 2383 fun = args[0].getSymbolFunction(); 2384 else 2385 fun = args[0]; 2392 2386 if (fun instanceof Function) { 2393 2387 final int length = args.length - 1; // Number of arguments. … … 2401 2395 } 2402 2396 } 2403 throw new TypeError(fun, "function");2397 throw new UndefinedFunctionError(args[0]); 2404 2398 } 2405 2399 };
Note: See TracChangeset
for help on using the changeset viewer.