Arc Forumnew | comments | leaders | submitlogin
4 points by shader 5656 days ago | link | parent

Makes sense.

Are there any plans to add the +=, -=, etc. operators? Or maybe making symbols that end in = syntactic sugar for [= _ (fn _)]? That would be a simple and powerful way to implement equivalent functionality.

Which naturally leads to questions about symbol macros, reader macros and then readers ;) But I won't ask those just yet.

Maybe we could just have separate ssyntax rules for when the character is at the beginning, middle or end the symbol, or by itself? That and multi-character ssyntaxes would probably go a long way towards symbol macros.



2 points by pg 5656 days ago | link

Are there any plans to add the +=, -=, etc. operators?

Is the existing ++ not sufficient?

-----

2 points by shader 5656 days ago | link

I guess I never noticed that the existing ++ operator could take a second argument, sorry.

However, the *= and /= operators are still very useful, and it would be very cool if a simple ssyntax could make it general to all single argument functions, or at least functions in which the first argument is the one being modified/extended. Good examples would be += as applies to alists and tables, and things like cut or sort.

Is there a reason that you can't append an atom to a list with '+ or '++?

-----