Skip to content

Instantly share code, notes, and snippets.

View informatimago's full-sized avatar

Pascal J. Bourguignon informatimago

View GitHub Profile
@informatimago
informatimago / compilation-lambda-gcc-clang.txt
Created May 24, 2023 14:51
Demonstration Compilation Lambda avec Gcc et avec Clang.
# Voir les sources dans: https://github.com/informatimago/c-tidbits/tree/master/lambda
16:48[pbourguignon@frprld7818008 :0.0 lambda ]$ make
gcc -std=c99 -o test-lambda-gcc clang-block.c gcc-local-function.c lambda.c main.c
clang -fblocks -lBlocksRuntime -std=c99 -o test-lambda-clang clang-block.c gcc-local-function.c lambda.c main.c
// ====== test-lambda-gcc
localfun counter = 0
localfun counter = 1
localfun counter = 2
localfun counter = 3

L’histoire méconnue des communs

05.07.2017

Article d’Anne Lechêne, 5 juillet 2017, repris de *Colibris le Mag*

Voici une histoire vraie, qui commence au Moyen-Âge et est directement reliée à l’essor d’Internet et du logiciel libre : l’histoire méconnue des communs. Elle fut exhumée en 1990 par Elinor Ostrom des poubelles de l’Histoire où l’avait projetée un certain biologiste Garrett Hardin

The most complex C macros are those that are used to implement
alternative flow-control. For example, to iterate some data structure,
where you want to process an element with a block, or worse, when you
need multiple blocks, such as for an unwind-protect macro. The
current "state of the art" is to have the macro expand to a for() so
that it can be followed by a block that is executed according to your
expressions in the for(). But this is very limited, because of
restrictions on what can be done in the for expressions. Notably, you
cannot define loop variables of different types (and you cannot define
a type there either, such as struct to wrap multiple variables of

Debugging a dead-lock in a program using bordeaux-threads in ccl.

We have a program with three threads:

cl-user> (list-threads)
 1) #<process Telnet REPL Client #1 DOWN LAYER(22) [semaphore wait] #x302002A4903D>
 2) #<process Telnet REPL Client #1(21) [semaphore wait] #x302002A469FD>
 3) #<process Telnet REPL Server(20) [Active] #x30200291EB5D>
@informatimago
informatimago / capa.lisp
Created May 16, 2021 10:15
Exploring capabilities.
(defpackage "COM.INFORMATIMAGO.CAPABILITY"
(:use "COMMON-LISP"))
(in-package "COM.INFORMATIMAGO.CAPABILITY")
;;;---------------------------------------------------------------------
;;; Conditions
(define-condition capability-access-error (error)
((capability :initarg :capability :reader capability-access-error-capability)
;;;; -*- mode:lisp;coding:utf-8 -*-
;;;;**************************************************************************
;;;;FILE: babel-extension-test.lisp
;;;;LANGUAGE: Common-Lisp
;;;;SYSTEM: Common-Lisp
;;;;USER-INTERFACE: NONE
;;;;DESCRIPTION
;;;;
;;;; Tests decode-character.
;;;;
;;;; -*- mode:lisp;coding:utf-8 -*-
;;;;**************************************************************************
;;;;FILE: babel-extension.lisp
;;;;LANGUAGE: Common-Lisp
;;;;SYSTEM: Common-Lisp
;;;;USER-INTERFACE: NONE
;;;;DESCRIPTION
;;;;
;;;; A function to test for code sequences.
;;;;

Keybase proof

I hereby claim:

  • I am informatimago on github.
  • I am informatimago (https://keybase.io/informatimago) on keybase.
  • I have a public key ASBLnDOF7ZySWv5TaRF7QHR7-uKtPQ3I7U6a1evQoDrTHgo

To claim this, I am signing this object:

Q⃣W⃣E⃣R⃣T⃣Y⃣
(defun function-names (fun)
"
RETURN: A list of function names fbound to the function FUN.
NOTE: We only scan symbols and (setf symbols). Functions could also
be bound to slots or to various other lisp objects.
"
(let ((names '()))
(dolist (pack (list-all-packages) (delete-duplicates names))
(do-symbols (sym pack)
(when (and (fboundp sym) (eql fun (symbol-function sym)))