(2014-09-05) Something Something Darkly

So I've been working on a little secret project for a new module as part of bashlib (I know, I know). Something I can only find a very small handful of people trying it (because why would you, I guess).

I'm not 100% there yet, but it is shaping up fairly nicely:

source ~/bin/bashlib/bashlib.sh
bashlib.load "class"

MyClass__construct () {
	this : name="no_name_set"
	echo "Object" $( this @ ReturnName ) "created"

MyClass_SetName () {
	this : name="${1}"

MyClass_ReturnName () {
	this - name

MyClass__destruct () {
	echo "Object" $( this @ ReturnName ) "destroyed"

class.new MyClass "class_a" { name="name_a_set" }
class.new MyClass "class_b" { }
echo "Object" $( class_a : ReturnName ) "returned"
echo "Object" $( class_b : ReturnName ) "returned"
class_a : SetName "new_name_a"
class_b : SetName "new_name_b"
class.destroy MyClass "class_a"
class.destroy MyClass "class_b"
% bash ./class.test.sh
Object no_name_set created
Object no_name_set created
Object name_a_set returned
Object no_name_set returned
Object new_name_a destroyed
Object new_name_b destroyed

Can you guess what it is yet? Here's the full function list:

% declare -F | grep -v bashlib
declare -f MyClass_ReturnName
declare -f MyClass_SetName
declare -f MyClass__construct
declare -f MyClass__destruct
declare -f class.destroy
declare -f class.new
declare -f class_a
declare -f class_b
declare -f this

On a different note; I'm working on proper documentation for bashlib as well (just a README file for now) and after the next version (1.5.3) I will be including a proper diff changelog from then on (I've really slacked since moving off of github). 1.5.3 will have a changelog since 1.5.2b (as that's the last publicly avaliable version). I will also be keeping public revisions as of 1.5.3 (1.5.2b will not be avaliable afterwards).

Bear with me on the documentation though, the next version wont have a fleshed out function reference as that is going to take a fair amount of time and there are some other changes I want to push.