Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
[wishlist] Make Signatures and Parameters first class citizens #2594
It is very complicated to dynamically create Parameter and Signature objects in code. At the moment, this task requires reverse engineering and writing nqp code setting up all the attributes correctly. In contrast, typing Signature literals is very easy (using the :() syntax) but does not cover all the use cases. A particularly interesting use-case is to link at runtime to frameworks providing functions and type informations such as Cocoa or GObject.
Example use case
With nativecast it is already possible to link to an exported C function symbol at runtime, this allow, for instance, this code to run:
This issue aims at completing this functionality, and allowing the following code to also work:
I think it should work
Both Signature and Parameter are defined in BOOTSTRAP.nqp and expanded in core, World.nqp contains the nqp code to create Signature and Parameter used by the Perl compiler.
Yes: it would be great to have a nice interface and the multi invocant is very internal. I think that this is not trivial because many properties of the parameters, including this, are there just to serve the signature.
For my task, making
also parameters can be an Array that allows names, types and certain flags (e.g. positional or named, where clauses, etc) at the same time. In this sense, it makes sense to make
changed the title
[wishlist] add BUILD submethods to Parameter and Signature classes
Jan 9, 2019
Thank you @lizmat ! I think your code still needs some work: for some reason it cannot create a
I think I spotted a bug in