I have code samples for Delphi 2009 generics, "result := inherited;" syntax, and for anonymous methods.
Fortunately generics worked already, due to work done for delphi.net
What else is there to support in Delphi 2009? Code samples would be appreciated.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
So far the the biggest problem is anonymous methods.
Something like this
...while (function (Stream: TStream; var a: Integer; b: Integer): Integer
.............begin
................result := 50;
.............end)(nil, a, 0) > 0 do
...begin
...end;
is valid syntax.
I wonder if new formatting options is needed... like I want method body to be aligned with the start of declaration or one or two idents later. However all samples from CodeGear looks like this
About generics. If I'm not mistaken currently whatever is between <> stays as it is. It would be nice to have some formating options like one in function parameters.
<a,r,p> -> <a, r, p>
or
<a> -> < a >
etc.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
So how many formatting options are wanted?
it could be just a couple of checkboxes: Space after comma y/n, Space after opening "<" and closing ">" y/n
Or the options for add/remove/leave as is on those spaces
Or also allow the variant for a space before the comma
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Well I don't know... Leading/Trailing space and Space before coma is the two options I need. Actually I can't think of other possibilities but who knows...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
How is a Delphi 2009 release going?
Great utility Anthony, been using it for years
Regards
Ray
Hi
Jean-Fabien Connault is checking in code to support Delphi 2009. there are just a few bugs left, and a release will happen when they're fixed.
Thanks
Anthony
Anthony,
Thanks for the update, keep up the great work
Cheers
Ray
Ray,
JCF 2.40 has been released and it does support Delphi 2009.
JEFF
There are still some thing that need to be handled. Like Anonymous methods and inheritance...
Keep up the good work!
I have code samples for Delphi 2009 generics, "result := inherited;" syntax, and for anonymous methods.
Fortunately generics worked already, due to work done for delphi.net
What else is there to support in Delphi 2009? Code samples would be appreciated.
So far the the biggest problem is anonymous methods.
Something like this
...while (function (Stream: TStream; var a: Integer; b: Integer): Integer
.............begin
................result := 50;
.............end)(nil, a, 0) > 0 do
...begin
...end;
is valid syntax.
I wonder if new formatting options is needed... like I want method body to be aligned with the start of declaration or one or two idents later. However all samples from CodeGear looks like this
..Result := function(x: Integer)
..begin
....Result := x + y;
..end;
Quite unreadable by my opinion.
P.S: btw you probably already know but this is a declaration of an anonymous method. This also breaks the formating.
type
TFuncOfIntToString = reference to function(x: Integer): string;
I take it there can also be anonymous procedures? Is there an example of these?
Definitely. Can't wait for it :)
Sure.
type
...TFuncOfIntToString = reference to procedure (var x: Integer);
var
...p : TFuncOfIntToString;
procedure proc(p: TFuncOfIntToString);
begin
//
end;
begin
...p := procedure (var x: Integer)
..........begin
.............{whatever}
..........end;
{...}
...proc(p);
{or}
...proc(procedure (var x: Integer)
...........begin
..............//
...........end)
end;
About generics. If I'm not mistaken currently whatever is between <> stays as it is. It would be nice to have some formating options like one in function parameters.
<a,r,p> -> <a, r, p>
or
<a> -> < a >
etc.
Thanks. I will put that code into my anonymous method test cases. I have started work on this.
Formatting generics is a good idea, but fixing parse failures must come first.
I have added the unit TestDelphi2009AnonymousMethod.pas, which has some anonymous method demo test code.
Yeah I saw it. Nice to now that you are working on it.
Something small that I've just discovered.
TRecordList<T> = class(TEnumerable<T>)
public
type
TEnumerator = class(TEnumerator<T>)
end;
end;
there is no indent for types declared inside an class
"whatever is between <> stays as it is" This is the case, See SingleSpaceAfter.pas, around line 83.
There is definitely room of options here, but I have for now done the basics of a single space after the comma.
So how many formatting options are wanted?
it could be just a couple of checkboxes: Space after comma y/n, Space after opening "<" and closing ">" y/n
Or the options for add/remove/leave as is on those spaces
Or also allow the variant for a space before the comma
Well I don't know... Leading/Trailing space and Space before coma is the two options I need. Actually I can't think of other possibilities but who knows...