summaryrefslogtreecommitdiff
path: root/doc/resource.txt
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2007-06-19 19:35:04 +0000
committeraarne <aarne@cs.chalmers.se>2007-06-19 19:35:04 +0000
commitbadae804541d427488f8a648efecaa5ee9b99b2f (patch)
tree43afa2bfd4d6e9587dc33bc2923a09764a8d2a10 /doc/resource.txt
parent780276850c013e388b3452f0d2b640c4cb761a14 (diff)
restricted functor example
Diffstat (limited to 'doc/resource.txt')
-rw-r--r--doc/resource.txt32
1 files changed, 14 insertions, 18 deletions
diff --git a/doc/resource.txt b/doc/resource.txt
index a0f4ac513..13f1f4798 100644
--- a/doc/resource.txt
+++ b/doc/resource.txt
@@ -256,8 +256,20 @@ MusicI are not satisfactory for some language. The resource grammar guarantees
that the linearizations are possible in all languages, in the sense of grammatical,
but they might of course be inadequate for stylistic reasons. Assume,
for the sake of argument, that adjectival modification does not sound good in
-English, but that a relative clause would be preferrable. One can then start as
-before,
+English, but that a relative clause would be preferrable. One can then use
+restricted inheritance of the functor:
+```
+ concrete MusicEng of Music =
+ MusicI - [PropKind]
+ with
+ (Syntax = SyntaxEng),
+ (MusicLex = MusicLexEng) **
+ open SyntaxEng in {
+ lin
+ PropKind k p = mkCN k (mkRS (mkRCl which_RP (mkVP p))) ;
+ }
+```
+The lexicon is as expected:
```
concrete MusicLexEng of MusicLex =
CatEng ** open ParadigmsEng in {
@@ -265,22 +277,6 @@ before,
song_N = mkN "song" ;
american_A = mkA "American" ;
}
-
- concrete MusicEng0 of Music = MusicI with
- (Syntax = SyntaxEng),
- (MusicLex = MusicLexEng) ;
-```
-The module ``MusicEng0`` would not be used on the top level, however, but
-another module would be built on top of it, with a restricted import from
-``MusicEng0``. ``MusicEng`` inherits everything from ``MusicEng0``
-except ``PropKind``, and
-gives its own definition of this function:
-```
- concrete MusicEng of Music = MusicEng0 - [PropKind] **
- open SyntaxEng in {
- lin
- PropKind k p = mkCN k (mkRS (mkRCl which_RP (mkVP p))) ;
- }
```