adderall and funny characters

Take a simple minikanren program like:

(run* [q]
  (fresh (x y)
    (appendᵒ x y ["a" "b" "c" "d"])
    (≡ (, x y) q)))

There are some special characters there, that are normally somewhat hard to type. Of course, it is possible to use easy to type function names and the program would look like:

(run* [q]
  (fresh (x y)
    (appendo x y ["a" "b" "c" "d"])
    (unifyo (, x y) q)))

But if you’re like me and would like to use the forms in shown in the upper program, you have to figure out something else.

Since I’m using emacs when working with lisp, I have abbrev-mode in my disposal. I can type the code as shown in the second listing and emacs automatically transforms it to the one shown in the upper one.

For time being, I have following definition in my abbrev_defs file (same for inferior-lisp-mode-abbrev-table too):

(define-abbrev-table 'hy-mode-abbrev-table
  '(
    ("alwayso" "alwaysᵒ" nil 1)
    ("anyo" "anyᵒ" nil 1)
    ("appendo" "appendᵒ" nil 1)
    ("conde" "condᵉ" nil 3)
    ("condi" "condⁱ" nil 2)
    ("conso" "consᵒ" nil 1)
    ("emptyo" "emptyᵒ" nil 1)
    ("eqo" "eqᵒ" nil 1)
    ("flatteno" "flattenᵒ" nil 1)
    ("flattenrevo" "flattenrevᵒ" nil 1)
    ("listo" "listᵒ" nil 1)
    ("listofo" "listofᵒ" nil 1)
    ("lolo" "lolᵒ" nil 1)
    ("loto" "lotᵒ" nil 1)
    ("membero" "memberᵒ" nil 1)
    ("memberrevo" "memberrevᵒ" nil 1)
    ("memo" "memᵒ" nil 1)
    ("nevero" "neverᵒ" nil 1)
    ("pairo" "pairᵒ" nil 1)
    ("pmembero" "pmemberᵒ" nil 1)
    ("remembero" "rememberᵒ" nil 1)
    ("resto" "restᵒ" nil 1)
    ("salo" "salᵒ" nil 2)
    ("twinso" "twinsᵒ" nil 2)
    ("unifyo" "≡" nil 2)
    ("unwrapo" "unwrapᵒ" nil 1)
   ))

This is really something cosmetic and has no effect into functionality at all.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s