Forum > Suggestions

Suggestion - implement FORWARD keyword for records.

(1/2) > >>

ad1mt:
Here's something I needed while working on a library...
implement FORWARD keyword for records...  :o
I know its non-standard, but it prevented me from doing something that would have been really useful.

cdbc:
Hi
PRecord = ^TRecord;
Doesn't work for you???
Regards Benny

Thaddy:
What would be very useful... Example plz.

marcov:
Currently forward declarations for storage types are only for types from which the storage size is known from the forward declaration.

i.e. a pointer (in the disguise of a class instance ref). This is not possible for a Record, since to embed that in another class of structure the size is required.

To fix that would require a radical different multipass parser model, which is beyond the scope of this project atm.

Similarly forward procedure declarations also have the base declaration to call it, for exactly the same reasons.

PascalDragon:

--- Quote from: ad1mt on December 18, 2023, 07:09:17 pm ---Here's something I needed while working on a library...
implement FORWARD keyword for records...  :o
I know its non-standard, but it prevented me from doing something that would have been really useful.

--- End quote ---

And that is something that will not be changed. The compiler must know the size of a record to be able to embed it somewhere else (without using a Pointer) and both Pascal and FPC are designed as a single pass language (in case of FPC as far as the parser is concerned).

Navigation

[0] Message Index

[#] Next page

Go to full version