www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - GC.KeepAlive in D and insane stuff

reply fakemail hotmail.com writes:
==================
My insane thoughts
==================

Definition
----------

All my thoughts actually, sinds I'm insane.
"Type Storage System", yeah I'm just dreaming.

Usage
-----

Hmm, bad idea to use insane thoughts.

====================
Programming Language
====================

Definition
----------
Some structure I format some text in, after which I use it to create a
segmentation fault.

Importing Specific Language files
=================================
import file;

Alias on import
===============
using target=boe;



Including Header files
======================
#include "boe.h"


Procedures and Function overloading
===================================

Defining
--------

Unique procedure names, when defining. When calling them the
ambiguity can automatically be resolved, when in the right
context.
From C these functions can then easily be called, they
do have a version number declared behind them.

public static class Library
{
public static procedure DoStuff.Double (double a, double b)
{
}
public static procedure DoStuff.Double.1 (double a, double b)
{
}
public static procedure DoStuff.Int (int a, int b)
{
}
public static procedure DoStuff.Whatever (int a, int b)
{
}
public static procedure WriteLine.String (string boe)
{
}
public static procedure WriteLine.Int(in boe)
{
}
}


Usage Source
------------

double a, b;
Library.DoStuff (a,b);		//calls DoStuff.Double.1 the 1 is the version
identifier.


From C 
------

Darn, this won't work those are managed classes, hmm, how to expose
those to C. No clue.

Library_Add_Double_0 (a, b);
Library_DoStuff_Whatever_0 (c, e);

void Library_WriteLine_String_0(const Compiler_String * boe)
{
}


Operator Overloading
====================

Definition
----------

Less typing, unique procedure or function names.
Maybe get rid of const.

Internals
---------
public class Vector3
{
public static function Vector3 opMul.Vector( const Vector3 a, const Vector3 b)
{
}
public static function Vector3 opMul.Scalar( const double a, const Vector3 b)
{
}
}

Usage
-----
double a; Vector3 b,c;
c=a*b;
c=Vector3.opMul(a,b);
c=Vector3.opMul.Scalar(a,b);

From C
------
c=Library_Vector3_opMul_Vector_0 (a,b);


Classes
=======

1) Defining classes
-------------------

public class Test
{
private:
int test;
public:
Test(int number)
{
this.test = number;
}
virtual procedure DoStuff(string boe)
{	
}
virtual function int Target()
{
return test;
}
~Test()			//Destructor
{
}
}

2) Using classes
-----------------

Test a;

Test a(10);		//Create instance of class and call constructor on it. Test a = new
Test(10);

Test(10);			//Create an instance of a class with auto naming.


Templates
=========

Definition
----------
Generics are created at runtime and templates
must be templatized at compile time.

Internals
---------

public template class Test.[type T]
{
private:
T boe;
public:
Test (string boe)
{
}
}

public generic class Collections.[type T]
{

}

template class can inherit from a generic class but a
generic class can not inherit from a template
class.

templatize Test.[int];		
templatize Test.[float];
templatize Test.[double];

public procedure string Test.[type T] (T a, T b)
{
return (a+b).ToString();
}

Test(a,b);
Test.[int](a,b)

type boe = Test[int];
boe hello;


Usage
-----

Test.[int] Hello("Assign");
Hello[x] = boe;

TypeWindow
TypeUsage
TypeUsage

ValInt
ValUint

Test.[int]
Test.[float];


Test.[int]	//Warning Test[int] has not been templatized,
//warning templatization occured more than once.

GNOME
-----

__Test();

Library__Library();	//Destructor
Library_Library();	//Constructor	



static interface
=================

Definition
-----------
Serves no other purpose than to give compile time errors and waste disk space. 
Sort of similar to interfaces but you can't pass it as parameter. 


Usage
-----

public static interface DesignApplicationMain
{
public static procedure Main();
}

public static interface class DesignStuff.[type T]
{
}

public class MainClass: DesignApplicationMain
{
public static procedure Main()
{
}
}

public static procedure CannotAsParameter(DesignApplication parameter)		//Error
{
}

static interface and templates
==============================

Definition
----------
Static interfaces can be used with templates.

Usage
-----
public template class Matrix.[StaticInterface T]
{
private T data;			
}



opAppend Operator
=================

Definition
----------
Very special Operator.

The goal is to get rid of HTML, and change them into types.
Sort of new script language.

Limit usage of types defined in scripts can only be stored in
volatile memory.

Internal
--------
public class Body
{
public procedure opAppend.Heading1 (H1 heading) {}
public procedure opAppend.Heading2 (H2 heading) {}
public procedure opAppend.P (P paragraph) {}
}

Usage Source
------------

H1 heading1;
Body {
heading1("The Book");
H2("Chapter 1");
H2("Chapter 2");
}
heading1.Onclick = this.HelloWorld;


XML
===

Xml, get rid of it. It eats up to much space.

From:

<html></html>

To:

Html {
}

And make Html a class type, with methods.

Enforce Names
=============

Events start with Event
------------------------
EventRightMouseButtonDown
EventLeftMouseButtonDown

Member events start with On
---------------------------
public EventRightMouseButtonDown OnRightMouseButtonDown

Enforce virtual or override for members calling an event start with Do
----------------------------------------------------------------------

protected virtual procedure	DoRightMouseButtonDown
{
if (OnRightButtonDown) OnRightButtonDown(self, blabla);
}

Maybe I'm pushing it with this enforcing.

Naming Convention
-----------------
Never MainWindow but WindowMain, FormCustom, AttributeDllImport


