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

2016-02-01 Thread David Butler
On Mon, Feb 1, 2016 at 8:45 PM, Dmitry Boyarintsev < skalogryz.li...@gmail.com> wrote: > > > On Mon, Feb 1, 2016 at 1:40 PM, silvioprog wrote: > >> On Mon, Feb 1, 2016 at 3:34 PM, Dmitry Boyarintsev < >> skalogryz.li...@gmail.com> wrote: >> >>> On Mon, Feb 1, 2016 at 1:23

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

2016-02-01 Thread Maciej Izak
2016-02-01 19:18 GMT+01:00 Sven Barth : > > 2. IIF should works like IfThen in Math or StrUtils. If no - It will be > precedence with comparision to others languages and iif definition (!)... > > > https://en.wikipedia.org/wiki/IIf > > And you didn't read the article

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

2016-02-01 Thread Marcos Douglas
On Mon, Feb 1, 2016 at 5:47 PM, Sven Barth wrote: > On 01.02.2016 20:33, Marcos Douglas wrote: >> Only "inline" keyword will be introduced. >> But I don't know if will be more hard to implement this. > > If we would go the route of such an if-expression instead of an

Re: [fpc-pascal] if-then-else expression

2016-02-01 Thread Maciej Izak
2016-02-01 21:16 GMT+01:00 Sven Barth : > On 01.02.2016 21:14, Sven Barth wrote: > > Time for the next flame. Flame? :O It was constructive discussion :) For me x := if true then 0 else 1 is ideal and compatible with Oxygene. +1 IMO no need to any other

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

2016-02-01 Thread Philippe Lévi
iif ... sounds good to me! +1 ! Philippe De: fpc-pascal-boun...@lists.freepascal.org em nome de Marco van de Voort Enviado: segunda-feira, 1 de fevereiro de 2016 16:22 Para: FPC-Pascal users

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

2016-02-01 Thread silvioprog
On Mon, Feb 1, 2016 at 4:10 PM, Maciej Izak wrote: > 2016-02-01 19:18 GMT+01:00 Sven Barth : > >> > 2. IIF should works like IfThen in Math or StrUtils. If no - It will be >> precedence with comparision to others languages and iif definition

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

2016-02-01 Thread Sven Barth
On 01.02.2016 20:33, Marcos Douglas wrote: > On Mon, Feb 1, 2016 at 5:06 PM, David Butler wrote: >> Speaking personally, the reason why I like Pascal syntax over C is exactly >> because it isn't short. I prefer the verbosity of Pascal rather than >> "cryptic" syntax of the C

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

2016-02-01 Thread Dmitry Boyarintsev
On Mon, Feb 1, 2016 at 2:47 PM, Sven Barth wrote: > If we would go the route of such an if-expression instead of an > intrinsic then just leave away the "inline". That's absolutely not > needed... (Note: implementation wouldn't be hard at all) > something like this:

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

2016-02-01 Thread Marco van de Voort
In our previous episode, Maciej Izak said: > > > iif is not semantic clear. IIF means "Immediate IF". Citation: "both > truepart and the falsepart will be evaluated regardless of which one is > actually returned." - https://en.wikipedia.org/wiki/IIf Well, correct that then :)

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

2016-02-01 Thread silvioprog
On Mon, Feb 1, 2016 at 4:47 PM, Sven Barth wrote: > On 01.02.2016 20:33, Marcos Douglas wrote: > > On Mon, Feb 1, 2016 at 5:06 PM, David Butler wrote: > >> Speaking personally, the reason why I like Pascal syntax over C is > exactly > >> because

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

2016-02-01 Thread Sven Barth
On 01.02.2016 20:50, Dmitry Boyarintsev wrote: > On Mon, Feb 1, 2016 at 2:47 PM, Sven Barth > wrote: > > If we would go the route of such an if-expression instead of an > intrinsic then just leave away the "inline". That's

Re: [fpc-pascal] if-then-else expression

