[Grace-core] Lancaster Workshop update #1 - Minor changes

Kim Bruce kim at cs.pomona.edu
Sat Jul 30 20:55:51 PDT 2011


On Jul 30, 2011, at 11:55 PM, James Noble <kjx at ecs.vuw.ac.nz> wrote:

> Hi all
> 
> here are the minor changes proposed out of today's Grace workshop in Lancaster.
> 
> 
> === Classes  ===
> * Class arguments are available as '''def'''s in methods in the class body

I assume this means just that the class parameters are within scope in method defs

> * '''unresolved issue:'''  multiple same-name defs in one object?
I assume this is the semantics as sequence of method defs (including super versions) rather than allowing multiple explicit defs with same name in an object expression. 
> 
> '''Rationale:'''
> In principle, all class declarations and object literals exist before the program starts to run. Non-reflective programs do not create new class declarations or object literals. Even if typing is structural, implementations may compute nominal subtype relations between all classes before the program starts to run.

It should be ok to have an object literal whose def depends on parameters of a surrounding method, but certainly the shape is known before program runs. 
> 
> === Misc. ===
>  * remove option for range on collections: all collection simply range over 1..size
>  * remove back-quoted identifiers ---  the  minigrace test case looks horrible, let's not do that
> 
> 
> 
> === Terminology ===
> 
> || '''term''' || '''definition''' ||
> || declaration || definition, variable definition, method, or class at  the outer level of a code block ||
> || literal || object, string, block, number, (potentially ''collection'') literals execute the current lexical scope, binding and substituting names etc.  Each time a ''literal'' is executed it conceptually  creates a new runtime ''object''.  If those objects  are ''values'' (string objects, number objects, collection objects?) then they of course the different runtime objects cannot be distinguished ||
> || object || the runtime objects in the program, created by evaluating a literal, or by requesting ''new'' from a factory object ||
> 
> So a ''class declaration'' creates a ''factory object''; an ''object literal'' creates an ''object''; a ''string literal'' creates a ''string object''; a ''number literal'' creates a ''number object'',and (crucially) a ''block literal'' creates a ''block object''.

I'm ok with this as long as we understand that a factory object is more complex than just an object with methods returning new objects. I'd be more comfortable calling this a "class" object (as it will almost certainly have to have other stuff necessary to support inheritance) and allow one to call any object with methods returning new objects (exclusively?) a factory object (though I'd probably be even happier not using the term factory object at all and just discussing factory methods (which could occur in any object). 
> 
> At this point, Grace does not have ''functions'', ''method literals'', or ''method objects''.
> _______________________________________________
> Grace-core mailing list
> Grace-core at cecs.pdx.edu
> https://mailhost.cecs.pdx.edu/mailman/listinfo/grace-core


More information about the Grace-core mailing list