[Grace-core] Lazy initialisation and circular definitions

Kim Bruce kim at cs.pomona.edu
Thu Nov 20 08:28:32 PST 2014


Ok, are we talking about MyType or family polymorphism or something more mundane. I write mutually recursive the defs all the time, but don't have problems except unless I'm heading for MyType kind of issues (& I don't think we need to worry about those at this point. 

Can someone give a concrete example of the problem to be solved & why it is important for Grace? Does this have something to do with making types first class?

My final project in the grace course has a circular initialization problem (values not types), so I told them how to code around it. I don't want to teach them about lazy initialization unless it is absolutely necessary -- and it hasn't been for the 30+ years I've been teaching. 

Sent from my iPad

> On Nov 20, 2014, at 3:46 AM, James Noble <kjx at ecs.vuw.ac.nz> wrote:
> 
> 
>> On 20/11/2014, at 19:44 pm, Kim Bruce <kim at cs.pomona.edu> wrote:
>> 
>> Why do we want this?
> 
> short answer - mutually recursive type definitions need something.
> Do we do something special purpose or more general
> 
> more generally - mutually recursive definitions need something...
> 
>> Any time we are competing with Scala for complexity I get very worried.  Simplicity is our calling card.  Let's keep it that way.  Simple syntax, simple semantics.  Yes, there are things we can't do easily (and generally they aren't necessary for novices).
> 
> which is why I like the "lazy {}" option (just like Scheme's delay)
> not in the core language, there if you need it.
> 
> J



More information about the Grace-core mailing list