Skip to content

Instantly share code, notes, and snippets.

@phoe
phoe / text.md
Last active February 7, 2020 13:22
loop return value

So recently a religious debate intense discussion happened on #lisp about whether the following form:

;; Form 1
(loop for i from 1 to 5 finally (return i))

should return 5 or 6 (or, in other words, (1+ 5) - this notation is important as it will be used later).

I argue that it is invalid for it to return 6 and 5 must be returned instead.

@WetHat
WetHat / CL-PrettyPrintTableData.ipynb
Last active August 1, 2024 16:36
Pretty Print Table Data in Common Lisp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vseloved
vseloved / rutils-tutorial.md
Last active August 29, 2024 09:07
RUTILS Tutorial

RUTILS Tutorial

Overview

RUTILS is split into two parts: core (package rutils) and contrib (package rutilsx). These are aggregate packages that just re-export the symbols that are provided by the specific packages like rutils.anaphora or rutils.list. Overall, there are 17 parts of the core, which are described, in more detail, in this tutorial. They include (with some changes and additions) 3 facilities, which are also available from separate libraries: SPLIT-SEQUENCE, ITERATE, and ANAPHORA. Besides, it defines 2 lightweight wrapper data structures: pair and hash-set.

There's also the package rtl that includes the core plus short names for a lot of basic Lisp operations.

Contrib holds "experimental" stuff (in the sense that it's not totally conventional even for me) that, gradually, migrates to core. I won't talk more about it in the tutorial: those who are interested can check on their own or ask questions.

@ralt
ralt / README.md
Last active September 21, 2020 17:41
horse-html: extension to Parenscript

My main gripe with who-ps-html is that it generates a string, which means that you don't have a real DOM object to play with; you must wait to render that object before being able to do things on it.

horse-html fixes that by generating real DOM elements in JavaScript, and returning those.

The absolute best feature of horse-html is that the closures also magically work. If you define an onclick on an element, the JavaScript will use the closures generated wherever your code is defining that onclick attribute.

PS: the code can definitely be improved. I suck. But for the little use cases I have, it works. Feedback definitely welcome. I'm notably not a fan of the nested functions, but couldn't figure out a better way.

@priyadarshan
priyadarshan / ccl.md
Last active August 26, 2019 07:52
class-v-struct.lisp CCL bench (Thinkpad x1 Extreme)
? (load "/home/lisp/class-v-struct.lisp")
#P"C:/home/lisp/class-v-struct.lisp"
? (run-test-suite)

(LOOP FOR I FROM 1 TO RUN-TIMES DO (SET-RANDOM-CLASS MY-CLASS-INSTANCE))
took 72,604,000 microseconds (72.604000 seconds) to run.
During that period, and with 12 available CPU cores,
     72,593,750 microseconds (72.593750 seconds) were spent in user mode
              0 microseconds ( 0.000000 seconds) were spent in system mode
@willmcclellan
willmcclellan / magit.sh
Created August 17, 2019 05:13 — forked from alphapapa/magit.sh
Run a standalone Magit editor!
#!/bin/bash
# Run a standalone Magit editor! To improve startup speed, this
# script ignores the user's Emacs init files and only loads the Emacs
# libraries Magit requires.
# Note that this does NOT install any packages. Magit and its
# dependencies must already be installed in ~/.emacs.d.
dependencies=(magit async dash with-editor git-commit transient)
@alphapapa
alphapapa / magit.sh
Last active April 5, 2020 10:18
Run a standalone Magit editor!
# Please see the script's new home: https://github.com/alphapapa/magit.sh
@mattmc3
mattmc3 / .zshrc
Created July 29, 2019 23:16
ZSH: grml zsh config
# http://git.grml.org/?p=grml-etc-core.git;a=blob_plain;f=etc/zsh/zshrc;hb=HEAD
# Filename: /etc/zsh/zshrc
# Purpose: config file for zsh (z shell)
# Authors: grml-team (grml.org), (c) Michael Prokop <[email protected]>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
################################################################################
# This file is sourced only for interactive shells. It
# should contain commands to set up aliases, functions,
# options, key bindings, etc.
@redblobgames
redblobgames / dark-borders.el
Last active October 15, 2019 11:33
Emacs: dark fringe, line numbers
(set-face-attributes 'header-line nil :inherit 'sample :foreground "gray70" :background "gray20")
(set-face-attributes 'fringe nil :foreground "gray70" :background "gray20")
(cl-loop for buffer in '(" *Echo Area 0*" " *Echo Area 1*") do
(with-current-buffer buffer
(face-remap-add-relative 'default '(:family "Muli" :background "gray20" :foreground "white"))))
(set-face-attributes 'line-number nil :family "M+ 1m" :height 0.6 :foreground "#ccc" :background "gray20")
(set-face-attributes 'line-number-current-line nil :inherit 'line-number :foreground "white" :background "blue")
(when (fboundp 'global-display-line-numbers-mode)
(setq-default display-line-numbers-width 4)
@ralt
ralt / eshell.org
Last active January 19, 2022 19:18
my eshell config

Eshell

eshell is the shell I’ve tried using over time, and in the end just never stick with it. Let’s try one more time with a couple of tricks. The first tricks are mostly documentation:

  • M-& in a tramp-aware session means you run commands in a new buffer, without a TTY. Great for things like tailf.
  • for ncurses-like applications, “visual commands” is the missing context. Applications like top are in the default list by default,