Skip to content

Instantly share code, notes, and snippets.

@mmontone
mmontone / weblocks-forms.lisp
Last active October 14, 2020 12:47
Weblocks forms with callback support
(defpackage :weblocks/forms
(:use :cl)
(:import-from #:weblocks/actions
#:make-action-url
#:function-or-action->action
#:get-request-action)
(:import-from #:weblocks/html
#:with-html)
(:import-from #:weblocks/request
#:get-path)
@svetlyak40wt
svetlyak40wt / weblocks-autocomplete.lisp
Created September 24, 2020 20:11
Example of autocompletion box using Weblocks
;; This example illustrates how to call actions from JS and update the widget in response.
;; It is incomplete but could be refactored into reusable library.
;; Hope, somebody will do this some day.
(defpackage #:weblocks-autocomplete
(:use #:cl))
(in-package weblocks-autocomplete)
(ql:quickload '(weblocks log4cl))
@vindarel
vindarel / Common Lisp VS Racket - testimonies.md
Last active April 17, 2024 21:48
Common Lisp VS Racket. Feedback from (common) lispers.

Developer experience, libraries, performance… (2021/11)

I'll preface this with three things. 1. I prefer schemes over Common Lisps, and I prefer Racket of the Schemes. 2. There is more to it than the points I raise here. 3. I assume you have no previous experience with Lisp, and don't have a preference for Schemes over Common Lisp. With all that out of the way... I would say Common Lisp/SBCL. Let me explain

  1. SBCL Is by far the most common of the CL implementations in 2021. It will be the easiest to find help for, easiest to find videos about, and many major open source CL projects are written using SBCL
  2. Download a binary directly from the website http://www.sbcl.org/platform-table.html (even for M1 macs) to get up and running (easy to get started)
  3. Great video for setting up Emacs + Slime + Quick Lisp https://www.youtube.com/watch?v=VnWVu8VVDbI

Now as to why Common Lisp over Scheme

#!/usr/bin/env python
import math
import sys
from moviepy.editor import AudioClip, VideoFileClip, concatenate_videoclips
# Get average RGB of part of a frame. Frame is H * W * 3 (rgb)
# Assumes x1 < x2, y1 < y2
Fonte: https://www.maccanismi.it/2012/08/21/elenco-url-streaming-radio-italiane-sul-web-rtl-rds-radio-kiss-kiss-r101-virgin-radio-e-moltre-altre/
Da usare per lettori come VLC e similari.
RTL:
http://shoutcast.rtl.it:3010/
RTL Best:
http://shoutcast.rtl.it:3020/
RTL ItalianStyle:
@phoe
phoe / package-local-nicknames.md
Last active February 27, 2024 08:14
Package-local nicknames in Common Lisp - a semishitpost about PLNs

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

@vindarel
vindarel / common-lisp-VS-clojure.md
Last active April 17, 2024 22:01
Notes on Common Lisp VS Clojure

Testimonies

CL's compiler

The thing in CL I miss most doing Clojure as my day job? CL's compiler. I like having a compiler tell me at compile time about the mistakes I've made. Bogus arguments. Unreachable code because of unhandled exceptions, and so on. CL saves me round after round of bugs that in clojure aren't found until you run the code. If you test well, it's found when testing, if you don't it's found in production. "Clojure compiler" almost demands air quotes.

CL's optional but oh-so-useful model of type declarations is also infinitely more useful (to me) than Clojure's use of "spec", and instrumentation that happens only at test time because of the cost. Depending on the OPTIMIZE declarations, other type defs are a floor wax and dessert topping. Want checks for argument types? Lower optimizations. Want most efficient machine code? High optimizations.

/u/Decweb, March 2023 https://www.reddit.com/r/lisp/comments/11ttnxk/the_rise_fall_of_lisp_too_good_for_the_rest_of/jczpysp/

@Goheeca
Goheeca / braille-pixels.lisp
Last active November 17, 2019 18:36
Braille pixels images using cl-charms (@ SBCL)
#!/usr/bin/sbcl --script
#|
Usage
=====
$ ./braille-pixels.lisp [path]
Main
====
@WetHat
WetHat / CL-PrettyPrintTrees.ipynb
Last active September 29, 2023 00:53
Pretty Print Tree Data Structures in Common Lisp
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@WetHat
WetHat / CL-PrettyPrintTableData.ipynb
Last active April 11, 2023 04:35
Pretty Print Table Data in Common Lisp
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.