* * *

Author Topic: Generic AVLTree  (Read 1368 times)

Pascal

  • Hero Member
  • *****
  • Posts: 664
Generic AVLTree
« on: June 27, 2017, 12:20:16 pm »
I am just porting unit Laz_AVL_Tree to generics.
Where should i put it to be suitable for integration into FPC? Generics.Trees? Generics.Collections?
laz trunk - fpc trunk 32bit - Windows 10 Pro x64 (1803)

hnb

  • Full Member
  • ***
  • Posts: 241
Re: Generic AVLTree
« Reply #1 on: June 27, 2017, 01:05:36 pm »
Rather Generics.Collections. The preferred way for large code base is separate .inc, maybe generics.treesh.inc (interface) and generics.trees.inc (implementation) like for dictionaries. Interface of TAVLTree can be changed in the future in the case when Delphi also implements it (so AVLTree tree must be marked as experimental). Be aware that Integration isn't sure so 3rd library might be also good idea (can be integrated in any time, when will be finished).
Checkout NewPascal initiative and donate beer - ready to use tuned FPC compiler + Lazarus for mORMot project

best regards,
Maciej Izak

Thaddy

  • Hero Member
  • *****
  • Posts: 6108
Re: Generic AVLTree
« Reply #2 on: June 27, 2017, 03:57:08 pm »
@Pascal
Yes, just like Maciej wrote. Keep in mind the conventions that are already in place for rtl-generics.
I might not give the answer that you want me to.. Peter Green 1969

Pascal

  • Hero Member
  • *****
  • Posts: 664
Re: Generic AVLTree
« Reply #3 on: June 27, 2017, 04:06:39 pm »
@Pascal
Yes, just like Maciej wrote. Keep in mind the conventions that are already in place for rtl-generics.
Which conventions do you mean? Delphi mode?
laz trunk - fpc trunk 32bit - Windows 10 Pro x64 (1803)

Thaddy

  • Hero Member
  • *****
  • Posts: 6108
Re: Generic AVLTree
« Reply #4 on: June 27, 2017, 04:27:55 pm »
No, I mean the way how it is structured and the means that are already provided. Outside of the units it doesn't really matter what syntax you use in your own units.
What I am referring to is to keep the code consistent if you eventually want to have it included in rtl-generics (which is indeed in delphi mode,not quirks mode)
I might not give the answer that you want me to.. Peter Green 1969

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus