pike.git/
CHANGES
Branch:
Tag:
Non-build tags
All tags
No tags
2007-11-15
2007-11-15 17:48:42 by Martin Nilsson <mani@lysator.liu.se>
98c7e4eb5b1ddc03fe7703e20f4ccc7465bdf087 (
11
lines) (+
6
/-
5
)
[
Show
|
Annotate
]
Branch:
7.9
New getter/setter syntax
Rev: CHANGES:1.85
41:
It is now possible to simulate variables with functions. Example: class A { private int a;
-
int
`->b
() { return a; } // Getter for the symbol b.
-
void
`->b
=(int c) { a = c; } // Setter for the symbol b.
+
int
`b
() { return a; }
// Getter for the symbol b.
+
void
`b
=(int c) { a = c; }
// Setter for the symbol b.
int c() {
-
return b; // Calls
`->b
().
+
return b; // Calls
`b
().
} } object a = A();
-
a->b = 17; // Calls
`->b
=(17).
-
werror("%d\n", a->b); // Calls
`->b
().
+
a->b = 17; // Calls
`b
=(17).
+
werror("%d\n", a->b); // Calls
`b
().
o Unicode escapes. Pike now understands the common way to escape unicode chars, using