Up to Main Index                            Up to Journal for August, 2014

                     JOURNAL FOR MONDAY 18TH AUGUST, 2014
______________________________________________________________________________

SUBJECT: A little flattening weirdness
   DATE: Mon 18 Aug 19:10:17 BST 2014

Last WolfMUD Wednesday - and Thursday! - went as planned and I managed to do
some more package flattening work.

However I now how some odd things going on. For example there are some package
level functions which now don't make sense and look plain weird. For example:


  BEFORE:

    account := player.HashAccount(string)


  AFTER:

    account := entities.HashAccount(string)


Now these can be dealt with by making them methods on the player type. However
this seems... messy(?) to just have the receiver for scoping? Maybe not. I'm
Currently digging into the official Go sources for examples and inspiration.

The other weirdness I now have is with constants. For example:


  BEFORE:

    player.BadCredentials


  AFTER:

    entities.BadCredentials


Only this time - as far as I know - you can't scope constants to a type, only
to a package :( Again trawling the official sources for inspiration.

So plenty to tweak, plenty to twiddle, back to the code... :)

--
Diddymus


  Up to Main Index                            Up to Journal for August, 2014