Arc Forumnew | comments | leaders | submitlogin
3 points by nex3 6171 days ago | link | parent

What I would really like to see is user-programmable in-symbol operators. Then you could trivially implement the pipe:

  (def-inop | (f1 f2) f2:f1)
You could probably even implement a simple module system without any core code using that.


1 point by etal 6171 days ago | link

Sounds good to me. But we'd have to keep a complete list of which characters can be used that way, or else the parser wouldn't know where to slice the tokens, right? Or can you think of a general way to do it?

This topic really makes me wish I knew a function-level programming language like K. It's all about composing a certain set of basic functions, and it's amazingly concise, so I feel like someone with that background would be able to suggest a Right Way of handling functions at this level.

-----

1 point by cpfr 6171 days ago | link

You could just set aside a handful of symbols. Every possible combination of them is a possible infix operator.

-----

1 point by ryantmulligan 6170 days ago | link

Is the way to implement def-inop a reader macro?

-----