[armedbear-devel] 0.18 and beyond

logicmoo at gmail.com logicmoo at gmail.com
Fri Nov 6 08:59:00 UTC 2009


>> How do you then pass the primitive as one? Like passing EQ/EQUAL/EQUALP
>> to FIND/POSITION family of functions?

Oh right, I understand the question a little better

Here is that impl:
http://larkc.svn.sourceforge.net/viewvc/larkc/trunk/platform/src/com/cyc/tool/subl/jrtl/nativeCode/subLisp/Sequences.java?revision=254&view=markup


  public static final SubLObject find(SubLObject item, SubLObject sequence,
      SubLObject test, SubLObject key, SubLObject start, SubLObject end) {

    // throw type error or allow user to supply a sequence type
    SubLSequence sequenceTyped = sequence.toSeq();

  // find or compile 2 arg signture version of the Test function
  // if UNPROVIDED use EQ
    BinaryFunction testFunction = extractBinaryFunc(test);

  // find or compile 1 arg signture version of the key function
    UnaryFunction keyFunction = extractUnaryFunc(key);

 //unboxers  (or force user to supply an int if not coercable)
    int startTyped = extractStart(start);
    int endTyped   = extractEnd(end);

   // use the specific Seq find/5 impl
    SubLObject result = sequenceTyped.find(item, testFunction,
      keyFunction, startTyped, endTyped);

    return result;
  }






More information about the armedbear-devel mailing list