lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


on 5/19/05 6:45 AM, Roberto Ierusalimschy at roberto@inf.puc-rio.br wrote:

>> Am I unusual for being uncomfortable with the same token being used
>> for both prefix and infix syntax?
> 
> I don't think you feel uncomfortable using both -a and a-b, do you? :)

That got pointed out to me privately. I guess it hasn't phased me since they
have closely related meanings whereas multiplication and size extraction
seem entirely unrelated. I guess that means it isn't really the prefix v
infix thing after all that makes me look askance at this.

I did also think a bit about whether this would be better as a postfix
operator. Dennis Ritchie has referenced Sethi as pointing out that various
things in C's syntax might have been simpler if pointer dereferencing were a
postfix operator. This would be harder to handle with something that could
either be an unary postfix operator or an infix operator. Whether that's
relevant or not to this discussion is unclear since I have no experience
using the new operator, but using * brought it to mind.

Mark