Storage Specifier
=================

Definition
----------
Stores a certain type either on the disk or in memory in the current directory, 
visible only from the current computer.

The names of everything stored in there must be unique, everything either
it is stored in disk or in memory.

Usage from Console
------------------

computer permanent int Boe;
computer memory int Hello;


Storage Directory System
========================

Definition
----------
Storage of types and instances of types in permanent
and volatile manner.

Permanent memory is stored on a disk. When a method
is called of a type on the disk a process is startup
to execute the method but that won't be shown in 
the storage system. 

In volatile memory section are stored the instances
of applications that are running. Methods of them
can also be accessed from a remote machine.


Internals
---------

diskonly class ConsoleClass {
console procedure Clear();
}

diskonly class Directory:ConsoleClass
{
diskonly private static string currentPath;

console procedure Add.Directory (Directory directory)
{
}
console procedure ChangeDirectory (string directory)
{
}
}

Usage from Console
------------------

ChangeDirectory ("FirstDirectory");
Clear();	


Console
=======

All the methods of the class Directory can be executed in the current directory.
All other types can be added to a directory.

Although Path can be defined as a string in memory, get rid of it. No more Path.
Scripts starts by defining the path like
using Library.Kernel.Routines;

Oh, Code Completion in the Console, it uses the information from Reflection,
Introspection

In the console, just type everything. Use the mouse or other application if it
becomes to hard. Wussy.

Starting an Application
=======================

Definition
----------

Starts an instance with constructor parameters, these instructions can be
executed
from the console as well from	with the code.

Note the WordApplication can only be started in memory.

Usage from Console
------------------

Applications.WordApplication;				//Auto Naming of instance from console

Applications.WordApplication first;

computer memory Applications.WordApplication first("Mydocument");		//instance
visible on local computer
first.Terminate();

computer memory WordApplication WordApplication; //Error names must be unique.


need something for first &;  //in background. hmm.


ApplicationProject
==================

Definition
----------

Starting up a new application project from the console. Should
be made fairly easily. No make files involved. Everything should
already be included in the Projects.ApplicationProject, if not
you can derive a new type from it.

WordApplicationProject.Compile() of course starts up a new process, but
this is entirely hidden from the user. From the users perspective
it is just a type stored on the disk with a method or procedure
Compile();

Although you can derive from ApplicationProject it is difficult
to modify once the instance is created. Auch.

Usage from Console
------------------

disk Projects.ApplicationProject WordApplicationProject;	
WordApplicationProject.AddSourceFile("");
WordApplicationProject.EditSource("");
WordApplicationProject.Compile();

disk type WordApplication = WordApplicationProject.ExtractApplication;


Documentation
=============

Definition
----------

Provides information for the user and is compiled into the library.
Reflection can get the information out of it. Every method can have 
its own documentation or any type derived from it.

Package, Application, Documentation are all one single package.

