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 (test peval?) | |
(compile | |
'(let () | |
(define (rewind-protect thunk protector) | |
(dynamic-wind | |
(let ((entered? #f)) | |
(lambda () | |
(if entered? | |
(error "Re-entering rewind-protected extent.")) | |
(set! entered? #t))) |
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 guardian (make-guardian)) | |
(define finalizer-table (make-weak-key-hash-table)) | |
(let ((f (lambda () (display "test\n")))) | |
(guardian f) | |
(hashq-set! finalizer-table (cons #f #f) f) | |
#f) ;; just in case you want to test at repl | |
(write finalizer-table) | |
(newline) |
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
make[3]: Entering directory `/home/ian/src/guile/libguile' | |
GEN guile−procedures.texi | |
Throw without catch before boot: | |
Throw to key misc−error with args ("module−transformer" "no module, and `macroexpand' unbound" () #f)Aborting. | |
/bin/sh: line 1: 4920 Broken pipe cat alist.doc arbiters.doc array−handle.doc array−map.doc arrays.doc async.doc backtrace.doc boolean.doc bitvectors.doc bytevectors.doc chars.doc control.doc continuations.doc debug.doc deprecated.doc deprecation.doc dynl.doc dynwind.doc eq.doc error.doc eval.doc evalext.doc expand.doc extensions.doc feature.doc filesys.doc fluids.doc foreign.doc fports.doc gc−malloc.doc gc.doc gettext.doc generalized−arrays.doc generalized−vectors.doc goops.doc gsubr.doc guardians.doc hash.doc hashtab.doc hooks.doc i18n.doc init.doc ioext.doc keywords.doc list.doc load.doc macros.doc mallocs.doc memoize.doc modules.doc numbers.doc objprop.doc options.doc pairs.doc ports.doc print.doc procprop.doc procs.doc promises.doc r6rs−ports.doc random.doc rdel |
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
;; Syntax parameter examples | |
(define-syntax-parameter abort | |
(syntax-rules ())) | |
(define-syntax forever | |
(syntax-rules () | |
[(forever body ...) | |
(call/cc (lambda (abort-k) | |
(syntax-parameterize |
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
;; scheme version of clojure's -> | |
;; -> | |
;; macro | |
;; Usage: (-> x) | |
;; (-> x form) | |
;; (-> x form & more) | |
;; Threads the expr through the forms. Inserts x as the | |
;; second item in the first form, making a list of it if it is not a | |
;; list already. If there are more forms, inserts the first form as the |
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
#!r6rs | |
;; a permissive version of receive, that allows extra values without | |
;; error, and supplies a default for missing ones | |
;; | |
;; tested on guile and racket | |
(library (permissive-receive) | |
(export receive*) | |
(import (rnrs) | |
(for (only (srfi :1 lists) iota) expand)) | |
(define-syntax receive* |
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
#!r6rs | |
;; Really simple generators using delimited continuations | |
(library (toys simple-generators) | |
(export make-generator | |
up-from | |
list->generator) | |
(import (rnrs) | |
(spells delimited-control)) |
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
(use-modules (ice-9 control) | |
(rnrs hashtables) | |
(web server) | |
(sxml simple) | |
(web response) | |
(web request) | |
(web uri) | |
(ice-9 match)) | |
;; utilities |
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
class type foo = | |
object | |
method bar : bazt | |
end and bazt = | |
object | |
inherit foo | |
end;; | |
class baz = | |
object (self : #foo) |
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-module (module-exports) | |
#:export (module-exports) | |
#:use-module (ice-9 session)) | |
(define (module-exports module-name) | |
(let ((new-module (resolve-module module-name))) | |
(apropos-fold (lambda (module name var data) | |
(if (eqv? module new-module) | |
(cons name data) | |
data)) |
OlderNewer