Not Python

From Esolang
Jump to navigation Jump to search

Not Python is a language created by User:PythonshellDebugwindow.

Functions

To call a non-user-created function:

$fname

To create a function:

{code}

To return a value x in a function:

{*x}

The above, but print x first:

{x printer:; *x}

Create a function that returns the nth value passed to it (1-based):

{*@@n}

To call the nth user-created function (0-based):

$n

To call the nth function with a args, add %arg a times.

Main

Last function is the main function. All code other than function definitions, global variable/constant definitions, and function imports should be written here, as not putting statements in a function would raise an error.

Not in main function

Import function

[vImport ^fname]

Global variable def

[_vname_value]

Global constant def

[_vname__value]

Examples

Hello, World!

{<Hello, World!> printer:}

Cat

[vImport ^in]{$in printer:}

Truth-machine

[vImport ^eq][vImport ^in]{&$eq%$in%'1' Forever ='1' printer:/Forever|| '0' printer:}

Create a function to add 2 numbers and call it

{*(@@1 + @@2)}{$0%5%10 printer:}

Create a function to find the area of a circle with radius and call it

[vImport ^MATHPI]{*((@@1 * 2) * MATHPI)}{$0%5 printer:}