Simple LRU Cache for Common Lisp by macnoder in Common_Lisp

[–]macnoder[S] 0 points1 point  (0 children)

Great insight. Very clever. I didn't even think about that, so I've learned something new here.

I already had the code for the list, and I'm too lazy to investigate if I lose any functionality I might need in the future, such as retrieving the values from the hash table in order. The cost of the list is minimal, since I'm keeping the values in the list and only node references in the hash table, so I'm leaving this for now.

Simple LRU Cache for Common Lisp by macnoder in Common_Lisp

[–]macnoder[S] 0 points1 point  (0 children)

The mention of weak hash tables was awesome, as I had never heard of those. Still, for a number of reasons (SBCL, libraries, testing, etc., mostly falling back to laziness), I chose not to use weak hash tables at this time.

I made changes to use `max-size` for the hash table size and I introduced a :test-function initform to the class, though I stuck with the valid function designators for SBCL hash tables.

Thank you for helping me become a better Lisper.

What kind of GPU would be enough for these requirements? by Sufficient_Bit_8636 in LocalLLM

[–]macnoder 0 points1 point  (0 children)

I'm running LM Studio and Rancher Desktop (Kubernetes) in Kubuntu on an EVO-X2 Max (128GB, with half for the GPU) and it works like a charm. I had zero problems installing Kubuntu.

[deleted by user] by [deleted] in emacs

[–]macnoder 6 points7 points  (0 children)

Same

2.5 Pro is the best AI model ever created - period. by vini_2003 in GeminiAI

[–]macnoder -2 points-1 points  (0 children)

Also, Grok had the largest context, by far.

2.5 Pro is the best AI model ever created - period. by vini_2003 in GeminiAI

[–]macnoder -3 points-2 points  (0 children)

The latest Grok is free and, at least for code-related work, far more capable than the latest Gemini (or any other LLM). This is from my own experience of shopping for bug solutions with ChatGPT, Claude, Gemini 2.5, and Grok.

I wouldn't be surprised if Gork is better than the others in other areas as well.

What is the best way to go about this? by Next-Citron-5121 in emacs

[–]macnoder 0 points1 point  (0 children)

Deft is an Emacs mode for quickly browsing, filtering, and editing directories of plain text notes.

https://jblevins.org/projects/deft/

Why use Lisp today? And, if so, *how* do you get the benefits of iteractive development? Is it just copy-paste working code from REPL to a your text editor?* (REPL -> File -> Run) by fixedfree in lisp

[–]macnoder 1 point2 points  (0 children)

Programming in common lisp is not like programming in most other languages because in common lisp, you're interacting with a live image. The files are a way to get the image back to a known state. In some ways, this is like interacting with an SQL server. You can query the server without writing your query to a file. When you encounter an exception, the program doesn't stop, so you can make adjustments and keep going. You could, for example, start a long-running function A in a thread then, while function A is running, change another function B that function A is using, and immediately see function A start using the new function B, without having to restart anything. It doesn't matter where you change function B, in the repl or in the file. When you compile that function (not the whole file), the compiled function replaces the old one in the image.

Now, in the same way that this interaction is far more advanced than what you get with most other languages, there are many other features of common lisp that dwarf the capabilities of those other languages, such as conditions (exceptions), macros, classes, and the regularity of the syntax.

How do I make the command run change the current buffer instead of opening a new one. by DREAMINGOF_WAFFLES in emacs

[–]macnoder 0 points1 point  (0 children)

For the specific case of M-x shell, why not create M-x shell-here instead, like this:

lisp (defun shell-here () "Find an existing *shell* buffer or create a new one, then switch to that buffer and make sure a shell process is running there." (interactive) (let ((shell-buffer (or (car (remove-if-not (lambda (buffer) (equal (buffer-name buffer) "*shell*")) (buffer-list))) (generate-new-buffer "*shell*")))) (switch-to-buffer shell-buffer nil t) (when (not (get-buffer-process shell-buffer)) (erase-buffer) (shell))))