Changeset 4331


Ignore:
Timestamp:
10/12/03 18:21:50 (19 years ago)
Author:
piso
Message:

Added execute() methods.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/GenericFunction.java

    r4324 r4331  
    33 *
    44 * Copyright (C) 2003 Peter Graves
    5  * $Id: GenericFunction.java,v 1.1 2003-10-12 16:11:51 piso Exp $
     5 * $Id: GenericFunction.java,v 1.2 2003-10-12 18:21:50 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    4141    }
    4242
     43    public LispObject execute() throws ConditionThrowable
     44    {
     45        LispObject[] args = new LispObject[0];
     46        return execute(args);
     47    }
     48
     49    public LispObject execute(LispObject arg) throws ConditionThrowable
     50    {
     51        LispObject[] args = new LispObject[1];
     52        args[0] = arg;
     53        return execute(args);
     54    }
     55
     56    public LispObject execute(LispObject first, LispObject second)
     57        throws ConditionThrowable
     58    {
     59        LispObject[] args = new LispObject[2];
     60        args[0] = first;
     61        args[1] = second;
     62        return execute(args);
     63    }
     64
     65    public LispObject execute(LispObject first, LispObject second,
     66                              LispObject third) throws ConditionThrowable
     67    {
     68        LispObject[] args = new LispObject[3];
     69        args[0] = first;
     70        args[1] = second;
     71        args[2] = third;
     72        return execute(args);
     73    }
     74
     75    public LispObject execute(LispObject[] args) throws ConditionThrowable
     76    {
     77        return funcall(getDiscriminatingFunction(), args, LispThread.currentThread());
     78    }
     79
    4380    private static final Primitive1 GENERIC_FUNCTION_DISCRIMINATING_FUNCTION =
    4481        new Primitive1("generic-function-discriminating-function", PACKAGE_SYS, false)
Note: See TracChangeset for help on using the changeset viewer.