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 (channels) | |
#:use-module (ice-9 occam-channel) | |
#:export (start-echo)) | |
;;; use like this: | |
;;; > (define c (start-echo)) | |
;;; > (! c 'test) | |
;;; > (? c) | |
;;; $1 = (echo test) | |
;;; > (! c '(some more "input data")) |
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
#!/usr/bin/env guile -s | |
!# | |
(use-modules (gnome-2) | |
(cairo) | |
(system base pmatch) | |
(srfi srfi-1) | |
(srfi srfi-8) | |
(imi frp)) | |
(use-modules (gnome gobject) |
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
#!/usr/bin/guile -s | |
!# | |
(use-modules (gnome-2) | |
(srfi srfi-1) | |
(imi frp) | |
(imi frp-standard)) | |
(use-modules (gnome gtk) | |
(imi frp-gobject)) |
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-meta-command (describe repl (form)) | |
"describe OBJ | |
Show description/documentation." | |
(display | |
(object-documentation | |
(let ((input (repl-parse repl form))) | |
(if (symbol? input) | |
(module-ref (current-module) input) | |
(repl-eval repl input))))) | |
(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
;;; Solution to a Programming Praxis task | |
;;; see http://programmingpraxis.com/2012/03/09/sparse-sets/ | |
(define-module (programming-praxis sparse-sets) | |
#:use-module (srfi srfi-9) | |
#:export (make-sparse-set sparse-set-clear! | |
sparse-set-member? | |
sparse-set-add! sparse-set-remove! | |
sparse-set-for-each) |
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
;;; higher order modules for guile | |
(define-syntax-parameter provide ; an "export" for `module' forms | |
(lambda (stx) | |
(syntax-violation 'provide "provide used outside a module form" stx))) | |
(define-syntax module | |
(lambda (stx) | |
(syntax-case stx (import) | |
((module (import lib libs ...) (params ...) body ...) |
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
#lang racket | |
(require plot) | |
(plot (line sin) | |
#:x-min (- pi) | |
#:x-max pi | |
#:title "y = sin(x)") |