Re:[fpc-pascal] Complex circular references

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Re:[fpc-pascal] Complex circular references

denisgolovan
> PasDoc can produce 'dot' files of unit dependencies. (No idea if it will
> handle circular refs though). GraphViz can then be used to produce
> images based on the 'dot' files. I gave up with it because it did not
> parse the implementaion sections, but you won't be needing that for unit
> dependences. (I was hoping for a full class heirachy diagram).
>
> http://pasdoc.sipsolutions.net/
>
> Regards,
> Peter

Hm.
Dot files should the ideal solution.
Thanks a lot for the hint.

 --
Regards,
Denis Golovan
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Complex circular references

Jorge Aldo G. de F. Junior
I still dont understand why FPC doesnt support circular references...

There is no way to solve that ?

2012/11/22 denisgolovan <[hidden email]>:

>> PasDoc can produce 'dot' files of unit dependencies. (No idea if it will
>> handle circular refs though). GraphViz can then be used to produce
>> images based on the 'dot' files. I gave up with it because it did not
>> parse the implementaion sections, but you won't be needing that for unit
>> dependences. (I was hoping for a full class heirachy diagram).
>>
>> http://pasdoc.sipsolutions.net/
>>
>> Regards,
>> Peter
>
> Hm.
> Dot files should the ideal solution.
> Thanks a lot for the hint.
>
>  --
> Regards,
> Denis Golovan
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Complex circular references

leledumbo
Administrator
> I still dont understand why FPC doesnt support circular references...

There is no way to solve that ?

Do you think Delphi or Turbo Pascal or even UCSD Pascal ever supports? The concept of units and uses clause makes the order in which units must be initialized (and how identifier is searched) is important, which is derived from how it's written in the uses clause, in a cascaded fashion. Thus, a uses clause serves as a depth first search path for the compiler to determine unit initialization order. If A uses B and B uses A, directly or indirectly, which one should be initialized first?

The only way to solve is to correctly group things in a unit (after all, unit serves as a placeholder for closely related things), or use 3rd unit for data sharing or the worst, use circular reference in implementation section. You'll notice that this is a common problem in a language with similar concept (and each have its own workaround).
Reply | Threaded
Open this post in threaded view
|

Re: Complex circular references

Jorge Aldo G. de F. Junior
Or, if the problem is the initialization, makes so that you can only
have circular references among units that dont have explicit
initialization/finalization.

Problem solved.

IIRC someone was trying to change FPC in order to solve circular
references, but this never materialized...

2012/11/23 leledumbo <[hidden email]>:

>> I still dont understand why FPC doesnt support circular references...
>
> There is no way to solve that ?
>
> Do you think Delphi or Turbo Pascal or even UCSD Pascal ever supports? The
> concept of units and uses clause makes the order in which units must be
> initialized (and how identifier is searched) is important, which is derived
> from how it's written in the uses clause, in a cascaded fashion. Thus, a
> uses clause serves as a depth first search path for the compiler to
> determine unit initialization order. If A uses B and B uses A, directly or
> indirectly, which one should be initialized first?
>
> The only way to solve is to correctly group things in a unit (after all,
> unit serves as a placeholder for closely related things), or use 3rd unit
> for data sharing or the worst, use circular reference in implementation
> section. You'll notice that this is a common problem in a language with
> similar concept (and each have its own workaround).
>
>
>
> --
> View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Re-fpc-pascal-Complex-circular-references-tp5712061p5712073.html
> Sent from the Free Pascal - General mailing list archive at Nabble.com.
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal