This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ( | |
"database/sql" | |
"reflect" | |
) | |
/* | |
* You can pass in an unaltered pointer to sql.Row, sql.Rows as a "RowScanner" | |
*/ | |
type RowScanner interface { | |
Scan(dest ...interface{}) error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package wait | |
import ( | |
"fmt" | |
"reflect" | |
) | |
type ReadChan struct { | |
Var interface{} | |
Chan interface{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/ksh | |
set -eu | |
typeset -A tracked | |
export SUBDIRECTORY_OK=1 NONGIT_OK=0 OPTIONS_SPEC='' LONG_USAGE='' USAGE='' GIT_TEXTDOMAINDIR='' GIT_GETTEXT_POISON='' | |
export GIT_TEST_GETTEXT_POISON='' | |
source "$(git --exec-path)/git-sh-setup" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(library (curry) | |
(export define-curried lambda-curried) | |
(import (rnrs)) | |
(define-syntax lambda-curried | |
(lambda (x) | |
(syntax-case x () | |
[(_ () b b* ...) #'(lambda () b b* ...)] | |
[(_ arg* b b* ...) (identifier? #'arg*) #'(lambda arg* b b* ...)] | |
[(_ (arg* ...) b b* ...) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(library (html) | |
(export html display-html) | |
(import (rnrs)) | |
(define short-tags (make-enumeration '(br img link meta))) | |
(define (short-tag? t) | |
(enum-set-member? t short-tags)) | |
(define (->string obj) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define-syntax param-args | |
(syntax-rules () | |
[(_ arg-list (opt param) ...) | |
(let loop ([args arg-list]) | |
(if (null? args) | |
'() | |
(case (car args) | |
[(opt) (if (null? (cdr args)) | |
(errorf 'param-args "Missing required argument for ~a" opt)) | |
(param (cadr args)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define iota | |
(fn ((count :: integer? exact? nonnegative?) | |
(start :: number? = 0) | |
(step :: number? = 1)) | |
(if (zero? count) | |
'() | |
(cons start | |
(iota (- count 1) (+ start step) step))))) | |
(define member |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!chezscheme | |
(library (future) | |
(export spawn sync let-futures) | |
(import (chezscheme)) | |
(define-record-type future | |
(fields (immutable lock) | |
(mutable completion) | |
(mutable result)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(library (documentation) | |
(export define/document define-syntax/document | |
document describe) | |
(import (rnrs)) | |
(define doc-list '()) | |
(define (document thing description) | |
(set! doc-list (cons (cons thing (syntax->datum description)) doc-list))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; | |
;;; This acts like a letrec*, with the ability to bind multiple values and destructure lists and vectors | |
;;; | |
;;; usage: | |
;;; | |
;;; (let+ ((a 1) | |
;;; (b (+ a 1)) | |
;;; ((values c d) (values (+ a b) (* a b))) | |
;;; ((vector e f g h) (vector a b c d)) |
OlderNewer