[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip / qa] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: (SICP-ARC).jpg (950 KB, 1920x1200)
950 KB
950 KB JPG
>Lisp is a family of programming languages with a long history and a distinctive parenthesized prefix notation. There are many dialects of Lisp, including Common Lisp, Scheme, Clojure and Elisp.

>Emacs is an extensible, customizable, self-documenting free/libre text editor and computing environment, with a Lisp interpreter at its core.

>Emacs Resources
https://gnu.org/s/emacs
https://github.com/emacs-tw/awesome-emacs
https://github.com/systemcrafters/crafted-emacs

>Learning Emacs
C-h t (Interactive Tutorial)
https://emacs.amodernist.com
https://systemcrafters.net/emacs-from-scratch
http://xahlee.info/emacs

>Emacs Distros
https://www.spacemacs.org
https://doomemacs.org

>Elisp
Docs: C-h f [function] C-h v [variable] C-h k [keybinding] C-h m [mode] M-x ielm [REPL]
https://gnu.org/s/emacs/manual/eintr.html
https://gnu.org/s/emacs/manual/elisp.html
https://github.com/p3r7/awesome-elisp

>Common Lisp
https://lispcookbook.github.io/cl-cookbook
https://cs.cmu.edu/~dst/LispBook
https://gigamonkeys.com/book
https://lem-project.github.io
https://stumpwm.github.io
https://nyxt-browser.com
https://awesome-cl.com

>Scheme
https://scheme.org
https://try.scheme.org
https://get.scheme.org
https://books.scheme.org
https://standards.scheme.org
https://go.scheme.org/awesome
https://research.scheme.org/lambda-papers

>Clojure
https://clojure.org
https://tryclojure.org
https://clojure-doc.org
https://www.clojure-toolbox.com
https://mooc.fi/courses/2014/clojure
https://clojure.org/community/resources

>Other
https://github.com/dundalek/awesome-lisp-languages

>Guix
https://guix.gnu.org
https://gitlab.com/nonguix/nonguix
https://systemcrafters.net/craft-your-system-with-guix
https://futurile.net/resources/guix
https://github.com/franzos/awesome-guix

>SICP/HtDP
https://web.mit.edu/6.001/6.037/sicp.pdf
https://htdp.org

>More Lisp Resources
https://paste.textboard.org/52b08691

(set! prev-thread (quote >>102998909))
>>
File: SICP.png (25 KB, 814x891)
25 KB
25 KB PNG
Have you read your SICP today?
>SICP: tracing the birth of a meme
https://archive.tinychan.net/read/prog/1383357224
>>
File: LaiNAVI.webm (1.17 MB, 848x480)
1.17 MB
1.17 MB WEBM
Layer:07

