In the late 1970s early 1980s I recollect the with clause in Pascal
causing many students learning programming great difficulties.  A number
of languages (notably Python and Groovy) are about to introduce this
construct and I am a bit concerned that it is a bad idea from the
program comprehension perspective -- it also adds complexity to the
compiler but that is not really the point.  I am wondering if there has
been any work on the comprehension issues of with clauses or scoping and
attribute lookup in general that might actually inform the debate (for
Groovy anyway -- I am on the development team for this language).

Thanks.

(For those wondering what the with clause is:  The with clause is a way
of changing the expression of binding of attributes to records or
objects.  The sequence:

        s.foo = [ 1 , 2 , 3 ]
        s.bar ( 4 , s.foo )

where s is some record or object reference / pointer and foo and bar are
correctly typed attributes of the type of s can be written using a with
clause:

        with ( s ) {
          foo = [ 1 , 2 , 3 ]
          bar ( 4 , foo )
        }
) 

-- 
Russel.
====================================================
Dr Russel Winder                +44 20 7585 2200
41 Buckmaster Road              +44 7770 465 077
London SW11 1EN, UK             [EMAIL PROTECTED]

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to