Package org.jatha.dynatype

Examples of org.jatha.dynatype.LispValue


  public LispConsOrNil makeAppendList(Collection elements)
  {
    if (elements.size() == 0)
      return NIL;

    LispValue result = NIL;
    for (Iterator iterator = elements.iterator(); iterator.hasNext();)
    {
      LispValue o = (LispValue) iterator.next();
      result = result.append(o);
    }

    return (LispConsOrNil) result;
  }
View Full Code Here


  public LispConsOrNil makeNconcList(Collection elements)
  {
    if (elements.size() == 0)
      return NIL;

    LispValue result = NIL;
    for (Iterator iterator = elements.iterator(); iterator.hasNext();)
    {
      LispValue o = (LispValue) iterator.next();
      result = result.nconc(o);
    }

    return (LispConsOrNil) result;
  }
View Full Code Here

    super(lisp, "STRING/=", 2);
  }

  public void Execute(SECDMachine machine)
  {
    LispValue arg2 = machine.S.pop();
    LispValue arg1 = machine.S.pop();

    machine.S.push(arg1.stringNeq(arg2));
    machine.C.pop();
  }
View Full Code Here

    super(lisp, "STRING=", 2);
  }

  public void Execute(SECDMachine machine)
  {
    LispValue arg2 = machine.S.pop();
    LispValue arg1 = machine.S.pop();

    machine.S.push(arg1.stringEq(arg2));
    machine.C.pop();
  }
View Full Code Here

    super(lisp, "STRING-LESSP", 2);
  }

  public void Execute(SECDMachine machine)
  {
    LispValue arg2 = machine.S.pop();
    LispValue arg1 = machine.S.pop();

    machine.S.push(arg1.stringLessP(arg2));
    machine.C.pop();
  }
View Full Code Here

  // Apply is routed through EVAL after the args are parsed.
  public void Execute(SECDMachine machine)
    throws CompilerException
  {
    LispValue args   = machine.S.pop();
    LispValue fn     = args.car();
    LispValue fnArgs = args.cdr();

    // The last arg must be a list.
    if (!validArgumentList(args))
      throw new WrongArgumentTypeException("APPLY", "a CONS in the last argument",
             "a " + fnArgs.last().car().type_of().toString());
    machine.S.push(f_lisp.makeCons(fn, f_lisp.COMPILER.quoteList(constructArgList(fnArgs))));

    // (mh) 4 Sep 2004
    // This seems like a kludge, but I don't know how to get around it.
    // if the fn is a user-defined function, we have to move the arguments to the E register.
View Full Code Here

    super(lisp, "STRING-RIGHT-TRIM", 1, 2);
  }

  public void Execute(SECDMachine machine)
  {
    LispValue arg2 = machine.S.pop();
    LispValue arg1 = machine.S.pop();

    if (arg1 != f_lisp.NIL)
      machine.S.push(arg1.stringRightTrim(arg2));
    else
      machine.S.push(arg2.stringRightTrim());
    machine.C.pop();
  }
View Full Code Here

    super(lisp, "STRING-NOT-LESSP", 2);
  }

  public void Execute(SECDMachine machine)
  {
    LispValue arg2 = machine.S.pop();
    LispValue arg1 = machine.S.pop();

    machine.S.push(arg1.stringNotLessP(arg2));
    machine.C.pop();
  }
View Full Code Here

    super(lisp, "STRING<", 2);
  }

  public void Execute(SECDMachine machine)
  {
    LispValue arg2 = machine.S.pop();
    LispValue arg1 = machine.S.pop();

    machine.S.push(arg1.stringLessThan(arg2));
    machine.C.pop();
  }
View Full Code Here

    super(lisp, "STRING-TRIM", 1, 2);
  }

  public void Execute(SECDMachine machine)
  {
    LispValue arg2 = machine.S.pop();
    LispValue arg1 = machine.S.pop();

    if (arg1 != f_lisp.NIL)
      machine.S.push(arg1.stringTrim(arg2));
    else
      machine.S.push(arg2.stringTrim());
    machine.C.pop();
  }
View Full Code Here

TOP

Related Classes of org.jatha.dynatype.LispValue

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.