This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//A collection of small Java 8 related utility methods, just for the fun of it. | |
public class Java8Tricks { | |
public static <T> Stream<T> stream(Iterator<? extends T> iterator) { | |
return StreamSupport.stream(Spliterators.spliteratorUnknownSize(iterator, Spliterator.ORDERED), false); | |
} | |
public static <A, B> Iterator<Entry<A, B>> zip(Iterator<? extends A> s1, Iterator<? extends B> s2) { | |
return Iterators.transform(s1, e1 -> immutableEntry(e1, s2.next())); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jpl.Atom; | |
import jpl.Compound; | |
import jpl.JPL; | |
import jpl.Query; | |
import jpl.Term; | |
/** | |
* This class shows how to configure Logtalk in SWI or YAP using the Jpl library. | |
* You need to have the jpl jar in your classpath to compile and execute this file. |