gracelang / language

Design of the Grace language and its libraries
GNU General Public License v2.0
6 stars 1 forks source link

exclude vs override #137

Open kjx opened 6 years ago

kjx commented 6 years ago

It seems we have two way of saying (almost) the same thing.

Given:

class sup {
    method foo { print "superfoo" } 
}

then

class sub {
     inherit sup 
     method foo is override { print "subfoo" }
}

and

class sub {
     inherit sup exclude foo 
     method foo { print "subfoo" }
}

do almost the same thing. Do we need both? Differences are

kjx commented 6 years ago

see also #77

kjx commented 6 years ago

also #44

kjx commented 6 years ago

see also #67

kjx commented 6 years ago

Another fun twist: can you override (with is overrides) a method that's been excluded? it seems like you should be able to, although that doesn't quite make sense.