Package astra.lang

Class Functions


  • public class Functions
    extends Module
    • Constructor Detail

      • Functions

        public Functions()
    • Method Detail

      • arity

        public int arity​(Funct f)
      • valueAsInt

        public int valueAsInt​(Funct f,
                              int index)
        Term that returns the value at the given index cast as an int.
        Parameters:
        f - the functional term containing the value
        index - the index of the value in the list
        Returns:
        that value at the given index
      • valueAsLong

        public long valueAsLong​(Funct f,
                                int index)
        Term that returns the value at the given index cast as an long.
        Parameters:
        f - the functional term containing the value
        index - the index of the value in the list
        Returns:
        that value at the given index
      • valueAsFunct

        public Funct valueAsFunct​(Funct f,
                                  int index)
        Term that returns the value at the given index cast as an long.
        Parameters:
        f - the functional term containing the value
        index - the index of the value in the list
        Returns:
        that value at the given index
      • valueAsDouble

        public double valueAsDouble​(Funct f,
                                    int index)
        Term that returns the value at the given index cast as an double.
        Parameters:
        f - the functional term containing the value
        index - the index of the value in the list
        Returns:
        that value at the given index
      • valueAsFloat

        public float valueAsFloat​(Funct f,
                                  int index)
        Term that returns the value at the given index cast as an float.
        Parameters:
        f - the functional term containing the value
        index - the index of the value in the list
        Returns:
        that value at the given index
      • valueAsList

        public ListTerm valueAsList​(Funct f,
                                    int index)
        Term that returns the value at the given index cast as a list.
        Parameters:
        f - the functional term containing the value
        index - the index of the value in the list
        Returns:
        that value at the given index
      • valueAsString

        public String valueAsString​(Funct f,
                                    int index)
        Term that returns the value at the given index cast as an string.
        Parameters:
        f - the functional term containing the value
        index - the index of the value in the list
        Returns:
        that value at the given index