词条 | Script.NET |
释义 |
|name = Script.NET |logo = |paradigm = imperative, meta, scripting |designer = |developer = Microsoft |latest_release_version = |latest_release_date = 2007-10-02 |typing = dynamic |implementations = |dialects = |influenced_by = JavaScript |influenced = |platform = .NET Framework |license = Free |website = }} Script.NET or S# is a metaprogramming language that provides scripting functionality in Microsoft .NET applications, allowing runtime execution of custom functionality, similar to VBA in Microsoft Office applications. The syntax of Script.NET is similar to JavaScript. It is designed to be simple and efficient scripting language allowing to customize .NET applications. The language has a true runtime interpreter, and it is executed without generating additional in-memory assemblies. Script.NET is an open-source project. Metaprogramming featuresScript.NET has a special quotation operator <[ program ]> which returns the AST of a given program. Additionally, the AST of the current program may be accessed with the prog object. Here is an example: The <[ ... ]> operator and prog objects allow Script.NET to generate new scripts or modify existing scripts at runtime. Generalized objectsScript.NET includes so-called "Mutantic Framework" which introduces a special kind of "meta" objects for controlling objects of any type. It is composed of a set of classes, on top of which is the "DataMutant" class. It implements several principles of mutant object: DefinitionA Mutant is a special object which could have all properties (fields, methods, etc.), and may be converted to any type (or assigned to object of any type). The semantics of such conversion (or assignment) are pragmatically conditional. There is a special operator := called Mutantic or Generalized assignment. Its purpose is to assign values of DataMutant fields to corresponding fields of an object of any type. Example. Creation and Usage of MObject: ExamplesHello worldBubble sort with out output functionRSS ReaderStackStack limited to 20 elements using Design by contract feature See also
External links
1 : .NET programming languages |
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。