Class Cons

    • Field Detail

      • NAME

        public static final Name NAME
    • Constructor Detail

      • Cons

        public Cons()
    • Method Detail

      • name

        public Name name()
        Description copied from class: PrimitiveFunction
        The unique name of the primitive function.
        Specified by:
        name in class PrimitiveFunction
        Returns:
        the name of this primitive function
      • implementation

        protected java.util.function.Function<java.util.List<Term>,​java.util.function.Function<Context,​java.util.function.Function<Graph,​Either<InContext<Error_>,​Term>>>> implementation()
        Description copied from class: PrimitiveFunction
        A dynamic/interpreted implementation of the function. Subclasses implement this with Either-based logic.
        Specified by:
        implementation in class PrimitiveFunction
        Returns:
        the function implementation
      • apply

        public static <X> ConsList<X> apply​(X el,
                                            ConsList<X> l)
        Apply the function to both arguments.
        Type Parameters:
        X - the element type
        Parameters:
        el - the element to prepend
        l - the list to prepend to
        Returns:
        the list with the element prepended