[Grace-core] [Minigrace] In praise of consistency

Andrew P. Black black at cs.pdx.edu
Tue May 29 09:57:10 PDT 2012


On 18 May 2012, at 18:48 , Michael Homer wrote:

> They already have two entirely different meanings: one is precedence
> grouping and one is application, and that isn't avoidable unless
> application uses something else.

I believe that this is the discussion we are having.  I don't think that the parenthesis
should mean adding arguments to a method request.   You do.

> As soon as something has more than
> one argument you're going to have to parenthesise them. 

Yes, I agree with that.  I was trying to think of this as a single argument that's a tuple, but
right now we don't have tuples.  


> One of the major problems is that you don't know you're in a mixfix
> name until after the argument is parsed, but you will need to know it
> in order to parse the argument.

Is that really true?  If so, we need to fix our method request syntax.
> 
> Something like:
>  print x.y(z) a b
> could be:
>  print (x.y(z))a(b)

Yes, that's requesting print()a() using my "as far right as possible" rule

> or:
>  print (x.y(z)a(b))
> and it's not clear which it should be. I think your rules make it the
> latter,

I don't think so

> which I think means that:
>  print x.y a b
> is a syntax error "missing argument to part b of y()b()".

I think that it should also be a request of print()a()

However, this example does help to convince me that we need an explicit way of saying "here comes and argument". 
Kim has suggested colon, and I have suggested square brackets.  Neither is as elegant as juxtaposition,
but both are easier to explain to students, which is perhaps more important.

	Andrew





More information about the Grace-core mailing list