Andrey did something similar in the past:
And yes if possible please avoid oop in kdb.
Von: firstname.lastname@example.org [mailto:email@example.com] Im Auftrag von Komsit Prakobphol
Gesendet: Dienstag, 3. November 2015 14:57
An: Kdb+ Personal Developers
Betreff: [personal kdb+] simulating class behavior
I need some way to simulate class behaviour in q
Something I can call like this
So I came up with this idea
1. store class instance in a namespace dict and keyed by instance id. new dict entry will be added every time new is called
For example, dict3 and dict4 are two instances created in memory
2. use function projection with instance id to simulate method call on instance (note projection with `dict3])
3. instance id is generated and bind to instance method at creation
4. done. you can call it like above code
Does anyone have other solution for this? Are you aware of any problem with this approach?
The reason why I came up with this idea is simply because I was looking for a cleaner way to do this
To create generic dict, this wouldn't work
So I had to do this.
You received this message because you are subscribed to the Google Groups "Kdb+ Personal Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firstname.lastname@example.org.
To post to this group, send email to email@example.com.
Visit this group at http://groups.google.com/group/personal-kdbplus.
For more options, visit https://groups.google.com/d/optout.
Hi Kim,Thanks for the link! That is interesting.Komsit
Tel: +44 (0)28 3025 2242
Tel: +1 (212) 447 6700
Tel: +61 (0)2 9236 5700