https://cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/lisp/code/fun/life.cl
>>
File: 1569016242284.gif (83 KB, 640x640)
83 KB
83 KB GIF
Scheme!
>>
File: SavesMeHours.png (21 KB, 1224x93)
21 KB
21 KB PNG
Why don't you have newline-and-indent bound to a keyboard shortcut?
>https://www.gnu.org/software/emacs/manual/html_node/elisp/Mode_002dSpecific-Indent.html#index-newline_002dand_002dindent
>>
Without the mouse, how do I scroll down a little (like, a line or two) while in an isearch?
>>
>>103106217
with evil this is just o and O
>>
File: isearch.png (215 KB, 1242x589)
215 KB
215 KB PNG
(setq isearch-allow-scroll 'unlimited)

Tell me why you don't do it.
>>
>>103100096
>What is the idiomatic way to name the parameters of a function that takes a struct as param?
>Is this ok or is shadowing the struct name detrimental?

I was curious about this too. Anyone?
>>
>>103106520
>Tell me why you don't do it.
Not that anon, but usually it's because we had no idea it was an option.
>>
>>103106676
(defmethod logout ((user user) other arguments)
(print user))

use Lisp's multiple dispatch feature
>>
>>103106676
I don't know if there's a lisp specific idiom for it, but the same problem arises in many languages and it's usually recommended to adopt a naming convention for the struct name, not the function parameters.
>(defstruct struct-user ...)

If you want it to be clear in the function that it must be a certain type I think you could just use "declaim", which is basically like writing a function prototype in C.
>(declaim (ftype (function (struct-user) <return type here>) logout))
>(defun logout (user) ...)
Or you can use a method like the other anon posted.
>>
>>103106520
Emacs bad default #2427
>>
>>103106990
That's like the third time you've given me specifically that reply. Are you keeping a list?
>>
Have you ever found a nice Emacs keybinding by accident?
>>
>>103107465
>That's like the third time you've given me specifically that reply
no, last time it was #2426
>>
>>103107465
>Are you keeping a list?
maybe someone should.
>>
>>103107469
does which-key count?
>>
>>103107469
Yes, many times, but I don't remember what they were or what they did. Usually it went like this:
>Whoa, this is really neat, I need to look into this
Then I never looked into it
>>
>>103107753
if you can find my posts on desuarchive you'll have a decent list already
>>
>>103107469
clojure-move-to-let
>>
File: 「ルーチェ」.jpg (1.16 MB, 1191x1683)
1.16 MB
1.16 MB JPG
M-x god-mode

https://www.gnu.org/fun/jokes/gospel.html
>>
>>103107757
Sure.
>>
>>103107469
I had bound C-' to a function that I wrote myself that toggled a short vterm at the bottom of the current emacs frame. However, while I was in org documents, it already had a binding that cycled through org-agenda-files. At first, I was annoyed, but then... I didn't realize there was a way to move through my org-agenda-files so quickly. I learned to like the original behavior of C-' and then I found out it was also bound to C-, . I think both of these bindings are just in org-mode-map so they're only active while you're in an org document.
>>
>>103106217
Because RET does that by default?
>>
>>103106520
Because I would rather it just drop the match. I can always go back by popping the mark.
>>
>>103107757
>which-key
Whomever came up with which-key gave Emacs such a huge boost. It made it so much easier to learn about Emacs.
>>
>>103110658
about a year ago I actually had a better idea than which-key (or rather, something that complements it), I should really make a video explaining it...
actually, I think I know enough elisp now to write a proof-of-concept implementation myself, maybe I'll just do that
>>
>>103110772
What's your idea?
>>
>>103110538
My vterm toggler.
(defun u/window-root (&optional w)
"Return the root window of the current frame."
(let* ((p (window-parent w)))
(if p
(u/window-root p)
w)))

(defun i/toggle-term (&optional height)
"Toggle a terminal"
(interactive)
(let* ((rootw (u/window-root))
(wl (window-list))
(vtw (seq-find (lambda (w) (equal "*vterm*" (buffer-name (window-buffer w)))) wl)) ; vtw => vterm window
(total-height (window-total-height rootw))
(desired-height (or height 14))
(split-height (- total-height desired-height)))
(if vtw
(progn
(quit-restore-window vtw "bury")
(delete-window vtw))
(let* ((nw (split-window rootw split-height nil nil)))
(select-window nw)
(vterm)
))))
>>
Racket is a good lisp...I love racket!!
>>
>>103110941
i was using popper mode for this exact thing but i just might replace it with this. cheers
>>
File: emacskeys.jpg (70 KB, 1080x340)
70 KB
70 KB JPG
>>103110781
the basic idea is that emacs should always display a few important keybindings in the mode-line, tab-bar, menu-bar or wherever else there's unused space.

Which ones it displays should change depending on the active modes, previously performed actions, and most importantly based on an estimation whether you've already memorized the keybindings. So if you use evil for the first time, it would display h j k l at first, but once you've pressed each of these keys 10 times or so it should display something else. If you haven't used evil in a while, it'll display the basic keybindings again once you start it.

If you've used an SRS like Anki or SuperMemo before, you can probably see where this is going.
Using a command from the menu toolbar or via M-x counts as a lapse, and the command goes to the top of the queue again. Of course you should be able to manually bury or blacklist commands that you just don't want to see.
>>
File: emacskey.jpg (55 KB, 1080x340)
55 KB
55 KB JPG
>>103111155
better example, since I want the displayed keybindings to make the most sense given the context.
Ultimately it'll probably be controlled by an LLM that tries to predict your next move based on the buffer contents, historical command patterns and so on.
>>
>>103111031
Glad you liked it.
>>
>>103110941
With small modifications, this can work for eat too. I think the only differences were looking for the "*eat*" buffer instead of the "*vterm*" buffer and running (eat) instead of (vterm) at the bottom.
>>
>>103060485
>>
>>103107795
https://desuarchive.org/g/search/text/%22Emacs%20bad%20default%22/
Am I doing it wrong or is there search busted? The search only yields 2 results.
>>
>>103111278
had the time to properly look at it... i'm still a novice in elisp so i might just be misunderstanding, but it seems like vtw has an optional window argument that is never actually used? because you never call vtw with that argument, and you can't pass it to i/toggle-term. i'm just wondering what the purpose of it is.
>>
>>103112114
You're confusing me. vtw is just a variable that holds the vterm window (if it exists) or nil otherwise.

Are you talking about u/window-root? That's the only function where I have an optional window parameter w. That's just a helper function for finding the root window. Notice that it's also a recursive function. To see it work, `M-x ielm` and split the window a few times. Then run (u/window-root) and it'll give you back a window. If you call (u/window-root) when there's only one window in the frame, it returns nil (which is fine).

The function that does the work of toggling a terminal is i/toggle-term. It takes an optional height parameter in case you don't like the default 14.
>>
>>103112318
i'm talking about the lambda function that gets passed as an argument to seq-find.
>>
>>103112470
This part?
ELISP> (setq wl (window-list))
(#<window 4987 on *ielm*> #<window 5010 on *vterm*> #<window 5011 on fu.el>)

ELISP> (seq-find (lambda (w) (equal "*vterm*" (buffer-name (window-buffer w)))) wl)
#<window 5010 on *vterm*>
ELISP>


It's just going through the list of windows in the current frame and looking for one named "*vterm*".

Oh, ...you thought vtw was a function call. It's not. It's part of the let* declaration that creates local variables. Put your cursor on the let* and hit `C-h f`.
https://emacsdocs.org/docs/elisp/Local-Variables#special-form-let-bindings-forms-1
>>
File: let.png (59 KB, 997x457)
59 KB
59 KB PNG
>>103112114
vtw and everything else in that red rectangle is a local variable that's valid until the end of the let*. That's my guess on what's actually confusing you.
>>
>>103112565
>>103112650
*** Welcome to IELM ***  Type (describe-mode) or press C-h m for help.
ELISP> (setq wl (window-list))
(#<window 3 on *ielm*> #<window 33 on *Help*>)

ELISP> (seq-find (lambda () (equal "*vterm*" (buffer-name (window-buffer)))) wl)
*** Eval error *** Wrong number of arguments: ((t) nil (equal "*vterm*" (buffer-name (window-buffer)))), 1
ELISP>

when i take the 'w' argument out this part fails. why? does the lambda function here HAVE to receive an argument? is it taking it directly from the window list? if not, where does it come from and how does it know it's getting a window as an argument?

i hate this stupid timer
>>
>>103112745
That w is necessary. The seq-find function wants a function that takes one argument, so I gave it a lambda that takes w. That w is later used by the window-buffer function to give me a buffer. Then the buffer-name function uses that buffer to pull out a string.
Try this in the REPL.
ELISP> (setq w (selected-window))
#<window 4987 on *ielm*>
ELISP> (setq b (window-buffer))
#<buffer *ielm*>
ELISP> (setq name (buffer-name b))
"*ielm*"
ELISP>

- It starts with a window in w.
- Then it gets a buffer b using the window-buffer function.
- Then I get the name of the buffer using the buffer-name function.

I hope this is starting to make sense for you.
>>
>>103112745
seq-find takes wl and gives each item in wl to the lambda until one of the lamdas returns true or we run out of items in wl.

C-h f seq-find
>>
>>103112870
>>103112894
alright, thanks
>>
File: covfefe.jpg (202 KB, 1024x1024)
202 KB
202 KB JPG
Greato (´• ω •`)b
https://clojure.org/news/2024/11/07/deref
>>
File: 1711127451922426.png (73 KB, 394x391)
73 KB
73 KB PNG
>>103115918
>>
File: wumbo.jpg (26 KB, 498x347)
26 KB
26 KB JPG
>>103112870
w for wambda
>>
>>103115918
>https://github.com/liquidz/elin
intredasting
>>
>>103112870
>
(setq b (window-buffer))

I meant to write
(setq b (window-buffer w))

It "worked" without the w, but I wanted to show the w being passed in.
>>
>>103107469
>>103107757
>>103111155
>>103111195
Your problems would be solved by simply using 'C-h b' or 'M-x describe-bindings'.
>>
>>103105320
I think it'd also be interesting to include in the general's template that you can read SICP as a texinfo file within emacs.

https://sarabander.github.io/sicp

If you're on GNU Guix, you can install its package.

guix install sicp
>>
File: (eval-apply).jpg (478 KB, 1280x720)
478 KB
478 KB JPG
>>103117546
guix shell sicp info-reader -- info sicp
>>
is there a better way to construct this loop? I am iterating over a number of subvectors within the overarching vector. the length of the subvector is multipliers-length, but the final subvector might not be that length.
>>
Is it possible to search for youtube videos and stream audio only from Emacs?
I want to manage my background drones from my editor during my ~10hours programming sessions
>>
File: 1730967193344628.png (178 KB, 512x361)
178 KB
178 KB PNG
>>103120132
I didn't read it closely but that could just be
(loop for data-index
from 0 to data-length
by mult-length do
(loop for mult-index
from 0 to mult-length
when (< mult-index data-length) do
#|vector bashing|#))

basically you don't need the iterator variables
>>
File: yeetube-mode.png (79 KB, 556x502)
79 KB
79 KB PNG
>>103121704
A little searching on melpa yielded this.
https://melpa.org/#/yeetube
https://git.thanosapollo.org/yeetube/

It's not evil-aware, so you'll want to toggle emacs state with C-z if you're an evil user. The default bindings are in pic-related.
>>
File: dondon.jpg (105 KB, 800x800)
105 KB
105 KB JPG
>>103121704
Something like
(defun yt-audio-search (term)
(make-process
:name "chill-lofi"
:command (list "mpv" "--no-video" (format "ytdl://ytsearch:'%s' term))))
>>
>Here's your guile scheme course content bro
magnet:?xt=urn:btih:b06de68bae450633f8afa559ea945c84557b0507&dn=hands-on-guile-scheme-for-beginners.tar.gz&tr=http%3A%2F%2Ftracker2.postman.i2p%2Fannounce.php
>>
>>103105320
>>
ELISP> (length org-agenda-files)
3 (#o3, #x3, ?\C-c)

How long is yours?
>>
>>103123825
>>
File: aoc2023day12GoldFaster.jpg (358 KB, 1017x1148)
358 KB
358 KB JPG
>>103106248
now ten times faster.
Next steps I can think of to improve the speed would be better pruning and using more efficient data structures.

But I don't feel like doing that right now.
>>
>>103115918
>https://github.com/BrunoBonacci/safely
nice, I knew that somebody else must've had the same idea already
https://desuarchive.org/g/thread/98182916/#98208016
>>
>>103124014
Why so many?
>>
>>103126338
I split one org file per task category so I have one file for:
name-days and birthdays,
School schedule
Important things I have to do
Optional things I have to do
Things I have to do to school
Exam & test dates
my part-time work schedule and my parents work shift schedule
It's just 7 now because I removed the last 3 which I wasn't using anymore.

Maybe it could be done better with tagging or something, but I never read the org manual desu. maybe I should
>>
>>103111998
https://desuarchive.org/g/search/text/%22Emacs%20default%22/
>>
>>103126547
org-agenda is so open-ended. There isn't necessarily a right or wrong way to use org-agenda. If it's helping you keep your tasks in order, it's working.
https://emacsdocs.org/docs/org/Agenda-Views
(info "(org) Agenda Views")
>>
>>103122067
LOOP is so damn confusing
>>
>>103128511
loop kinda breaks the otherwise beautiful lisp syntax if you let it. But it's honestly my favorite way of doing it and I love how rust does it
>>
I've been playing around with doom emacs since I wanted to use lisp instead of lua for my config, but as I was translating my neovim config I noticed that doom emacs is much slower than neovim. Is elisp really that slow? I do use fzf-lua in neovim so I'm used to pretty short load times on large codebases, I don't know how much that affects my perception.
>>
>>103129512
if you want to continue with Neovim, then you can use Fennel for your config, which is a Lisp that transpiles to Lua
I have a friend that does this and I call him autistic for it
>>
>>103129512
you'll have to be more specific than that
but yes, in my experience even my autistically optimized emacs config is slower visually, in latency, and just in general than a hyperbloated nvim config
>>
>>103129707
It's mostly slow in completions in some of my larger projects. On a slightly related note, I was wondering if lem is better since it runs on common lisp or is it just a meme?

>>103129651
I will turn myself into an autist if I have to.
>>
>>103129796
>It's mostly slow in completions in some of my larger projects.
usually when people complain about slowness for completions it's because they have extremely conservative defaults for delays
iirc company's default is almost a full second of delay before it pops up. corfu is similar

>I was wondering if lem is better since it runs on common lisp or is it just a meme?
i haven't tried it, but i can definitely imagine it running a bit better. it's still early days though, it's likely missing a bunch of functionality you want
>>
TIL that if you have a single line `loop do` it indents better than having the dangling :do
```lisp
(loop :for mesh :across meshes :do
(update mesh))
```
:collect doesn't
>>
>>103129867
>being this new
I also wish we had markdown support
>>
>>103129846
My completions are pretty fast, but I was trying to configure it so that I can have an external command give me the collection for the completion. I've found no straight forward way of doing this in an asynchronous setting without it crumbling once the projects get too big.
>>
Do I need some sort of package to make dried a good alternative to my file system? I know where my files live, so all that I actually want is good autocomplete for directories.
>>
How do I make a new section in Markdown mode? All of the shortcuts I've found assume a different style than how I write titles. I use
># Section
>## Subsection
>### Subsubsection
>>
>>103131201
As far as i know, there is nothing built in for that style.
>>
>>103130024
tagfile sir
>>
>>103131201
>>103131260
Fixed it myself.

(setq markdown-asymmetric-header t)


You can find this in the code for markdown-insert-header. I'm not sure where it is documented.

Now the usual header commands will work. It's known as an "atx header", so the command names all have "atx" in them. The one that you typically want is triggered by C-c C-s h

I would like to cum now.
>>
>>103131179
You mean like the completions you get with C-x d or C-x C-f?
>>
>>103131640
Yeah, like that.
>>
>>103131915
>>103131937
literally who
who give a shit about some random troon seething
>>
>>103132038
It's the troon version of fukamachi, but instead of writing confusing and undocumented shit straight up stolen from ruby, he writes confusing and well documented (with bespoke tooling) CLOSmaxxing shit.
>>
>>103132038
Careful, all of CL's webstuff are on the shoulder of one autistic trans woman in the country of the mountain jews.
>>
banning twitter screencap posting would improve the quality of this site tenfold
yes twitter clones also count
>>
File: mugshot.jpg (124 KB, 960x1080)
124 KB
124 KB JPG
>>103132134
The absolute state of CLarpers.
Thanks GOD. I'm a CLOJUREGOD.
>>
>>103132134
she*
>>
>>103132362
41%
>>
Fuck me. I've just discovered customize-mode. This will save me hours of Googling.
>>
>>103132740
Can you reach this from the GUI? I thought it was in the menu-mode menu somewhere, but I can't find it. Does Emacs really have mode customization hidden behind knowing a command?
>>
Have I lost my mind? Not only is customize-mode not in Emacs's GUI, I can't see it in the GNU Emacs Manual either. How are people supposed to discover this awesome feature?
https://www.gnu.org/software/emacs/manual/html_mono/emacs.html
>>
File: customize.jpg (174 KB, 539x712)
174 KB
174 KB JPG
>>103133430
https://www.gnu.org/software/emacs/manual/html_node/emacs/Easy-Customization.html

I usually use customize-group or customize-faces

usually doesn't work as intended in Doom Emacs though, which is one of my main gripes with it.
>>
>>103134010
>customize-faces
That's just for fonts, right?
>>
>>103134127
no, it drags you into The Ragged Flagon and Galathil starts cutting your face up to your specifications
>>
File: customize-face.jpg (256 KB, 1080x375)
256 KB
256 KB JPG
>>103134127
sort of. It's for everything emacs calls a face.
>>
>>103131201
I just type the #s myself. I didn't even realize there were commands for inserting headers.
>>
>>103122387
neat
thanks
>>
>>103134010
>which is one of my main gripes with it
You mean gripes with Doom Emacs?
>>
ayyyy shrinking encoding works (mostly, need to rid of the 0, which appears due to incorrect calculation of decoded data length).
>>
>>103137394
yes
>>
File: mike.jpg (7 KB, 178x283)
7 KB
7 KB JPG
HtdP or Concrete Abstractions before SICP

or in what order?
>>
>>103140654
writing code, any order.
>>
>>103140825
this
book obsession is just another form of nocoder jeets getting stuck in youtube tutorial hell
>>
File: donotfeed.jpg (131 KB, 1080x1077)
131 KB
131 KB JPG
https://www.youtube.com/watch?v=VYKSNTN-pOM

https://archive.4plebs.org/x/thread/38711593
>>
clojure.core's higher-order functions all expect the collection as their last argument.

This breaks with Clojure's js/java/dart OOP interop where the object is always the first argument to the method call, so you can't use Javascript's native .map, .reduce and .filter calls in the same threading macro as clojure's own (more flexible but slower) equivalents.

I'm trying to think of a good macro (or set of macros) that solves this.

in the meantime I guess one solution is to just use a let form.
>>
File: ok.png (1 MB, 738x1045)
1 MB
1 MB PNG
>>103140875
(telepsyche-send '(the akashic records are written in sexps))
>>
File: folded-keybindings.png (42 KB, 694x332)
42 KB
42 KB PNG
Something I just discovered is that the buffer generated by `C-h b` (describe-bindings) can be folded. If you're using evil:
- Hit `C-h b`.
- Focus on the window that documents keybindings.
- Then `z m` to fold everything.
- To open a fold, `z o`.
- To close a fold, `z c`.

I'm not sure why undo-tree-mode and evil-collection-unimpaired-mode are in there twice.
>>
>>103141001
>Javascript's native .map, .reduce and .filter
Why don't use clojure version of them?
>I'm trying to think of a good macro (or set of macros) that solves this.
as->
>>
>>103141097
>Why don't use clojure version of them?
Because they're slower and blow up the code size (at least for small programs)
>as->
right, I had forgotten about that
>>
File: arentyoushiraishi.png (50 KB, 302x365)
50 KB
50 KB PNG
>>103140825
>>103140833
oh well
i get it
thanks
>>
>>103127181
I know, what I meant is that there might some superior solution to my use case which I wasn't aware of
>>
>>103141097
>as->
The examples for that always seem contrived. What am I missing out on?
>>
I only use Org as a Markdown replacement. My to-do list is a .txt file. Why should I change?
>>
>>103141097
>as->
kinda ugly

https://stuartsierra.com/2018/07/15/clojure-donts-thread-as
>>
>>103141541
WTF?
https://www.lambdasierra.com/2022/hello
>>
>>103141526
>Why should I change?
You shouldn't. Org has horrid syntax compared to markdown and is only useful if markdown is insufficient for some clear reason.
>>
File: I will retire young.png (117 KB, 909x736)
117 KB
117 KB PNG
>>103141885
>only useful if markdown is insufficient for some clear reason
For me, that specific reason is that I have one document that needs LaTeX and to show the results of Python code. I use it to work out my finances.
>>
File: aoc2018day1goldSquint.jpg (108 KB, 1080x400)
108 KB
108 KB JPG
>>103141517
using interop methods together with clojure higher-order functions would be one such case
>>
Would there be any substantial differences using emacs on openbsd coming from debian? Any of you have experience with it?
>>
>>103141788
>>
>>103141788
reading the first paragraph, at first I thought "oh he helped his daughter make a website, that's so nice"
>>
I've never understood why /g/ has never had a DBA general. I used to think it was intelligence, but Lisp people are smarter than SQL people.
>>
>>103141788
clojer has fallen
>>
>>103142314
There was (is?) a sysadmin general, I feel like database stuff would end up there
>>
>>103142305
He used to be a handsome, clean-cut, white man. He didn't even trigger my gaydar.
>>
>>103142452
https://youtu.be/o7zyGMcav3c your gaydar is broken, it's pretty obvious from the first sentence that he might be gay.
>>
>>103142577
>your gaydar is broken, it's pretty obvious from the first sentence that he might be gay.
I guess. It's not obvious to me.
>>
>>103142577
>when you're so obsessed with homoiconicity that you become a homo icon yourself
lisp sisters, I'm scared
>>
https://veilofreality.com/2022/12/15/the-a-i-transhumanism-occult-trap-and-the-way-out/
>>
>>103142314
>but Lisp people are smarter than SQL people
I don't like this dichotomy.
https://www.endatabas.com/
https://github.com/endatabas/endb
>Common Lisp 71.8%
>Rust 19.1%
>>
>>103142266
Xah is Right, TTD.
http://xahlee.org/Periodic_dosage_dir/trans_calamity.html
>>
>>103142868
>>103142314
SQL people are smart, most of them were born after the spec so shouldn't be made guilty of what a trainwreck of a language it is.
>>
>>103142868
Franz inc also has a creepy super fast AI db thing that is prolly only used by spooks
>>
Is it just impossible to set the fucking initial frame size (not the following ones, those show up in the right place) and position for emacsclient? I've managed to do the font, which I couldn't make work for days, now I need to deal with the initial frame and the same solution(server-after-make-frame-hook) doesn't FUCKIGN WORK I am losing my MIIIIIIIIIND
>early init
doesnt work
>initial-frame-alist
doesnt work
>default-frame-alist
doesnt work
>server-after-make-frame-hook with the previous settings
doesnt work
>before-make-frame-hook
doesnt work
I don't want to edit xresources, i want it to be either in early init or init
>>
>>103142314
>I've never understood why /g/ has never had a DBA general.
It's called /twg/.
>I used to think it was intelligence, but Lisp people are smarter than SQL people.
There are no "SQL people" anymore. DBAs got replaced by generalist intern/juniors with rudimentary SQL skills or maybe an ORM. Turns out you don't need a noSQL database and you don't need a relational database and you don't need optimized queries either, because everybody uses SQLite and all you needed was one file to store your data.
>>
>>103142983
You can give emacsclient some elisp to execute with -e. For example, I have this elisp function.
;; https://emacs.stackexchange.com/a/74260/37580
(defun frame-center (&optional frame)
"Center the current frame."
(interactive)
(let* ((dw (display-pixel-width))
(dh (display-pixel-height))
(f (or frame (selected-frame)))
(fw (frame-pixel-width f))
(fh (frame-pixel-height f))
(x (- (/ dw 2) (/ fw 2)))
(y (- (/ dh 2) (/ fh 2))))
;;(message (format "dw %d dh %d fw %d fh %d x %d y %d" dw dh fw fh x y))
(set-frame-position f x y)))


I can use it with emacsclient like this:
emacsclient -e "(frame-center)" -c


This only controls position and places the new emacs frame at the center of the screen. If you wanted to control size and position, you could write your own elisp function to do that and call it via emacsclient in a similar way.
>>
>>103142983
>>default-frame-alist
>doesnt work
works on my machine
i set it to fullscreen in my early init
>>
>>103143116
>There are no "SQL people" anymore.
Lies like these make me rich.

>DBAs got replaced by generalist intern/juniors with rudimentary SQL skills or maybe an ORM.
Falls apart as soon as your database goes over 1 TB. Collapses completely at 10 TB. Nothing makes a database consultant's dick harder than the phrase "We are an EF-only shop".

>SQLite
It amazing for its use case, but you can't use it for everything. https://www.sqlite.org/whentouse.html#situations_where_a_client_server_rdbms_may_work_better
>>
How do you prefer to delete the line breaks from a source that was full of them, such as a PDF? I just make a macro, but is there already a keyboard shortcut for tidying these things up?

Example input:
Hilary Cotter is a New Jersey–based consultant specializing in
replication and other high-availability technologies, full-text
search, and performance tuning. He has over 20 years of expe-
rience in IT.
>>
>>103142314
database discussion is only interesting when it involves bullying sql-lets
>>
>>103144842
I agree. Show me your database dick, so I may laugh at it.
>>
>>103144568
What does EF mean in this context?
> 1 TB
try 50 Gb in the geodjango postgres shit I am maintaining that was made by literal apes.
>>
>>103144777
auto-fill-mode
fill-region
good morning sir
>>
>>103145657
>What does EF mean in this context?
entity framework, probably
cshart's orm with loads of magic and abstraction
>>
>>103145672
I think he wants the opposite of fill-region.

>>103144777
https://melpa.org/#/unfill
https://github.com/purcell/unfill/
>>
Why did the Clojure guys abandon leiningen?

I wanted to play around with using it as the backend for a Xitter clone, and I noticed that the successor to Luminus uses some crazy Java cli-style shit instead of 'lein build foo'. As a noob, it seems like they made the developer experience worse for no reason.
>>
>>103146563
>successor to Luminus
Is it
https://kit-clj.github.io/ ?
>>
>>103144568
Yeah, hibernate fucking you over with the worst queries known to man, requiring deep knowledge of the library and HQL to unfuck makes you want to just rawdog SQL.
>>
>>103146612
Yes, but I was wondering more broadly why these seemingly less ergonomic build tools seem to have taken over in Clojure land. I think Pedestal is also not using Leiningen.
>>
>>103146625
>just rawdog SQL
This is the way.
>>
File: 1731079442144864.jpg (213 KB, 701x664)
213 KB
213 KB JPG
>>103142983
>Is it just impossible to set the fucking initial frame size (not the following ones, those show up in the right place) and position for emacsclient?
Try this?
;; early-init.el
(modify-all-frames-parameters
'((top . 10)
(left . 10)
(width . 80)
(height . 24)))
>>
>>103146661
It's like, if to use Hibernate properly, you need an expert in the library and who's fluent in HQL *and* SQL to avoid footguns, why not just have a DBA who actually knows SQL deeply write complex queries for the backend developers. This might be a Hibernate problem, thoughbeit.
>>
>>103144403
To emacsclient? Setting frame size AND postition?
>>103146745
Doesn't work
>>103144020
Sort of works but not a real solution, the problem with it is that I'd have to modify something outside the init, and by that point I could just edit xresources or whatever.
>>
>>103146778
>Doesn't work
Damn, in that case I'll look through the initialization process for emacclient as it clearly differs from emac
>>
>>103145937
ah yes
>>103144777
C-X h M-% M-q-j (or was it C-q-j?) RET RET !
>>
>>103144568
Since you are here, what do you use in your emacs for DB-shit and sql?
>>
This might be useful for people who are in to emacs->web-browser automation.
https://gitlab.com/mauroaranda/emacs-webdriver
>>
>>103146563
deps.edn just works.
>>
>search ASDF documentation
>generic package manager comes up
who the fuck decided to write ANOTHER package manager ASDF?
>>
((((((sheeeeeeeeeeeeeittt))))))
>>
File: 498vn439i-fgvya7hf.jpg (54 KB, 720x404)
54 KB
54 KB JPG
>tfw no emacs lisp gf
faak me
>>
File: emac.png (329 KB, 661x480)
329 KB
329 KB PNG
>>103149330
sorry m8
only EMAChads get the grills
>>
>>103145657
How do you fuck up Postgres at only 50 GB? At that scale, you can just put the whole fucking database in RAM.
>>
>>103146880
There is no good DB management shit in Emacs, but it's great OOB for writing SQL. Running SQL requires too much config for me to mention without you naming the SQL.
>>
File: YBMC.png (115 KB, 981x794)
115 KB
115 KB PNG
>>103149520
>Richard Stallman (RMS) gave a keynote at the Gran Canaria Desktop Summit in July 2009 in which he described "EMACS virgins" as "women who have never used EMACS" and said that it was a sacred duty to "relieve them of their virginity".
GNU/Chad.
>>
>>103149589
An important thing to know in tech, is that you can always make it worse.
>>103149618
thanks
>>
>>103148805
ASDF is a build tool, not a package manager. Quicklisp is a package manager (still in beta despite being nine hundred years old btw).
ASF => Autistic Make
QuickLisp => Pip
>>
>>103150687
ASDF*
>>
>>103149618
How did you enter this consultant DBA stuff? I come from embedded, stats and signals, but I was put to work in webshit and now I waste 95% of my time keeping a critical service from imploding, with mostly db management stuff, but I've never had formal training. Just this one and I will stop derailing guys, sorry.
>>
File: BASED.jpg (225 KB, 1920x1080)
225 KB
225 KB JPG
>>103149631
M-x based-mode
>>
>>103140833
the issue with "just code" is that it's very possible to spend the rest of your life writing literal garbage without ever improving
and I also hate the feeling of just poking around and glueing shit together
what am I getting better at when doing that?

at the same time reading 1000 page textbooks in the current year is insanity
but you need *some* form of intentional study and exercise on top of just programming
>>
>>103154430
>what am I getting better at when doing that?
The solution is not to go read textbooks, it is to question what you are doing when you are writing your code and how you can make it better. Many times you will encounter issues that others have had in the past, recognizing that and looking up other's solutions is a type of studying.
>>
>>103154430
sure, but reading 3 books that all teach the same thing in a different way is a waste of time and academic wankery
if it has to be one of those, pick one and read through it with a specific goal in mind
>>
File: cave_noire_fairy.jpg (25 KB, 700x643)
25 KB
25 KB JPG
guix/emacs/exwm
>>
https://lists.gnu.org/archive/html/guix-devel/2024-11/msg00131.html
it's up
>>
>>103154430
>1000 page textbooks in the current year is insanity
I like to go through 1000 page books as I practice things regularly on the side don't make me feel bad
>>
>>103154430
bruh you are writing this with the personality of someone that knows what they are talking about, when you don't
write
more
projects
there are hundreds of patterns of loops, conditionals, recursive calls, data structures, etc. and you will only ever learn them by using them and the best way to use them is to come up with them on your own through banging your head against difficult issues on a regular basis
>>
whats in your early-init.el?
>>
>>103159031
>basically init.el (I don't even use init.el anymore)
>byte compile
>native compile (speed 3)
>>
>>103158743
and you're writing like a retard
kys
>>
>>103159839
His point is valid though. Practical experience gained while solving a non-academic problem can teach you a lot.
>>
>>103154430
>I also hate the feeling of just poking around and glueing shit together
this is the most fun part though
>>
Choosing Clojure for some hobby projects is the most fun I've had programming in years
>>
>>103156073
>exwm
Meme
>>
File: tomoko emac.png (506 KB, 1024x994)
506 KB
506 KB PNG
>>103149520
why can't i get a gf who uses emacs
>>
>>103159031
(setq gc-cons-threshold (* 16 1024 1024))
>>
>>103151583
Get good at SQL while in a decently big shop, particularly related to performance tuning. Solve a few major emergencies related to what you're good at. Add said things to your CV. Afterwards, get a job at a consulting firm.

This is exactly what I did.
>>
Why do people bother with init.el? Just use .emacs.
>>
>>103163235
I like to experiment with different emacs configurations via --init-directory.
>>
I like how he organized his technical notes.
https://github.com/jbranchaud/til

I have a lot of technical notes in org-roam, but it's structured kinda haphazardly.
>>
>>103161505
im a gril and i use emac >~<
>>
File: Built-for-BBQ.jpg (451 KB, 800x640)
451 KB
451 KB JPG
>>103163492
Your body, my choice. Forever.
>>
(make-emacs-great-again)
>>
>>103164106
we can grill both if u give me ur xmpp anon >.<
>>
File: 1731419981486331.jpg (136 KB, 1200x930)
136 KB
136 KB JPG
>>103159031
>whats in your early-init.el?
I make the background dark so emacs early startup doesn't blind me with its brillance
>>
>>103164843
i start emacs with -bg black and -fg white because of that
>>
File: the_strongest.jpg (75 KB, 925x653)
75 KB
75 KB JPG
>>103159031
(push '(menu-bar-lines . 0) default-frame-alist)
(push '(tool-bar-lines . 0) default-frame-alist)
(push '(vertical-scroll-bars) default-frame-alist)
(setq menu-bar-mode nil
tool-bar-mode nil
scroll-bar-mode nil)

(add-to-list 'default-frame-alist '(font . "monospace-10"))

(setq gc-cons-threshold most-positive-fixnum)
(add-hook 'emacs-startup-hook
(lambda ()
(setq gc-cons-threshold (* 16 1024 1024))))

(provide 'early-init)
>>
>>103166231
>(push '(menu-bar-lines . 0) default-frame-alist)
>(push '(tool-bar-lines . 0) default-frame-alist)
>(push '(vertical-scroll-bars) default-frame-alist)
Given your setq, these do nothing.
>>
is there a use-package equivalent to doing "(when (require 'fireplace nil :noerror)"?
i want to apply configurations conditionally if a package exists. but i'm not installing packages through use-package so i'd like it not throw any errors if a package doesn't.
>>
>>103111967
very nice
>>
anyone planning to do advent of code in emacs lisp?
What would your boilerplate utils look like?

I plan to do something like
(defun read-input (filename)
(with-temp-buffer
(insert-file-contents filename)
(split-string (buffer-string) "\n" t)))

but I have no idea what I'm doing.
How would you read and parse textfiles?
>>
>>103170991
here's one approach:
https://gist.github.com/Gavinok/1631fd138fc91a08a33c4b66afe15f39

I did one a while ago where I simply had the input file open in one buffer and then did elisp evaluation in another window
>>
>>103169254
Thanks for keeping receipts.
>>
File: pro.jpg (702 KB, 1800x2718)
702 KB
702 KB JPG
http://bookszlibb74ugqojhzhg2a63w5i2atv5bqarulgczawnbmsb6s6qead.onion/book/2316430/838600/professional-automated-trading-theory-and-practice.html
>>
>>103174600
pretty gud
thankz
>>
File: btcusd.1M.png (482 KB, 2725x1891)
482 KB
482 KB PNG
>>103169254
Where will it end, though?
- During this cycle, I'm going to keep an eye on the Monthly StochRSI.
>>
in guix, how would one package a custom iosevka build? you need to run
npm install
to download dependencies, which of course guix doesn't support since npm needs to connect to the internet.
>>
>>103177237
you need a fixed-output derivation senpai
(computed-file "node-source"
(with-imported-modules '((guix build utils))
#~(begin
(use-modules (guix build utils))
(let ((npm (string-append #$npm "/bin/npm")))
(invoke npm "install"))))
#:options (list #:hash-algo 'sha256
#:hash (nix-base32-string->bytevector
"0000000000000000000000000000000000000000000000000000")))

idk how node or iosevka work so refactor to your needs and use in the package's source field
>>
I had a hard day at work today that would have easily been solved by knowing Vim. This is the final straw for me. I'm learning Vim. Even if Emacs' keyboard shortcuts are better, I cannot assume that I will have access to Emacs everywhere. You can always assume Vim.
>>
>>103178334
>does not describe the problem
good morning sar
>>
>>103178334
M-x evil-tutor
>>
>>103178334
It's good to know both.
>>
File: cock.li.png (117 KB, 1359x573)
117 KB
117 KB PNG
What's going on over at cock.li ?
>>103167023
>>
File: dickmao.jpg (43 KB, 1280x720)
43 KB
43 KB JPG
Neovim Origin Story, An Emacs User's Perspective
https://commandlinesystems.com/neovim.txt
https://www.youtube.com/watch?v=8TCYnWPuc0I
>>
>>103105320
>fedshit as op pic
FAIL and AIDS. That pic is the reason why privacy on phones is in even more danger than before. Remember the
>bifi hacked shooter phone, but HOW???????
? Careful what you wish for, OP.
>>
File: spook.jpg (224 KB, 586x733)
224 KB
224 KB JPG
>>103179587
>fedshit
M-x spook
>>
What is a good sly (with doom) workflow? I'm still very new at emacs and lisp and have the following pain points atm:
* When opening my project, I want the sly repl to autoload the root asd file
* how do I even send the current defun to the repl? there is C-M-x to eval defun, but the result is down in the status bar, not repl (this, cmds like in-package don't work
>>
>>103146563
Officially it's because it makes writing really complicated and fucked up builds really easy, but honestly I don't even know where to start with it.

There's a cli tool for making new projects according to a format like Lein, but truth be told I haven't ever actually written a tools.clj buildscript since it seems like total overkill for what I actually want to do (Simply compile a set of .clj files into a single uberjar) but I can kind of see how it's better if you're doing something fucked up where you're mixing Clojure source code with something else and so on.

That said, I'm kind of a mediocre programmer myself so it's probably just me. In any case, does anyone have some good resources on when, why, and how to write tests in Clojure? I keep seeing stuff about test driven development in Lein/tools and want to know what all the hoopla's about. Another thing's that I'm not really sure when I should be using defrecord/deftype/reify since it seems to me that for all intents and purposes hashmaps tend to occupy the same space in Clojure as 'objects' would in an ooplang. So I usually just have functions that return a bit of processed data as a hashmap, but I'm wondering if I shouldn't just define some records or what-have-you. Adding to that - are protocols simply a way to add new methods to existing types?

While I could simply keep writing mediocre code while ignoring features I don't understand, I think it'd be better to hear about these things from someone more experienced than I, since these common features surely aren't actually all that complex or difficult to use?

Though I admit that I feel more and more like the 'programmer that just wants to slap slop together' rather than the 'programmer that wants to understand software at levels both high and low.' I find books don't really help, because while they do kind of show you the 'how', they don't really tell you 'when' to actually use the mentioned tools they demonstrate.
>>
Better late than never, in Emacs 30, gnus will support Atom feeds.
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=1601c5a518d
>>
>>103181358
>when, why, and how to write tests in Clojure?
you should be writing tests for pretty much everything. let's imagine you define a record with some operations. you would want to write a test of object creation and manipulation via the defined operations. you would want to input bad data that generates errors, and assert that correct errors are being reported. you would also want to submit good data, and assert the correct changes are being made.
I like to write one "test" per data structure I make. mind you that a single test can contain many assertions.
if you are writing standalone functions, not related to any specific data structure, then each of these functions should get their own test, with as many assertions as needed.
always test both good and bad data. try to mentally read through your code and hit every single possible path.
writing a bunch of tests is annoying, ngl, but once you are done you will feel so much more confident in the viability of your code. you will certainly run into bugs with existing code, and will become unable to feel at all confident in your algorithms without thoroughly testing them.
also, a HUGE benefit of writing tests out is that maintenance becomes so much easier. this is of course obvious.
note that your tests do not need to be "dry" at all really. write them fast as fuck, with as much copy-paste as you want. very often my tests exceed the LOC of the actual implementation.

>hashmaps tend to occupy the same space in Clojure as 'objects' would in an ooplang.
no, hashmaps are used only when you cannot predict what the key values are. if you are return a user record with a definite name, birthdate, sex, database ID, and so on, then document such fields within a record. if there is additional metadata regarding the user that might or might not exist (such as SSN, Facebook links, etc.) then those can become hashmap entries within a hashmap called "metadata" that belongs to the user record.
>>
>>103181358
>>103181654
protocols are used to annotate what commons functionality exists between differing data structures.
for example, I might have a AES and Serpent cryptosystem. both of these cryptosystems have their own implementations (they encrypt/decrypt data in their own ways, using their own data contained within their own records). but, they do both encrypt/decrypt data. so, AES and Serpent become records containing keys and whatever other shit they need to work. but they both get encrypt(plaintext) and decrypt(ciphertext) operations, which make up the "symmetric cryptosystem protocol."
the very cool thing with protocols is that now one can implement functionality that wraps symmetric cryptosystems together. all the wrapper needs to know is that the algorithms it is passed support the symmetric cryptosystem protocol (encrypt and decrypt). then, you can pass it an AES instance, then a Serpent instance, then another AES instance, and you will end up with a triple-encrypted ciphertext first using AES, then Serpent, then AES again (potentially with a different key length).

protocols are often used in lieu of inheritance. rather than a dog inheriting the locomotion class that defines "walk," the dog can implement "walk" itself in order to satisfy the locomotion protocol. these might seem like the same thing, but they are not, and after many years of coding I can firmly state that one should prefer protocols over inheritance in almost all scenarios.
Golang implements protocols in the form of "interfaces." Rust implements protocols in the form of "traits."
>>
>>103181654
Ah, I think I kind of get it now, and you use Clojure.spec.alpha to run tests on types themselves to see if they conform to your spec while Clojure.test's for testing values returned from functions?

>>103181709
Ah, so they really are just 'interfaces' that can sort of be bolted onto existing types? I think I get it now.
Honestly, just having this confirmed's really nice, since I felt like I was really missing out on substantial parts of the language since I didn't really feel like I had the right idea of what these features were meant to 'be'.

I kind of feel like I'm a bit too green to be using Clojure, since I feel like these're beginner-esque questions. Thanks for answering my questions.
>>
>>103181788
I have never actually used Clojure, but looking at https://github.com/suvash/one-time/blob/main/test/one_time/totp_test.clj
it appears to me that Clojure tests are simply .clj files that end in _test (just like in Golang). I recommend using files like those as a reference.
I personally use Common Lisp with FiveAM for testing (a library), which has the `is` macro, just like is found in Clojure.
    (is (= 319222 (totp/get-token "A4I774XAQM36J7IL" {:date (th/parse-date "Thu Jul 21 01:12:31 UTC 2016")})))

asserts that the result of the totp/get-token call is equal to 319222.

I HIGHLY recommend that you get somewhat comfortable with reading other codebases. looking at how others do things can clue you in very quickly as to what you need to do.
>>
>>103146563
https://blog.michielborkent.nl/new-clojure-project-quickstart.html
>>
testing in Lisp is so much better than Go
>>
>>103182893
>those parens
>>>103178785
>>
>>103183448
I get that it is not idiomatic but I'm not using any custom Lisp functionality in my editor and this makes it easy to move shit around.
I'm even using tabs
idgaf, it is Lisp, the whole point is to not have meaningful whitespace
>>
File: paredit_assert.webm (107 KB, 648x364)
107 KB
107 KB WEBM
(defun my/assert-defun-at-point-equals-cider-eval-register ()
"Wrap defun at point with assertion of equality to most recent evaluation.
Example: turns `(+ 2 2)' into `(assert (= 4 (+ 2 2)))'
but only if you evaluated it with `cider-eval-defun-at-point' beforehand.
Requires paredit to be installed and loaded."
(interactive)
(when (boundp 'parinfer-rust-mode) (parinfer-rust-toggle-disable))
(beginning-of-defun)
(paredit-wrap-round)
(insert "assert ")
(paredit-wrap-round)
(insert "= ")
(left-char)
(insert-register cider-eval-register)
(when (boundp 'parinfer-rust-mode) (parinfer-rust-toggle-disable)))


(defun my/is-defun-at-point=cider-eval-register ()
"Wrap defun at point with assertion of equality to most recent evaluation.
Example: turns `(+ 2 2)' into `(is (= 4 (+ 2 2)))'
but only if you evaluated it with `cider-eval-defun-at-point' beforehand.
Requires paredit to be installed and loaded."
(interactive)
(when (boundp 'parinfer-rust-mode) (parinfer-rust-toggle-disable))
(beginning-of-defun)
(paredit-wrap-round)
(insert "assert ")
(paredit-wrap-round)
(insert "= ")
(left-char)
(insert-register cider-eval-register)
(when (boundp 'parinfer-rust-mode) (parinfer-rust-toggle-disable)))
>>
>>103180026
I searched around, and this was touted as a solution.
https://github.com/kaz-yos/eval-in-repl
However, it didn't work as advertised for me. Instead of splitting the frame so that I'd have source in one window and a REPL in the other, the REPL buffer would take over the whole frame. My config might be at fault, but I couldn't get it to work after messing with it for a while.
(use-package eval-in-repl
:ensure t
:config
(require 'eval-in-repl-sly)
(setq eir-always-split-script-window nil) ; XXX: What should this be?
(setq eir-delete-other-windows nil) ; XXX: What should this be?
(setq eir-repl-placement 'right)
(add-hook 'lisp-mode-hook
'(lambda ()
(local-set-key (kbd "C-<return>") 'eir-eval-in-sly))))
>>
>>103182893
you're damaging the reputation of tmux users with this post
>>
File: frieren.gif (514 KB, 400x400)
514 KB
514 KB GIF
>>103115918
having a clojure style formatter is all well and good, but it's a bit of a bummer if it deletes your file on syntax errors
https://github.com/oakmac/standard-clojure-style-js/issues/150
>>
>>103187379
webshits strike again
>>
>>103185466
Just commenting: I hate when people complain about Lisp just because of the parenthesis. The truth is that Lisp can look very beautiful and elegant; I even had an orgasm of happiness while reading the code.

People should stop judging a language based on its syntax.
>>
File: laughingCheetahs.png (621 KB, 800x600)
621 KB
621 KB PNG
>>103187379
>this is definitely not great behavior or user experience
you don't say
>>
what's the difference between emacs on linux and emacs on *BSD ?
>>
>>103185868
why
>>
>>103187527
Did you mean to reply to someone else?
>>
>>103188037
It's been over a decade since I last logged in to a BSD machine. How are the BSD people doing these days?
>>
>>103188283
Who remembers when Yahoo switched from FreeBSD to Linux?
>>
>paredit
>smartparens
>electric-pair-mode
>something else
how are you managing your parentheses?
>>
>>103188465
Not ideal.
I'm using lispy but sometimes it gets confused.
>>
>>103188283
not changing much which I personally find a very comfortable thing, of course I still have to use linux for some things but it's nice having a cohesive operating system and not just a kernel with things put on top 50 different ways that can and will change for the sake of change
>>
File: aoc2023day12goldSmall.png (82 KB, 833x621)
82 KB
82 KB PNG
>>103188465
parinfer

I even prefer it visually because dimming the inferred parens makes it look less cluttered.
Unfortunately, it clashes with paredit/parinfer
>>
>>103189019
>it clashes with paredit/parinfer
i meant smartparens, and other structural paren editing packages
>>
>>103188465
Manually.
>>
File: (((eat))).gif (2.27 MB, 640x438)
2.27 MB
2.27 MB GIF
>>103189155
(based)
>>
>>103161464
>Meme
why?
>>
>>103181654
>hashmaps are used only when you cannot predict what the key values are
That is not the preference in Clojure.
The baseline is use a hash map for domain modeling unless you find a good reason to do something else. If you want to provide contracts over your API, use spec or malli.
>>103181358
>why, and how to write tests in Clojure?
Depends on what you're testing and your coding style.
Most Clojure programmers will recommend you write "flat" code with side effects on the edges, which makes most code unit testable (e.g. functions often receive the results of side effects, not perform them).
You should probably be writing generative tests on the edges of your systems or protocols.
You should probably use nubank/matcher-combinators because comparing maps sucks and match? is kino.
If you connect to a database, etc, either use griffinbank/test-contract (requires you know what you're doing) or just bring one up in a test container.
Another important question is how you should be running your tests.
The answer is from within an editor connected to the REPL. CIDER has commands to run tests. Use them.
>>
>>103192875
>>103181709
Your description of protocols is fine but they aren't as ubiquitous as interfaces or abstract classes would be in OOP langs.
Unlike those filthy abominations, you should not make a protocol if you have a single implementation and don't expect consumers to participate in the protocol. Just use a function.
Besides that, protocols are classical type based dispatch on the first argument, like interfaces (>>103181788) with the added bonus of being extensible to existing types, which you can't do on the JVM. If you want OPEN type based dispatch use protocols. In JVM Clojure, Protocols are backed by real interfaces and perform instance checks on their arguments to dispatch to them before looking up the implementation on the extension table.
If you want closed type based dispatch you might as wall use cond with instance checks.
If you want polymorphism a la carte use multi methods which dispatch on value, have hierarchies, neat stuff. You often find multi methods are preferred in Clojure to protocols. This is not necessarily because they're better, that's just the prevailing style
>>
>>103192881
multimethods are more propular because they've been around for longer and are more versatile.
Protocols are much faster. Metosin has written up a few basic guidelines for writing fast clojure code:
https://github.com/metosin/muuntaja/blob/master/doc/Performance.md
>>
>>103192875
>nubank/matcher-combinators
any reason to use this when I'm already using malli?
>>
Clojure makes me cum.
Coomjure.
>>
File: 1731645194_grim.png (1.34 MB, 1882x957)
1.34 MB
1.34 MB PNG
wayland private code generation is complete, which is like the client-server "glue code".

been rewriting the unit tests from wayland in lisp and testing them to ensure similar behavior from my lisp bindings and so far everything on the lower-level end seems to be working as intended

other than wrapping it into a defun or macro, is there a way to delay variable evaluation until the rest of a module is finished loading? i come from a C background and can use externing for something like this, but can't find a way to delay lisp variable evaluation beyond putting the defvar at the very end of the module loading sequence
>>
>>103194267
good morning sir, your language has no delay and force? maybe in combination with eval-when or something like it.
>>
>>103189019
>parinfer
i think im unironically too retarded to use this
t just gets in my way compared to paredit
>>
File: 1731626158346244.png (774 KB, 1280x720)
774 KB
774 KB PNG
>>103194267
Nice progress so far anon, is eval-when with :load-toplevel or :execute appropriate for delaying evaluation? Scheme has a similar thing using import-specs with its library form (for run/expand/meta time evaluation) so asdf may also have that feature
>>
>>103195793
i couldnt get eval-when to behave correctly for some reason. my current workaround is creation init-variable macros, since some of the wayland objects will depend on user input.

alongside this using find-class and boundp similar to the header guards that wayland uses for creating sever and client-side interfaces
>>
I've wanted something like this for a long time. I wish it didn't take me this long to discover it.
https://github.com/vifon/tmsu.el
https://tmsu.org/
>>
>>103195102
I already indented most of my code the way parinfer wants you to before I even came across parinfer, so I guess it was just a natural thing for me.

I think I would enjoy paredit when it's part of a real structural editing mode like Lispy, but unfortunately Lispy seemed quite buggy when I tried it. Lispy also seems to be an emacs-only thing, whereas parinfer is available for most of the important editors.
>>
>>103174600
He wrote so much on this. What a generous soul.
>>
>>103193235
Not to powerlevel but it's funny getting lectured about Clojure performance.
Anyway, protocols have better performance, but they can't be inlined by the JIT compiler, so if you want good performance you want to use monomorphic interfaces.
Multimethods are not only preferred because they're older, but because the general preference in Clojure is for working with data over types. Love it or hate it, that's just the shape of things.
>>103193481
Less friction and more plastic to the problem.
It's easier to write (is (match? {:a 1} your-map)) than (is (m/validate [:map [:a [:= 1]]] your-map))
You'll also get better error reporting.
>>
File: oceangate4.png (278 KB, 1800x1013)
278 KB
278 KB PNG
>>103197084
>You'll also get better error reporting
guess I'll dick around with it then, at least for functions where I don't already have a malli schema
>>
>>103197514
If you have malli schema on your functions you can write generative tests that exercise them and use `match?` in the assertion clause, or just good ol' =
>>
meowbros, how do I make a certain buffer use meow-motion-mode by default?
Slime's debugger starts in normal mode and some of the keybindings get in the way. But if I put it in motion mode it doesn't.
>>
>>103188465
solely my eyes and brain
>>
>>103105329
fuck I miss /prog/ what a time to be alive.
>>
File: experts.png (355 KB, 960x540)
355 KB
355 KB PNG
>>103105329
>>103200822
EXPERT /PROG/RAMMERS

https://textboard.org/static/img/abelson-stole-the-precious-course-mit-version.webm
>>
File: 1723176195598279.jpg (2.4 MB, 4080x3072)
2.4 MB
2.4 MB JPG
TREE SHITTER SIRS
>YOU WILL STANCH
>FROM THE BRANCH
>>
>>103199240
You could try this
>(add-to-list 'meow-mode-state-list '(slime-db-mode . motion))
It looks like meow has integration for sly which makes it use motion mode in the debugger, but not for slime. So you could also potentially switch to sly.
>>
>>103193575
I have yet to discover an Emacs package for masturbation.
>>
File: xah+inori.jpg (248 KB, 1920x1080)
248 KB
248 KB JPG
>>103204188
M-x xah-coomer-mode
>>
File: aoc2022day16gold.jpg (727 KB, 865x1951)
727 KB
727 KB JPG
>>103115918
>https://github.com/BrunoBonacci/mulog
that seems like a much nicer logging solution than what I was using before
>>
>>103204188
https://github.com/qdot/deldo
>>
>>103205958
But what about pornography?
>>
>>103205971
C-x C-f ~/Documents/.Porn/StoryWithYourFetish.txt RET

You don't need more than plaintext to get off do you?
>>
File: CX0HbReUkAEi_M5.jpg (23 KB, 293x400)
23 KB
23 KB JPG
>>103204188
>mom found the emms config
>>
File: CleanCode.png (117 KB, 1323x418)
117 KB
117 KB PNG
How do you make your Emacs work like this? I'm pretty sure that if I hit undo, it's local to the buffer I have open.
>>
you dumb dumbz vim is gooder lolz XD
>>
File: coomeremacs.jpg (209 KB, 1017x1563)
209 KB
209 KB JPG
>>103205971
>>
>>103207926
I wonder if there's a way to play back the file generated by M-x open-dribble-file.
>>
>>103207926
does kbd-macro do this?
>>
what emacs packages do you think should be part of vanilla?
>>
>>103211044
meow
>>
>>103211044
which key
vertico
corfu
all the litter helper functions for devs (dash, s-, f-, etc.)
>>
>>103211103
>vertico
Sell me on it.
>>
File: 1731789270997739.png (579 KB, 800x650)
579 KB
579 KB PNG
>>103211288
>Sell me on it.
it’s free
>>
>>103211288
icomplete but better.
>>
>>103211103
>which key
wish granted!
https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/which-key.el
>>
>>103207926
I dusted off VS Code for a certain thing recently and realized how much I missed a proper minimap, seeing the shape of code, being able to instantly jump to a specific section without keeping line numbers/identifiers/anything at all in my head, being able to do smooth but fast erratic scrolling - which is closely matches how I skim through physical printed/written text.
In general it's close to how I naturally work with physical textual and graphical information.
minimap-mode is clunky enough to break the flow and Helix doesn't have a minimap. I just tricked myself into thinking it's unnecessary and I don't want it.
>>
>>103211044
Magit
>>
>>103211044
a package as described in >>103111195
>>
>>103211103
Great list.
>>
>>103194267
Why are you writing source code instead of using a macro???
Also whats up with your weird usage of uppercase?
>>
>>103208171
>vimeme
>>
File: lazysql.png (675 KB, 3020x1836)
675 KB
675 KB PNG
emacbros, are there any package(s) to get similar functionality to lazygit? it looks incredibly comfy, but it would be even comfier to have in emac
>>
>>103217979
no idea what that is, but emacs canonically has magit sir. good morning.
Querying dbs is possible in emacs but it is not very confortable, but I don't think it is anywhere.
>>
>>103218226
im retarded, i meant to type lazysql not layzgit kek
i know sql-mode has some comint integration to send queries to the db and get the results back in a table, but it feels a little janky
>>
>>103218251
For regular shit that can spew a bagillion queries
>sql-mode in some buffer
>then sql-[my-dbs-technology]
>type connection specs
>type commands and send them to the psql buffer (in my case)

For things I know will work okayish
>org-mode
>>
>>103218268
baguillion rows*
>>
File: shape.gif (730 KB, 709x658)
730 KB
730 KB GIF
>>103211044
https://github.com/misohena/el-easydraw
>>
I just reduced my corfu-auto-delay from 0.5 to 0.05 and life feels great. Is there any reason why I shouldn't do this?
>>
>>103221415
Getting popup popping up every keystroke is annoying.
>>
Who among you don't use ido-mode?
>>
I tired fido-vertical-mode for like 15 minutes before deciding that I want vertico instead. Vertical completions don't make sense if grids are unsupported.
>>
>>103221581
I don't use it. The way it does completions looks messier than what I have already.
>>
>>103209946
How would it?
>>
>https://en.wikipedia.org/wiki/Monad_(Gnosticism)
Uhh bros?
>>
File: kangz.png (786 KB, 800x900)
786 KB
786 KB PNG
>>103222605
>the monad is a monarchy
we wuz
>>
new bread
>>103224728
>>103224728
>>103224728
>>103224728
>>
>>103128511
I just rewrote this in Elixir and it is only like 15% the size of this code. I did a Enum.chunk_every() |> Enum.map(), and inside of the map() I used Enum.zip_reduce()
functional programming = OP
>>
https://archived.moe/gif/thread/28146188/#28158045



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.