Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,29 @@
|
|||
declare
|
||||
%% Creates a new class derived from BaseClass
|
||||
%% with an added feature (==public immutable attribute)
|
||||
fun {AddFeature BaseClass FeatureName FeatureValue}
|
||||
class DerivedClass from BaseClass
|
||||
feat
|
||||
%% "FeatureName" is escaped, otherwise a new variable
|
||||
%% refering to a private feature would be created
|
||||
!FeatureName:FeatureValue
|
||||
end
|
||||
in
|
||||
DerivedClass
|
||||
end
|
||||
|
||||
class Base
|
||||
feat
|
||||
bar:1
|
||||
|
||||
meth init
|
||||
skip
|
||||
end
|
||||
end
|
||||
|
||||
Derived = {AddFeature Base foo 2}
|
||||
|
||||
Instance = {New Derived init}
|
||||
in
|
||||
{Show Instance.bar} %% inherited feature
|
||||
{Show Instance.foo} %% feature of "synthesized" class
|
||||
Loading…
Add table
Add a link
Reference in a new issue