Recent

Author Topic: Result not being set in class method.  (Read 1827 times)

dbannon

  • Hero Member
  • *****
  • Posts: 3215
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Result not being set in class method.
« Reply #15 on: January 25, 2025, 12:29:14 pm »
Yes, but why are these not defaults in Lazarus ?  With Debug being the active default? I would think most users are using Lazarus to create something, and they will likely need to debug it.

In a new project, optimization is -O1, quite low optimization, "debugger friendly". Thats usually enough, maybe you have discovered an exception, perhaps they will name it after you ?

Use of the debugger is also turned on.  The thing missing, IMHO, is heaptrace, I'd advise any project be tested, from time to time for memory leaks. Especially newer users.

Davo

Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10802
  • Debugger - SynEdit - and more
    • wiki
Re: Result not being set in class method.
« Reply #16 on: January 25, 2025, 12:44:59 pm »
Originally there were no build modes. And then it appears when they were added no one bothered to create new defaults...

You could create a bug report. Not sure how quickly that will or will not be picked up.


There are also other issues, like the "which dwarf do you want question" => Different versions of fpc have different defaults, and the defaults differ for different target OS....
So the IDE does not know what the default is.

Also forcing a common default from the IDE will no always work. And the setting may need to be changed depending on if the user chooses FpDebug or GDB (or LLDB on Mac).

Worse, (and even the current dialog does not manage that). The primary setting (in project options) only affects project files. The LCL has its own settings. So if you debug into the LCL you may have to change those too.... (same for optimization).
Currently that means the IDE will then rebuild the LCL (and other packages). That is slow...

To fix all that is a huge task.
And also not simple, because with all the debug options in existence there would then be a need for several pre-build versions of all of that. But ideally not to increase the download size to double.
And I have no idea how it would affect prebuild closed source 3rd party add ons.

The list goes on and on.

PascalDragon

  • Hero Member
  • *****
  • Posts: 5858
  • Compiler Developer
Re: Result not being set in class method.
« Reply #17 on: January 26, 2025, 03:56:46 pm »
It is. It is part of  ISO 7185 which makes it as old as... Pascal.
stdin, stdout  and stderr are not standard, but input, output and erroutput are standard. The former are merely aliases to the real pascal types.

No, they are predefined text files. They are an integral part of the language.
So, yes, variables, but very special variables:
program test (input,output);

Output and Input are not keywords. Not in TP, not in Delphi, not in FPC and not in ISO Pascal. They are variables. ISO Pascal even explicitly states so in 6.10 (emphasis mine):

Quote
Each program-parameter shall have a defining-point as a variable-identifier for the region that is the program-block.


In FPC, Delphi and TP Input and Output are identifiers in the System unit.

 

TinyPortal © 2005-2018