Skip to content

How to import standard library functions

Fully qualified access

Call any standard library function directly using its full path:

      $::str::trim '  hello  '
hello

Import by name

Use #import to bind a function to a local name:

      #import $::str::trim
      trim '  hello  '
hello

Import with an alias

      #import $::str::trim as strip
      strip '  hello  '
hello

List functions in a namespace

      )fns $::str
lower  trim  upper

Available namespaces

  • $::str -- string utilities (trim, upper, lower)
  • $::io -- file I/O (nread, nwrite)
  • $::error -- error handling (ea, en)

See also: Standard library reference