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

Events (change "main" procedure) #9

Closed
bates64 opened this issue Oct 28, 2016 · 8 comments
Closed

Events (change "main" procedure) #9

bates64 opened this issue Oct 28, 2016 · 8 comments

Comments

@bates64
Copy link
Contributor

bates64 commented Oct 28, 2016

to main do
    display(factorial(5))
end

Although main in C makes sense, here (since Haumea seems very english-like) it doesn't make much sense - perhaps

to begin do
to start do

could work better as a starting procedure?

@jeandrek
Copy link
Contributor

Is there any advantage to requiring a "main" procedure at all?

@BookOwl
Copy link
Member

BookOwl commented Oct 28, 2016

It provides a natural place to put the starting code.

@bates64
Copy link
Contributor Author

bates64 commented Oct 28, 2016

It provides a natural place to put the starting code.

You could put the main procedure anywhere, no?

to main do /* it's at the top now! */
  this()
end

to this do
  display(25)
end

If you can support it, just make Haumea a scripting language (i.e. the main function is everything not within a procedure)!

@TheMonsterFromTheDeep
Copy link

Even if main is a block, it doesn't necessarily have to be a function. What about something like

on entry do
    display("Hello, world!")
end

@BookOwl
Copy link
Member

BookOwl commented Oct 31, 2016

How about this?

when started do
  display(1)
end

@bates64
Copy link
Contributor Author

bates64 commented Nov 3, 2016

"when" says 'event' to me. Could we add events to the standard library (async!)

@BookOwl
Copy link
Member

BookOwl commented Nov 3, 2016

When you think about it, the program starting is basically an event. As far as other events go, sure.

@bates64 bates64 changed the title Change "main" function name Change "main" procedure Nov 4, 2016
@bates64 bates64 changed the title Change "main" procedure Events (change "main" procedure) Nov 5, 2016
@BookOwl
Copy link
Member

BookOwl commented Nov 8, 2016

Moved to haumea-lang/spec#3

@BookOwl BookOwl closed this as completed Nov 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants