TYPEOF


stack debug
Since v1.0.0
Available on all platforms

Gets the type of an element.

The TYPEOF function consumes the top element on the stack and pushes back a string containing the type. The output could be:

  • BITSET
  • BOOLEAN
  • BYTES
  • COUNTER
  • DOUBLE
  • GEOSHAPE
  • GTS
  • LIST
  • LONG
  • MACRO
  • MAP
  • MAPPER
  • MATRIX
  • NULL
  • PFONT
  • PGRAPHICS
  • PIMAGE
  • PSHAPE
  • REDUCER
  • SET
  • STRING
  • VECTOR
  • VLIST

Signature

Examples

// NULL NULL TYPEOF // STRING "hello" TYPEOF // LONG 42 TYPEOF // DOUBLE pi TYPEOF // BOOLEAN 2 2 == TYPEOF // LIST [ 4 ] 'c' + TYPEOF // MAP { 'key' 42.3 } TYPEOF // MACRO <% DROP %> TYPEOF // MAPPER mapper.sigmoid TYPEOF // REDUCER reducer.count TYPEOF // GTS NEWGTS TYPEOF // BYTES 'hello' 'UTF8' ->BYTES TYPEOF // PGRAPHICS 2 2 '2D' PGraphics TYPEOF // GEOSHAPE 'POLYGON ((-4.574435 48.641404, -4.565680 48.641404, -4.565680 48.636101, -4.574435 48.636101, -4.574435 48.641404 ))' 0.1 true GEO.WKT TYPEOF // SET ( 5 7 ) TYPEOF // BITSET '0010110001000011' BIN-> BYTESTOBITS TYPEOF 'BITSET' == ASSERT // VLIST [ 'ss' 42 ] ->V TYPEOF // VECTOR [ 4 5.5 ] ->VEC TYPEOF // MATRIX [ [ 42 41 40 42.42 ] [ 42 41 40 0.2 ] [ 42 41 40 42.42 ] ] ->MAT TYPEOF