Package jason.stdlib

Class type

All Implemented Interfaces:
InternalAction, Serializable

@Manual(literal=".type(argument,type)", hint="retrieves types of the argument or checks whether the argument is of a given type", argsHint={"the term to be checked","the given type or a variable to retrieves types"}, argsType={"term","term or variable"}, examples={".type(\"home page\",string): true",".type(b(10),string): false",".type(b,T): unifies T with the term \'atom\' and backtracks unifying T with \'literal\' and \'ground\'",".type(X,T): unifies T with the term \'free\' if X is free, or other types if X is not free"}, seeAlso={"jason.stdlib.atom","jason.stdlib.list","jason.stdlib.literal","jason.stdlib.number","jason.stdlib.string","jason.stdlib.structure","jason.stdlib.ground"}) public class type extends DefaultInternalAction

Internal action: .type.

Description: retrieves types of the argument.

Parameter:

  • + argument (any term): the term to be checked.
  • +/- type (atom or variable): the given type or a variable. Values are atoms.

Examples:

  • .type(\"home page\",string): true.
  • .type(b(10),string): false.
  • .type(b,T): unifies T with the term 'atom' and backtracks unifying T with 'literal' and 'ground'.
  • .type(X,T): unifies T with the term 'free' if X is free, or other types if X is not free.
See Also: