[Grace-core] Dialect encoding

Timothy Jones tim at zimothy.com
Sun Jul 29 21:44:32 PDT 2012


> newspeak's encoding (actually not an "encoding") is based on classes...
And the given encoding is a class by Grace's definition (an object with
a method that returns an object). The big difference is that in Grace a
module is the result of the method, not the class itself.

> would something like
>
> object {
>   def newObject = object {
>     inherits … 
>  }
> }
>
> work just as well? 
> the point is that a method establishes an additional dynamic scope.
Yes, good point.

> Sure. And that's good: we don't want to add "dialect" as a first-class construct
> unless we absolutely have to!
I guess the important thing to note here is that dialect would have to
at least be a built-in sugar to be avoid the direct nesting: this
encoding is the simplest I can think of. You can't define a method
called dialect that achieves the same thing, because the object you pass
it can't be nested inside the outer object dynamically (as far as I'm
aware). If you want the simplicity of just being able to right `dialect`
at the top of your program and have the following code affected, it has
to be special.

Tim



More information about the Grace-core mailing list