Skip to content

Instantly share code, notes, and snippets.

Avatar
🤔
:thonk:

Michał "phoe" Herda phoe

🤔
:thonk:
View GitHub Profile
@phoe
phoe / analysis.md
Last active Jan 7, 2021
Analysis of Hexstream's public contributions to the Common Lisp ecosystem
View analysis.md

This is a copy of the post from the locked issue https://github.com/cl-library-docs/common-lisp-libraries/issues/3#issuecomment-732563750 made available as a separate gist for clarity and posterity.


Phoe said I am not a Common Lisp expert. This is actually the single most batshit unhinged shit anyone has ever said to me on the internet, ever. What a fucking monster. He would do well to review my extensive contributions in depth before making self-discrediting pronouncements. - @Hexstream, https://twitter.com/HexstreamSoft/status/1331030226634219520

Hokay then.

Allow me to review your claims of having a huge positive impact on the Common Lisp community. My review is based on your CV, the current Quicklisp dist, and your public GitHub activity. I assume that your next tweet will link to this post as a proof that I have done exactly what you've asked of me, and so your fans can get to kn

@phoe
phoe / package-local-nicknames.md
Last active Sep 3, 2020
Package-local nicknames in Common Lisp - a semishitpost about PLNs
View package-local-nicknames.md

Package-local nicknames in Common Lisp

Warning: this is a rant.

Warning: you have been warned.

Note: actually worthwhile content starts in the second subsection. You are free to skip the first one.

Story time

@phoe
phoe / arcturus-glossary.json
Last active May 14, 2020
Arcturus riichi mahjong glossary in JSON format - plus tiles, plus standard and nonstandard yaku and yakumans
View arcturus-glossary.json
[{
"romaji": "Agari",
"kanji": "和がり",
"english": "Win",
"explanation": "Generic call for winning a hand."
},
{
"romaji": "Agaripai",
"kanji": "和がり牌",
"english": "Winning tile",
@phoe
phoe / format-float-junk.lisp
Last active Nov 21, 2019
fix for CCL's floating point fuckery - code adapted from SBCL
View format-float-junk.lisp
;; Do not use - a proper fix was committed into my fork at phoe-trash/ccl.
(defconstant single-float-min-e
(- 2 ccl::ieee-single-float-bias ccl::ieee-single-float-digits))
(defconstant double-float-min-e
(- 2 ccl::ieee-double-float-bias ccl::ieee-double-float-digits))
;; TODO: maybe-inline %flonum-to-digits, we don't need the indirection
(declaim (inline %flonum-to-digits))
(defun %flonum-to-digits (char-fun
@phoe
phoe / text.md
Last active Feb 7, 2020
loop return value
View text.md

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.

@phoe
phoe / pzmq-router-dealer.lisp
Created May 24, 2019
ZeroMQ pzmq sample router/dealer in Common Lisp
View pzmq-router-dealer.lisp
;; modified from pzmq examples
(defun hwclient (&optional (server-address "tcp://localhost:5555"))
"Translation of http://zguide.zeromq.org/c:hwclient updated for ZMQ 3.
Includes some parameters in with-* macros to demonstrate syntax."
(pzmq:with-context (ctx :max-sockets 10)
(pzmq:with-socket (requester ctx) (:dealer :affinity 3 :linger 100)
;; linger is important in case of (keyboard) interrupt;
;; see http://api.zeromq.org/3-3:zmq-ctx-destroy
(pzmq:connect requester server-address)
@phoe
phoe / lu-decomposition.lisp
Created Nov 14, 2018
LU decomposition in portable Common Lisp
View lu-decomposition.lisp
;;; Matrix utilities.
(defun matrix= (matrix-1 matrix-2)
(destructuring-bind (m1y m1x) (array-dimensions matrix-1)
(destructuring-bind (m2y m2x) (array-dimensions matrix-2)
(and (= m1y m2y)
(= m1x m2x)
(loop for y below m1y
always (loop for x below m1x
always (= (aref matrix-1 y x)
@phoe
phoe / kbmap-lisp
Created Oct 18, 2018
Polish Lisp keyboard map - parens and brackets switched
View kbmap-lisp
// based on a keyboard map from an 'xkb/symbols/pl' file
default partial alphanumeric_keys
xkb_symbols "basic" {
// Visualisation and description: http://podziemie.net/xkb/pl
// Contact: Michał Górny <zrchos+freedesktop@gmail.com>
include "latin"
@phoe
phoe / ssl.lisp
Created Aug 30, 2018
Connect to Furcadia with STARTTLS
View ssl.lisp
(defun ssl-connect () ;; this is a god damn hack
(let* ((socket (usocket:socket-connect "lightbringer.furcadia.com" 80))
(stream (usocket:socket-stream socket)))
(sleep 1)
(loop while (listen stream)
for line = (read-line stream nil stream)
until (eq line stream)
do (format t "S> ~A~%" line))
(format t "C> ~A~%" "starttls")
(format stream "starttls~C~C" #\Return #\Linefeed)
@phoe
phoe / list-otwarty.md
Last active Jun 26, 2018
List otwarty do Dziekana WMiI UJ w sprawie artykułów 11 i 13 dyrektywy UE o prawie autorskim
View list-otwarty.md

List otwarty

prof. dr hab. Włodzimierz Zwonek
Dziekan Wydziału Matematyki i Informatyki
Uniwersytetu Jagiellońskiego
Łojasiewicza 6
30-348 Kraków

Szanowny Panie Dziekanie,

You can’t perform that action at this time.