This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package metaobjectTest | |
@doc{* | |
This metaobject should only be attached to methods 'functionForMethod:1' and | |
'functionForMethodWithSelf:1' of Any. It replaces method calls to these | |
methods by an anonymous function. If the parameter of 'functionForMethod:1' is | |
a literal string "m:1", then the code that | |
replaces the method call is | |
{ (: T elem :) receiver m: elem } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package metaobjectTest | |
@doc{* | |
checkCatchParameter checks whether each parameter to a catch: selector | |
has at least one 'eval:' method, each of them accepting one parameter whose | |
type is subprototype of CyException | |
*} | |
object CheckCatchParameter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package metaobjectTest | |
@doc{* | |
Annotation 'codeAfter' adds the code attached to the | |
annotation after a local variable declaration. | |
*} | |
object CodeAfter | |
func run { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package metaobjectTest | |
@doc{* | |
Annotation 'compilationInfo' takes a parameter and returns an information | |
on the current source code. The parameter and the return type are as | |
follows: | |
"filename", "String" | |
"prototypename", "String" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package metaobjectTest | |
import generic | |
@doc{* | |
Annotation 'concept' should be attached to a prototype. It tests | |
whether one or more prototypes obey some restrictions. That | |
includes parameters to the generic prototype. | |
*} | |
object Concept |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package generic | |
@concept{* | |
T has [ func * (T other) -> T | |
func unit -> T | |
func inverse -> T ], | |
"T should have methods *, unit, and inverse in order to be considered element of a Group", | |
axiom opTest: T a, T b, T c {% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package generic | |
@concept{* | |
cyan.lang.init(IntGroupPlus, Int), | |
cyan.lang.lessThan(IntGroupPlus) | |
*} | |
object IntGroupPlus | |
@init(_elem) | |
@property var Int _elem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package metaobjectTest | |
@doc{* | |
Annotation 'countFieldAccess' should be attached to a field. It | |
creates an Int field countFieldAccess_fieldName if the attached field | |
is fieldName. countFieldAccess_fieldName is the number of times | |
the field was accessed for reading or writing. | |
*} | |
object CountFieldAccess |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package metaobjectTest | |
@doc{* | |
Annotation 'deprecated' should be attached to a method. | |
Whenever there is a possible message passing that can call | |
the method, an error message is issued at compile-time | |
*} | |
object Deprecated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package metaobjectTest | |
@doc{* | |
Annotation 'doc' can be attached to any declaration, including | |
the program and packages | |
*} | |
object Doc | |
@doc{* |