Example example1 {
H1("This is an example of how to use Console.WriteLine");
Code("
Console.WriteLine("boe");
");
}


Internals
---------

public class Documentation
{
public procedure opAppend.Header1 (H1 header);
public procedure opAppend.Header2 (H2 header);
}

Usage
-----
Documentation ("This is documentation");
Documentation boe ("This is the actual information");

public procedure Dostuff()
{
public Documentation MyDocumentation
{
H1("First Chapter");
H1("Second Chapter");
P("This is the first
Paragraph and I hope
That it will work"
);
}
public Documentation SecondDocumentation
{
}
}


GtkWindow ("Caption")
{
GtkVBox
{
GtkButton button1;
GtkButton button2;
}
}

Remote Computer
===============

Definition
----------

Define types and store them on a remote machine.
A popup may appear asking the username and password.
This can be executed in the console as well in the
source code. Errors will occur when the type
is not defined on the remote machine.

192.168.0.2 is actually really a fixed location
must be able to replace it with a variable.

Also a type of variable that specifies a location
but that consists of multiple computers. A
Type Storage System over multiple computers.


Usage
-----

remote permanent string 192.168.0.2/Information.Boe = "Hello world";


Transactions
============



Package Maintainers
===================

Definition
----------
Dudes that create packages, we should try to make them go extinct.
Seek way to make them go extinct. (not with weapons)


Type Storage System
===================

Definition
----------
1. Everything stored is a type or instance of a type.
2. Everything in that storage has a unique name.
3. Everything is stored in the default location defined
by the developer.

if Application.WordApplication depends on Library.Kernel.Console
the directory defines it uniquely the package name and path.
No extensions are needed. Console has a type.

Application.InstallationManager.Install("Library.Kernel.Console");
Application.InstallationManager.Install(200.200.200.200/Library.Kernel.Console);

Possibly a layer over the existing file system.

SQL
---

Hmm, try to get rid of it.
array.[int] list = {1,2,3,4,5};
array.[int] numbersSmallerThan3 = list[]; //I don't know, but not SQL.



Stored Procedures
-----------------

The types have methods, use those instead.

//Hmm visual basic seems to be better for sql like methods.
192.168.0.3/thetype.Insert(address="", name="");		//Implement the code for
referential constraints in there.
thetype.Select(1, value<2 );    				//column, expression ??	

Somebody else will figure it out, how this should be done.

GUID
----
Get rid of them. If it clashes just change the name.

Library.Kernel.Boe;
Library.Borland.Boe;
Library.Microsoft.Boe;
Library.Mozilla.Hehe;

Application.Mozilla.MozillaBrowser;


Versioning
==========

Definition
----------

In the type storage system everything is defined uniquely. That is how can we
have
two same types with different versioning. The version follows the name of the
type.

DirectoryMy.0
DirectoryMy.2
DirectoryMy.3

Usage from Console
------------------

ChangeDirectory( "DirectoryMy" );			//Goes to DirectoryMy.3
ChangeDirectory( "DirectoryMy.2" );		//Goes to DirectoryMy.2
CreateDirectory( "DirectoryMy" );			//Already exists error
CreateDirectory( "DirectoryNew" );		//Creates DirectoryMy.0 but if there is only
one
//of them the 0 is not displayed
disk Directory DirectoryNewer;


Stability Level
===============

Definition
----------
Prevent libraries or applications to be linked. A new development
project starts usually at stability level 2. Projects can be started
with higher stability levels,	such as a project to test a library.

Stability level should be automatically modified by the project, from
the moment you link your project your stability level is increased
to the appropriate level.

0		Stable
1		Testing
2		Development				Main development branch starts at dependency level 2
3		Experimental			These are branches of the main development branch


Package with stability level A can depend on packages of stability level B or
lower.
There is a distance of 2 for stability levels.

A			B
-------
0			0
1			0
2			0
3			1
4			2


Dependency Level
================

Prevent libraries or applications to be linked.
There is a distance of 1 for dependency levels.

A			B
-------
1			0
2			1
3			2

Package with dependency level A can depend on packages of dependency level B or
lower.

FUTURE DESIGN PROJECT
=====================

Definition
----------

Define a project called specification. Design project.
a TOP DOWN project of the entire operating system,
starting from a users perspective.

Set up a specification board, that will gather new idea's
of an impossible unrealistic FUTURE operating system and
programming language.

Topaz of GNOME is still too realistic.

Maybe a wikipedia project.

Call it FUTURE DESIGN PROJECT, darn it is already a company I think.




Distributions
=============

Package and library or more or less the same thing. They contain a list of all
dependencies.
and thus also in what directories these dependencies are stored.

How to resolve these?

Library.Kernel.MyLibrary386
Library.Kernel.MyLibraryAMD64

Above obviously suck, different names is a nono.

Distribution.AMD64.Linux.Library.Kernel.MyLibrary
Distribution.i386.Windows.Library.Kernel.MyLibrary

The libraries must be in the correct directory before they can be used at all,
because we
are working with a fixed directory system.

Distributions
=============
Documentation is in the source code. 


Login
=====
User
Defines the user, like Users.Borland.Frederick
Team
Define the what is your function on this system, or team.
(Teams.Administration, Teams.Backup)
Password
Password to enter the function or team.

Team
====

Definition
----------

Team and project managed is fully integrated into the operating system,
to login you must already join a team.

Teams.Borland.DelphiTeam

A: TeamLeader, TeamMember, TeamMember
B: TeamLeader, TeamMember, TeamMember

Deny
Permit
DenyButPermitAllow
AllowButPermitDeny

Like names Teams are structured in a tree. TeamMember can be a Team Owner.
Team Onwer can set permissions.

A user can join multiple teams.

Internals
---------

diskonly class Team
{
console static procedure AddUser() //blabla bla
}


Document Format
===============


Definition
----------
A Document Format based on the types on the system. Thus Html
is a class and so is P,	and any other tag.

Usage
-----

using GreenParagraphs;

P paragraph2;

remote Html HtmlFirst {
paragraph2 ("This is the first Paragraph");
remote P ("This is the second Paragraph");
P ("This is the third Paragraph");
private P boe ("blablabla");
A("Next Page", HtmlSecond, HtmlSecond.paragraph13);
A("Remote Page", "212.165.156.200/HtmlPage");
GreenParagraph("These are in green");
P (
"Wouldn't it be a bit
strange to have the
programming language
and html integrated"
);
GtkWindow("Caption");			//Error could not opAppend GtkWindow to Html HtmlFirst.
}


GtkWindow & window = Windows[x];
GtkWindow window = Windows[x];

GtkWindow[int] & window;

public class GtkWindow
{
private string text;
public procedure Caption(string text)
{
this.text = text;
}
public procedure Caption.Value(string text);
public procedure Caption.Ref(ref string text);
{
this.text = text;	
}
public procedure Caption.Ref.1(ref string text)
{
}
public function string Caption()
{
return test;
}
}

Properties
==========

Definition
----------
The following means exactly the same, if you define the procedure
and the function or the property.

Usage
-----	

public property string Caption {
get {
}
set {
}
}

public procedure Caption( string Caption)
{
}

public function string Caption()
{
}


Arrays
======

Definition
----------
Sort of a template thingy.

Internals
---------

public template TypeArray.[type T]
{
}

Usage
-----
array.[int] boe;
array.[int, 10] boe;
array.[type] MyArray={int, string};

hash.[int, string] boe = {1:"Hello", 2:"Boe"};


Enumerated Types
================

Usage
-----
boe(hello);	//Copy constructor

boe=hello;

string
boe = "terminal";
boe("terminal");

boe=target		//only assigns reference
boe("hehe")		//Creates a new string


public procedure Target() const
{
}


public function string ReturnString.Hehe(string boe)
{
}



Keywords
========

Definition
----------

Special words used by compiler such as function, public, class.
All of them are actually enumerated types.

Compiler.KeyWords.Public
Compiler.KeyWords.Class


Usage
-----

Keywords.Public Keywords.Procedure Target()
{
}

Okay maybe pushing it again, overactive imagination, it serves no purpose.


Disk Memory
===========

perma string OnDiskText;
memory string VolatileText("boe");		//default.
unmanaged pointer int boe;
managed pointer int boe;

OnDiskText = VolatileText;		//Creates a copy or a reference? Eh, a copy right?

VolatileText = OnDiskText;		//Eh pffew. maybe again a copy?


Pointer to memory pointer to disk, instance in memory instance on disk.
= permanew Test();
= new Test();

yeps, I don't know, need to think about this.


Define
======
A is defined using B, B is defined using C, C is defined using A.

Naming Project
==============

Give any object a unique name and classify it. This will
give a name to every possible object, or concept.

To be used in artificial intelligence, in the far future.

Element.Animal.Mamal.Dog.Leg
Element.Animal.Mamal.Cat.Leg
Element.Animal.Mamal.Cat.Leg.LeftFrontLeg
Element.Animal.Mamal.Cat.Leg.LeftBackLeg
Element.Animal.Mamal.Cat.Leg.LeftBackLeg.LeftBackLegOfNeighboursCatSarah
Element.Animal.Mamal.Cat.Leg.FrontLegs


So given the right context Element.Animal.Mamal.Cat.Leg can refer
to the left back leg of Sarah.

Or we could use it in translation software. Instead of typing a document
in English, French, the united nations type it in

Element.Animal.Mamal.Cat

Which than with an automated translator changes to

to: cat
to: kat
to: chat

Of course they can type

using Element.Animal;

on top of their document. :-)

