Forum > General

"$if declared()" directive

<< < (2/4) > >>

PascalDragon:

--- Quote from: MarkMLl on November 28, 2021, 06:58:49 pm ---Without meaning to criticise either project, I don't know which is worse: that Lazarus has added something without conditionalising it or that FPC complains about an undefined field without supporting the obvious way of excluding it.

--- End quote ---

Declared() simply does not allow dots. It only allows identifiers (including generics) currently. I have it somewhere on my ToDo list to add support for dots as well, but we all know the problems with ToDo lists... %)

MarkMLl:

--- Quote from: PascalDragon on November 30, 2021, 11:02:18 pm ---
--- Quote from: MarkMLl on November 28, 2021, 06:58:49 pm ---Without meaning to criticise either project, I don't know which is worse: that Lazarus has added something without conditionalising it or that FPC complains about an undefined field without supporting the obvious way of excluding it.

--- End quote ---

Declared() simply does not allow dots. It only allows identifiers (including generics) currently. I have it somewhere on my ToDo list to add support for dots as well, but we all know the problems with ToDo lists... %)

--- End quote ---

Indeed. As I said, I wasn't trying to criticise but I don't really know whose responsibility fixing that one is. It would have been easier if additions to automatically-inserted Lazarus code had been marked by a conditional.

MarkMLl

PascalDragon:

--- Quote from: MarkMLl on December 01, 2021, 07:01:22 am ---Indeed. As I said, I wasn't trying to criticise but I don't really know whose responsibility fixing that one is. It would have been easier if additions to automatically-inserted Lazarus code had been marked by a conditional.

--- End quote ---

Lazarus assumes that you're using a project generated with version X with version X or newer (here the version that generates a project with Application.Scaled does provide Application.Scaled as well). In my opinion that is a valid assumption.

MarkMLl:

--- Quote from: PascalDragon on December 01, 2021, 01:53:15 pm ---Lazarus assumes that you're using a project generated with version X with version X or newer (here the version that generates a project with Application.Scaled does provide Application.Scaled as well). In my opinion that is a valid assumption.

--- End quote ---

Somebody pointed out earlier in the thread that there is a risk that a given version of Lazarus insert lines into an older project.

I believe I've seen that, but I don't want to put my hand on my heart and say under what circumstances.

But I did say that the /easiest/ would have been if Lazarus conditionalised the addition, even if it were not strictly necessary.

MarkMLl

Bart:
There are some setting to treat a project with as much backwards compatibility as possible.
Maybe you can file a feature request to have it write that info in ifdef's based on that setting?

Bart

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version