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

Run interactively does not allow free format #50

Open
edi-meier opened this issue Aug 11, 2013 · 3 comments
Open

Run interactively does not allow free format #50

edi-meier opened this issue Aug 11, 2013 · 3 comments

Comments

@edi-meier
Copy link

#include "aldor"
#include "aldorio"

main(): () ==
{
    maini(): () ==
    {
        stdout << "Hello, world!" << newline;
    }

    maini();
}

main();

is allowed by -fx/-grun/-ginterp, but not for -gloop.
There you have to write

main(): () == {

which is not necessary for maini()

@pippijn
Copy link
Collaborator

pippijn commented Aug 11, 2013

See this comment.

@edi-meier
Copy link
Author

Well, it happens not only for defining functions also with other "braces-constructs", e. g.

%3 >> for i in 1..4 repeat
      ..................................................^
[L4 C51] #1 (Error) Cannot recover from earlier syntax errors.

%4 >> for i in 1..4 repeat {
...   

In the case above indentation works until the closing-brace:

%1 >> #include "aldor"
                                           Comp: 120 msec, Interp: 20 msec
%2 >> #include "aldorio"
                                           Comp: 30 msec, Interp: 0 msec
%3 >> main(): () ==
{
...     maini(): () ==
...     {
...     stdout << "Hello, world!" << newline;
...     }
...     maini();
...     }
      .............^
[L3 C14] #1 (Error) Syntax error.

%4 >>

@pippijn
Copy link
Collaborator

pippijn commented Aug 12, 2013

It's the same reason: you would need to indent it properly. I suppose the loop could do that for you if it detects that indentation is required, but then how would you un-indent? Perhaps indentation levels could be controlled with tab/shift-tab. The loop could be nicer.

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