Package kiss.lang.impl

Examples of kiss.lang.impl.KissException


    return Maybe.create(t);
  }
 
  @Override
  public void validate() {
    if (this!=Null.INSTANCE) throw new KissException(this+ " should be a singleton!");
  }
View Full Code Here


    return "(Value "+value.toString()+")";
  }
 
  @Override
  public void validate() {
    if (!(klass.isInstance(value))) throw new KissException(value+ " is of wrong type, should be "+klass);
  }
View Full Code Here

    return Reference.INSTANCE;
  }
 
  @Override
  public void validate() {
    if (this!=Something.INSTANCE) throw new KissException(this+ " should be a singleton!");
  }
View Full Code Here

    return this;
  }

  @Override
  public void validate() {
    if (this!=Anything.INSTANCE) throw new KissException(this+ " should be a singleton!");
  }
View Full Code Here

  }
 
  @Override
  public void validate() {
    if (type.checkInstance(null)) {
      throw new KissException("Maybe should not contain nullable type!");
    }
    type.validate();
  }
View Full Code Here

  }
 
  @Override
  public void validate() {
    int n=types.length;
    if (n<2) throw new KissException("Intersection must have at least two members");
    for (int i=0; i<n; i++) {
      Type t=types[i];
      t.validate();
      if (t instanceof Anything) throw new KissException(this+ " should not contain Anything");
    }
  }
View Full Code Here

 
  public Object getValue() {
    if (unboundDeps==null) {
      return value;
    } else {
      throw new KissException("Free symbols cannot be resolved: "+unboundDeps.toString());
    }
  }
View Full Code Here

  public Expression getExpression() {
    return exp;
  }

  public IMapEntry toMapEntry(Object key) {
    if (!isBound()) throw new KissException("Free symbols cannot be resolved: "+unboundDeps.toString());
    return new MapEntry((Symbol)key,value);
  }
View Full Code Here

  @Test public void testIntersections() {
    for (Type a:testTypes) {
      for (Type b: testTypes) {
        if (!(a.isWellBehaved()&&b.isWellBehaved())) continue;
        Type c=a.intersection(b);
        if (!c.equals(b.intersection(a))) throw new KissException(a+ " x "+b);
         assertEquals(c,b.intersection(a));
      }
    }
   
    for (Type a:testTypes) {
View Full Code Here

      Var v=RT.var(sym.getNamespace(),sym.getName());
      if (v!=null) return e.withResult(v.deref());
    } catch (Throwable t) {
      String err="Error trying to lookp var "+sym+" ";
      err+=" with Environment "+e.toString();
      throw new KissException(err,t);
    }
   
    throw new KissException("Cannot find Clojure symbol "+sym+" in environment");
  }
View Full Code Here

TOP

Related Classes of kiss.lang.impl.KissException

Copyright © 2018 www.massapicom. 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.