Changeset 12456


Ignore:
Timestamp:
02/13/10 15:28:44 (11 years ago)
Author:
vvoutilainen
Message:

Stack-friendly SpecialOperators?.

File:
1 edited

Legend:

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

    r12290 r12456  
    4141{
    4242  // ### quote
    43   private static final SpecialOperator QUOTE =
    44     new SpecialOperator(Symbol.QUOTE, "thing")
    45     {
     43  private static final SpecialOperator QUOTE = new sf_quote();
     44  private static final class sf_quote extends SpecialOperator {
     45      sf_quote()
     46      {
     47        super(Symbol.QUOTE, "thing");
     48      }
     49 
    4650      @Override
    4751      public LispObject execute(LispObject args, Environment env)
     
    5559
    5660  // ### if
    57   private static final SpecialOperator IF =
    58     new SpecialOperator(Symbol.IF, "test then &optional else")
    59     {
     61  private static final SpecialOperator IF = new sf_if();
     62  private static final class sf_if extends SpecialOperator {
     63      sf_if()
     64      {
     65        super(Symbol.IF, "test then &optional else");
     66      }
     67 
    6068      @Override
    6169      public LispObject execute(LispObject args, Environment env)
     
    8593
    8694  // ### let
    87   private static final SpecialOperator LET =
    88     new SpecialOperator(Symbol.LET, "bindings &body body")
    89     {
     95  private static final SpecialOperator LET = new sf_let();
     96  private static final class sf_let extends SpecialOperator {
     97      sf_let()
     98      {
     99        super(Symbol.LET, "bindings &body body");
     100      }
     101 
    90102      @Override
    91103      public LispObject execute(LispObject args, Environment env)
     
    99111
    100112  // ### let*
    101   private static final SpecialOperator LET_STAR =
    102     new SpecialOperator(Symbol.LET_STAR, "bindings &body body")
    103     {
     113  private static final SpecialOperator LET_STAR = new sf_let_star();
     114  private static final class sf_let_star extends SpecialOperator {
     115      sf_let_star()
     116      {
     117        super(Symbol.LET_STAR, "bindings &body body");
     118      }
     119 
    104120      @Override
    105121      public LispObject execute(LispObject args, Environment env)
     
    174190
    175191  // ### symbol-macrolet
    176   private static final SpecialOperator SYMBOL_MACROLET =
    177     new SpecialOperator(Symbol.SYMBOL_MACROLET, "macrobindings &body body")
    178     {
     192  private static final SpecialOperator SYMBOL_MACROLET = new sf_symbol_macrolet();
     193  private static final class sf_symbol_macrolet extends SpecialOperator {
     194      sf_symbol_macrolet()
     195      {
     196        super(Symbol.SYMBOL_MACROLET, "macrobindings &body body");
     197      }
     198 
    179199      @Override
    180200      public LispObject execute(LispObject args, Environment env)
     
    224244
    225245  // ### load-time-value form &optional read-only-p => object
    226   private static final SpecialOperator LOAD_TIME_VALUE =
    227     new SpecialOperator(Symbol.LOAD_TIME_VALUE,
    228                         "form &optional read-only-p")
    229     {
     246  private static final SpecialOperator LOAD_TIME_VALUE = new sf_load_time_value();
     247  private static final class sf_load_time_value extends SpecialOperator {
     248      sf_load_time_value()
     249      {
     250        super(Symbol.LOAD_TIME_VALUE,
     251                        "form &optional read-only-p");
     252      }
     253 
    230254      @Override
    231255      public LispObject execute(LispObject args, Environment env)
     
    245269
    246270  // ### locally
    247   private static final SpecialOperator LOCALLY =
    248     new SpecialOperator(Symbol.LOCALLY, "&body body")
    249     {
     271  private static final SpecialOperator LOCALLY = new sf_locally();
     272  private static final class sf_locally extends SpecialOperator {
     273      sf_locally()
     274      {
     275        super(Symbol.LOCALLY, "&body body");
     276      }
     277 
    250278      @Override
    251279      public LispObject execute(LispObject args, Environment env)
     
    260288
    261289  // ### progn
    262   private static final SpecialOperator PROGN =
    263     new SpecialOperator(Symbol.PROGN, "&rest forms")
    264     {
     290  private static final SpecialOperator PROGN = new sf_progn();
     291  private static final class sf_progn extends SpecialOperator {
     292      sf_progn()
     293      {
     294        super(Symbol.PROGN, "&rest forms");
     295      }
     296 
    265297      @Override
    266298      public LispObject execute(LispObject args, Environment env)
     
    273305
    274306  // ### flet
    275   private static final SpecialOperator FLET =
    276     new SpecialOperator(Symbol.FLET, "definitions &body body")
    277     {
     307  private static final SpecialOperator FLET = new sf_flet();
     308  private static final class sf_flet extends SpecialOperator {
     309      sf_flet()
     310      {
     311        super(Symbol.FLET, "definitions &body body");
     312      }
     313 
    278314      @Override
    279315      public LispObject execute(LispObject args, Environment env)
     
    285321
    286322  // ### labels
    287   private static final SpecialOperator LABELS =
    288     new SpecialOperator(Symbol.LABELS, "definitions &body body")
    289     {
     323  private static final SpecialOperator LABELS = new sf_labels();
     324  private static final class sf_labels extends SpecialOperator {
     325      sf_labels()
     326      {
     327        super(Symbol.LABELS, "definitions &body body");
     328      }
     329 
    290330      @Override
    291331      public LispObject execute(LispObject args, Environment env)
     
    365405
    366406  // ### the value-type form => result*
    367   private static final SpecialOperator THE =
    368     new SpecialOperator(Symbol.THE, "type value")
    369     {
     407  private static final SpecialOperator THE = new sf_the();
     408  private static final class sf_the extends SpecialOperator {
     409      sf_the()
     410      {
     411        super(Symbol.THE, "type value");
     412      }
     413 
    370414      @Override
    371415      public LispObject execute(LispObject args, Environment env)
     
    400444
    401445  // ### progv
    402   private static final SpecialOperator PROGV =
    403     new SpecialOperator(Symbol.PROGV, "symbols values &body body")
    404     {
     446  private static final SpecialOperator PROGV = new sf_progv();
     447  private static final class sf_progv extends SpecialOperator {
     448      sf_progv()
     449      {
     450        super(Symbol.PROGV, "symbols values &body body");
     451      }
     452 
    405453      @Override
    406454      public LispObject execute(LispObject args, Environment env)
     
    428476
    429477  // ### declare
    430   private static final SpecialOperator DECLARE =
    431     new SpecialOperator(Symbol.DECLARE, "&rest declaration-specifiers")
    432     {
     478  private static final SpecialOperator DECLARE = new sf_declare();
     479  private static final class sf_declare extends SpecialOperator {
     480      sf_declare()
     481      {
     482        super(Symbol.DECLARE, "&rest declaration-specifiers");
     483      }
     484 
    433485      @Override
    434486      public LispObject execute(LispObject args, Environment env)
     
    440492
    441493  // ### function
    442   private static final SpecialOperator FUNCTION =
    443     new SpecialOperator(Symbol.FUNCTION, "thing")
    444     {
     494  private static final SpecialOperator FUNCTION = new sf_function();
     495  private static final class sf_function extends SpecialOperator {
     496      sf_function()
     497      {
     498        super(Symbol.FUNCTION, "thing");
     499      }
     500 
    445501      @Override
    446502      public LispObject execute(LispObject args, Environment env)
     
    498554
    499555  // ### setq
    500   private static final SpecialOperator SETQ =
    501     new SpecialOperator(Symbol.SETQ, "&rest vars-and-values")
    502     {
     556  private static final SpecialOperator SETQ = new sf_setq();
     557  private static final class sf_setq extends SpecialOperator {
     558      sf_setq()
     559      {
     560        super(Symbol.SETQ, "&rest vars-and-values");
     561      }
     562 
    503563      @Override
    504564      public LispObject execute(LispObject args, Environment env)
Note: See TracChangeset for help on using the changeset viewer.