Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
skyusuf15 opened this issue Dec 31, 2018 · 2 comments
Closed

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

skyusuf15 opened this issue Dec 31, 2018 · 2 comments

Comments

@skyusuf15
Copy link
Contributor

skyusuf15 commented Dec 31, 2018

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
Copy link
Owner

anoniscoding commented Dec 31, 2018

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
Copy link
Owner

anoniscoding commented Dec 31, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants