Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2017-03

Hash List

10 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

African Wild Dog

Hello,

Ia there any hash list implementation in free Pascal?

Ghashmap has no documentation. Is it stable for production use?

Regards

Reply by email

silvioprog
to African Wild Dog
African Wild Dog wrote
Hello, Ia there any hash list implementation in free Pascal?

Hello,

Please take a look at these examples:

https://github.com/graemeg/freepascal/tree/master/packages/rtl-generics/examples

and in this wiki page:

http://www.freepascal.org/docs-html/3.0.0/fcl/contnrs/tfphashlist.html

Ghashmap has no documentation. Is it stable for production use?

Some info: https://www.mii.lt/olympiads_in_informatics/pdf/INFOL101.pdf

Silvio Clécio

Reply by email

African Wild Dog
to Giuliano Colla

Thanks for your reply Giuliano, Silvio.

To be more specific, i need a generic hash map similar to the Delphi's TDictionary.

It seems THashmap from the ghashmap unit is the most close to TDictionary.

Regards

Reply by email

silvioprog
to African Wild Dog

You're welcome. :-)

Notice the first link I've passed is exactly showing the TDictionary, recently added to FPC:
https://github.com/graemeg/freepascal/blob/master/packages/rtl-generics/src/inc/generics.dictionariesh.inc#L534 .

You should take a look at that. :-)

African Wild Dog wrote 9 lines
Thanks for your reply Giuliano, Silvio. To be more specific, i need a generic hash map similar to the Delphi's TDictionary. It seems THashmap from the ghashmap unit is the most close to TDictionary. Regards
Silvio Clécio

Reply by email

Unknown author
to Giuliano Colla: Il 18/03/2017 00:29, African Wild Dog ha scritto: The IniFiles unit…
Giuliano Colla wrote 6 lines
Il 18/03/2017 00:29, African Wild Dog ha scritto: > Ia there any hash list implementation in free Pascal? The IniFiles unit (fpc/packages/fcl-base/src/inifiles.pp) provides a THashedStringList (descendant from TstringList) which I'm using reliably since many years.

If it is not specific to INI files and can be used generally for many things, maybe it should be pulled out into some other unit so people do not think it is just INI file related?

Also, ini files are file based, so could it be used without using files on the disk and used as a in memory list only?
Any time someone sees "ini file" they think "files on the hard drive", and could be turned off using this, when in fact it could be just what they need.

Reply by email

Michael Van Canneyt
to Unknown author
Show quoted text 11 lines
On 2017-03-17 19:06, Giuliano Colla wrote: > Il 18/03/2017 00:29, African Wild Dog ha scritto: > >> Ia there any hash list implementation in free Pascal? > The IniFiles unit (fpc/packages/fcl-base/src/inifiles.pp) provides a > THashedStringList (descendant from TstringList) which I'm using > reliably since many years. If it is not specific to INI files and can be used generally for many things, maybe it should be pulled out into some other unit so people do not think it is just INI file related?

we could put it in contnrs, and alias it in inifiles.pp

Michael.

Reply by email