Environment Variables
=====================

Just volatile instantiated types in the Type Storage System. With the naming
convention of the type storage system.


UNIQUE
======

Everything must be uniquely defined, but when using it, given the right context,
ambiguity	can be resolved.

TYPE STORAGE SYSTEM
===================

Eh virtual type system or type storage system or just type database.

Store types and instances of types, either in permanent or volatile.
It can store any type that you made, well ... if you can serialize it. 

Its usual structure is a tree of the class type Directory, which has
methods. ChangeDirectory() is one of them.


STOP TYPING THIS STUPID TEXT
============================

You have been typing for more than 8 hours stop it.
Yes, stop it now.

Sorry for eating up your precious time.


Maybe GNOME guys can implement such a system for GObject?



QUESTION ABOUT D
================

Intro
-----

I've got a question about the D programming language, and I compare it



type is not fully aware of this.

Handle here is of type int

Code below has a potential error.

public void TestMethod() {
FileStream fileStream = new FileStream("blabla");
PinvokeStuff.PinvokeMethod(fileStream.Handle, "blabla");
}


That is when fileStream is no longer used the garbage collector
can already start deleting the object wile in PinvokeMethod.

Solution1 use GC.KeepAlive
---------

public void TestMethod() {
FileStream fileStream = new FileStream("blabla");
PinvokeStuff.PinvokeMethod(fileStream.Handle, "blabla");
GC.KeepAlive(fileStream);   //or call fileStream.AnotherMethod()
}

Solution2 use of HandleRef
---------

HandleRef keeps a reference to the object.

Question
--------

My Question. What is the method in D? Or how does D handle this?
Mar 22 2006
parent Kyle Furlong <kylefurlong gmail.com> writes:
I'll top post so that people can actually see it!

He asked this question:

 QUESTION ABOUT D
 ================

 Intro
 -----

 I've got a question about the D programming language, and I compare it



 type is not fully aware of this.

 Handle here is of type int

 Code below has a potential error.

 public void TestMethod() {
 FileStream fileStream = new FileStream("blabla");
 PinvokeStuff.PinvokeMethod(fileStream.Handle, "blabla");
 }


 That is when fileStream is no longer used the garbage collector
 can already start deleting the object wile in PinvokeMethod.

 Solution1 use GC.KeepAlive
 ---------

 public void TestMethod() {
 FileStream fileStream = new FileStream("blabla");
 PinvokeStuff.PinvokeMethod(fileStream.Handle, "blabla");
 GC.KeepAlive(fileStream);   //or call fileStream.AnotherMethod()
 }

 Solution2 use of HandleRef
 ---------

 HandleRef keeps a reference to the object.

 Question
 --------

 My Question. What is the method in D? Or how does D handle this?
