http://www.cs.indiana.edu/~dyb/pubs/hocs.pdf
- SDP (with Rex Dwyer)
- Z80 Scheme (with George Cohn)
- C-Scheme
- Data General Common Lisp (with Rob Vollum, others)
data StartsWithA a b = StartsWithA a (StartsWithB a b) | |
| EmptyA | |
deriving Show | |
data StartsWithB a b = StartsWithB b (StartsWithA a b) | |
| EmptyB | |
deriving Show | |
infixr 7 <<< | |
infixr 7 >>> |
http://www.cs.indiana.edu/~dyb/pubs/hocs.pdf
#!/usr/bin/env python | |
# -*-coding: utf8-*- | |
# Title: chessboard.py | |
# Author: Gribouillis | |
# Created: 2012-05-19 22:18:09.909216 (isoformat date) | |
# License: Public Domain | |
# Use this code freely. | |
version_info = (0, 1) | |
version = ".".join(map(str, version_info)) |
(ns rxjava-datomic.query | |
(:require [datomic.api :as d]) | |
(:use [clojure.repl :only [pst]]) | |
(:import [rx Observable] | |
datomic.Peer)) | |
(defn query [qry & inputs] | |
(Observable/toObservable | |
(Peer/q qry (object-array inputs)))) |
Jim Weirich:
This is how I explain it… Ruby has Procs and Lambdas. Procs are created with
Proc.new { }
, lambdas are created withlambda {}
and->() {}
.
In Ruby 1.8,
proc {}
creates lambda, and Ruby 1.9 it creates procs (don't ask).
Lambdas use method semantics when handling parameters, procs use assignment semantics when handling parameters.
This means lambdas, like methods, will raise an ArgumentError when called with fewer arguments than they were defined with. Procs will simply assign nil to variables for arguments that were not passed in.
Links for essays ref'd in http://blog.fogus.me/2009/03/11/seven-books/
;; 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 |
Latency Comparison Numbers | |
-------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns | |
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms | |
Read 4K randomly from SSD* 150,000 ns 0.15 ms |
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs