Skip navigation

Welcome to the new f(e) hosted on wordpress. I’ve imported all the old posts too, and I must say WP has made it a breeze!

I’ve managed to get more than 100 of fera’s testcases to pass, now! The exact number is 125 / 127 testcases (the remaining two are generics1 and doexits1, both features are not implemented yet). I finished implementing variable parameters and a lot of constructor / object-oriented stuff like base/this constructor calls.

Since it was inherently easy thanks to the way I built the compiler, it is currently possible to call the base version of a virtual method via the constructor-like base() syntax:

public override method void Write (string s):
   base (s)
{
   // x x x
}

This is less to type than using ‘base.Write (s)’ but is limited to situations where the base version should be called first. It only works for methods that return void right now, the compiler emits an error if this is not the case. Also you can only use ‘base’, the compiler doesn’t let you do ‘this’. I’m still on the fence about whether to keep this.

By the way, this isn’t new but I haven’t mentioned it in any other posts: Fera defines constructors and destructors like so:

public construct ()
{
}

public destruct ()
{
}

This is in sharp contrast to almost every other C-family language which make you type the class name of the class for the method name when defining constructors. Not only does this make typing out a new constructor take less time in most scenarios, but no distraction is necessary if you aren’t sure exactly what the class name is your looking at or you forgot the nuances of it’s naming.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: