Changeset 11465


Ignore:
Timestamp:
12/21/08 22:16:29 (13 years ago)
Author:
ehuelsmann
Message:

Make clear difference between calling the template evaluator or evaluating the object. (Relates to ClosureTemplateFunction?.)

Location:
trunk/abcl/src/org/armedbear/lisp
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/ClosureTemplateFunction.java

    r11391 r11465  
    3434package org.armedbear.lisp;
    3535
    36 public abstract class ClosureTemplateFunction extends Closure
     36public class ClosureTemplateFunction extends Closure
     37        implements Cloneable
    3738{
     39
     40  public LispObject[] ctx;
     41
    3842  public ClosureTemplateFunction(LispObject lambdaList)
    3943    throws ConditionThrowable
     
    4246  }
    4347
     48  public ClosureTemplateFunction setContext(LispObject[] context)
     49  {
     50    ctx = context;
     51    return this;
     52  }
     53
     54  public ClosureTemplateFunction dup()
     55      throws CloneNotSupportedException
     56  {
     57      return (ClosureTemplateFunction)super.clone();
     58  }
     59
     60
     61
     62    // execute methods have the semantic meaning
     63    // "evaluate this object"
    4464  public final LispObject execute() throws ConditionThrowable
    4565  {
    46     return notImplemented();
     66      return _execute(ctx);
    4767  }
    4868
    4969  public final LispObject execute(LispObject arg) throws ConditionThrowable
    5070  {
    51     return notImplemented();
     71      return _execute(ctx);
    5272  }
    5373
     
    5575    throws ConditionThrowable
    5676  {
    57     return notImplemented();
     77      return _execute(ctx, first, second);
    5878  }
    5979
     
    6282    throws ConditionThrowable
    6383  {
    64     return notImplemented();
     84      return _execute(ctx, first, second, third);
    6585  }
    6686
     
    6989    throws ConditionThrowable
    7090  {
    71     return notImplemented();
     91      return _execute(ctx, first, second, third, fourth);
    7292  }
    7393
     
    7797    throws ConditionThrowable
    7898  {
    79     return notImplemented();
     99      return _execute(ctx, first, second, third, fourth, fifth);
    80100  }
    81101
     
    85105    throws ConditionThrowable
    86106  {
    87     return notImplemented();
     107      return _execute(ctx, first, second, third, fourth, fifth, sixth);
    88108  }
    89109
     
    94114    throws ConditionThrowable
    95115  {
    96     return notImplemented();
     116      return _execute(ctx, first, second, third, fourth, fifth, sixth, seventh);
    97117  }
    98118
     
    103123    throws ConditionThrowable
    104124  {
    105     return notImplemented();
     125      return _execute(ctx, first, second, third, fourth, fifth,
     126              sixth, seventh, eighth);
     127  }
     128
     129  public final LispObject execute(LispObject[] args)
     130    throws ConditionThrowable
     131  {
     132    return _execute(ctx, args);
    106133  }
    107134
     
    111138  }
    112139
     140
     141    // _execute methods have the semantic meaning
     142    // "evaluate this template with these values"
     143
    113144  // Zero args.
    114   public LispObject execute(LispObject[] context) throws ConditionThrowable
     145  public LispObject _execute(LispObject[] context) throws ConditionThrowable
    115146  {
    116147    LispObject[] args = new LispObject[0];
    117     return execute(context, args);
     148    return _execute(context, args);
    118149  }
    119150
    120151  // One arg.
    121   public LispObject execute(LispObject[] context, LispObject first)
     152  public LispObject _execute(LispObject[] context, LispObject first)
    122153    throws ConditionThrowable
    123154  {
    124155    LispObject[] args = new LispObject[1];
    125156    args[0] = first;
    126     return execute(context, args);
     157    return _execute(context, args);
    127158  }
    128159
    129160  // Two args.
    130   public LispObject execute(LispObject[] context, LispObject first,
     161  public LispObject _execute(LispObject[] context, LispObject first,
    131162                            LispObject second)
    132163    throws ConditionThrowable
     
    135166    args[0] = first;
    136167    args[1] = second;
    137     return execute(context, args);
     168    return _execute(context, args);
    138169  }
    139170
    140171  // Three args.
    141   public LispObject execute(LispObject[] context, LispObject first,
     172  public LispObject _execute(LispObject[] context, LispObject first,
    142173                            LispObject second, LispObject third)
    143174    throws ConditionThrowable
     
    147178    args[1] = second;
    148179    args[2] = third;
    149     return execute(context, args);
     180    return _execute(context, args);
    150181  }
    151182
    152183  // Four args.
    153   public LispObject execute(LispObject[] context, LispObject first,
     184  public LispObject _execute(LispObject[] context, LispObject first,
    154185                            LispObject second, LispObject third,
    155186                            LispObject fourth)
     
    161192    args[2] = third;
    162193    args[3] = fourth;
    163     return execute(context, args);
     194    return _execute(context, args);
    164195  }
    165196
    166197  // Five args.
    167   public LispObject execute(LispObject[] context, LispObject first,
     198  public LispObject _execute(LispObject[] context, LispObject first,
    168199                            LispObject second, LispObject third,
    169200                            LispObject fourth, LispObject fifth)
     
    176207    args[3] = fourth;
    177208    args[4] = fifth;
    178     return execute(context, args);
     209    return _execute(context, args);
    179210  }
    180211
    181212  // Six args.
    182   public LispObject execute(LispObject[] context, LispObject first,
     213  public LispObject _execute(LispObject[] context, LispObject first,
    183214                            LispObject second, LispObject third,
    184215                            LispObject fourth, LispObject fifth,
     
    193224    args[4] = fifth;
    194225    args[5] = sixth;
    195     return execute(context, args);
     226    return _execute(context, args);
    196227  }
    197228
    198229  // Seven args.
    199   public LispObject execute(LispObject[] context, LispObject first,
     230  public LispObject _execute(LispObject[] context, LispObject first,
    200231                            LispObject second, LispObject third,
    201232                            LispObject fourth, LispObject fifth,
     
    211242    args[5] = sixth;
    212243    args[6] = seventh;
    213     return execute(context, args);
     244    return _execute(context, args);
    214245  }
    215246
    216247  // Eight args.
    217   public LispObject execute(LispObject[] context, LispObject first,
     248  public LispObject _execute(LispObject[] context, LispObject first,
    218249                            LispObject second, LispObject third,
    219250                            LispObject fourth, LispObject fifth,
     
    231262    args[6] = seventh;
    232263    args[7] = eighth;
    233     return execute(context, args);
     264    return _execute(context, args);
    234265  }
    235266
    236267  // Arg array.
    237   public LispObject execute(LispObject[] context, LispObject[] args)
     268  public LispObject _execute(LispObject[] context, LispObject[] args)
    238269    throws ConditionThrowable
    239270  {
  • trunk/abcl/src/org/armedbear/lisp/CompiledClosure.java

    r11391 r11465  
    5454    public LispObject execute() throws ConditionThrowable
    5555    {
    56         return ctf.execute(context);
     56        return ctf._execute(context);
    5757    }
    5858
    5959    public LispObject execute(LispObject arg) throws ConditionThrowable
    6060    {
    61         return ctf.execute(context, arg);
     61        return ctf._execute(context, arg);
    6262    }
    6363
     
    6565        throws ConditionThrowable
    6666    {
    67         return ctf.execute(context, first, second);
     67        return ctf._execute(context, first, second);
    6868    }
    6969
     
    7272        throws ConditionThrowable
    7373    {
    74         return ctf.execute(context, first, second, third);
     74        return ctf._execute(context, first, second, third);
    7575    }
    7676
     
    7979        throws ConditionThrowable
    8080    {
    81         return ctf.execute(context, first, second, third, fourth);
     81        return ctf._execute(context, first, second, third, fourth);
    8282    }
    8383
     
    8787        throws ConditionThrowable
    8888    {
    89         return ctf.execute(context, first, second, third, fourth, fifth);
     89        return ctf._execute(context, first, second, third, fourth, fifth);
    9090    }
    9191
     
    9595        throws ConditionThrowable
    9696    {
    97         return ctf.execute(context, first, second, third, fourth, fifth, sixth);
     97        return ctf._execute(context, first, second, third, fourth, fifth, sixth);
    9898    }
    9999
     
    104104        throws ConditionThrowable
    105105    {
    106         return ctf.execute(context, first, second, third, fourth, fifth, sixth,
     106        return ctf._execute(context, first, second, third, fourth, fifth, sixth,
    107107                           seventh);
    108108    }
     
    114114        throws ConditionThrowable
    115115    {
    116         return ctf.execute(context, first, second, third, fourth, fifth, sixth,
     116        return ctf._execute(context, first, second, third, fourth, fifth, sixth,
    117117                           seventh, eighth);
    118118    }
     
    120120    public LispObject execute(LispObject[] args) throws ConditionThrowable
    121121    {
    122         return ctf.execute(context, args);
     122        return ctf._execute(context, args);
    123123    }
    124124}
  • trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp

    r11464 r11465  
    89408940                (*child-p*
    89418941                 (if *closure-variables*
    8942                      +lisp-ctf-class+
     8942                     (progn
     8943                       (setf execute-method-name
     8944                             (setf (method-name execute-method) "_execute"))
     8945                       (setf (method-name-index execute-method)
     8946                             (pool-name (method-name execute-method)))
     8947                       (setf (method-descriptor-index execute-method)
     8948                             (pool-name (method-descriptor execute-method)))
     8949                       +lisp-ctf-class+)
    89438950                     (if *hairy-arglist-p*
    89448951                         +lisp-compiled-function-class+
Note: See TracChangeset for help on using the changeset viewer.