Disregard all the other post. fakemail hotmail.com wrote:
 ==================
 My insane thoughts
 ==================
 
 Definition
 ----------
 
 All my thoughts actually, sinds I'm insane.
 "Type Storage System", yeah I'm just dreaming.
 
 Usage
 -----
 
 Hmm, bad idea to use insane thoughts.
 
 ====================
 Programming Language
 ====================
 
 Definition
 ----------
 Some structure I format some text in, after which I use it to create a
 segmentation fault.
 
 Importing Specific Language files
 =================================
 import file;
 
 Alias on import
 ===============
 using target=boe;
 
 
 
 Including Header files
 ======================
 #include "boe.h"
 
 
 Procedures and Function overloading
 ===================================
 
 Defining
 --------
 
 Unique procedure names, when defining. When calling them the
 ambiguity can automatically be resolved, when in the right
 context.
 From C these functions can then easily be called, they
 do have a version number declared behind them.
 
 public static class Library
 {
 public static procedure DoStuff.Double (double a, double b)
 {
 }
 public static procedure DoStuff.Double.1 (double a, double b)
 {
 }
 public static procedure DoStuff.Int (int a, int b)
 {
 }
 public static procedure DoStuff.Whatever (int a, int b)
 {
 }
 public static procedure WriteLine.String (string boe)
 {
 }
 public static procedure WriteLine.Int(in boe)
 {
 }
 }
 
 
 Usage Source
 ------------
 
 double a, b;
 Library.DoStuff (a,b);		//calls DoStuff.Double.1 the 1 is the version
 identifier.
 
 
 From C 
 ------
 
 Darn, this won't work those are managed classes, hmm, how to expose
 those to C. No clue.
 
 Library_Add_Double_0 (a, b);
 Library_DoStuff_Whatever_0 (c, e);
 
 void Library_WriteLine_String_0(const Compiler_String * boe)
 {
 }
 
 
 Operator Overloading
 ====================
 
 Definition
 ----------
 
 Less typing, unique procedure or function names.
 Maybe get rid of const.
 
 Internals
 ---------
 public class Vector3
 {
 public static function Vector3 opMul.Vector( const Vector3 a, const Vector3 b)
 {
 }
 public static function Vector3 opMul.Scalar( const double a, const Vector3 b)
 {
 }
 }
 
 Usage
 -----
 double a; Vector3 b,c;
 c=a*b;
 c=Vector3.opMul(a,b);
 c=Vector3.opMul.Scalar(a,b);
 
 From C
 ------
 c=Library_Vector3_opMul_Vector_0 (a,b);
 
 
 Classes
 =======
 
 1) Defining classes
 -------------------
 
 public class Test
 {
 private:
 int test;
 public:
 Test(int number)
 {
 this.test = number;
 }
 virtual procedure DoStuff(string boe)
 {	
 }
 virtual function int Target()
 {
 return test;
 }
 ~Test()			//Destructor
 {
 }
 }
 
 2) Using classes
 -----------------
 
 Test a;
 
 Test a(10);		//Create instance of class and call constructor on it. Test a =
new
 Test(10);
 
 Test(10);			//Create an instance of a class with auto naming.
 
 
 Templates
 =========
 
 Definition
 ----------
 Generics are created at runtime and templates
 must be templatized at compile time.
 
 Internals
 ---------
 
 public template class Test.[type T]
 {
 private:
 T boe;
 public:
 Test (string boe)
 {
 }
 }
 
 public generic class Collections.[type T]
 {
 
 }
 
 template class can inherit from a generic class but a
 generic class can not inherit from a template
 class.
 
 templatize Test.[int];		
 templatize Test.[float];
 templatize Test.[double];
 
 public procedure string Test.[type T] (T a, T b)
 {
 return (a+b).ToString();
 }
 
 Test(a,b);
 Test.[int](a,b)
 
 type boe = Test[int];
 boe hello;
 
 
 Usage
 -----
 
 Test.[int] Hello("Assign");
 Hello[x] = boe;
 
 TypeWindow
 TypeUsage
 TypeUsage
 
 ValInt
 ValUint
 
 Test.[int]
 Test.[float];
 
 
 Test.[int]	//Warning Test[int] has not been templatized,
 //warning templatization occured more than once.
 
 GNOME
 -----
 
 __Test();
 
 Library__Library();	//Destructor
 Library_Library();	//Constructor	
 
 
 
 static interface
 =================
 
 Definition
 -----------
 Serves no other purpose than to give compile time errors and waste disk space. 
 Sort of similar to interfaces but you can't pass it as parameter. 
 
 
 Usage
 -----
 
 public static interface DesignApplicationMain
 {
 public static procedure Main();
 }
 
 public static interface class DesignStuff.[type T]
 {
 }
 
 public class MainClass: DesignApplicationMain
 {
 public static procedure Main()
 {
 }
 }
 
 public static procedure CannotAsParameter(DesignApplication parameter)		//Error
 {
 }
 
 static interface and templates
 ==============================
 
 Definition
 ----------
 Static interfaces can be used with templates.
 
 Usage
 -----
 public template class Matrix.[StaticInterface T]
 {
 private T data;			
 }
 
 
 
 opAppend Operator
 =================
 
 Definition
 ----------
 Very special Operator.
 
 The goal is to get rid of HTML, and change them into types.
 Sort of new script language.
 
 Limit usage of types defined in scripts can only be stored in
 volatile memory.
 
 Internal
 --------
 public class Body
 {
 public procedure opAppend.Heading1 (H1 heading) {}
 public procedure opAppend.Heading2 (H2 heading) {}
 public procedure opAppend.P (P paragraph) {}
 }
 
 Usage Source
 ------------
 
 H1 heading1;
 Body {
 heading1("The Book");
 H2("Chapter 1");
 H2("Chapter 2");
 }
 heading1.Onclick = this.HelloWorld;
 
 
 XML
 ===
 
 Xml, get rid of it. It eats up to much space.
 
 From:
 
 <html></html>
 
 To:
 
 Html {
 }
 
 And make Html a class type, with methods.
 
 Enforce Names
 =============
 
 Events start with Event
 ------------------------
 EventRightMouseButtonDown
 EventLeftMouseButtonDown
 
 Member events start with On
 ---------------------------
 public EventRightMouseButtonDown OnRightMouseButtonDown
 
 Enforce virtual or override for members calling an event start with Do
 ----------------------------------------------------------------------
 
 protected virtual procedure	DoRightMouseButtonDown
 {
 if (OnRightButtonDown) OnRightButtonDown(self, blabla);
 }
 
 Maybe I'm pushing it with this enforcing.
 
 Naming Convention
 -----------------
 Never MainWindow but WindowMain, FormCustom, AttributeDllImport
 
 
 Storage Specifier
 =================
 
 Definition
 ----------
 Stores a certain type either on the disk or in memory in the current
