Relaxed and extended delegates
AssigneeMicrosoft Corporation
InventorsHenricus Johannes Maria Meijer, Brian C. Beckman, Peter F. Drayton, David N. Schach, Ralf Lammel, Avner Y. Aharoni
Life of this patent
Estimating the term…
Abstract
Systems and methods that enhance expressibility in a programming language (e.g., Visual Basic) via relaxation of artificial restrictions and extension of delegates associated therewith, without changing the runtime infrastructure. A stub is employed that can replace an impermissible expression in the programming language, to leverage the existing permissible expressions.
Claims20
A method for relaxing artificial restrictions associated with a programming language and extend delegates associated with such programming language, without changing a runtime structure associated therewith, comprising:
- accessing source code written in a programming language;
- processing the source code written in the programming language, wherein processing includes:
- identifying an impermissible expression in the source code, the impermissible expression improperly defining a delegate construction according to the programming language, such that the impermissible expression is not type-safe;
- inserting a stub in place of the impermissible expression defining an improper delegate construction, wherein the stub provides a proper exact match in the programming language, the exact match being type-safe;
- and
- defining a constructor by a delegate class passed a specification of an object method to make the stub convert a currently impermissible expression to a currently permissible delegate construction;
- and
- moving a requirement that a check for an exact match be performed at delegate creation, such that a check for an exact match is instead made at a function call.
One or more computer-readable storage media having stored thereon computer-executable instructions that, when executed by a processor, cause a computing system to perform the following:
- access source code written in a programming language;
- process the source code, wherein processing the source code includes:
- identifying an impermissible expression in the source code, the impermissible expression improperly defining a delegate construction according to the programming language;
- inserting a stub in place of the impermissible expression defining an improper delegate construction, wherein the stub provides a proper exact match in the programming language;
- and
- defining a constructor by a delegate class passed a specification of an object method to make the stub convert a currently impermissible expression to a currently permissible delegate construction;
- and
- moving a requirement that a check for an exact match be performed at delegate creation, such that the a check for an exact match is instead performed at a function call.
A computing system comprising:
- a processor;
- one or more computer-readable media communicatively coupled to the processor, the one or more computer-readable media having thereon computer-executable instructions that, when executed by the processor, cause the computing system to:
- access source code written in a programming language, wherein such access is performed by a computing environment that includes a compiler;
- use the computing environment to process the source code, wherein processing the source code includes:
- identifying an impermissible expression in the source code, the impermissible expression improperly defining a delegate construction according to the programming language;
- inserting a stub in place of the impermissible expression defining an improper delegate construction, wherein the stub provides a proper exact match in the programming language, wherein the stub defines an exact match for a function such that when the exact match is acceptable for functions it is also acceptable for delegates, and wherein the stub has a form of:
- Function Y (X as Z) As Z;
- and
- defining a constructor by a delegate class passed a specification of an object method to make the stub convert a currently impermissible expression to a currently permissible delegate construction;
- and
- moving a requirement of the computing environment that a check for an exact match be performed at delegate creation, such that the computing environment instead checks for an exact match at a function call.
Dependencies are inferred from the claim text.