Full List of Functions

THIS HAS NOT BEEN UPDATED. IT IS AN ACCURATE LIST OF FUNCTIONS BUT THE DESCRIPTIONS ARE INACCURATE. DISREGARD.

Functions in Psilo

When running a function, we take the last elements of the stack

  • lines

    • input: string

    • output: array of strings split on "\n"

  • csv

    • input: string

    • output: array of strings split on ","

  • jsonparse

    • input: string

    • output: json object of string (if valid) (ie array or dictionary)

  • shell, sh,

    • input: string

    • output: result of shell command as string

  • runshell, run

    • input: string

    • output: none

    • action: run shell command in connected terminal

  • insertshell, insert

    • input: string

    • output

    • action: insert shell command in connected terminal (but not run)

  • env

    • input: none

    • output: adds shell environment variables as a JSON object dictionary to the stack

Useful chained command

  • env "PWD" jsprop

    • input: none

    • output: get the value of the "PWD" environment variable

  • figread

    • input: file path as a string

    • output: contents of file as string

  • figwrite

    • input: file path as a string

    • output: none

    • action: writes content of string to file

  • figclose

    • input: none

    • output: none

    • action: closes fig window, ends execution

  • prop

    • input: (json object, string)

    • output: get the value of the "string" from the json object

e.g.

  • "person.name" prop

    • gets the value of person.name from the object on the stack

  • "a[0].b.c" prop

  • matches

    • Input: (string, regex pattern (as string))

    • Output: array of strings matching regex pattern

  • prefix?

    • Input: (stringOne, stringTwo)

    • Output: Boolean: checks if stringOne starts with stringTwo

  • suffix?

    • Input: (stringOne, stringTwo)

    • Output: Boolean: checks if stringOne ends with stringTwo

  • contains?

    • Input: (stringOne, stringTwo)

    • Output: Boolean: checks if stringOne contains stringTwo

  • filter

    • input: (array, function)

    • output: new array only keeping results of function that are true

  • map

    • input: (array, function)

    • output: new array mapping function over stack

  • =

    • input (numberOne, numberTwo)

    • output: check if numberOne is equal to numberTwo

  • s=

    • input (stringOne, stringTwo)

    • output: check if stringOne is equal to stringTwo

  • !

    • input: boolean

    • output: opposite of input boolean

Parsing

Types

  • "sdfsdf"

    • String

  • 121

    • Number

  • "[ "sdfs", "aaa", 121 ]" json

    • Array

  • true / false

    • Boolean

  • ??Everything else:

    • Psilo function

Last updated