[Grace-core] Draft Minutes of Teleconference 9-10.2.2014

Kim Bruce kim at cs.pomona.edu
Thu Feb 12 11:20:03 PST 2015


My text books from the "olden" days when we talk Pascal don't seem to allow initializing variables in declarations, though some newer implementations apparently do with the "value" key word.

I would think it would be very confusing to students to write
   var x = 10 
   x := x + 1

I think of 
    var x := 10
as an abbreviation for 
    var x
    x:= 10


Kim



> On Feb 12, 2015, at 11:00 AM, James Noble <kjx at ecs.vuw.ac.nz> wrote:
> 
>> A brief comment:
> 
> :-)
> 
>> I agree that it is confusing at first remembering the difference between = and := given our conditioning with C/C++/Java.
> 
> actually I keep it straight most of the time - probably 'cos I started with BASIC then Pascal
> 
>> I find it useful to have an asymmetric symbol used for assignment as novices often have trouble remembering the direction of assignments. (They still get confused with :=, but a bit less in my experience).  
> 
> ChucK goes consistently right-to-left and so writes 7 => x 
> 
>> I also think it is useful to distinguish between definitions and assignments as they are quite distinct operations.  I had earlier suggested using "is" for constant definitions, but there seemed to be no enthusiasm for that.
> 
> so do I.
> 
> I'm concerned about the syntactic inconsistency between "def" and "var" declarations only;
> this is what trips me up. 
> 
> all I was wondering about was changing
> 
> var x := 7  
> 
> to 
> 
> var x = 7
> 
> in other words
> = used only in declarations - and in all in declarations & initialisations
> == used for comparison
> := used for assignment (only to change things, not to set up initial values) 
> 
> 
> this is pretty much where Pascal ended up 
> 
>> I had earlier suggested using "is" for constant definitions, but there seemed to be no enthusiasm for that.
> 
> not given how we're using "is" for annotations. 
> Standard Pascal uses "value" apparently - not that I remember it - 
> but most implementations either also support "=" or only "=" and not "value" 
> 
> J




More information about the Grace-core mailing list