Index: doc/next-migration.html =================================================================== diff -u -rf3cb5afe6aa1b6761b4a9909058f64ff7d64ab92 -rdfbcccd3296d1472af73d0f08fdd2b5079cefdab --- doc/next-migration.html (.../next-migration.html) (revision f3cb5afe6aa1b6761b4a9909058f64ff7d64ab92) +++ doc/next-migration.html (.../next-migration.html) (revision dfbcccd3296d1472af73d0f08fdd2b5079cefdab) @@ -590,6 +590,76 @@

Object Parameters

+ + + + + + + +
XOTclNext Scripting Language
Class Foo -parameter {a {b 1}}

+ # Create instance of the class Foo
+ Foo f1 -a 0

+ # Object f1 has a == 0 and b == 1
+
+ Class Foo -slots {
+    Attribute a
+    Attribute b -default 1
+ }
+
+ # Create instance of the class Foo
+ Foo f1 -a 0

+ # Object f1 has a == 0 and b == 1
+ +
+
+ # Define two attributes, second with default value

+ Class create Foo {
+    :attribute a
+    :attribute {b 1}
+ }

+ # Create instance of the class Foo
+ Foo create f1 -a 0

+ # Object f1 has a == 0 and b == 1
+
+
+ +Next example + +Person slots { + Attribute create sex -type "sex" { + :method type=sex {name value} { + #puts stderr "[self] slot specific converter" + switch -glob $value { + m* {return m} + f* {return f} + default {error "expected sex but got $value"} + } + } + } +} + +vs. + + Class create Person { + :attribute sex { + :type "sex" + :method type=sex {name value} { + #puts stderr "[self] slot specific converter" + switch -glob $value { + m* {return m} + f* {return f} + default {error "expected sex but got $value"} + } + } + } +} + +Next :types + +Next :required + +

Method Parameters

Interceptors

@@ -1175,6 +1245,6 @@
- Last modified: Wed Aug 11 12:19:50 CEST 2010 + Last modified: Fri Aug 13 13:25:57 CEST 2010