Skip to content

Instantly share code, notes, and snippets.

View gist:79479b836a4262e9bcd9e124803cf8f0
### Keybase proof
I hereby claim:
* I am manuel on github.
* I am msimoni (https://keybase.io/msimoni) on keybase.
* I have a public key ASC3_N8cmaCDXyRmFG6rWilVZcJlAYJC1-aVvAjfMsvL4Qo
To claim this, I am signing this object:
View the.lisp
;; Define a simple structure
(defstruct point
x
y)
(defun make-point (x y)
(make-instance 'point :x x :y y))
;; Normal Lisp style function
(defun add-points (p1 p2)
View MOP-COLA.adoc
fun send(rcv, msg, args) {
  cls = rcv.isa
  if (cls.isa == STD_CLS)
    method = builtin_lookup(rcv, msg)
  else
    method = send(cls, "lookup", msg)
  method(rcv, args)
}
View delimc-leak.wat
;; Causes stack overflow:
(def p 'p)
(def (spawn-thread)
(push-prompt p
(loop
(sleep))))
(def (sleep)
@manuel
manuel / webrtc logs
Last active Aug 29, 2015
webrtc logs
View webrtc logs
PC 1: Chromium Version 31.0.1650.63 Built on Debian 7.2, running on Debian 7.3 (238485)
PC 2: Chrome Version 33.0.1750.149, Mac OS X
PC 1 (manuel28):
Creating local peer: manuel28 bbrtc.js:51
Creating RTCPeerConnection. bbrtc.js:33
Listening for ICE candidates. bbrtc.js:33
Listening for `negotiationneeded` bbrtc.js:33
Listening for data channel bbrtc.js:33
View stuns
# source : http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list
# A list of available STUN server.
stun.l.google.com:19302
stun1.l.google.com:19302
stun2.l.google.com:19302
stun3.l.google.com:19302
stun4.l.google.com:19302
stun01.sipphone.com
stun.ekiga.net
View threads.html
<html>
<head>
<title>Wat Sleeping Demo</title>
<script type="text/javascript" src="../../wat.js"></script>
</head>
<body>
<h1><a href="https://github.com/manuel/wat-js">Wat</a></h1>
<script type="text/javascript">
var code =
["begin",
View variant-genfuns.ml
(*
(define-class foo (make-foo))
(define-class bar (make-bar))
(define-generic (m obj))
(define-method (m (f foo)) 1)
(define-method (m (b bar)) 2)
(print (m (make-foo))) ; => 1
(print (m (make-bar))) ; => 2
(define-method (m (f foo)) 3)
(print (m (make-foo))) ; => 3
@manuel
manuel / representing-monads.scm
Created Aug 28, 2012
Error monad from Filinski's "Representing Monads"
View representing-monads.scm
;; Error monad from Filinski's "Representing Monads"
(define *default-prompt* (make-prompt))
(define (reflect m) (shift *default-prompt* k (ext k m)))
(define (reify t) (push-prompt *default-prompt* (unit (t))))
(define-record-type Success
(make-success a)
success?
@manuel
manuel / dyn-wind-commentary.scm
Created Aug 11, 2012
Commenting on Oleg's dyn-wind.scm
View dyn-wind-commentary.scm
;; See http://okmij.org/ftp/continuations/implementations.html#dynamic-wind
;; and http://axisofeval.blogspot.com/2012/08/delimited-continuations-do-dynamic-wind.html
;; Slight trick here: use identity of yield-record-tag function as the actual tag
(define (yield-record-tag) yield-record-tag)
(define (make-yield-record v k)
(list yield-record-tag v k))
;; Yield simply aborts up to the generator's caller, delivering to it
;; the yielded value and the continuation for resuming after the call