3 ms·
The big thing I took away from LISP is that having everything be prefix solves a lot of problems. Seriously, the arguments people have in languages like Zig abo
by LAC-Tech 3y ago
The big thing I took away from LISP is that having everything be prefix solves a lot of problems. Seriously, the arguments people have in languages like Zig about whether to have "operator overloading" just seem a bit silly. Operators are just functions, it's very silly to make them syntastically different.
But I never got much into REPL driven development. Probably because I just couldn't wrap my head around emacs.
- mpweiher 3y agoSmalltalk solves that by having everything be infix. With fewer parentheses. ¯\_(ツ)_/¯
- LAC-Tech 3y agoYeah 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.
- mpweiher 3y agoHow 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.
- LAC-Tech 3y agoI'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.+"