Introduction

What is ArrEx

ArrEx is a shorthand programming language for Python that allows for easy manipulation of arrays. Some notable features are arithmetic operators, array looping, conditional statements, sorting, regex, and customizable functions.

Installing ArrEx

ArrEx can either be installed through Github or through Pip


pip install ArrayExpressions

Getting Started

The main function that will be used is evaluate

from ArrayExpressions import arrex
lst = [1, 2, 3, 4, 5]
output = arrex.evaluate(lst, "e(x + 1)")
print(output) # [2, 3, 4, 5, 6]

In this code, 'evaluate' will run the code, passing in lst to the scope (represented by 'x'). So, at the beginning of the code, x will equal [1, 2, 3, 4, 5]. In this language, certain functions like e() create a new scope. Essentially, e() loops through each element of the x in scope. So, it loops through the list, and sets the scope of x inside of it to the current element. Look at the table below for a step by step.

StepXCodeReturnComments
1[1, 2, 3, 4, 5]e(x+1)Nothing returned yet
21x + 12Uses the first element and adds to it
32x + 13Pattern continues
43x + 14
54x + 15
65x + 16
7[1, 2, 3, 4, 5][2, 3, 4, 5, 6][2, 3, 4, 5, 6]The code 'e(x+1)' was replaced with an array

What's Next

To continue learning, you can use the arrows on the bottom or press the button in the top left which will give a list of every page. To use it, refer to the installation section on this page. Finally, you can support this project by starring ⭐ the repository on Github!

Function Parameters