Fork me on GitHub
#emacs
<
2023-03-20
>
borkdude14:03:19

Just opened the #scimacs channel (https://github.com/jackrusher/scimacs)

🆒 20
borkdude17:03:16

What was the elisp package again which implements a bunch of clojure-like macros and functions, like ->

vemv17:03:48

https://github.com/emacs-mirror/emacs/blob/42fba8f36b19536964d6deb6a34f3fd1c02b43dd/lisp/emacs-lisp/seq.el thread-first is bundled with Emacs, it's considered idiomatic to use it instead of ->

borkdude17:03:36

ah yes, dash.el

ericdallo18:03:28

dash.el rocks!

ag18:03:35

but seq.el is built-in

magnars22:03:13

emacs-devel didn't much like my cheeky dash prefix, so seq.el was created as an alternative.

😄 2
ericdallo22:03:01

Oh didn't know you were the maintainer of both, awesome!

borkdude22:03:45

so seq- is the prefix . I guess it's recommend to always choose a prefix? If I were to make an .el package with a fn macro, like this one: https://github.com/borkdude/clj.el/blob/main/clj.el it would be bad practice to expose it as fn but clj:fn is kinda crap as well. Anything you can do about that?

borkdude22:03:23

I tried something like this:

(defmacro clj (&rest body)
  `(let* ((map #'clj:map)
          (fn #'clj:fn))
     ,@body))
;; (clj (fn [x] x))
but it doesn't work for macros

borkdude22:03:00

FWIW I don't care about the opinion of emacs-devel, this is mostly just for my own usage (and I'm not even sure if I'm really going to use it)

👍 2
ericdallo22:03:19

Even if you find a hacky way to expose fn as fn , people from melpa and reviewers may complain about that

ericdallo22:03:53

yeah, I find those requirements a little bit too much most of the time

borkdude22:03:43

how does one indicate a "private" function in a name by convention?

ericdallo22:03:40

my-package--my-priv-function

👍 2
borkdude22:03:12

I made an attempt here to use prefixes together with a macro that lets you use the unprefixed versions: https://github.com/borkdude/clj.el/blob/31fd337cafa47abdcd7e66ea98f0e85029086489/clj.el#L42 but the macro expansion doesn't evaluate correctly For some reason I get void function clj-let... what does elisp mean...

borkdude19:03:40

Do elisp macros have the concept of &env for detecting if locals are in scope?

hifumi12320:03:24

If you’re asking whether elisp has something like &environment for macros, I want to guess “no” but I wouldn’t be surprised if something in the cl package attempted to emulate it somehow