Michael Starberg said:
news:eabc413e-a4ea-4bf4-822b-9389dcafd97b@m34g2000hsf.googlegroups.com...
C+- 2.0 in action.
// Licence: This source is Copylefted, Also known as Public Domain in the
good old days.
// You may use the below source in any way possible; without no freakin'
GPL.
// Nev
subject a; //a declared
strong subject b = 5; //b declared and probably won't contain any near value
of 5.
weak subject c = 6 orelse; // c declared and probably will contain the value
of 6.
//we start slow. let's compare b and c.
if (b >> c)
{
//b is much better than c.
//let's do some more assignments
Boolean d = new Boolean(whatif(b == a)); //who knows?
//and some error handling
please
{
//let's check and change the state of d.
if (d == DUBIOUS)
{
d = TRUE; //will most likely to yield an runtime error as the orelse
keyword is missing.
}
}
whythehellnot
{
//runtime error caught here, must check VB-lameness
Dim v As Variant
Set v = oldmama(d)
If Not ( Not (((v = Nothing) Or (v = Null) Or (v = Empty) Or (v =
Error))) Then
Else
d = True;
Else If
}
}
else
{
//b had no chance.
return orelse; // the orelse directive on return is not mandatory, but you
never know!
}
//Anyways we still got to assign a.
a = b + c;
//a should be assigned but is still very volatile. Let's make sure.
Dino dino = new Dino(a);
if (evenifnot(a == b + c))
{
dino.torch();
}
// a is assigned and by dragonfear alone, a probably helped in scaring b and
c also.
// a should contain the value of 11.
There is more to know.
Less realistic languages like Java and C# builds into jar-files or
..dll-assemblies.
C+- does not compile nor link. The C+- runtime have gatherings.
Gatherings are a set of meetings. Each meeting can take place at anytime
while coding. This is why we recommend you to save only when you have clean
code, to avoid weird class-mutations, that subjects would laugh at during a
gathering.
It is in gatherings the power of subject oriented programming comes into
play. During a gathering, each subject will enumerate every other subject,
forget half of them, and discard but a few that they will call friends. The
rest is ignored.
Friends will participate in meetings and will mostly be associated with the
default value of non-humpable, until proven otherwise; which happens way too
often. This will be fixed in the paradise-edition. Some subjects will still
be friends even after a hammering of whynot-, evenifnot- and
foreachtry-attempt.
It is common for subjects to implement the standard interface IAdversary.
Having this feature as an interface is highly valuable, as to ensure that
no-one really knows what the methods .Slap(Subject s) and .Kill(Subject s)
really do.
Also consider LINQ - Linear Intrusive Non Quearable
In c+- you can do this:
var q =
kinda from x in gathering
where x is like nice
ordersomewhatby greatness
poke x
select stuff from x
The result is hidden by subject extentions, also called hardons, but always
implements an IGroup<T> and will contain subjects who likes to be selected
and those lame subjects that respects the authorata of being poked.
Also, the var keyword let's the JITCer invent imaginary subjects. Hence, by
inference, the compiler can tell if a subject is lonely and via projection
create a virtual friend that may be type-safe and may implement IHumpable.