~mdw
/
sod
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
doc/{runtime,structures}.tex: Fix careless transfer from the manpages.
[sod]
/
test
/
chimaera.sod
diff --git
a/test/chimaera.sod
b/test/chimaera.sod
index
644bb74
..
976c727
100644
(file)
--- a/
test/chimaera.sod
+++ b/
test/chimaera.sod
@@
-31,16
+31,21
@@
class Goat : Animal {
}
class Serpent : Animal {
}
class Serpent : Animal {
+ int limit = 2;
+
void hiss() { puts("Sssss!"); }
void bite() { puts("Nom!"); }
void nml.tickle() {
void hiss() { puts("Sssss!"); }
void bite() { puts("Nom!"); }
void nml.tickle() {
- if (SERPENT__CONV_NML(me)->nml.tickles <= 2) Serpent_hiss(me);
- else Serpent_bite(me);
+ if (SERPENT__CONV_NML(me)->nml.tickles <= me->serpent.limit)
+ Serpent_hiss(me);
+ else
+ Serpent_bite(me);
}
}
[nick = sir, link = Animal]
class Chimaera : Lion, Goat, Serpent {
}
}
[nick = sir, link = Animal]
class Chimaera : Lion, Goat, Serpent {
+ serpent.limit = 1;
}
code c : user {
}
code c : user {
@@
-77,25
+82,25
@@
static void provoke_serpent(Serpent *s)
int main(void)
{
{
int main(void)
{
{
- SOD_DECL(Lion, l);
+ SOD_DECL(Lion, l
, NO_KWARGS
);
provoke_lion(l);
tickle_animal(LION__CONV_NML(l));
}
{
provoke_lion(l);
tickle_animal(LION__CONV_NML(l));
}
{
- SOD_DECL(Goat, g);
+ SOD_DECL(Goat, g
, NO_KWARGS
);
provoke_goat(g);
tickle_animal(GOAT__CONV_NML(g));
}
{
provoke_goat(g);
tickle_animal(GOAT__CONV_NML(g));
}
{
- SOD_DECL(Serpent, s);
+ SOD_DECL(Serpent, s
, NO_KWARGS
);
provoke_serpent(s);
tickle_animal(SERPENT__CONV_NML(s));
}
{
provoke_serpent(s);
tickle_animal(SERPENT__CONV_NML(s));
}
{
- SOD_DECL(Chimaera, c);
+ SOD_DECL(Chimaera, c
, NO_KWARGS
);
provoke_lion(CHIMAERA__CONV_LION(c));
provoke_goat(CHIMAERA__CONV_GOAT(c));
provoke_serpent(CHIMAERA__CONV_SERPENT(c));
provoke_lion(CHIMAERA__CONV_LION(c));
provoke_goat(CHIMAERA__CONV_GOAT(c));
provoke_serpent(CHIMAERA__CONV_SERPENT(c));