<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://debianws.lexgopc.com/wiki143/index.php?action=history&amp;feed=atom&amp;title=Script.NET</id>
	<title>Script.NET - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://debianws.lexgopc.com/wiki143/index.php?action=history&amp;feed=atom&amp;title=Script.NET"/>
	<link rel="alternate" type="text/html" href="http://debianws.lexgopc.com/wiki143/index.php?title=Script.NET&amp;action=history"/>
	<updated>2026-09-08T18:14:19Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>http://debianws.lexgopc.com/wiki143/index.php?title=Script.NET&amp;diff=5662517&amp;oldid=prev</id>
		<title>imported&gt;Dexxor: Undid revision 1182305084 by 24.155.181.218 (talk)</title>
		<link rel="alternate" type="text/html" href="http://debianws.lexgopc.com/wiki143/index.php?title=Script.NET&amp;diff=5662517&amp;oldid=prev"/>
		<updated>2024-01-13T11:02:38Z</updated>

		<summary type="html">&lt;p&gt;Undid revision 1182305084 by &lt;a href=&quot;/wiki143/index.php?title=Special:Contributions/24.155.181.218&quot; title=&quot;Special:Contributions/24.155.181.218&quot;&gt;24.155.181.218&lt;/a&gt; (&lt;a href=&quot;/wiki143/index.php?title=User_talk:24.155.181.218&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;User talk:24.155.181.218 (page does not exist)&quot;&gt;talk&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Short description|Programming language}}&lt;br /&gt;
{{Infobox programming language&lt;br /&gt;
|name = Script.NET&lt;br /&gt;
|logo = &lt;br /&gt;
|paradigm = [[imperative programming|imperative]], [[metaprogramming|meta]], [[scripting language|scripting]]&lt;br /&gt;
|designer = &lt;br /&gt;
|developer = [[Microsoft]]&lt;br /&gt;
|latest_release_version =&lt;br /&gt;
|latest_release_date = 2007-10-02&lt;br /&gt;
|typing = [[dynamic typing|dynamic]]&lt;br /&gt;
|implementations = &lt;br /&gt;
|dialects = &lt;br /&gt;
|influenced_by = [[JavaScript]]&lt;br /&gt;
|influenced =&lt;br /&gt;
|platform = [[.NET Framework]]&lt;br /&gt;
|license = Free&lt;br /&gt;
|website =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Script.NET&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;S#&amp;#039;&amp;#039;&amp;#039; is a [[metaprogramming]] language that provides scripting functionality in [[Microsoft .NET]] applications, allowing [[Run time (program lifecycle phase)|runtime]] execution of custom functionality, similar to [[Visual Basic for Applications|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.&lt;br /&gt;
&lt;br /&gt;
Script.NET is an open-source project.&lt;br /&gt;
&lt;br /&gt;
==Metaprogramming features==&lt;br /&gt;
&lt;br /&gt;
Script.NET has a special quotation operator &amp;#039;&amp;#039;&amp;#039;&amp;lt;[&amp;#039;&amp;#039;&amp;#039; program &amp;#039;&amp;#039;&amp;#039;]&amp;gt;&amp;#039;&amp;#039;&amp;#039; which returns the [[Abstract syntax tree|AST]] of a given program. Additionally, the AST of the current program may be accessed with the &amp;#039;&amp;#039;&amp;#039;prog&amp;#039;&amp;#039;&amp;#039; object.&lt;br /&gt;
&lt;br /&gt;
Here is an example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
//Create an AST for MessageBox.Show(&amp;#039;Hello&amp;#039;); program&lt;br /&gt;
ast = &amp;lt;[ MessageBox.Show(&amp;#039;Hello&amp;#039;); ]&amp;gt;;&lt;br /&gt;
//Add this AST at the end of the current program&lt;br /&gt;
prog.AppendAst(ast);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;&amp;lt;[&amp;#039;&amp;#039;&amp;#039; ... &amp;#039;&amp;#039;&amp;#039;]&amp;gt;&amp;#039;&amp;#039;&amp;#039; operator and &amp;#039;&amp;#039;&amp;#039;prog&amp;#039;&amp;#039;&amp;#039; objects allow Script.NET to generate new scripts or modify existing scripts at runtime.&lt;br /&gt;
&lt;br /&gt;
== Generalized objects ==&lt;br /&gt;
Script.NET includes so-called &amp;quot;Mutantic Framework&amp;quot; which introduces a special kind of &amp;quot;meta&amp;quot; objects for controlling objects of any type. It is composed of a set of classes, on top of which is the &amp;quot;DataMutant&amp;quot; class. It implements several principles of mutant object:&lt;br /&gt;
&lt;br /&gt;
===Definition===&lt;br /&gt;
A 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.&lt;br /&gt;
&lt;br /&gt;
There is a special operator &amp;#039;&amp;#039;&amp;#039;:=&amp;#039;&amp;#039;&amp;#039; called Mutantic or Generalized assignment. Its purpose is to assign values of DataMutant fields to corresponding fields of an object of any type.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Example&amp;#039;&amp;#039;. Creation and Usage of MObject:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
 // Create Data Mutant Object&lt;br /&gt;
 mobj = [ Text -&amp;gt; &amp;#039;Hello from Mutant&amp;#039; ];&lt;br /&gt;
 // Set Additional Fields&lt;br /&gt;
 mobj{{Not a typo|.}}Top = 0;&lt;br /&gt;
 mobj{{Not a typo|.}}Left = 0;&lt;br /&gt;
 // Set corresponding fields of Windows Form object&lt;br /&gt;
 // (Mutantic Assignment)&lt;br /&gt;
 form := mobj;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
===Hello world===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
 MessageBox.Show(&amp;#039;Hello World!&amp;#039;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Bubble sort without output function===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
a=[17, 0, 5, 3,1, 2, 55];&lt;br /&gt;
for (i=0; i &amp;lt; a.Length; i=i+1)&lt;br /&gt;
 for (j=i+1; j &amp;lt;  a.Length; j=j+1)&lt;br /&gt;
   if (a[i] &amp;gt; a[j] )&lt;br /&gt;
   {&lt;br /&gt;
     temp = a[i]; &lt;br /&gt;
     a[i] = a[j];&lt;br /&gt;
     a[j] = temp;&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
s = &amp;#039;Results:&amp;#039;;&lt;br /&gt;
for (i=0; i &amp;lt; a.Length; i++)&lt;br /&gt;
  s = s + &amp;#039;,&amp;#039; + a[i];&lt;br /&gt;
&lt;br /&gt;
MessageBox.Show(s);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===RSS Reader===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
a = new XmlDocument();&lt;br /&gt;
a.Load(&amp;#039;http://www.codeplex.com/scriptdotnet/Project/ProjectRss.aspx&amp;#039;);&lt;br /&gt;
 &lt;br /&gt;
MessageBox.Show(&amp;#039;CodePlex Script.NET RSS::&amp;#039;);&lt;br /&gt;
foreach (n in a.SelectNodes(&amp;#039;/rss/channel/item/title&amp;#039;))&lt;br /&gt;
  MessageBox.Show(n.InnerText);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Stack===&lt;br /&gt;
Stack limited to 20 elements using [[Design by contract]] feature&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function Push(item)&lt;br /&gt;
[&lt;br /&gt;
//Limit to 10 items&lt;br /&gt;
 pre(me{{Not a typo|.}}Count &amp;lt; 10 ); &lt;br /&gt;
 post();&lt;br /&gt;
 invariant();&lt;br /&gt;
]&lt;br /&gt;
{&lt;br /&gt;
 //me is mutated object, &lt;br /&gt;
 //stack in this case&lt;br /&gt;
 me.Push(item);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function Pop()&lt;br /&gt;
[//Check emptiness hardik&lt;br /&gt;
 pre(me{{Not a typo|.}}Count &amp;gt; 0);&lt;br /&gt;
 post();&lt;br /&gt;
 invariant();&lt;br /&gt;
]&lt;br /&gt;
{&lt;br /&gt;
 return me.Pop();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
stack = new Stack&amp;lt;|int|&amp;gt;();&lt;br /&gt;
&lt;br /&gt;
//Create Mutant hardik&lt;br /&gt;
//1. Set Functions, override stack{{Not a typo|.}}Push&lt;br /&gt;
mObject=[Push-&amp;gt;Push,PopCheck-&amp;gt;Pop];&lt;br /&gt;
//2. Capture object&lt;br /&gt;
mObject.Mutate(stack);&lt;br /&gt;
&lt;br /&gt;
for (i=0; i&amp;lt;5; i++)&lt;br /&gt;
  mObject.Push(i);&lt;br /&gt;
&lt;br /&gt;
Console.WriteLine((string)mObject.PopCheck());&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* L Sharp - Lisp-like scripting language for .NET&lt;br /&gt;
* [[Boo (programming language)|Boo]] - a Python Like language for .NET platform&lt;br /&gt;
* [[IronPython]] - an implementation of Python for the .NET platform, similar to [[Jython]].&lt;br /&gt;
* [[Nemerle]] - a high-level language for the .NET platform.&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://www.codeplex.com/scriptdotnet Latest release]&lt;br /&gt;
*[http://www.protsyk.com/scriptdotnet/ Script.NET Homepage]&lt;br /&gt;
*[http://www.protsyk.com/scriptdotnet/examples.html Code Examples]&lt;br /&gt;
&lt;br /&gt;
{{DEFAULTSORT:Script.Net}}&lt;br /&gt;
[[Category:.NET programming languages]]&lt;/div&gt;</summary>
		<author><name>imported&gt;Dexxor</name></author>
	</entry>
</feed>