2016-02-01 Thread Sven Barth
On 01.02.2016 21:14, Sven Barth wrote: > Hello together! > > Time for the next flame. I've attached a patch which implements an "if > Condition then ThenExpr else ElseExpr"-expression for those that want to > play around with it. It follows the same principles as the > yet-to-be-renamed IfThen()

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

2016-02-01 Thread Marcos Douglas
On Mon, Feb 1, 2016 at 5:06 PM, David Butler wrote: > Speaking personally, the reason why I like Pascal syntax over C is exactly > because it isn't short. I prefer the verbosity of Pascal rather than > "cryptic" syntax of the C family. e.g. Pascal uses "function" not "func", >

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

2016-02-01 Thread Roberto P.
Maybe we shouldn't focus all that much on the " if " word..since all in all, it is meant to be differently from the language if-then-else What about using another word suggesting a choice? j := Switch(i < 32, 48, 21); j := Select(i < 32, 48, 21); j := Which(i < 32, 48, 21); They look to

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

2016-02-01 Thread Dennis
Roberto P. wrote: Maybe we shouldn't focus all that much on the " if " word..since all in all, it is meant to be differently from the language if-then-else What about using another word suggesting a choice? j := Switch(i < 32, 48, 21); j := Select(i < 32, 48, 21); j := Which(i < 32,

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

2016-02-01 Thread Philippe Lévi
I thought about "condEval( cnd, true, false);" we are looking for a name of a function ... and "if" is a statment ... variations of "if" still have the flavour of statment name ... Philippe De: fpc-pascal-boun...@lists.freepascal.org

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

2016-02-01 Thread Maciej Izak
2016-02-01 9:35 GMT+01:00 David Butler : > This is usually called "inline if". > > Maybe call it "inlineif" or "iif", e..g > > x := iif (a < 3, 1, 2) > > or even > > x := iif a < 3 then 1 else 2; > > anything is better than System.IfThen blatant incompatibility. I opt for

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

2016-02-01 Thread David Butler
This is usually called "inline if". Maybe call it "inlineif" or "iif", e..g x := iif (a < 3, 1, 2) or even x := iif a < 3 then 1 else 2; On Mon, Feb 1, 2016 at 10:26 AM, Maciej Izak wrote: > 2016-02-01 8:59 GMT+01:00 Marco van de Voort : > >> The only

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

2016-02-01 Thread leledumbo
> If i understand correctly "ThenExpr" is executed only when "Condition" is true and "ElseExpr" is executed only when "Condition" is false. For standard "IfThen" from Math and StrUtils "ThenExpr" and "ElseExpr" is executed before IfThen is called. This is one thing that becomes my concern as

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

2016-02-01 Thread Maciej Izak
2016-02-01 10:42 GMT+01:00 Michael Van Canneyt : > > This is not an argument. > > If you take this as an argument, then the system unit is set in concrete, > for fear of breaking someones code whenever something new is introduced. No. This is argument. That was reason in

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

2016-02-01 Thread Maciej Izak
2016-02-01 10:42 GMT+01:00 Michael Van Canneyt : > Sven took the best possible route by making it an > identifier of the system unit. The refactoring argument is nonsense, as it > applies to ANY identifier, not just this one. > > We can discuss IIF or IfThen, but the same

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

2016-02-01 Thread Michael Van Canneyt
On Mon, 1 Feb 2016, Maciej Izak wrote: 2016-02-01 10:42 GMT+01:00 Michael Van Canneyt : Sven took the best possible route by making it an identifier of the system unit. The refactoring argument is nonsense, as it applies to ANY identifier, not just this one. We can

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

2016-02-01 Thread Marco van de Voort
In our previous episode, Sven Barth said: > > > > > > +1 . IfThen instricit is IMO very bad idea. I have a lot of "IfThen" from > math and strutils modules. > > > > IfThen from System totally breaks the compatibility :\ . C'mon Sven. In > one field you're rigorously but in something like this

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

