Forum > General

OOP structures in fpc and Lazarus

<< < (3/14) > >>

jollytall:
Well, not many comments yet, so I try to ask some of the questions raised in the document, explicitly here:
Q1. Mode and Modeswitch for advanced records
I analyzed and wrote that it is a bit tricky what mode to use to be able to use advanced records.
- In Mode delphi everything (instance and class level fields and methods) is possible, no need of modeswitch advancedrecords.
- In Mode objfpc also everything is possible, but advancedrecords is also needed.
- In Mode fpc even with advancedrecords, only the instance level fields and methods are available, class level is not possible.
What is the logic of this set-up? Why are objfpc and advancedrecords sort of independent, and not one including the other (either way)?

cdbc:
Hi
Short answer:
0)  Get a Github account - It's free.
1)  Create a repository for your document.
2)  Share the link to repo here, easy peasy  ;)
Good luck.
Regards Benny

jollytall:
Thanks,
As said above, the plan is to share it once the questions, problems are corrected, but I trust this community most to validate and answer the uncertainties I have.

(and I have a github account, but that does not answer my questions  :))

MarkMLl:

--- Quote from: cdbc on November 10, 2021, 06:37:53 pm ---If it ain't broke, don't fix it.

--- End quote ---

So why the Hell should we all be obliged to do absolutely everything via Github or equivalent these days?

He didn't ask about a way to publish his document. He asked about a way of making it available to other members of this forum for review and constructive criticism.

MarkMLl

jollytall:
MarkMLI I think is right, but that is not the point. So, before it turns into a religious war, I ask my second question (and still hope, someone can shed some light on Q1).

Q2. Why is there a static keyword needed for an advanced record class level method?
The good news is that it is at least coherent with the object approach, i.e. a class procedure X; static; can be called with the type tTest.X and there is no Self available.
On the other hand I do not understand why is it implemented this way. To me two ways would be logic:
EITHER
it would be similar to object, but then why not to allow class procedure X; (without static) and procedure X; static; (without class) with slightly different behavior?
OR
accept the fact that record is different than object and in record there is only one way to make a method class level, but then why need to use static at all? Using only class procedure X; would be in line with the record field declaration where there is only one way to define with class var (unlike the object where static is also allowed to define a field, but that is another question).

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version