On 6/15/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> 1. class that can have more then one object as it's parent (at this

Multiple Inheretance. Difficult to understand, difficult to implement,
but I have a problem where multiple inheretance was the solution, instead
of multiples interfaces.

Difficult ? While interfaces does not have any execution code, Classes
do, so any real code such as functions and properties can be shared by
classes. It's much less work in the long run, and still not that hard
to understand then the use of interfaces...


> 2. Powerful containers for class usage such as class X requires class

Same as templates/generics.

Actually it's more an RTTI feature that we can use in order to control
better our code.
We do have strong RTTI, but we can make it even stronger :)


> 3.  Better/Faster IO usage ;)

Better designed I/O libraries/classes ?

Better way to control the I/O buffering etc... so we will not need to
"hack" our way to have bigger container then 255 chars...


> 4. The amount of classes that comes with Java as part of the compiler :P

Can live with them. Make your own libraries.

You are loosing the reason to work with Pascal. When you have ready to
use libraries that come with the language, you increase development,
and it means that you can show what the language can actually do. You
need a complex graph, plotting etc calculation ? use the "GraphMath"
unit... You need an XSLT(2) support ? use the xslt unit. You need SNMP
traps support ? use that unit ...etc..


> 5.  Associative/anonymous classes (like in script language).

Not recomemnded. Dificult to control.

How come ?
MyClass.SubClassA := class(something).Create(something);
MyClass.SubClassA['Private'].FName : string := 'Anonymous class';
MyClass.SubClassA['published'].Name : string read Self.SubClassA.FName
write  Self.SubClassA.FName
...


It can be actually much powerful (please ignore the way that the above
syntax is looking, it's not that destined)...


> 6. "inline" code inside class (like in C++/Java).

Not recommended. Bad design.

Huh ?!

destructor Destroy; override;
begin
 inherited Destroy;
end;

Why should i place it somewhere else ?! To remind you, I could use
"inline" command in order to place code of functions in the interface
sections on TP... So the Pascal language do have history of such
things ...


> 7. Build in regex syntax like in Perl, Ruby Javascript.

Replace it, by a library.

Why ?!
S := 'We are programming in Perl';
S :=~ s/Perl/Pascal/s;

Doesn't it nicer then to use something like:

S := 'We are programming in Python';
Regex := TRegex.Create;
Regex.compile ('Python',S);
S := Regex.Replace ('Pascal', 's');

Sure it's cool to use external functions, but it's useful to use it as
a syntax structure :)


> 8. Templates. (there is something that is cooking)

OK. This one is right. We reealy need templates/generics support.

That's actually a debug hell, and usually there are workaround :P
But, it can be useful and give us a lot more flexibility.


> 9. Hashes (associative arrays) -> Yes there are classes that mimic

Classes with indexed properties work and look like associative arrays.

Sorry, but it's not the same IMHO...
A ['Class'] := Form1;
A ['Project Name'] := 'Hashes';
A ['Array']             := b;
...


> 10. The infamous support of "..." for "infinite' parameters (You can

Open arrays.

To use open arrays like that (array of const) is a hack, and can be
trouble some... I actually like the way that C does it... va_arg have
functions to use, but Pascal is an enumerate language, so we have more
powerful language to start with :)


> And I had more things on my list I just don't remember all of them at
> the moment ...

1. operator overloading

type
  X: TMyType;

operator +(A, B: TMyType): TMyType;

2. Property type overloading.

type

TA = class
...
end;

TB = class(TA)
...
end;

TC = class
...
  property X: TA;
end;

TD = class(TC)
...
  property X: TA as TB;
end;

NOW, TD.X property is TB class not TA.
If you declare a TD variable, with this feature,
you no longer need to cast the X property to TB type
each time you need it.

> There is the D language and other mutant of that language that suppose

I think D IS BETTER. But not enough.

-----
Marco Aurelio Ramirez Carrillo
lazarus dot mramirez at star-dev dot com [dot mx]


_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to