gracelang / language

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

should annotations be permitted in more places? #149

Open kjx opened 6 years ago

kjx commented 6 years ago

It may be useful to annotate more things - objects, types, parameters, arguments, requests. (Hat tip to Dave Ungar's Ly :-)

objects

object {
  is abstract
  method x is required {}
  method y is required {}
}

requests:

print (collection.at(12) is readonly)
actor.message(1,2) is oneway

parameters:

class foo(size is manifest) {
}

I think there may be an issue here between definition and use - does an annotation make something have some property method fast is optimised { .. } (like "assume") or test that something has the property (like "assert"). Or does this depend on where the annotations go?