Jump to content
  • Advertisement
  • entries
    628
  • comments
    1454
  • views
    1010494

Epoch: Structure definitions get an overhaul

Sign in to follow this  
ApochPiQ

911 views

Instead of working on changing variable initialization syntax (which is hard) I decided to make structures work again in the R12 compiler, which turned out to be more or less just as hard.

The results are pleasing, though:

structure outer :
integer foo,
inner bar

structure inner :
string baz,
string quux

structure test :
integer foo,
string bar,
(func : integer -> string),
(voidfunc : )


Overall, I'm pretty happy with this.

Next I promise I'll work on variable initialization. Here's a preview of what I want it to look like:

structure complex :
real RealPart,
real ImaginaryPart

entrypoint :
{
integer foo = 42
complex i = 0, 1
print(i * i) // in a special world with custom operator overloads, prints -1
}
Sign in to follow this  


2 Comments


Recommended Comments

[quote][code] print(i * i) // in a special world with custom operator overloads, prints -1[/code][/quote]
Shouldn't that print like -1, 0 or perhaps <-1, 0> just to be sane

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!