Sm

From Esolang
Jump to navigation Jump to search

Sm is an esolang based on Smu, with comments removed.

  • () Push a string to the stack. The string is whatever is inside the parentheses, you can have nested parentheses but it must be nested correctly. Only the characters ()=|+ can be inside a string, other characters are ignored or are processed by the preprocessor.
  • = Pops two strings from the stack, and sets the variable with the name specified by the first string (the top value) to the value specified by the second string. Does nothing if not enough strings on the stack.
  • | Splits a string into a head and a tail and pushes them onto the stack (tail first, the head will then be at the top of the stack). If the string is empty then it will pop it from the stack without pushing anything. Does nothing if stack is empty.
  • + Pops two variable names from the top of the stack and joins their values. Value at top is the name of variable which is the value at end of the string, second from top is the beginning of result string. Does nothing if not enough strings on the stack.