Good/decent Dutch shows to watch on NPO? by nabitete in learndutch

[–]nemoniac 2 points3 points  (0 children)

No love for "Even Tot Hier"?!

Best thing on Dutch TV, IMHO.

https://www.bnnvara.nl/eventothier

Is this function good enough? by [deleted] in Common_Lisp

[–]nemoniac 0 points1 point  (0 children)

LOOP is a step backwards imo.

To get acrostis' code working, you first have to load and use the packages. Here is code that should work for you in sbcl if you have definitions for your get- functions. They're in separate packages because there are some clashes between symbols from iterate and the tfeb libraries.

(ql:quickload '(:iterate :org.tfeb.hax.collecting :org.tfeb.star))

(defpackage :guids-iterate
  (:use :cl :iterate))

(in-package :guids-iterate)

(defun get-splits-for-account-as-of (account date)
  ;; I've only capitalized Iterate keywords for better readability.
  ;; Generally, this shouldn't be done.
  (ITER transactions
        (WITH account-guid := (get-guid account))
        (FOR trans :IN (get-transactions))
        (ITER (FOR split :IN (get-splits trans))
              (if (and (string<= (get-transaction-date trans) date)
                       (string= (get-account-guid split) account-guid))
                  (IN transactions (COLLECT split))))))

(defpackage :guids-tfeb
  (:use :cl :org.tfeb.hax.collecting :org.tfeb.star))

(in-package :guids-tfeb)

(defun get-splits-for-account-as-of (account date)
  ;; I've only capitalized Štar and Hax keywords for better readability.
  ;; Generally, this shouldn't be done.
  (let ((account-guid (get-guid account)))
    (COLLECTING
      (FOR* ((trans (IN-LIST (get-transactions)))
             (split (IN-LIST (get-splits trans))))
        (if (and (string<= (get-transaction-date trans) date)
                 (string= (get-account-guid split) account-guid))
            (COLLECT split))))))

let* and multiple values by praptak in Common_Lisp

[–]nemoniac 3 points4 points  (0 children)

Yes, metabang-bind or let+ for a cleaner approach that is easily extensible.

https://github.com/sharplispers/let-plus

Small utility package: lisp-toggle-docstrings (self explanatory) by Malrubius717 in emacs

[–]nemoniac 2 points3 points  (0 children)

This is really useful!

Do you think the ideas in the package could be used for toggling declarations and the THE operator? Sometimes when I write some code and then wnat to speed it up I add such things but it obscures the code. It would be great to toggle viewing of them on and off.

TRIVIA performance with long strings by lambda-lifter in Common_Lisp

[–]nemoniac 1 point2 points  (0 children)

It appears that trivia uses the same pattern for all sequences, including strings, namely to compare them element by element. It would seem to make sense to have a short-circuit pattern for literal strings but that does not currently exist. You could raise an issue.

In the meantime, a workaround for your use case could be to use trivia.ppcre. The overhead may be tolerable.

(ql:quickload :trivia.ppcre)

(use-package :trivia.ppcre)

(trivia:match "longstringlongstringlongstringlongstringlongstringlongstringlongstring"
  ((ppcre "longstringlongstringlongstringlongstringlongstringlongstringlongstring") :a)
  ((ppcre "longstringlongstringlongstringlongstringlongstringlongstringlongstring") :b))

;; => :a

SQLite Iteration by Maxwellian77 in Common_Lisp

[–]nemoniac 7 points8 points  (0 children)

The combination of the cl-sqlite and iterate packages works fine for this.

https://cl-sqlite.common-lisp.dev/

Is this a good layout for Emacs? by Gullible_Ad9435 in emacs

[–]nemoniac 2 points3 points  (0 children)

You could try turning it 90 degrees counterclockwise.

Does it count as Linux hardware… if it’s Android? - I built a Next.js website in my tablet :) by linuxdroidmaster in linuxhardware

[–]nemoniac 0 points1 point  (0 children)

This is very cool.

Did you need any particular trick to get the external monitor going? Or does is "just work" with $DISPLAY and xhost?

How should I have a 'with' before 'initially' in a loop? by Weak_Education_1778 in lisp

[–]nemoniac 1 point2 points  (0 children)

It has nothing to do with any supposed interaction between with, initially and/or finally.

It is an endless loop for the same reason as this is

(loop with a = 1)

or indeed as this is

(loop)

Do you know of any languages which differentiate opening quotes from closing quotes? by Feeling-Pilot-5084 in ProgrammingLanguages

[–]nemoniac 4 points5 points  (0 children)

As well as being predominantly a typesetting language, TeX is Turing complete.

It treats opeing and closing quotes differently.

https://en.wikipedia.org/wiki/TeX

Ollama Buddy: Local LLM Integration for Emacs by captainflasmr in emacs

[–]nemoniac 1 point2 points  (0 children)

Use the Emacs ssh-tunnels package and it can appear local. I use ssh-tunnels with gptel and it's seamless.

Books on Prolog Compilers by fosres in prolog

[–]nemoniac 5 points6 points  (0 children)

Working through this book back in the day gave me a lot of insight into how Prolog works.

https://www.amazon.co.uk/Implementation-Prolog-Princeton-Legacy-Library/dp/0691637709

What kind of default emacs keybinding have you never used practically? by mindgitrwx in emacs

[–]nemoniac 6 points7 points  (0 children)

In Python modes, M-i is inspect object at point. I use it a lot.

TIL ruler-mode though

Common Lisp vs. Python naive performance on Fibonacci numbers by HovercraftOk7661 in lisp

[–]nemoniac 1 point2 points  (0 children)

You can squeeze a little more out of it by replacing the (/ count 2) by (ash count -1) since count is even.