Skip to content

Commit 9bad550

Browse files
committed
automatic registration
1 parent 1ea77a8 commit 9bad550

25 files changed

Lines changed: 122 additions & 120 deletions

File tree

README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,6 @@ mixin(registerMethods);
137137

138138
I like to place it just after the `import methods` directive.
139139

140-
Finally, `updateMethods` must be called before calling any methods. Typically
141-
this is done once, in `main`.
142-
143140
To recap:
144141

145142
```D
@@ -178,8 +175,6 @@ void _print(DiagonalMatrix m)
178175
179176
void main()
180177
{
181-
updateMethods();
182-
183178
Matrix dense1 =
184179
new DenseMatrix(2, 3,
185180
[ 1, 2, 3,

benchmarks/calls.d

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,6 @@ void writesec(T...)(T arg)
139139

140140
void main()
141141
{
142-
updateMethods();
143-
144142
obj = new DerivedClass;
145143
intf = obj;
146144

blog/kick_open.d

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ string _kick(Pitbull dog) { return next!kick(dog) ~ " and bite"; }
2929

3030
void main()
3131
{
32-
updateMethods();
3332
import std.stdio : writeln;
3433
Animal snoopy = new Dog, hector = new Pitbull;
3534
writeln("kick(snoopy): ", kick(snoopy)); // bark

blog/novisitor.d

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ void _print(SparseMatrix m, File of)
5151

5252
void main()
5353
{
54-
updateMethods();
55-
5654
Matrix dense = new DenseMatrix, diagonal = new DiagonalMatrix;
5755
print(dense, stdout);
5856
print(diagonal, stdout);

docs/dconf2018/ast.d

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,6 @@ version(openmethods) {
187187
}
188188

189189
void main() {
190-
version (openmethods) updateMethods();
191-
192190
Node expr =
193191
new Times(new Number(2), new Plus(new Number(3), new Number(4)));
194192
writefln("value = %s", expr.value); // 2 3 4 + * = 14

examples/acceptnovisitors/source/app.d

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ string _toRPN(Number expr)
8080

8181
void main()
8282
{
83-
updateMethods();
84-
8583
version (unittest) {
8684
} else {
8785
Node expr =

examples/adventure/source/app.d

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ string incredible(Character t, Dragon d, Hands w)
7373

7474
void main()
7575
{
76-
updateMethods();
77-
7876
Character bob = new Character, rambo = new Warrior;
7977
Creature elliott = new Dragon, paddington = new Bear;
8078
Device hands = new Hands, axe = new Axe, chiquita = new Banana;
@@ -90,8 +88,6 @@ unittest {
9088
import std.meta;
9189
import std.string;
9290

93-
updateMethods();
94-
9591
static bool error;
9692

9793
foreach (CHARACTER; AliasSeq!(Character, Warrior)) {

examples/dl/app.d

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ extern(C) void* dlsym(void*, const char*);
1010

1111
void main()
1212
{
13-
updateMethods();
14-
1513
Animal ralf = new Wolf;
1614
assert(species(ralf) == "wolf");
1715

examples/matrix/source/app.d

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ void _print(DiagonalMatrix m)
3333

3434
void main()
3535
{
36-
updateMethods();
37-
3836
Matrix dense1 =
3937
new DenseMatrix(2, 3,
4038
[ 1, 2, 3,

examples/matrix/source/matrixops.d

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ bool _same(DiagonalMatrix a, DiagonalMatrix b) {
2626

2727
unittest
2828
{
29-
if (needUpdateMethods) {
30-
updateMethods();
31-
}
32-
3329
Matrix
3430
a = new DenseMatrix(2, 2,
3531
[ 0, 1,

0 commit comments

Comments
 (0)