Emacs Lisp shorthands as namespacing system
andreyorst.gitlab.io
andreyorst.gitlab.io
Using / has one major disadvantage. You can’t name macros w/stdin, w/stdout, w/file, etc.
It’s short for “with-“. It’s only a few characters, but it adds up.
Admittedly it’s more important in arc, where brevity is a feature, not a bug.
On the other hand, having a full separator for the namespace is worthwhile. One idea I toyed with is:
my-func@pkg
So the namespace is on the right, not the left.
But I decided this is even worse, even if it does match e.g. how we ssh into things.
Ultimately it’s hard to beat a global namespace with prefixing conventions.
https://joearms.github.io/published/2015-03-12-The_web_of_na...
https://news.ycombinator.com/item?id=2580383
(The OP is a very well written article btw, nice work!)
Now that I think about it, I really should set up a "snippet" to type this for me:
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd import anyNamespace from 'module.js'
import { subModule } from 'module.js'
import { subModule as anyName } from 'module.js'A) I type "import {} from 'module" first and then go back and add modules
or more often these days,
B) I let Copilot guess for me, which combined with my predictable file organization usually results in the right autocomplete.
Option A can be improved upon by writing a macro/template with slots in the correct order.
import qualified Foo.Bar as Baz (import (prefix (rename #;from (rnrs r5rs)
(delay #;as eval-later)
(force #;as eval-now))
r5rs:))
And from (rnrs r5rs) it will import delay as r5rs:eval-later and force as r5rs:eval-now.TLDR: Hugo + Rocinante theme (https://github.com/mavidser/hugo-rocinante)
They've got a post on their workflow here: https://andreyorst.gitlab.io/posts/2022-10-16-my-blogging-se...