3 ms·
Notes on CL: - why nothing on the "compiler" line? Everytime you load a snippet or a file with SBCL, it compiles it (to machine code). There's also compile-fil
by vindarel 5mo ago
Notes on CL:
- why nothing on the "compiler" line? Everytime you load a snippet or a file with SBCL, it compiles it (to machine code). There's also compile-file.
- interpreter: likewise, all code is compiled by default with SBCL, not interpreted, even in the REPL. To use the interpreter, we must do this: https://github.com/lisp-tips/lisp-tips/issues/52 https://github.com/lisp-tips/lisp-tips/issues/52
- command line program: the racket cell shows the use of -e (eval), the same can be done with any CL implementation.
- since the string split line introduces cl-ppcre, one could mention cl-str :D (plug) (much terser join, trim, concat etc)
- ah ok, for dates and times, flattening a list, hash-table literals… we need more libraries.
- more files operations: https://lispcookbook.github.io/cl-cookbook/files.html https://lispcookbook.github.io/cl-cookbook/files.html
- emacs buffers: now compare with Lem buffers 8-)
- posix-getenv: I'd rather use uiop:getenv (comes in implementations).
- uiop:*command-line-arguments*
- exit: uiop:quit
- uiop:run-program (sync) / launch-program (async)
- java interop: with LispWorks or ABCL (or other libraries)
my 2c
- sinsudo 5mo agoSince you are also commenting libraries, I think that FSet (1) for inmutable memory,and perhaps a comparison with clojure, and the quick-lisp package manager could be mentioned. (1) https://news.ycombinator.com/item?id=47779659 https://news.ycombinator.com/item?id=47779659
- aidenn0 5mo ago> - ah ok, for dates and times local-time has its limits (e.g. Gregorian only), but it does everything listed in this chart > flattening a list What? Isn't this[1] just fine (<s>) > hash-table literals… Since the chart is sbcl specific, this ugly mess would technically count; a more portable (but longer) version could be made similarly using #.: #.(SB-IMPL::%STUFF-HASH-TABLE (MAKE-HASH-TABLE :TEST 'EQUAL) '((:X . :Y))) > java interop: with LispWorks or ABCL (or other libraries) I've had good luck with .net/java interop using FOIL (written by Rich Hickey prior to Clojure). 1: CL-USER> (let* ((result (cons nil nil)) (tail result)) (subst-if t (constantly nil) '(a ((b(c d)) e) f) :key (lambda (x) (when (and x (atom x)) (setf (cdr tail) (cons x nil) tail (cdr tail))))) (cdr result)) => (A B C D E F)
- tmtvl 5mo agoHash-table literals are covered by (among others): - Serapeum - golden-utils - rutils - make-hash Though now I'm wondering which libraries would make for a proper canonical extended core... asdf, uiop (comes with asdf, so naturally), alexandria, bordeaux-threads, cffi, cl-ppcre, str, local-time, trivia,... and maybe fset? (although I personally prefer Sycamore's naming conventions) ...maybe also fivem (although I personally prefer parachute) and hunchentoot.