directory, 
 visible only from the current computer.
 
 The names of everything stored in there must be unique, everything either
 it is stored in disk or in memory.
 
 Usage from Console
 ------------------
 
 computer permanent int Boe;
 computer memory int Hello;
 
 
 Storage Directory System
 ========================
 
 Definition
 ----------
 Storage of types and instances of types in permanent
 and volatile manner.
 
 Permanent memory is stored on a disk. When a method
 is called of a type on the disk a process is startup
 to execute the method but that won't be shown in 
 the storage system. 
 
 In volatile memory section are stored the instances
 of applications that are running. Methods of them
 can also be accessed from a remote machine.
 
 
 Internals
 ---------
 
 diskonly class ConsoleClass {
 console procedure Clear();
 }
 
 diskonly class Directory:ConsoleClass
 {
 diskonly private static string currentPath;
 
 console procedure Add.Directory (Directory directory)
 {
 }
 console procedure ChangeDirectory (string directory)
 {
 }
 }
 
 Usage from Console
 ------------------
 
 ChangeDirectory ("FirstDirectory");
 Clear();	
 
 
 Console
 =======
 
 All the methods of the class Directory can be executed in the current
directory.
 All other types can be added to a directory.
 
 Although Path can be defined as a string in memory, get rid of it. No more
