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

Indentation rules overlap with ":" #52

Closed
Frozen1084 opened this issue Mar 7, 2023 · 1 comment
Closed

Indentation rules overlap with ":" #52

Frozen1084 opened this issue Mar 7, 2023 · 1 comment

Comments

@Frozen1084
Copy link

Frozen1084 commented Mar 7, 2023

I'm very confused why we still need to use ":" to define new blocks of code even though we are using indentation rules. Isn't this already defined by indentation?

It's a waste if it's just to support one-line patterns as well.
if true: print 123

Another comment, can the "func" keyword be replaced with the more concise "fn"?
My preference would be: fn > fnunc > function

Sometimes, when someone is particularly fond of using concise variable names. e.g. st pt li, then when he uses a language with very long keywords, the code becomes particularly stupid.

@fubark
Copy link
Owner

fubark commented Mar 7, 2023

In both cases, the reason is for readability.

A colon after each block is a consistent pattern that indicates you are beginning a new block rather than continuing an expr on the next line. This is actually very important since Cyber is very structural in it's syntax.

"func" is preferred because it's not too short and not too long to convey what it is. Shorter doesn't automatically make something "better" or less wasteful. If the goal was to come up with the shortest acronym, this would be a different language. (Probably not a very well designed one)

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