Language ElementsCommentsComments are surrounded by a backquote ("`"). VariablesVariables are dynamically typed; pico uses static scope. var: value FunctionsFunctions are first-class objects in Pico. They can be assigned to variables. For example a function with two parameters param1 and param2 can be defined as func(param1, param2): ... Functions can be called with the following syntax: func(arg1, arg2) OperatorsOperators can be used as prefix or infix in Pico: +(5, 2) 5 + 2 Data TypesPico has the following types: string, integer, real and tables. It does not have a native char type, so users should resort to size 1 strings. Tables are compound datastructures that may contain any of the regular datatypes. Boolean types are represented by functions, in the same way as lambda calculus does. Control StructuresConditional EvaluationOnly the usual if statement is included if(condition, then, else) Code Snippets
display('Hello World', eoln)
max(a, b): if(a < b, b, a) ` http://www.paulgraham.com/accgen.html accgen(n): accfun(num): n + num ImplementationsMac OS / Mac OS XWindows
LinuxCrossplatformExternal links
| |