Package de.tuhrig.thofu.types

Examples of de.tuhrig.thofu.types.LObject.run()


        list = new LList();

        for (Object o : args)
          list.add(new LJObject(o));

        return result.run(environment, list);
      }
    };
  }
}
View Full Code Here


          LObject name = tmp.getFirst();
          LObject expression = tmp.getRest();
         
          environment.put(LSymbol.get(name), new LJObject(e));
         
          return expression.run(environment, expression);
        }
      }
    });

    // (begin (expression1) (expression2) ...)
View Full Code Here

          LObject second = ((LList) tokens).get(1);

          if(second instanceof LOperation)
            expression = second; //.run(environment, tokens);
          else
            expression = second.run(environment, tokens);
        }

        // if we have a lambda (not an other variable) we can name it
        if (expression instanceof LLambda)
          ((LLambda) expression).setName(name.toString());
View Full Code Here

        if (!environment.contains(LSymbol.get(name)))
          throw new LException(name + " is undefined");

        LObject second = ((LList) tokens).get(1);

        second = second.run(environment, tokens);

        environment.set(LSymbol.get(name), second);
 
        return second;
      }
View Full Code Here

      public LObject evaluate(Environment environment, LObject tokens) {

        LObject object = ((LList) tokens).get(0);

        if(!(object instanceof LOperation))
          object = object.run(environment, tokens);

        builder.append(object.toString());

        return object;
      }
View Full Code Here

        LObject result = condition.run(environment, tokens);

        if (result.equals(LBoolean.TRUE)) {

          LObject ifExpression = ((LList) tokens).get(1);
          return ifExpression.run(environment, tokens);
        }

        else {

          LObject elseExpression = ((LList) tokens).get(2);
View Full Code Here

        }

        else {

          LObject elseExpression = ((LList) tokens).get(2);
          return elseExpression.run(environment, tokens);
        }
      }
    });
   
    // (for (define i 0) (< i 5) (set! i (+ i 1)) (print i))
View Full Code Here

        LList list = (LList) tokens;
             
        LObject c = list.get(0).run(environment, tokens);
        LLambda lambda = (LLambda) list.get(1).run(environment, tokens);
       
        LJClass cl = (LJClass) c.run(environment, tokens);

        return LJava.createInterface((Class<?>) cl.getJObject(), lambda, environment);
      }
    });
   
View Full Code Here

        LList list = (LList) tokens;
             
        LObject c = list.get(0).run(environment, tokens);
        LLambda lambda = (LLambda) list.get(1).run(environment, tokens);
       
        LJClass cl = (LJClass) c.run(environment, tokens);

        return LJava.createClass((Class<?>) cl.getJObject(), lambda, environment);
      }
    });
   
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.