🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Epoch: Structure definitions get an overhaul

Published February 21, 2012
Advertisement
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
}
0 likes 2 comments

Comments

Washu
[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
February 22, 2012 05:29 AM
ApochPiQ
Pedantry. :-P
February 23, 2012 12:00 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement