(
Jump to the original submission)
Sun 21 Sep 2014 08:57:33 PM UTC, comment #7:
Thank you for the clarifications, I see these points. If such extension would have entered it had to be made without breaking existing code, such as by free string literals like Javascript does with "use strict"; ( http://www.w3schools.com/js/js_strict.asp ) to classify code.
|
Sun 21 Sep 2014 07:28:25 PM UTC, comment #6:
In any case, white space has other meaning.
|
Sun 21 Sep 2014 07:21:44 PM UTC, comment #5:
To my knowledge, Python is the only language that is using indentation as a syntax element (OK, maybe "Sass" and some Wiki markup languages, too).
Introducing this feature to Octave, it would break a lot of existing code (Octave + Matlab) that is coming with inadvertently "sloppy" code formatting.
|
Sun 21 Sep 2014 06:31:57 PM UTC, comment #4:
To me, it's not about readability. I find Python style readable. The issue is that we are targeting the language used by Matlab. That language has END statements and whitespace is ignored in this context. I see no simple way to mix and match the Matlab language syntax for statements like IF, FOR, WHILE, etc., with the Python syntax. So I don't think this is a reasonable request and I'm closing this report.
|
Sun 21 Sep 2014 04:32:22 PM UTC, comment #3:
Can you elaborate on why this is not as readable? Are you refering to a mixed use of indent and end?
If code-blocks are recognizable by indentation depth, it seems very structured and readable to me ( http://effbot.org/pyfaq/why-does-python-use-indentation-for-grouping-of-statements.htm ).
|
Sun 21 Sep 2014 03:32:45 PM UTC, comment #2:
Not a good idea. Better if code is easily
readable.
|
Sun 21 Sep 2014 03:08:39 PM UTC, comment #1:
The example should have looked like:
for a=1:n
___dothis(); # loop body ( are spaces)
dothat(); # outside loop
|
Sun 21 Sep 2014 02:53:10 PM UTC, original submission:
Would it be possible to make the end* statements unnecessary for loops and conditional blocks by evaluating indentation depth (as python forces) ?
So, the end of a block is reached as soon as the indentation depth reduces, ie:
for a=1:n
dothis(); # loop body
dothat(); # outside loop
|
(Note: upload size limit is set to 16384 kB, after insertion of the required
escape characters.)
Attach File(s):
Comment:
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
Follow 2 latest changes.