Hacker News new | past | comments | ask | show | jobs | submit login

Smalltalk solves that by having everything be infix. With fewer parentheses.

¯\_(ツ)_/¯




Yeah that's another approach to it, one I think could definitely be borrowed (though I wouldn't do it exactly how smalltalk did). And then of course there's the "concatenative" family where everything is postfix.


How would you make it different?

One change that I made in ObjS is that I added the pipe so you don't need to parenthesize chained keyword messages.

   ((receiver msg1:arg1) chained1:arg2) chained2:arg3
vs.

   receiver msg1:arg1 | chained1:arg2 | chained2:arg3

Having colon keywords does get in the way a little, as I also need them for schemes (URIs are part of the language) and I would also like them for type-specifiers, as type-after really seems the better way.

I can probably pull all that off syntactically, not sure about aesthetically.


I've actually thought about this a lot!

1. no more keyword parameters

2. every message has exactly one argument, which may be a tuple.

3. "obj.msg" becomes short hand for "obj msg ()"

4. if a message expects 2 element tuple and you give it a one element one.. it returns a closure that expects the rest of the arguments. ie "add1 = 1.+"




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: