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.
// note: -D_7ZIP_ST is required when compiling on non-Windows platforms | |
// g++ -o lzma_sample -std=c++14 -D_7ZIP_ST lzma_sample.cpp LzmaDec.c LzmaEnc.c LzFind.c | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <string.h> | |
#include <memory> | |
#include "LzmaEnc.h" | |
#include "LzmaDec.h" |
Stable branch, I can see you in the stable branch
See you again, I see you again
In my dreams, in my dreams, in my dreams, in my dreamsMorning light, I remember the morning li-i-i-i-ight
Outside my door (outside my door), I'll see you no more (see you no more)
In my dreams, in my dreams, in my dreams, in my dreams
>
GOOPS has GFs which can have a variable number of arguments while still permitting the programmer to specialize on them. This is a quick draft of a CL version that I've done recently and decided to share for fun and profit.
The main issue here is to avoid the fact that methods which agree on parameter specializers and qualifiers as per CLHS 7.6.3 are gonna get overwritten, and we don't want that. GOOPS-like dispatch must mean a maximum of 0 required arguments in defmethod
, which means that we get to specialize on exactly 0 arguments, which means that, trivially, 7.6.3 points 1 and 2 are always going to be true.
Hence, only 7.6.3 point 3 is left for us - and that means qualifiers. I (ab)use those in this example, by using a lax method combination (to still have :before
/:after
/:around
) and passing class names this way. It also means that all method lambda lists are effectively (&rest args)
or something similar, since we have no req
(defun starts-with (string substring) | |
(let ((length (length substring))) | |
(and (<= length (length string)) | |
(string= (subseq string 0 length) substring)))) | |
(defun list-all-sbcl-packages () | |
(flet ((sbcl-package-p (package) | |
(starts-with (package-name package) "SB-"))) | |
(remove-if-not #'sbcl-package-p (list-all-packages)))) |
Dear GitHub Trust and Safety Team,
you've requested me to edit and delete the contents of the two posts, which has now happened:
I would like to thank you for moderating GitHub and upholding your GitHub Community Guidelines, specifically including the following points:
Dear GitHub Trust and Safety Team,
you've requested me to edit and delete the contents of the two posts, which has now happened:
I would like to thank you for moderating GitHub and upholding your GitHub Community Guidelines, specifically including the following points:
[{ | |
"romaji": "Agari", | |
"kanji": "和がり", | |
"english": "Win", | |
"explanation": "Generic call for winning a hand." | |
}, | |
{ | |
"romaji": "Agaripai", | |
"kanji": "和がり牌", | |
"english": "Winning tile", |
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.
;; 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 |