Path.
 Scripts starts by defining the path like
 using Library.Kernel.Routines;
 
 Oh, Code Completion in the Console, it uses the information from Reflection,
 Introspection
 
 In the console, just type everything. Use the mouse or other application if it
 becomes to hard. Wussy.
 
 Starting an Application
 =======================
 
 Definition
 ----------
 
 Starts an instance with constructor parameters, these instructions can be
 executed
 from the console as well from	with the code.
 
 Note the WordApplication can only be started in memory.
 
 Usage from Console
 ------------------
 
 Applications.WordApplication;				//Auto Naming of instance from console
 
 Applications.WordApplication first;
 
 computer memory Applications.WordApplication first("Mydocument");		//instance
 visible on local computer
 first.Terminate();
 
 computer memory WordApplication WordApplication; //Error names must be unique.
 
 
 need something for first &;  //in background. hmm.
 
 
 ApplicationProject
 ==================
 
 Definition
 ----------
 
 Starting up a new application project from the console. Should
 be made fairly easily. No make files involved. Everything should
 already be included in the Projects.ApplicationProject, if not
 you can derive a new type from it.
 
 WordApplicationProject.Compile() of course starts up a new process, but
 this is entirely hidden from the user. From the users perspective
 it is just a type stored on the disk with a method or procedure
 Compile();
 
 Although you can derive from ApplicationProject it is difficult
 to modify once the instance is created. Auch.
 
 Usage from Console
 ------------------
 
 disk Projects.ApplicationProject WordApplicationProject;	
 WordApplicationProject.AddSourceFile("");
 WordApplicationProject.EditSource("");
 WordApplicationProject.Compile();
 
 disk type WordApplication = WordApplicationProject.ExtractApplication;
 
 
 Documentation
 =============
 
 Definition
 ----------
 
 Provides information for the user and is compiled into the library.
 Reflection can get the information out of it. Every method can have 
 its own documentation or any type derived from it.
 
 Package, Application, Documentation are all one single package.
 
 Example example1 {
 H1("This is an example of how to use Console.WriteLine");
 Code("
 Console.WriteLine("boe");
 ");
 }
 
 
 Internals
 ---------
 
 public class Documentation
 {
 public procedure opAppend.Header1 (H1 header);
 public procedure opAppend.Header2 (H2 header);
 }
 
 Usage
 -----
 Documentation ("This is documentation");
 Documentation boe ("This is the actual information");
 
 public procedure Dostuff()
 {
 public Documentation MyDocumentation
 {
 H1("First Chapter");
 H1("Second Chapter");
 P("This is the first
 Paragraph and I hope
 That it will work"
 );
 }
 public Documentation SecondDocumentation
 {
 }
 }
 
 
 GtkWindow ("Caption")
 {
 GtkVBox
 {
 GtkButton button1;
 GtkButton button2;
 }
 }
 
 Remote Computer
 ===============
 
 Definition
 ----------
 
 Define types and store them on a remote machine.
 A popup may appear asking the username and password.
 This can be executed in the console as well in the
 source code. Errors will occur when the type
 is not defined on the remote machine.
 
 192.168.0.2 is actually really a fixed location
 must be able to replace it with a variable.
 
 Also a type of variable that specifies a location
 but that consists of multiple computers. A
 Type Storage System over multiple computers.
 
 
 Usage
 -----
 
 remote permanent string 192.168.0.2/Information.Boe = "Hello world";
 
 
 Transactions
 ============
 
 
 
 Package Maintainers
 ===================
 
 Definition
 ----------
 Dudes that create packages, we should try to make them go extinct.
 Seek way to make them go extinct. (not with weapons)
 
 
 Type Storage System
 ===================
 
 Definition
 ----------
 1. Everything stored is a type or instance of a type.
 2. Everything in that storage has a unique name.
 3. Everything is stored in the default location defined
 by the developer.
 
 if Application.WordApplication depends on Library.Kernel.Console
 the directory defines it uniquely the package name and path.
 No extensions are needed. Console has a type.
 
 Application.InstallationManager.Install("Library.Kernel.Console");
 Application.InstallationManager.Install(200.200.200.200/Library.Kernel.Console);
 
 Possibly a layer over the existing file system.
 
 SQL
 ---
 
 Hmm, try to get rid of it.
 array.[int] list = {1,2,3,4,5};
 array.[int] numbersSmallerThan3 = list[]; //I don't know, but not SQL.
 
 
 
 Stored Procedures
 -----------------
 
 The types have methods, use those instead.
 
 //Hmm visual basic seems to be better for sql like methods.
 192.168.0.3/thetype.Insert(address="", name="");		//Implement the code for
 referential constraints in there.
 thetype.Select(1, value<2 );    				//column, expression ??	
 
 Somebody else will figure it out, how this should be done.
 
 GUID
 ----
 Get rid of them. If it clashes just change the name.
 
 Library.Kernel.Boe;
 Library.Borland.Boe;
 Library.Microsoft.Boe;
 Library.Mozilla.Hehe;
 
 Application.Mozilla.MozillaBrowser;
 
 
 Versioning
 ==========
 
 Definition
 ----------
 
 In the type storage system everything is defined uniquely. That is how can we
 have
 two same types with different versioning. The version follows the name of the
 type.
 
 DirectoryMy.0
 DirectoryMy.2
 DirectoryMy.3
 
 Usage from Console
 ------------------
 
 ChangeDirectory( "DirectoryMy" );			//Goes to DirectoryMy.3
 ChangeDirectory( "DirectoryMy.2" );		//Goes to DirectoryMy.2
 CreateDirectory( "DirectoryMy" );			//Already exists error
 CreateDirectory( "DirectoryNew" );		//Creates DirectoryMy.0 but if there is
only
 one
 //of them the 0 is not displayed
 disk Directory DirectoryNewer;
 
 
 Stability Level
 ===============
 
 Definition
 ----------
 Prevent libraries or applications to be linked. A new development
 project starts usually at stability level 2. Projects can be started
 with higher stability levels,	such as a project to test a library.
 
 Stability level should be automatically modified by the project, from
 the moment you link your project your stability level is increased
 to the appropriate level.
 
 0		Stable
 1		Testing
 2		Development				Main development branch starts at dependency level 2
 3		Experimental			These are branches of the main development branch
 
 
 Package with stability level A can depend on packages of stability level B or
 lower.
 There is a distance of 2 for stability levels.
 
 A			B
 -------
 0			0
 1			0
 2			0
 3			1
 4			2
 
 
 Dependency Level
 ================
 
 Prevent libraries or applications to be linked.
 There is a distance of 1 for dependency levels.
 
 A			B
 -------
 1			0
 2			1
 3			2
 
 Package with dependency level A can depend on packages of dependency level B or
 lower.
 
 FUTURE DESIGN PROJECT
 =====================
 
 Definition
 ----------
 
 Define a project called specification. Design project.
 a TOP DOWN project of the entire operating system,
 starting from a users perspective.
 
 Set up a specification board, that will gather new idea's
 of an impossible unrealistic FUTURE operating system and
 programming language.
 
 Topaz of GNOME is still too realistic.
 
 Maybe a wikipedia project.
 
 Call it FUTURE DESIGN PROJECT, darn it is already a company I think.
 
 
 
 
 Distributions
 =============
 
 Package and library or more or less the same thing. They contain a list of all
 dependencies.
 and thus also in what directories these dependencies are stored.
 
 How to resolve these?
 
 Library.Kernel.MyLibrary386
 Library.Kernel.MyLibraryAMD64
 
 Above obviously suck, different names is a nono.
 
 Distribution.AMD64.Linux.Library.Kernel.MyLibrary
 Distribution.i386.Windows.Library.Kernel.MyLibrary
 
 The libraries must be in the correct directory before they can be used at all,
 because we
 are working with a fixed directory system.
 
 Distributions
 =============
 Documentation is in the source code. 
 
 
 Login
 =====
 User
 Defines the user, like Users.Borland.Frederick
 Team
 Define the what is your function on this system, or team.
 (Teams.Administration, Teams.Backup)
 Password
 Password to enter the function or team.
 
 Team
 ====
 
 Definition
 ----------
 
 Team and project managed is fully integrated into the operating system,
 to login you must already join a team.
 
 Teams.Borland.DelphiTeam
 
 A: TeamLeader, TeamMember, TeamMember
 B: TeamLeader, TeamMember, TeamMember
 
 Deny
 Permit
 DenyButPermitAllow
 AllowButPermitDeny
 
 Like names Teams are structured in a tree. TeamMember can be a Team Owner.
 Team Onwer can set permissions.
 
 A user can join multiple teams.
 
 Internals
 ---------
 
 diskonly class Team
 {
 console static procedure AddUser() //blabla bla
 }
 
 
 Document Format
 ===============
 
 
 Definition
 ----------
 A Document Format based on the types on the system. Thus Html
 is a class and so is P,	and any other tag.
 
 Usage
 -----
 
 using GreenParagraphs;
 
 P paragraph2;
 
 remote Html HtmlFirst {
 paragraph2 ("This is the first Paragraph");
 remote P ("This is the second Paragraph");
 P ("This is the third Paragraph");
 private P boe ("blablabla");
 A("Next Page", HtmlSecond, HtmlSecond.paragraph13);
 A("Remote Page", "212.165.156.200/HtmlPage");
 GreenParagraph("These are in green");
 P (
 "Wouldn't it be a bit
 strange to have the
 programming language
 and html integrated"
 );
 GtkWindow("Caption");			//Error could not opAppend GtkWindow to Html HtmlFirst.
 }
 
 
 GtkWindow & window = Windows[x];
 GtkWindow window = Windows[x];
 
 GtkWindow[int] & window;
 
 public class GtkWindow
 {
 private string text;
 public procedure Caption(string text)
 {
 this.text = text;
 }
 public procedure Caption.Value(string text);
 public procedure Caption.Ref(ref string text);
 {
 this.text = text;	
 }
 public procedure Caption.Ref.1(ref string text)
 {
 }
 public function string Caption()
 {
 return test;
 }
 }
 
 Properties
 ==========
 
 Definition
 ----------
 The following means exactly the same, if you define the procedure
 and the function or the property.
 
 Usage
 -----	
 
 public property string Caption {
 get {
 }
 set {
 }
 }
 
 public procedure Caption( string Caption)
 {
 }
 
 public function string Caption()
 {
 }
 
 
 Arrays
 ======
 
 Definition
 ----------
 Sort of a template thingy.
 
 Internals
 ---------
 
 public template TypeArray.[type T]
 {
 }
 
 Usage
 -----
 array.[int] boe;
 array.[int, 10] boe;
 array.[type] MyArray={int, string};
 
 hash.[int, string] boe = {1:"Hello", 2:"Boe"};
 
 
 Enumerated Types
 ================
 
 Usage
 -----
 boe(hello);	//Copy constructor
 
 boe=hello;
 
 string
 boe = "terminal";
 boe("terminal");
 
 boe=target		//only assigns reference
 boe("hehe")		//Creates a new string
 
 
 public procedure Target() const
 {
 }
 
 
 public function string ReturnString.Hehe(string boe)
 {
 }
 
 
 
 Keywords
 ========
 
 Definition
 ----------
 
 Special words used by compiler such as function, public, class.
 All of them are actually enumerated types.
 
 Compiler.KeyWords.Public
 Compiler.KeyWords.Class
 
 
 Usage
 -----
 
 Keywords.Public Keywords.Procedure Target()
 {
 }
 
 Okay maybe pushing it again, overactive imagination, it serves no purpose.
 
 
 Disk Memory
 ===========
 
 perma string OnDiskText;
 memory string VolatileText("boe");		//default.
 unmanaged pointer int boe;
 managed pointer int boe;
 
 OnDiskText = VolatileText;		//Creates a copy or a reference? Eh, a copy right?
 
 VolatileText = OnDiskText;		//Eh pffew. maybe again a copy?
 
 
 Pointer to memory pointer to disk, instance in memory instance on disk.
 = permanew Test();
 = new Test();
 
 yeps, I don't know, need to think about this.
 
 
 Define
 ======
 A is defined using B, B is defined using C, C is defined using A.
 
 Naming Project
 ==============
 
 Give any object a unique name and classify it. This will
 give a name to every possible object, or concept.
 
 To be used in artificial intelligence, in the far future.
 
 Element.Animal.Mamal.Dog.Leg
 Element.Animal.Mamal.Cat.Leg
 Element.Animal.Mamal.Cat.Leg.LeftFrontLeg
 Element.Animal.Mamal.Cat.Leg.LeftBackLeg
 Element.Animal.Mamal.Cat.Leg.LeftBackLeg.LeftBackLegOfNeighboursCatSarah
 Element.Animal.Mamal.Cat.Leg.FrontLegs
 
 
 So given the right context Element.Animal.Mamal.Cat.Leg can refer
 to the left back leg of Sarah.
 
 Or we could use it in translation software. Instead of typing a document
 in English, French, the united nations type it in
 
 Element.Animal.Mamal.Cat
 
 Which than with an automated translator changes to
 
 to: cat
 to: kat
 to: chat
 
 Of course they can type
 
 using Element.Animal;
 
 on top of their document. :-)
 
 Environment Variables
 =====================
 
 Just volatile instantiated types in the Type Storage System. With the naming
 convention of the type storage system.
 
 
 UNIQUE
 ======
 
 Everything must be uniquely defined, but when using it, given the right
