Message-ID: <2144859883.85.1369150413031.JavaMail.firstname.lastname@example.org> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_84_1938574360.1369150413030" ------=_Part_84_1938574360.1369150413030 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
<= a href=3D"#Keywordswithexamples-super">#super
"abstract"= ; is used to designate a class as a base class. A derivative of the abstrac= t class must implement all of its abstract methods and properties.
"and= " is a logical operator that is applied to test if two boolean express= ions are true.
a as boo= l =3D true b as bool =3D true if a and b: print "c"=09=09
The "as&= quot; keyword declares a variables type.
"AST= " is used to create AST objects for use with the Boo compiler.
&= quot;break" is a keyword used to escape program execution. Typically b= reak is used inside a loop and may be coupled with the "if" or &q= uot;unless" keywords.
"callable" allows function or type to be called by ano= ther.
"= ;cast" is a keyword used to explicitly transform a variable from one d= ata type to another.
"= ;char" is a data type representing a single character. The char data t= ype is distinct from a string containing a single character. char('t') refe= rs to a System.Char type, whereas "t" or 't' is a System.String.<= /p>
&= quot;class" is a definition of an object including its properties and = methods.
"constructor" is a method belonging to a c= lass that is used to define how an instance of the class should be created.= The constructor may include input parameters and may be overloaded.
see the examples = for the keyword "class"
"continue" is a keyword = used to resume program execution at the end of the current loop.
The = continue keyword is used when looping. It will cause the position of the co= de to return to the start of the loop (as long as the condition still holds= ).
"def= " is used to define a new function or method.
"destructor" is used to destroy objects. Destr= uctors are necessary to release memory used by non-managed resources in the= .NET CLI. Desctructors should never be called explicitly. They can be invo= ked by implementing the IDisposable() interface.
"do"= ; is synonymous with 'def' for closures. However, "do" reads as a= n imperative and therefore should be used in an active sense.
"= ;elif" is similar the same as the "if" conditional statement= in form, except that it needs to be preceded by an if statement or another= elif statement and that it is only evaluated (checked) if the if/elif stat= ement preceding it evaulates to false.
If one of the preceding if/eli= fs statements evaluates to true, the rest of the elifs will not be evaluate= d, thus sparing extra CPU power from a pointless task.
x =3D 3 if x =3D=3D 1: =09print "One." elif x =3D=3D 2: =09print "Two." elif x =3D=3D 3: =09print "Three."=09=09
"= ;else" is defines a statement that will be executed should a preceding= "if" condition fail.
"ensure" is used with the "try" and "except&quo= t; keywords to guarantee a certain block of code runs whether the try/excep= t block is successful or not. "ensure" is often used to add some = post executions to an exception event.
"= ;enum" is used to create a list of static values. Internally the names= are assigned to an Int32 value.
&= quot;event" is (insert text here)
"except" is keyword use to ident= ify a block of code that is to be executed if the "try" block fai= ls.
See exa= mples under the "ensure" keyword.
"failure" is not y= et implemented in boo.
"final" is a keyword used to identify a class that c= annot have subclasses. final may also be used to declare a field as a const= ant.
"= ;from" is used with the "import" keyword to identify the ass= embly being imported from. Form usage is "import TARGET (from ASSEMBLY= ). The "from" keyword is optional.
"for= " is used to loop through items in a series. "for" loops are= frequently used with a range or a listarray.
&= quot;false" represents a negative boolean outcome.
j as boo= l =3D false if j =3D=3D false: print "j is false."=09=09
"get= " is used to identify a field that is exposed for external access. Use= "get" to make a field available as read-only. Use "set"= ; to add write access. "get" is suffixed by a colon when implemen= ted and includes a return statement. It is possible to modify the value of = the field being returned. See example 1.
"get" is also used= when defining an interface to define which fields should be implemented as= accessible. When "get" is used to define an interface the colon = and return statements are excluded. See example 2.
&= quot;given" is used as the entry to a "given ... when" loop.= "given" identifies a state. A series of "when" stateme= nts may be executed based on the identified state. _ The "given" = keyword is currently not implemented. _
"= ;goto" exits a line of code and moves to a named line in the code. The= named line must be prefixed wtih a colon. Good programming practice eschew= s the use of "goto"
The example below names two lines "= ;:start" and "test". They are referenced in the code by sepa= rate goto statements. This example produces an endless loop. The "ensu= re" statement includes a Console.Readline() that prevents the loop fro= m continuing without user input.
"if"= ; is a conditional statement, followed by a statement that either evaluates= to true or false. In block form, the code within the block is executed onl= y if the expression following the if evaluates to true.
The if statem= ent can be used to selectively execute a line of code by placing "if &= lt;expression>" at the very end of the statement. This form of the = if conditional is useful in circumstances when you are only going to perfor= m one operation based entirely on an expression: this makes the code cleane= r to read than an unnecessary if block.
"import" is used to include a namespace from other assemblies = within your program. If the assembly is not automatically included, the &qu= ot;from" keyword must be included to identify the respective assembly.=
import S= ystem import Gtk from "gtk-sharp" ###prints 3.1415926535879 print Math.PI ###prints an Error print PI=09=09
"in"= ; is used in conjunction with "for" to iterate through items in a= list. "in" may also be used to test items in a set.
See examples for the keyword "for"= ;.
"inteface" is used to define the fields and metho= ds that may be implemented by a class. The implementation is never performe= d by the interface. Interfaces allow you to establish an API that is the ba= sis for other classes.
"internal" is a keyword that precedes a class definiti= on to limit the class to the assembly in which it is found.
"is"= ; is an equvalence operator keyword that is used to test a value. "is&= quot; may not be used with ints, doubles, or boolean types. "is" = is commonly used to test for null.
lol =3D = null print lol is null print lol is not null=09=09
"isa= " determines if one element is an instance of a specific type.
"not= " is used with "is" to perform a negative comparison. "= not" can also be used in logical expressions.
"= ;null" is a keyword used to specify a value is absent.
"of"= ; is used to specify type arguments to a generic type or method.
myList = =3D List[of=C2=A0int]() myList.Add(1) # success! myList.Add('f') # failure, oh horrible, horrible failure.=09=09
"or"= ; is a logical operator that is applied to test if either of two boolean ex= pressions are true.
"otherwise" is part of the conditional phrase &qu= ot;given ... when ... otherwise". The otherwise block is executed for = a given state if none of the when conditions match. _ The otherwise keyword= is not yet implemented _
See examples for "given".
"override&q= uot; is used in a derived class to declare that a method is to be used inst= ead of the inherited method. "override" may only be used on metho= ds that are defined as "virtual" or "abstract" in the p= arent class.
"namespace" is a name that uniquely identifies a = set of objects so there is no ambiguity when objects from different sources= are used together. To declare a namespace place the namespace followed by = the name you choose at the top of the file.
"partial" is (insert text here)
"pass" is a keyword used when = you do not want to do anything in a block of code.
"public" is used to define a class, method, or field as availa= ble to all. "public class" is never required because a defined cl= ass defaults to public.
"protected" is a keyword used to declare a class,= method, or field as visible only within its containing class. Fields are b= y default protected. Prefixing a field name with an underscore=C2=A0 is rec= ommended practice.
"private" is keyword used to declare a class, method, or f= ield visible within only its containing class and inherited classes..
&= quot;raise" is (insert text here)
"ref" makes a parameter be passed by referen= ce instead of by value. This allows you to change a variable's value outsid= e of the context where it is being used
&= quot;retry" is not yet implemented.
"return" is a keyword use to s= tate the value to be returned from a function definition
"= ;self" is used to reference the current class. "self" is not= required for boo but may be used to add clarity to the code. "self&qu= ot; is synonymous with the c# keyword "this".
class Po= int(): [property(Xcoordinate)] _xcoordinate as double [property(Ycoordinate)] _ycoordinate as double def constructor(): pass def constructor(one as double, two as double): self.Xcoordinate =3D one self.Ycoordinate =3D two=09=09
"set= " is a keyword used to define a field as writeable.
class Ca= t: =09_name as string =09Name as string: =09=09get: =09=09=09return _name =09=09set: =09=09=09_name =3D value fluffy =3D Cat() fluffy.Name =3D 'Fluffy'=09=09
"static" is (insert text here)
"struct" is short for struc= ture. A structure is similar to a class except it defines value types rathe= r than reference types.
Refer to the Boo Primer for more information = on structures.
struct= =C2=A0Coordinate: =C2=A0=C2=A0=C2=A0=C2=A0X=C2=A0as=C2=A0int =C2=A0=C2=A0=C2=A0=C2=A0Y=C2=A0as=C2=A0int =C2=A0=C2=A0=C2=A0=C2=A0def=C2=A0constructor(x=C2=A0as=C2=A0int, y=C2=A0as= =C2=A0int): =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0X =3D x =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0Y =3D y c=C2=A0as=C2=A0Coordinate print=C2=A0c.X, c.Y c =3D=C2=A0Coordinate(3,=C2=A05) print=C2=A0c.X, c.Y=09=09
"success" is not yet implemented.
"super" is used to refer= ence a base class from a child class when one wants to execute the base beh= avior.
"transient" transient marks a member as not to be= serialized. By default, all members in Boo are serializable.
"= ;true" is keyword used to represent a positive boolean outcome.
a as boo= l =3D true if a is true: =09print "as true as true can be"=09=09
"try= " is used with the "ensure" and "except" keywords = to test whether a block of code executes without error.
_see key= word ensure for examples_=09=09
typeof returns a Type instance. Unnecessary, in Boo since you can pass b= y type directly.
anIntege= r =3D typeof(int) #or, the boo way: anotherInteger =3D int=09=09
"unless" is similar to the "if" statement, except th= at it executes the block of code unless the expression is = true.
"virtual" is a keyword that may precede the 'def' keyword = when the developer wishes to provide the ability to override a defined meth= od in a child class. The 'virtual' keyword is used in the parent class.=
"= ;when" is used with the "given" keyword to identify the cond= ition in a which the "given" value may be executed. _b "when= " is currently not implemented.
see examples for the "given" keyword.
"while&quo= t; will execute a block of code as long as the expression it evaluates is t= rue.
It is useful in cases where a variable must constantly be evalul= ated (in another thread, perhaps) , such as checking to make sure a socket = still has a connection before emptying a buffer (filled by another thread, = perhaps).
&= quot;yield" is similar to "return" only it can be called mul= tiple times within a single method.