HuoLanguage / huo

interpreted language written in C
MIT License
212 stars 21 forks source link

Multiplying an entire array with a single value #60

Open snordgren opened 7 years ago

snordgren commented 7 years ago

For writing, for example, a method that scales a data set, it would be useful to be able to write something along the lines of

(* 2 [2, 3])

and get the expected result [4, 6], as well as performing other arithmetic operations or functions where one argument is a single value applied to all elements of an array argument.

I have implemented this feature to familiarize myself with the Huo codebase, it can be found at my constant-array-expansion branch of my fork. Feedback/issues appreciated!