Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -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