Jump to content

February 2017 »

S M T W T F S
   1234
567891011
12131415161718
19202122232425
2627 28     
- - - - -

Epoch: Structure definitions get an overhaul


Epoch Syntax
4: Adsense

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
}

Feb 21 2012 11:29 PM

print(i * i)          // in a special world with custom operator overloads, prints -1

Shouldn't that print like -1, 0 or perhaps <-1, 0> just to be sane
Feb 22 2012 06:00 PM
Pedantry. :-P

Note: GameDev.net moderates comments.