Open pmoura opened 2 years ago
Thanks for your help! Actually, I'm going to ask you to not send any PR because this is my project for learning Logtalk in a more-than-toy codebase and I'd like to improve it myself when I find some free time. But, any kind of suggestion is welcome!
One question: why the messages to self in the registers
object? Do you expect to extend this object and redefine the value/3
predicate?
Hmm, actually I don't know why. Now that you're asking that, I suppose that there's a difference between ::value
and value
.
In this specific case, with the code as-is currently, the end results are the same but not the performance as ::/1
is a message-sending control construct that necessarily uses dynamic binding (as self is only know at runtime); calling value/3
directly is faster as it's just a call to a locally defined predicate with no need for lookups.
The source code can be made more portable by replacing the use of the
assoc
module library by the Logtalkdictionaries
library and replacing the use of theformat
module by the Logtalkformat
library. If you agree these changes are beneficial, I'm happy to help (e.g. via pull requests).