This post originated from an RSS feed registered with Agile Buzz
by James Robertson.
Original Post: What If?
Feed Title: Travis Griggs - Blog
Feed URL: http://www.cincomsmalltalk.com/rssBlog/travis-rss.xml
Feed Description: This TAG Line is Extra
I had this zany idea as I was cutting tile this weekend. I was thinking very reductionist. I was thinking about MOP for Smalltalk. We love to brag that our simple language has just three levels of precedence, dictated by the three kinds of messages: unary, binary, and keyword.
The binary type is just syntactic sugar. Very nice sugar indeed. But we could replace all of our + messages with plus: and such, and we'd still have a fully functional system. Terseness would suffer. What if we go the other way though? What if we generalize keyword tokens to be any alphanumeric token which terminates in one of more infix characters? Normal keyword tokens of the form fold:andGroup: would be fine. But so would a method for Point that looked something like: x=y=. I think you'd have to have rule that tokens of exclusive infix characters could only have one argument, otherwise you'd have to use lots of parens to distinguish between a series of simple messages like + and -, instead of one where they were actually a two arg signature.
Thinking about this, and that MOP thing again, caused me then to wonder why in that case one couldn't just turn the assignment operator into a message. It's just infix characters. And then you could create new assignment methods, like say: +=. To do that you'd have to reify the variable storage more than we do today. That part becomes fuzzy to me, but didn't Self do something like that?