Aliases equal to º and partial, like ¬ in clojure

I skipped the short syntax to express the basic operations of functions in Clojure. Because of this, I started using ºas a shorthand expression for comp(so that it approximates the mathematical operator, but is easily accessible) and ¬for partial(because it reminds me of missing parameters).

What do you think about this? is this useful or does it have a risk of confusing the code?

+5
source share
3 answers

I prefer not to use non-ASCII characters in the code (outside of string / character literals and comments). How about making your editor outperform the code for you when it is displayed, but not when you save it? For instance. the following function will cause Emacs to display compas (the actual character of the composition of the function):

(defun pretty-comp ()
  (font-lock-add-keywords
   nil `(("\\<\\(comp\\)\\>"
          (0 (progn (compose-region (match-beginning 1)
                                    (match-end 1)
                                    ?∘)
                    nil))))))

Apparently, it is not perfect - it seems that it distorts the display compfoo, etc., but you can configure it to work.

+3
source

Generally, I would be very unable to invent new names for already established concepts.

+4
source

This is confusing for people who do not know the designations. I think this is probably also quite difficult to print. I would just stick with standard names.

+3
source

All Articles