context,
 ambiguity	can be resolved.
 
 TYPE STORAGE SYSTEM
 ===================
 
 Eh virtual type system or type storage system or just type database.
 
 Store types and instances of types, either in permanent or volatile.
 It can store any type that you made, well ... if you can serialize it. 
 
 Its usual structure is a tree of the class type Directory, which has
 methods. ChangeDirectory() is one of them.
 
 
 STOP TYPING THIS STUPID TEXT
 ============================
 
 You have been typing for more than 8 hours stop it.
 Yes, stop it now.
 
 Sorry for eating up your precious time.
 
 
 Maybe GNOME guys can implement such a system for GObject?
 
 
 
 QUESTION ABOUT D
 ================
 
 Intro
 -----
 
 I've got a question about the D programming language, and I compare it

 

 type is not fully aware of this.
 
 Handle here is of type int
 
 Code below has a potential error.
 
 public void TestMethod() {
 FileStream fileStream = new FileStream("blabla");
 PinvokeStuff.PinvokeMethod(fileStream.Handle, "blabla");
 }
 
 
 That is when fileStream is no longer used the garbage collector
 can already start deleting the object wile in PinvokeMethod.
 
 Solution1 use GC.KeepAlive
 ---------
 
 public void TestMethod() {
 FileStream fileStream = new FileStream("blabla");
 PinvokeStuff.PinvokeMethod(fileStream.Handle, "blabla");
 GC.KeepAlive(fileStream);   //or call fileStream.AnotherMethod()
 }
 
 Solution2 use of HandleRef
 ---------
 
 HandleRef keeps a reference to the object.
 
 Question
 --------
 
 My Question. What is the method in D? Or how does D handle this?
 
 
 
Mar 22 2006