2016-02-01 Thread Sven Barth
Am 01.02.2016 09:26 schrieb "Maciej Izak" : > > 2016-02-01 8:59 GMT+01:00 Marco van de Voort : >> >> The only really bad thing is the name, as Florian already said, with the >> versions in strutils and math. The clash with delphi compatible functions >> should

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

2016-02-01 Thread Maciej Izak
2016-02-01 10:17 GMT+01:00 Michalis Kamburelis : > > As far as I understand, compatibility is not broken: new IfThen was > deliberately introduced as part of the System unit, that is implicitly > always used as the 1st unit. If you use Math (or StrUtils or any other >

Re: [fpc-pascal] Pascal Lexical Diagrams

2016-02-01 Thread Graeme Geldenhuys
On 2016-01-30 19:12, Michael Van Canneyt wrote: > Wikimedia is NOT documentation. It is a knowledgebase. +1000 The Lazarus project just doesn't seem to get that. The Lazarus wiki has so much broken or outdated information, no offline support, no documentation per Lazarus release. The list off

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

2016-02-01 Thread Michael Van Canneyt
On Mon, 1 Feb 2016, Maciej Izak wrote: 2016-02-01 10:17 GMT+01:00 Michalis Kamburelis : As far as I understand, compatibility is not broken: new IfThen was deliberately introduced as part of the System unit, that is implicitly always used as the 1st unit. If you

Re: [fpc-pascal] Pascal Lexical Diagrams

2016-02-01 Thread Mark Morgan Lloyd
Graeme Geldenhuys wrote: On 2016-01-30 12:26, Jürgen Hestermann wrote:> The look of the diagrams is very good. Call me old-fashioned, but what is wrong with the EBNF (ExtendedBackus-Naur Form) which is also an ISO standard. https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_Form I

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

2016-02-01 Thread Alexandrov Alexandru
IIf or IfThen (I opt for IIf) are trivial functions. The result of the Math function must be the same as the System ones. Why do you care which one apply? 2016-02-01 12:00 GMT+02:00 Maciej Izak : > 2016-02-01 10:42 GMT+01:00 Michael Van Canneyt : > >>

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

2016-02-01 Thread Maciej Izak
2016-02-01 11:12 GMT+01:00 Michael Van Canneyt : > *your argument means the system unit cannot be changed _ever again_* > FPC team learned me more conservative approach :P > As I said, I don't care about the actual name. > > I personally would have used IIF(): I have a

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

2016-02-01 Thread Maciej Izak
2016-02-01 11:28 GMT+01:00 Sven Barth : > It does *not* break existing code at all. > Right. As mentioned in my other message: "Paradoxically, "IfThen" hinders future usage of the code" :) -- Best regards, Maciej Izak ___

Re: [fpc-pascal] Pascal Lexical Diagrams

2016-02-01 Thread OBones
Mark Morgan Lloyd wrote: So hopefully we can drop the nasty "railroad" Americanism, since it wasn't the original name. And hopefully we can use "syntax" in the name, since that's what they describe. Hence "syntax chart", "syntax diagram" or something similar. Please :-) Where I live,

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

2016-02-01 Thread Sven Barth
Am 01.02.2016 09:35 schrieb "David Butler" : > > This is usually called "inline if". > > Maybe call it "inlineif" or "iif", e..g > > x := iif (a < 3, 1, 2) > > or even > > x := iif a < 3 then 1 else 2; I personally would have preferred "if a < 3 then 1 else 2", but a

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

2016-02-01 Thread Maciej Izak
2016-02-01 11:38 GMT+01:00 Marco van de Voort : > Not if you run unmodified, but a bit of copy and paste due to other > FPC<->delphi conversion issues and a forgotten uses and you run into > something strange problem. Of course after three days debugging later you > find out

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

2016-02-01 Thread Michalis Kamburelis
Maciej Izak wrote: > +1 . IfThen instricit is IMO very bad idea. I have a lot of "IfThen" > from math and strutils modules. > > IfThen from System totally breaks the compatibility :\ . C'mon Sven. In > one field you're rigorously but in something like this you're liberal > (braking/dangerous

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

