+ 3
Ideas for new syntax is programming?
So I have this idea for a programmign language where the blocks begin with colon ,the statements end with period and the statements inside blocks and loops end with commas. But how would you do it for nested loops? any ideas?
10 Respuestas
+ 2
Well it does sort of look confusing.
What example code syntax did you have in mind, compared to mine?
+ 2
I was thinking like you, until I remembered the nested blocka. Maybe a semicolon will be useful to separate them.
+ 1
line of code,
main block:
line of code,
line of code,
for loop:
line of code,
if statement:
line of code,
;
line of code,
;
line of code,
.
This is sanely confusing to use, but if you're solely doing the language for the fun of it, go at it. Stanislav Vladev
+ 1
Instead of a fullstop? Maybe that is a better idea. Looks more readable and less confusing than a .
+ 1
A bit inconsistent don't you think? But I guess if that's the rule, it can work.
+ 1
More like
Main block:
Statement.
Statement.
If y = 5 then
Statement, statement, statement;
If condition then statement, statement.
0
put before the colon put some text - class/struct/if etc
yes, it can be confusing if the code is stuffed....
I actually design it seriously.
0
Just like you normally use { and }, the only difference if you want : and . instead.
0
Exactly! I Want the code to look like a real sentece, but looks liek when you use nested blocks it becomes confusing and not like a sentence really. Unless one build a compicated code to check this.
0
No, a semicolon to separate nested blocks inside the main block. The main is still ended with a period.