anoniscoding / yorlang

A programming language with yoruba language construct
https://anoniscoding.github.io/yorlang/
MIT License
450 stars 70 forks source link

jẹ́kí should not be use with increments #58

Closed skyusuf15 closed 5 years ago

skyusuf15 commented 5 years ago

Since jẹ́kí is use for creating variables it makes no sense using it to increment for example fún ( jẹ́kí i = 0 ; i < 5 ; jẹ́kí i = i + 1 ;) {}, jẹ́kí i = i + 1 should be i = i + 1 since variable i as been created, no point creating it again and I don’t see any reason why we should use a keyword to assign values to variables

anoniscoding commented 5 years ago

Thank you for your input. The purpose of yorlang is to allow beginners to interact with programming concepts and syntax in their native tongue.

So the idea of jeki in yorlang is that it should be used whenever you are initializing and re-assigning a variable so that what is going on is clear to a beginner. So we only use the variable name by itself when reading its value in yorlang.

PHP likewise has this feature where a dollar sign is attached to a variable at all times.

More or less we are allowing the beginner to let i be 0 and later when he is incrementing it, the beginner is still aware syntatically that he is simply letting i be 1.

It's the same reason why i++ and i-- are not supported. I'm only trying to make things as clear as possible.

We should also remember that yorlang is not a commercial language. It is just a stepping stone to helping them get familiar with programming concepts and syntaxes in the language they understand the most.

They must still learn the commercial languages that you and I know

anoniscoding commented 5 years ago

Another thing to note, using jeki when re-assigning a variable does not recreate the variable, it simply updates its value in memory. Following my php analogy, $a = 1; changing it to $a = 2; will not recreate the variable $a. It will simply update its value and the same applies in yorlang