2016-02-01 Thread Sven Barth
Am 01.02.2016 11:21 schrieb "Alexandrov Alexandru" < alexandru.alexand...@gmail.com>: > > IIf or IfThen (I opt for IIf) are trivial functions. The result of the Math function must be the same as the System ones. Why do you care which one apply? Because there is a semantic difference. The new

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

2016-02-01 Thread Maciej Izak
2016-02-01 11:31 GMT+01:00 Sven Barth : > I personally would have preferred "if a < 3 then 1 else 2", > The first step to compatibility with Oxygene :) I love it -- Best regards, Maciej Izak ___ fpc-pascal maillist -

Re: [fpc-pascal] Pascal Lexical Diagrams

2016-02-01 Thread Graeme Geldenhuys
On 2016-01-30 19:34, Ewald wrote: > So I am > trying to convince you to collaborate to the existing documentation > instead of writing your own. Because your own documentation will also be > a one-man project, +1 And he will be 15+ years behind Michael van Canneyt's efforts. Regards, -

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

2016-02-01 Thread Michael Van Canneyt
On Mon, 1 Feb 2016, Maciej Izak wrote: 2016-02-01 11:28 GMT+01:00 Sven Barth : I have to admit though that I forgot about the potential problems due to refactoring. I'll change the name to avoid this pitfall, though I've yet to decide which one. My

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

2016-02-01 Thread Serguei TARASSOV
Hello, I'm not afraid about existing uses of Math.IfThen ou StrUItils.IfThen because they will hide System.IfThen. However, existing semantic of IfThen doesn't allow expressions like this s := IfThen(Obj = nil, 'Unknown', Obj.Value); // raise AV when Obj is nil As far as I understand, new

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

2016-02-01 Thread Maciej Izak
2016-02-01 13:09 GMT+01:00 Michael Van Canneyt : > > No. The compiler already uses &. > > & means 'the following is an identifier even if it is a keyword'. > > You can perfectly declare and compile: > > Var >: integer; > > begin > :=1; > end. > > So is a bad idea.

Re: [fpc-pascal] Pascal Lexical Diagrams

2016-02-01 Thread Peter
On 30/01/16 09:45, Anthony Walter wrote: > I've been working on writing Javascript to generate lexical language > diagrams Would this be of any interest? (Rather than reinvent the wheel.) http://www.bottlecaps.de/rr/ui Peter ___ fpc-pascal maillist

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

