From: Emanuel Berg <incal@dataswamp.org>
To: emacs-devel@gnu.org
Subject: how to speed up Lisp devel time
Date: Fri, 09 Aug 2024 09:16:52 +0200 [thread overview]
Message-ID: <87y156413v.fsf@dataswamp.org> (raw)
One thing one could try is to replace boring, trivial stuff
with non-Lisp syntax and have that embedded.
For example setting up the interface.
Note: Over one in five interfaces in the Emacs source uses
Lisp and not the `interactive' format string. So it isn't just
me. It takes _a lot_ of time setting up the interface,
assigning default values, verifying indata, setting up
collections for completion, and so on.
Here is one example from my own code:
;; ...
(interactive (if (numberp current-prefix-arg)
(list current-prefix-arg)
current-prefix-arg))
(unless end
(setq end 73))
(unless step
(setq step (min 10 (max 2 (/ end 10)))))
(unless i
(setq i 0))
(unless (and (numberp i) (<= 0 i)
(numberp end) (< 0 end)
(numberp step) (< 0 step))
(error "Bogus indata"))
This is 402 chars!
But here is a 135-char solution that expresses the same:
[
end :range 0< :default 73 :prefix-arg
step :range-cut 2-10 :default (/ end 10)
i :range 0<= :default 0
]
And here is a 88 char solution:
[
end :r 0< :d 73 :pa
step :rc 2-10 :d (/ end 10)
i :r 0<= :d 0
]
Also with: :prompt-string (:ps), :doc-string (:ds) ...
That way, we could keep Lisps elegance and power for where
people cared about it, for example solving interesting
algorithmic problems.
--
underground experts united
https://dataswamp.org/~incal
next reply other threads:[~2024-08-09 7:16 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-09 7:16 Emanuel Berg [this message]
2024-08-09 7:24 ` how to speed up Lisp devel time Eli Zaretskii
2024-08-09 7:39 ` Emanuel Berg
2024-08-09 10:43 ` Eli Zaretskii
2024-08-09 11:18 ` Emanuel Berg
2024-08-09 12:02 ` Eli Zaretskii
2024-08-09 13:54 ` Emanuel Berg
2024-08-09 14:58 ` Eli Zaretskii
2024-08-09 16:03 ` Emanuel Berg
2024-08-09 16:16 ` Emanuel Berg
2024-08-09 17:54 ` Eli Zaretskii
2024-08-09 18:56 ` Christopher Dimech
2024-08-09 21:57 ` Emanuel Berg
2024-08-09 21:47 ` Emanuel Berg
2024-08-09 17:27 ` Yuri Khan
2024-08-09 21:21 ` Emanuel Berg
2024-08-10 2:14 ` Emanuel Berg
2024-08-10 6:01 ` Yuri Khan
2024-08-10 6:08 ` Emanuel Berg
2024-08-10 6:44 ` Yuri Khan
2024-08-10 7:22 ` Emanuel Berg
2024-08-10 7:51 ` Emanuel Berg
2024-08-10 4:32 ` Emanuel Berg
2024-08-10 5:58 ` Eli Zaretskii
2024-08-09 14:59 ` Eduardo Ochs
2024-08-09 16:19 ` Emanuel Berg
2024-08-09 18:00 ` Eli Zaretskii
2024-08-09 18:54 ` Christopher Dimech
2024-08-09 22:17 ` Emanuel Berg
2024-08-09 22:00 ` Emanuel Berg
2024-08-09 8:24 ` Emanuel Berg
2024-08-09 10:36 ` Christopher Dimech
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y156413v.fsf@dataswamp.org \
--to=incal@dataswamp.org \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).