[lisaac-Bugs][312425] Dynamic inheritance: parent can't call slots
lisaac-bugs at alioth.debian.org
lisaac-bugs at alioth.debian.org
Sun Aug 15 09:43:23 UTC 2010
Bugs item #312425, was changed at 2010-04-01 03:30 by Mildred Ki'Lya
You can respond by visiting:
https://alioth.debian.org/tracker/?func=detail&atid=413092&aid=312425&group_id=100200
Status: Open
Priority: 3
Submitted By: Mildred Ki'Lya (mildred-guest)
Assigned to: Nobody (None)
Summary: Dynamic inheritance: parent can't call slots
Target Milestone: None
Category: Compiler: Core
Tags: Compiler Core
Initial Comment:
Not to repeat myself:
// Lisaac BUG: with dynamic inheritance. Say we have a prototype SELF
// inheriting from ROOT. Now, we dynamically change the parent to use P that
// is a child of ROOT.
//
// When code in P tries to call a slot specific to P (the slot is not defined
// in ROOT). Instead of looking at the slot in P, it tries to look at the slot
// in SELF, then in ROOT.
//
// If the slot is found in SELF, then it is called. That is wrong, it should
// call the slot in P instead. The fact is that SELF never redefined the slot
// that P tries to call, and it might well do something completely different
// than the slot in P does.
//
// And if the slot is not found at all, the compiler throws an error.
The testcase is in features/dynamic-inheritance.feature
When I run the testcase, I get:
Feature: Dynamic Inheritance
Background: # features/dynamic-inheritance.feature:3
Given lisaac/bin is in the PATH # features/step_definitions/steps.rb:3
And make.lip is installed # features/step_definitions/steps.rb:8
Scenario: # features/dynamic-inheritance.feature:7
Given I am in an empty directory # ures/step_definitions/steps.rb:14
And a file "hello.li": # ures/step_definitions/steps.rb:34
"""
Section Header
+ name := HELLO;
Section Inherit
+ parent_root :ROOT := ROOT;
Section Public
- main <-
(
hello;
parent_root := TOTO;
hello;
);
"""
And a file "root.li": # ures/step_definitions/steps.rb:34
"""
Section Header
+ name := ROOT;
Section Public
- hello <-
(
"Hello ROOT".println;
);
"""
And a file "toto.li": # ures/step_definitions/steps.rb:34
"""
Section Header
+ name := TOTO;
Section Inherit
+ parent_root :Expanded ROOT;
Section Public
- toto <-
(
"Hello back from TOTO".println;
);
- hello <-
(
"Hello TOTO".println;
toto;
);
"""
When I run lisaac hello # ures/step_definitions/steps.rb:67
Then it should pass # ures/step_definitions/steps.rb:79
Failed with exit status 256
Output:
Depending pass: ..--SEMANTIC---------
Slot `toto' not found in `HELLO'.
Line 19 column 8 in TOTO(.../tmp/toto.li):
toto;
^
Load lip file: ./../make.lip
(RuntimeError)
/home/mildred/Projects/Lisaac/compiler-stable/features/step_definitions/steps.rb:84:in `/^it should (fail|pass)$/'
features/dynamic-inheritance.feature:66:in `Then it should pass'
When I run ./hello # ures/step_definitions/steps.rb:67
Then it should pass with # ures/step_definitions/steps.rb:89
"""
Hello ROOT
Hello TOTO
Hello back from TOTO
"""
Failing Scenarios:
cucumber features/dynamic-inheritance.feature:7 # Scenario:
1 scenario (1 failed)
10 steps (1 failed, 2 skipped, 7 passed)
0m0.098s
----------------------------------------------------------------------
>Comment By: Mildred Ki'Lya (mildred-guest)
Date: 2010-08-15 11:43
Message:
Basically, if the parent is dynamic and is a subtype of the static type of the parent, it can't call private slots.
The big question if what is the value of SELF in the inherited parent?
How is defined SELF?
----------------------------------------------------------------------
You can respond by visiting:
https://alioth.debian.org/tracker/?func=detail&atid=413092&aid=312425&group_id=100200
More information about the Lisaac-devel
mailing list