Charles-Johnson / zia_programming

A language that can program itself
https://zia-lang.org
GNU General Public License v3.0
3 stars 0 forks source link

defining arrays #64

Closed Charles-Johnson closed 4 months ago

Charles-Johnson commented 2 years ago
let ([ _x_ ])[ 0 ] -> _x_
let ([ _x_ , _y_)[ 0 ] -> _x_
let ([ _x_ , _y_)[ _i_ +1 ] -> ([ _y_)[ _i_ ]
let 1 := 0 +1

so ([ 8 , 7, 4 ])[ 1 ] evaluates to 7

Charles-Johnson commented 5 months ago

I should try to make a tutorial for this

Charles-Johnson commented 5 months ago

Created a pull request for the tutorial: #79