On Sun, 17 Dec 2023, Adriaan van Os via fpc-pascal wrote:


Another use of UNIV is type-compatibility of procedural parameters. For example with

 function BinaryFind
        (     theValuePtr             : univ UnivPtr;
              theFirstIndex           : Int32;
              theLastIndex           : Int32;
     function SmallerThan
        (     theIndex                : Int32;
              theValuePtr             : univ UnivPtr): boolean;
     function EqualTo
        (     theIndex                : Int32;
              theValuePtr             : univ UnivPtr): boolean;
          var theFoundIndex           : Int32): boolean;

But this kind of procedural parameter doesn't seem to be included in the rule for <parameter-declaration>. it is allowed in macpas and iso modes.

I added univ and documented it.

Michael.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to