[Grace-core] Inheritance in Javascript version

Andrew P Black andrew.p.black at gmail.com
Mon Aug 12 13:00:20 PDT 2013


On 12 Aug 2013, at 11:18 , Kim Bruce wrote:

> My understanding was that unlabeled variables were considered confidential.  If not, then how do we label them to be confidential readable or confidential writeable (or both)?

According to the spec, un-annotated fields (both defs and vars) are private (see Spec §8.8.2).  In the C compiler, the meaning of an un-labelled variable can be changed with pragmas.  The default seems to be "local", but I don't know what that means.  That's why I put the pragma

#pragma DefaultDefVisibility=private
#pragma DefaultVarVisibility=private
#pragma DefaultMethodVisibility=public

in my tests.

The spec also says that the annotation for making a variable more accessible are 

	is readable			// confidential reader method
	is publiclyreadable	// public reader method

	is writable			// confidential writer method
	is publiclywritable	// public writer method


	is readable, writable				// confidential reader and writer methods
	is publiclyreadable, publiclywritable	// public reader and writer methods

The last two are a bit verbose; we might want to offer as alternatives (not currently in the Spec, but maybe we should add)

	is confidential		// confidential reader and writer methods
	is public			// public reader and writer methods

These annotations are not all implemented, and some of them are implemented with different semantics.  (For example, is readable currently means is publiclyReadable in the JS implementation; publiclyreadable, and publiclywritable are not recognized)    If we can agree on them, then perhaps Michael will implement; I can understand his reluctance to change the code when we can't make up out minds!

	Andrew





More information about the Grace-core mailing list