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

Martin fpc at mfriebe.de
Mon Feb 1 16:02:59 CET 2016


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<b, 1, 2).

Only it will have to be written as &IF()

That already works today. The below compiles with fpc 3.0. (And I would 
guess, few (if any) are using this)

function &if(a: boolean; c,b: integer): integer;
begin
end;

var
   x: Integer;
begin
x := &if(1<2,2,3);
end.







More information about the fpc-pascal mailing list