Skip to content

Instantly share code, notes, and snippets.

View wlbr's full-sized avatar

Michael Wolber wlbr

View GitHub Profile
@wlbr
wlbr / floats.go
Last active January 12, 2021 09:56
Fun with floating point precision in Go
package main
import (
"fmt"
"math/big"
)
func main() {
var a, b, c float32

Reader Macros in Common Lisp

Reader macros are perhaps not as famous as ordinary macros. While macros are a great way to create your own DSL, reader macros provide even greater flexibility by allowing you to create entirely new syntax on top of Lisp.

Paul Graham explains them very well in [On Lisp][] (Chapter 17, Read-Macros):

The three big moments in a Lisp expression's life are read-time, compile-time, and runtime. Functions are in control at runtime. Macros give us a chance to perform transformations on programs at compile-time. ...read-macros... do their work at read-time.

Macros and read-macros see your program at different stages. Macros get hold of the program when it has already been parsed into Lisp objects by the reader, and read-macros operate on a program while it is still text. However, by invoking read on this text, a read-macro can, if it chooses, get parsed Lisp objects as well. Thus read-macros are at least as powerful as ordinary macros.

@wlbr
wlbr / gist:1685405
Created January 26, 2012 22:07
Create a git repo with a central repository server.

##Create a git repo with a central repository server.

Step 1: Connect to server, create a new, empty directory there and initialize an empty repository.

$ ssh server.com
Last login ...
Welcome to server.com!
> mkdir myrepo.git 
> cd myrepo.git

> git --bare init