The Call command has been enhanced to allow invoking a function as an object method.
We do this by placing braces after the Call keyword.
Syntax:
Example:
Output:
--
---
You received this message because you are subscribed to the Google Groups "The Ring Programming Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ring-lang+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/ring-lang/5cbb658d-3674-4c85-8c96-f43e5913af0an%40googlegroups.com.
Thank you very much — I enjoyed reading the samples. I think they need very little modification to be fully usable
In practice, instead of using AddMethod(), which add method permanently to the class, the new feature allows us to call temporary methods that can be executed as if they were object methods without becoming part of the class itself. These temporary methods can also be passed as parameters.
This feature was introduced to improve the performance of the Natural Library, but as you mentioned, it opens the door to many additional use cases.
To view this discussion visit https://groups.google.com/d/msgid/ring-lang/8035f875-e0d0-49c2-811d-97e743d88bcbn%40googlegroups.com.