Advertisement Jump to content
Sign in to follow this  
Alpha_ProgDes

A question about Epoch

This topic is 849 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

//
// A simple Epoch program
//

// Declare an algebraic sum type
type OptionalString : string | nothing

// Define a function
Display : string optstr
{
    print(optstr)
}

// Overload the function
Display : nothing
{
    print("End of line.")
}

// Entry point function
entrypoint :
{
    OptionalString hello = "Hello, world!"
    OptionalString blank = nothing

    Display(hello)
    Display(blank)
}

The Display function. Can it take an OptionalString as an argument and have the function do a pattern match as well? So 3 ways to skin that cat?

Share this post


Link to post
Share on other sites
Advertisement
What language is this? It would be polite to mention it somewhere.

EDIT: Oh, "Epoch" is a programming language??? Edited by Álvaro

Share this post


Link to post
Share on other sites

What language is this? It would be polite to mention it somewhere.

EDIT: Oh, "Epoch" is a programming language???

 

LOL.

 

It was only mentioned in the title, tag, and comment :P

Share this post


Link to post
Share on other sites

What language is this? It would be polite to mention it somewhere.

EDIT: Oh, "Epoch" is a programming language???

A language made by ApochPiQ over the last few years.

Seems mature now.

 

 

L. Spiro

Share this post


Link to post
Share on other sites

It was only mentioned in the title, tag, and comment :P
It didn't say it was a programming language. Epoch is "00:00:00 UTC on 1 January 1970" to me.  :)

Share this post


Link to post
Share on other sites

 

It was only mentioned in the title, tag, and comment :P
It didn't say it was a programming language. Epoch is "00:00:00 UTC on 1 January 1970" to me.  :)

 

 

LOL. Fair enough.

Share this post


Link to post
Share on other sites

The Display function. Can it take an OptionalString as an argument and have the function do a pattern match as well? So 3 ways to skin that cat?



Right now you can only decompose a sum-type/union using overload dispatch. The mechanism it uses is actually currently being refactored to work better on 64-bit platforms and also to support inline decomposition, so... stay tuned I guess? :-)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!