2016-02-01 Thread Martin
On 01/02/2016 10:28, Sven Barth wrote: I have to admit though that I forgot about the potential problems due to refactoring. I'll change the name to avoid this pitfall, though I've yet to decide which one. well (playing devils advocate), why not IF(a

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

2016-02-01 Thread Jürgen Hestermann
Am 2016-02-01 um 16:27 schrieb Michael Van Canneyt: > Never, and if Delphi didn't have it, I would oppose its introduction as well. It is a result of a 'whatever goes' attitude. > Why not introduce C syntax, while we're at it ? Or Perl, or Javascript or whatever just happens to be the fashion

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

2016-02-01 Thread Michael Van Canneyt
On Mon, 1 Feb 2016, Maciej Izak wrote: 2016-02-01 18:08 GMT+01:00 Jürgen Hestermann : From the above I would vote for "InlineIf" or eve better "IfThenElse". InlineIf sounds better than IIF. Very suggestive and correct. IfThenElse looks more like "Immediate IF"

Re: [fpc-pascal] Pascal Lexical Diagrams

2016-02-01 Thread Graeme Geldenhuys
On 2016-02-01 16:13, Peter wrote: > Would this be of any interest? (Rather than reinvent the wheel.) > http://www.bottlecaps.de/rr/ui Very nice, thanks for sharing. Regards, - Graeme - ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] *** GMX Spamverdacht *** Re: Pascal Lexical Diagrams

2016-02-01 Thread Michael Van Canneyt
On Mon, 1 Feb 2016, Jürgen Hestermann wrote: Am 2016-01-30 um 20:44 schrieb Michael Van Canneyt: I can only concur with what Ewald writes. Are the Latex sources for the documenation available somewhere for download? They are in svn. I would like to check why the syntax diagrams

Re: [fpc-pascal] *** GMX Spamverdacht *** Re: Pascal Lexical Diagrams

2016-02-01 Thread Jürgen Hestermann
Am 2016-01-30 um 20:44 schrieb Michael Van Canneyt: I can only concur with what Ewald writes. Are the Latex sources for the documenation available somewhere for download? I would like to check why the syntax diagrams created with the syntax.sty are incorrect and how they can be improved.

Re: [fpc-pascal] Pascal Lexical Diagrams

2016-02-01 Thread Graeme Geldenhuys
On 2016-02-01 14:59, Dmitry Boyarintsev wrote: > > Could you please categorize any page as "outdated"? Is there a "outdated" category? If not, I don't know how to add new categories. > So later any page within the category could be considered for either update > or removal. The problem is

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

2016-02-01 Thread Michael Van Canneyt
On Mon, 1 Feb 2016, Maciej Izak wrote: 2016-02-01 16:07 GMT+01:00 Michael Van Canneyt : Then you preclude Var : Integer; This is a really bad idea. The whole idea of & is to make the above possible, so you are going to make an exception on an exception ? You

Re: [fpc-pascal] Pascal Lexical Diagrams

2016-02-01 Thread Dmitry Boyarintsev
On Mon, Feb 1, 2016 at 10:19 AM, Graeme Geldenhuys < mailingli...@geldenhuys.co.uk> wrote: > On 2016-02-01 14:59, Dmitry Boyarintsev wrote: > > > > Could you please categorize any page as "outdated"? > > Is there a "outdated" category? If not, I don't know how to add new > categories. > The

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

2016-02-01 Thread Maciej Izak
2016-02-01 11:28 GMT+01:00 Sven Barth : > I have to admit though that I forgot about the potential problems due to > refactoring. I'll change the name to avoid this pitfall, though I've yet to > decide which one. > My proposition is: function (Condition: Boolean;

[fpc-pascal] Running fpcmake, lazarus and fpc 3.0.0

2016-02-01 Thread Tony Whyman
When building release versions of lazarus programs I use build scripts that build both linux and windows targets on the same system using the fpcross compiler (from linux x64_86 to win32). To do this I obviously need to build both x64_86 and win32 versions of the lazarus libraries on the same

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

2016-02-01 Thread silvioprog
On Mon, Feb 1, 2016 at 11:42 AM, Sven Barth wrote: [...] > I'm more inclined to use iif() however, as () doesn't look that nice... > (though it would be more noticeable :P ) > +1+1+1+1+1 iif(). :-D -- Silvio Clécio ___

Re: [fpc-pascal] Running fpcmake, lazarus and fpc 3.0.0

2016-02-01 Thread Jonas Maebe
Tony Whyman wrote on Mon, 01 Feb 2016: When building release versions of lazarus programs I use build scripts that build both linux and windows targets on the same system using the fpcross compiler (from linux x64_86 to win32). To do this I obviously need to build both x64_86 and win32

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

2016-02-01 Thread Maciej Izak
2016-02-01 18:08 GMT+01:00 Jürgen Hestermann : > From the above I would vote for "InlineIf" or eve better "IfThenElse". > InlineIf sounds better than IIF. Very suggestive and correct. IfThenElse looks more like "Immediate IF" (or IfThen) functionality. -- Best

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

2016-02-01 Thread Fabrício Srdic
Em 01/02/2016 12:52, "leledumbo" escreveu: > > > Iif sounds good, and would be very useful for converting C code. > > However Iif() sounds very good. > > Me too. Iif is used for many languages. > > +1+1+1+1+1 iif(). :-D > > I'm with Silvio. The name "inline if" (iif)

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

2016-02-01 Thread silvioprog
On Mon, Feb 1, 2016 at 7:12 AM, Michael Van Canneyt wrote: [...] > > I personally would have used IIF(): Me too. Iif is used for many languages. -- Silvio Clécio ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] Pascal Lexical Diagrams

2016-02-01 Thread Dmitry Boyarintsev
On Mon, Feb 1, 2016 at 4:32 AM, Graeme Geldenhuys < mailingli...@geldenhuys.co.uk> wrote: > On 2016-01-30 19:12, Michael Van Canneyt wrote: > > Wikimedia is NOT documentation. It is a knowledgebase. > > +1000 > > The Lazarus project just doesn't seem to get that. The Lazarus wiki has > so much

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

2016-02-01 Thread Maciej Izak
2016-02-01 17:41 GMT+01:00 Fabrício Srdic : > Em 01/02/2016 12:52, "leledumbo" escreveu: > > > > > Iif sounds good, and would be very useful for converting C code. > > > However Iif() sounds very good. > > > Me too. Iif is used for many

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

2016-02-01 Thread leledumbo
> Looks good and clever. Logical choice. How often you have variables with & prefix? Only when I use ORM with automapping of properties to fields (for fields whose name clash with reserved words such as the most common 'type'). I won't use it in other cases. Agree with Michael, no & please.

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

2016-02-01 Thread Dennis Poon
Jürgen Hestermann wrote: Am 2016-02-01 um 19:45 schrieb Dmitry Boyarintsev: No matter what the language is, developers still want to write C... for the shortness of script Such people should simply use C. Pascal <> C and I am glad that this is true. In my humble opinion, the importance of

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

2016-02-01 Thread Anthony Walter
Sven, I missed this post when you made it a two days ago. If someone hasn't already asked, does your implementation support short circuit evaluation? For example: BasketCount := IfThen(ShoppingList <> nil, ShoppingList.Count, 0); Where evaluating ShoppingList.Count will cause an exception if

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

2016-02-01 Thread Sven Barth
On 01.02.2016 21:02, silvioprog wrote: > On Mon, Feb 1, 2016 at 4:47 PM, Sven Barth > wrote: > > On 01.02.2016 20:33, Marcos Douglas wrote: > > On Mon, Feb 1, 2016 at 5:06 PM, David Butler

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

2016-02-01 Thread Martin
On 01/02/2016 19:33, Marcos Douglas wrote: V := inline If Condition then ThenExpr else ElseExpr; ignoring the "inline" There are 3 styles (ignoring the names of identifiers used), can think of 1) function x := IfThen(a,b,c); 2) statement with return value x := If a Then b else c; 3)

