Jump to content
Darian Miller

10.4.1+ Custom Managed Records usable?

Recommended Posts

The If and Case statements expressions are indeed pretty nice.

 

Share this post


Link to post
3 hours ago, Lars Fosdal said:

The If and Case statements are indeed pretty nice.

 

We already have if and case statements in Delphi, we don't have expressions though. Expressions are parts of statements.

 

Speaking of Oxygene, don't forget to mention colon operator, lambda expressions, for loop expressions, async & await (.NET only) expressions and more ...

 

See also this Q&A that relates to the topic discussed in this thread - ternary conditional operator,  null-coalescing operator (Elvis operator) and Oxygene colon operator:

Escape from chain of Assigned() in Delphi

It also provides some QP links of feature requests.

  • Like 1

Share this post


Link to post
On 8/13/2021 at 3:38 AM, dummzeuch said:

I wouldn't refactor code only to now use inline variable declarations either.

Why not?

 

new is always better.jpg

Share this post


Link to post
23 minutes ago, Joseph MItzen said:

Why not?

 

new is always better.jpg

Because I'm not Barney Stinson.

  • Haha 2

Share this post


Link to post
On 8/19/2021 at 6:07 AM, Stefan Glienke said:

IMO the only true way to do this in pascal is as they done in Oxygene - see "if expressions": https://docs.elementscompiler.com/Oxygene/Delphi/NewFeatures/

IMHO the only true way to do this in pascal is as they've done in Python... like Oxygene, except Oxygene reversed it for for some reason.

 

ilabel = 'Item' if ilist.Count == 1 else 'Items'

 

Share this post


Link to post
48 minutes ago, Joseph MItzen said:

IMHO the only true way to do this in pascal is as they've done in Python... like Oxygene, except Oxygene reversed it for for some reason.

 


ilabel = 'Item' if ilist.Count == 1 else 'Items'

 

If I'm not missing anything, Oxygene didn't "reverse" it, but kept it consistent with Pascal. 

Share this post


Link to post
22 minutes ago, uligerhardt said:

If I'm not missing anything, Oxygene didn't "reverse" it, but kept it consistent with Pascal. 

I don't think that rings true. I mean the Python if statement is the same as the Pascal if statement. 

 

The Python syntax is closer to natural language than what is done in Oxygene. I don't see either as being particularly in keeping with Pascal, one way or another. 

Share this post


Link to post
10 hours ago, Joseph MItzen said:

IMHO the only true way to do this in pascal is as they've done in Python...


ilabel = 'Item' if ilist.Count == 1 else 'Items'

 

Looks like Perl to me, only with less special characters.

Share this post


Link to post
39 minutes ago, dummzeuch said:

Looks like Perl to me, only with less special characters.

It's Python. Perl's conditional operator is the same as C. That looks completely different. And has the condition first. Quote unlike how it is done in Python. 

  • Thanks 1

Share this post


Link to post

It just reminded me of conditional execution of statements with appended conditions:

 

DoSomething if condition

 

I don't remember the specifics. I rarely program in Perl nowadays.

Share this post


Link to post
1 hour ago, dummzeuch said:

It just reminded me of conditional execution of statements with appended conditions:

 

DoSomething if condition

Ah, yes, I see now! 

 

1 hour ago, dummzeuch said:

I rarely program in Perl nowadays.

Wise

  • Haha 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×