Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2012-10

Seems Delphi is moving to Java-style primitive types

6 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Well, kind-of... I don't know if C# also supports this (like Java). It probably does, because for the last few years, Delphi has just been copying whatever is in C#. [sad]

eg: This compiles and works in Delphi XE3.

   ShowMessage('Hello World!'.ToUpper);

And there are lots more string functions (like .ToUpper) out of the box.

http://www.youtube.com/watch?v=ndeJeBdZQIw&feature=share&list=UUStifH8LUsnsTQNcT_BDTVw

It actually uses record helpers, but the end result looks very much like Java primitive types where you have <type>.ToString, <type>.Equals, <type>.Split etc...

Interesting.

Regards,
- Graeme -

Paul Ishenin
to Graeme Geldenhuys

17.10.12, 17:00, Graeme Geldenhuys пишет:

Well, kind-of... I don't know if C# also supports this (like Java). It probably does, because for the last few years, Delphi has just been copying whatever is in C#. [sad]

...

Interesting.

This was already discussed here or fpc-devel list.

Best regards,
Paul Ishenin

Graeme Geldenhuys
to Paul Ishenin
Paul Ishenin wrote
This was already discussed here or fpc-devel list.

The video was about Delphi XE3, which just got release... was this Delphi functionality already existing in earlier Delphi versions too?

[sorry, I don't keep up with every Delphi feature any more]

Graeme.

Sven Barth
to Graeme Geldenhuys
"Graeme Geldenhuys" wrote 8 lines
On 2012-10-17 11:15, Paul Ishenin wrote: > > This was already discussed here or fpc-devel list. The video was about Delphi XE3, which just got release... was this Delphi functionality already existing in earlier Delphi versions too?

Yes, it's a Delphi XE3 feature, but XE3 isn't that new anymore either. In fact I already have a proof of concept implementation working for FPC (constants are not yet supported though)

Regards,
Sven

leledumbo
to Graeme Geldenhuys: Well, kind-of... I don't know if C# also supports this (like Java). It probably does,…

C# is a full OO language, so I guess yes it's supported. Anyway, Delphi doesn't seem to move toward Java, but Embarcadero is missing Anders' touch. And this is the way they get it for free :p

Chad Berchek
to Graeme Geldenhuys: Well, kind-of... I don't know if C# also supports this (like Java). It probably does,…
It actually uses record helpers, but the end result looks very much like Java primitive types where you have <type>.ToString, <type>.Equals, <type>.Split etc...

Not with the intent to be contrary, but for the sake of clarity in discussion, String in Java is not a primitive type; it is a full-fledged class like any other except the compiler has a couple pieces of special knowledge about it. That is why it can have methods. The actual primitive types such as short, int, long, etc., do not have methods. However, this must not be confused with the boxed form of the primitive types, which again are full-fledged classes (Integer, Long, etc.) and have methods.