Re: [fpc-pascal] if-then-else expression

2016-02-01 Thread silvioprog
On Mon, Feb 1, 2016 at 5:35 PM, Maciej Izak wrote: > 2016-02-01 21:16 GMT+01:00 Sven Barth : > >> On 01.02.2016 21:14, Sven Barth wrote: >> > Time for the next flame. > > > Flame? :O It was constructive discussion :) > +1. It was constructive

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

2016-02-01 Thread Michael Schnell
On 02/01/2016 09:35 AM, David Butler wrote: Maybe call it "inlineif" or "iif", e..g x := iif (a < 3, 1, 2) It's iif in Oxygen. So why not keep that name ? -Michael ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

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

2016-02-01 Thread Marc Weustink
Sven Barth wrote: Am 01.02.2016 09:26 schrieb "Maciej Izak" >: > > 2016-02-01 8:59 GMT+01:00 Marco van de Voort >: >> >> The only really bad thing is the name, as Florian already said, with the >>

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

2016-02-01 Thread LacaK
Switch, Select, Which are all good except that they are very common English words. They might already be used by users in existing function names in their code. I prefer V := If Condition then ThenExpr else ElseExpr; +1 (for me is "if ... then ... else" also good understandable and looks

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

2016-02-01 Thread Maciej Izak
2016-02-01 10:59 GMT+01:00 Michael Schnell : > On 02/01/2016 09:35 AM, David Butler wrote: > >> >> >> Maybe call it "inlineif" or "iif", e..g >> >> x := iif (a < 3, 1, 2) >> >> It's iif in Oxygen. So why not keep that name ? Same here. I see no reason to differ from it.

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

2016-02-01 Thread Jürgen Hestermann
Am 2016-02-01 um 19:45 schrieb Dmitry Boyarintsev: No matter what the language is, developers still want to write C... for the shortness of script Such people should simply use C. Pascal <> C and I am glad that this is true. ___ fpc-pascal

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

2016-02-01 Thread Dmitry Boyarintsev
On Mon, Feb 1, 2016 at 1:23 PM, silvioprog wrote: > > It would be nice if the programmer could choose it from some compiler > switch, something like: > > {$define ifthendecl := InlineIf} > > macros? thanks, Dmitry ___ fpc-pascal

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

2016-02-01 Thread silvioprog
On Mon, Feb 1, 2016 at 3:34 PM, Dmitry Boyarintsev < skalogryz.li...@gmail.com> wrote: > On Mon, Feb 1, 2016 at 1:23 PM, silvioprog wrote: > >> >> It would be nice if the programmer could choose it from some compiler >> switch, something like: >> >> {$define ifthendecl :=

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

2016-02-01 Thread Sven Barth
Am 01.02.2016 13:29 schrieb "Michael Van Canneyt" : > > > > On Mon, 1 Feb 2016, Maciej Izak wrote: > >> 2016-02-01 13:09 GMT+01:00 Michael Van Canneyt : >>> >>> >>> No. The compiler already uses &. >>> >>> & means 'the following is an identifier even

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

2016-02-01 Thread leledumbo
> Iif sounds good, and would be very useful for converting C code. > However Iif() sounds very good. > Me too. Iif is used for many languages. > +1+1+1+1+1 iif(). :-D I'm with Silvio. The name "inline if" (iif) describes its semantics clearer than IfThen, which already has semantics of being

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

2016-02-01 Thread Maciej Izak
2016-02-01 15:42 GMT+01:00 Sven Barth : > Maciej is in so far right that the intrinsic could indeed be named "if" > and the only way to call it would thus be by "", cause only then the > scanner would not treat "if" as a keyword. So it would work with what the >

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

2016-02-01 Thread Michael Van Canneyt
On Mon, 1 Feb 2016, Maciej Izak wrote: 2016-02-01 13:09 GMT+01:00 Michael Van Canneyt : No. The compiler already uses &. & means 'the following is an identifier even if it is a keyword'. You can perfectly declare and compile: Var : integer; begin :=1; end.

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

2016-02-01 Thread silvioprog
On Mon, Feb 1, 2016 at 6:17 AM, Michalis Kamburelis < michalis.ka...@gmail.com> wrote: > Maciej Izak wrote: > > +1 . IfThen instricit is IMO very bad idea. I have a lot of "IfThen" > > from math and strutils modules. > > > > IfThen from System totally breaks the compatibility :\ . C'mon Sven. In

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

2016-02-01 Thread Maciej Izak
2016-02-01 13:15 GMT+01:00 Maciej Izak : > 2016-02-01 13:09 GMT+01:00 Michael Van Canneyt : >> >> No. The compiler already uses &. >> >> & means 'the following is an identifier even if it is a keyword'. >> >> You can perfectly declare and compile: >> >>

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

2016-02-01 Thread silvioprog
On Mon, Feb 1, 2016 at 5:35 AM, David Butler wrote: > This is usually called "inline if". > > Maybe call it "inlineif" or "iif", e..g > [...] Iif sounds good, and would be very useful for converting C code. -- Silvio Clécio ___

Re: [fpc-pascal] buggy debian package

2016-02-01 Thread Jonas Maebe
Jonas Maebe wrote on Fri, 18 Dec 2015: Mattias Gaertner wrote: Debian has a FPC 3.0.0 package called "rc-buggy". https://packages.debian.org/search?keywords=fpc=names=all=all Is it just me, or does "buggy" sound a bit below awesome? It's their alias for the "experimental" branch. Just

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

2016-02-01 Thread Maciej Izak
2016-02-01 13:29 GMT+01:00 Michael Van Canneyt : > You missed my point. > > >> looks also good (I like shorter syntax ). With "&" prefix it is >> obvious that this function is unique. >> > > You misunderstand. > > The & character cannot be used as part of an identifier,

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

2016-02-01 Thread Maciej Izak
2016-02-01 16:07 GMT+01:00 Michael Van Canneyt : > > Then you preclude > > Var > : Integer; > > This is a really bad idea. The whole idea of & is to make the above > possible, so you are going to make an exception on an exception ? > > You really want to create

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

2016-02-01 Thread silvioprog
On Mon, Feb 1, 2016 at 12:48 PM, leledumbo wrote: > > Looks good and clever. Logical choice. How often you have variables with > & > prefix? > > Only when I use ORM with automapping of properties to fields (for fields > whose name clash with reserved words such as the

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

2016-02-01 Thread Graeme Geldenhuys
On 2016-02-01 15:27, Michael Van Canneyt wrote: >> Looks good and clever. Logical choice. > > Only in warped minds, as far as I am concerned. > There is nothing logical about it. > > The logical thing is to find a new pascal identifier. +1 > This 'whatever goes' attitude is really a

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

2016-02-01 Thread Sven Barth
Am 01.02.2016 15:58 schrieb "Maciej Izak" : > > 2016-02-01 15:42 GMT+01:00 Sven Barth : >> >> Maciej is in so far right that the intrinsic could indeed be named "if" and the only way to call it would thus be by "", cause only then the scanner would

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

2016-02-01 Thread Sven Barth
Am 01.02.2016 16:07 schrieb "Michael Van Canneyt" : > > > > On Mon, 1 Feb 2016, Sven Barth wrote: > >>> >>> And modifying the scanner for this exception is a REALLY bad idea. >> >> >> Maciej is in so far right that the intrinsic could indeed be named "if" and >> the only

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

2016-02-01 Thread Sven Barth
Am 01.02.2016 17:00 schrieb "silvioprog" : > > On Mon, Feb 1, 2016 at 12:48 PM, leledumbo wrote: >> >> > Looks good and clever. Logical choice. How often you have variables with & >> prefix? >> >> Only when I use ORM with automapping of properties

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

2016-02-01 Thread silvioprog
On Mon, Feb 1, 2016 at 2:41 PM, Michael Van Canneyt wrote: > On Mon, 1 Feb 2016, Maciej Izak wrote: > >> 2016-02-01 18:08 GMT+01:00 Jürgen Hestermann : >> >> From the above I would vote for "InlineIf" or eve better "IfThenElse". >>> >>> >>

Re: [fpc-pascal] buggy debian package

2016-02-01 Thread Mattias Gaertner
On Mon, 01 Feb 2016 13:30:51 +0100 Jonas Maebe wrote: >[...] > FWIW, last weekend FPC 3.0 was promoted from Debian Experimental to > Debian Unstable. Awesome :) Mattias ___ fpc-pascal maillist -

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

2016-02-01 Thread Rolf Grunsky
Maybe I could suggest ThenIf as opposed to IfThen. Same idea, different implementation / purpose. -- TRUTH in her dress finds facts too tight. In fiction she moves with ease. Stray Birds by Rabindranath

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

2016-02-01 Thread Felipe Monteiro de Carvalho
So finally we have the ternary operator in Pascal? This will simplify converting from C to Pascal. > j ;= IfThen(i < 32, 48, 21); I guess this is a typo and should be ":=" instead of ";=" thanks, -- Felipe Monteiro de Carvalho ___ fpc-pascal

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

2016-02-01 Thread Graeme Geldenhuys
On 2016-02-01 15:09, Felipe Monteiro de Carvalho wrote: >> > j ;= IfThen(i < 32, 48, 21); > I guess this is a typo and should be ":=" instead of ";=" You replied to the wrong message, or I'm receiving mailing list messages out of sequence. The code you quoted above was in reply to Michael's