Re: [fpc-pascal] New feature: IfThen() intrinsic

2016-01-31 Thread Marco van de Voort
In our previous episode, Sven Barth said: > After the discussion last year about the inline-if I've decided to add > it as an intrinsic function instead of an extension of the language. > Like all intrinsics it's part of the System unit and "declared" like this: > > === code begin === > > functio

Re: [fpc-pascal] New feature: IfThen() intrinsic

2016-01-31 Thread Stephen Chrzanowski
Mostly code readability, but, I've been writing my own functions to do that kind of thing for years. Same with the BETWEEN function. On Mon, Feb 1, 2016 at 1:03 AM, Ralf Quint wrote: > On 1/31/2016 7:14 AM, Vojtěch Čihák wrote: > >> >> Hi, >> >> what is difference in produced assembler between

Re: [fpc-pascal] New feature: IfThen() intrinsic

2016-01-31 Thread Ralf Quint
On 1/31/2016 7:14 AM, Vojtěch Čihák wrote: Hi, what is difference in produced assembler between ifthen(); and classic if - then - else? +1 I don't really see how this is different from properly writing if ... then ... else... either... :-\ Ralf --- This email has been checked for vir

Re: [fpc-pascal] New feature: IfThen() intrinsic

2016-01-31 Thread Sven Barth
On 31.01.2016 16:09, silvioprog wrote: > Wooow! I did a request about it many years ago, however it was rejected > because the limitation in the generic feature at that time. This implementation has nothing to do with generics. It's a compiler magic function, just like Writeln() and thus it can be

Re: [fpc-pascal] New feature: IfThen() intrinsic

2016-01-31 Thread Sven Barth
On 31.01.2016 16:14, Vojtěch Čihák wrote: > what is difference in produced assembler between ifthen(); and classic > if - then - else? === code begin === i := IfThen(x < 42, 32, 49); === code end === is equivalent to === code begin === if x < 42 then i := 32 else i := 49; === code end ==

Re: [fpc-pascal] New feature: IfThen() intrinsic

2016-01-31 Thread Vojtěch Čihák
Hi,   what is difference in produced assembler between ifthen(); and classic if - then - else? Thanks, V. __ Od: Sven Barth Komu: "FPC-Pascal users discussions" Datum: 31.01.2016 15:43 Předmět: [fpc-pascal] New feature: IfThen() intr

Re: [fpc-pascal] New feature: IfThen() intrinsic

2016-01-31 Thread Mark Morgan Lloyd
Sven Barth wrote: Hello together! I've finally come around to add a feature that many people have asked for throughout the years: an inline if that works like the if-statement in that it only evaluates that expression that is indeed returned. After the discussion last year about the inline-if I

[fpc-pascal] New feature: IfThen() intrinsic

2016-01-31 Thread Sven Barth
Hello together! I've finally come around to add a feature that many people have asked for throughout the years: an inline if that works like the if-statement in that it only evaluates that expression that is indeed returned. After the discussion last year about the inline-if I've decided to add i

Re: [fpc-pascal] New feature: IfThen() intrinsic

2016-01-31 Thread silvioprog
On Sun, Jan 31, 2016 at 1:03 PM, silvioprog wrote: [...] > > If there are any combinations of types that should work, but do not, >> please don't hesistate to report them at http://bugs.freepascal.org/ > > > First issue sent to: http://bugs.freepascal.org/view.php?id=29554. :-) > And: http://bugs

Re: [fpc-pascal] New feature: IfThen() intrinsic

2016-01-31 Thread silvioprog
On Sun, Jan 31, 2016 at 11:43 AM, Sven Barth wrote: > Hello together! > > I've finally come around to add a feature that many people have asked > for throughout the years: an inline if that works like the if-statement > in that it only evaluates that expression that is indeed returned. > > After

Re: [fpc-pascal] New feature: IfThen() intrinsic

2016-01-31 Thread silvioprog
On Sun, Jan 31, 2016 at 12:20 PM, Sven Barth wrote: > On 31.01.2016 16:09, silvioprog wrote: > > Wooow! I did a request about it many years ago, however it was rejected > > because the limitation in the generic feature at that time. > > This implementation has nothing to do with generics. It's a

Re: [fpc-pascal] New feature: IfThen() intrinsic

2016-01-31 Thread silvioprog
On Sun, Jan 31, 2016 at 11:43 AM, Sven Barth wrote: > Hello together! > > I've finally come around to add a feature that many people have asked > for throughout the years: an inline if that works like the if-statement > in that it only evaluates that expression that is indeed returned. > > After

Re: [fpc-pascal] Pascal Lexical Diagrams

2016-01-31 Thread Mark Morgan Lloyd
Michael Van Canneyt wrote: Found . Sorry for ask! ^^' Nice. Added to my bookmarks :-) I may actually use this to redo the official ones as PNG images. Without wanting to go too far OT, I wonder whether I could make a couple of observations.