Skip to content

Instantly share code, notes, and snippets.

View fib-binrec-a.sps
(import (rnrs) (ikarus))
(define (binrec f g h i j)
(define (fun x)
(if (f x)
(g x)
(j (fun (h x))
(fun (i x)))))
fun)
View is-vector-of-pt-with-index.scm
(define-syntax is-vector-of-pt-with-index
(lambda (stx)
(syntax-case stx ()
( (is-vector-of-pt-with-index name index)
(with-syntax ( (name.index (gen-id #'name #'name "." #'index ))
(name.index! (gen-id #'name #'name "." #'index "!" ))
View pt-class.sls
(library (pt-class)
(export make-pt is-pt pt::norm pt/n pt::normalize)
(import (rnrs)
(dharmalab misc gen-id))
(define-record-type pt
(fields (mutable x)
(mutable y)))
View define-is-type-syntax.sls
(library (define-is-type-syntax)
(export define-is-type-syntax)
(import (rnrs)
(dharmalab misc gen-id))
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define-syntax define-get-field-syntax
View define-is-type-syntax-example-pt-a.sls
(import (define-is-type-syntax))
;; Define the pt type:
(define-record-type pt
(fields (mutable x)
(mutable y)))
;; Generate the 'is-pt' macro:
View cons-wm-configure-request.scm
(define configure-request
(let ((wc (make-XWindowChanges)))
(lambda (ev)
(XWindowChanges-x-set! wc (XConfigureRequestEvent-x ev))
(XWindowChanges-y-set! wc (XConfigureRequestEvent-y ev))
(XWindowChanges-width-set! wc (XConfigureRequestEvent-width ev))
(XWindowChanges-height-set! wc (XConfigureRequestEvent-height ev))
(XWindowChanges-border_width-set! wc (XConfigureRequestEvent-border_width ev))
(XWindowChanges-sibling-set! wc (XConfigureRequestEvent-above ev))
(XWindowChanges-stack_mode-set! wc (XConfigureRequestEvent-detail ev))
View glu.chezscheme.sls
(library (agave glu)
(export GLU_EXT_object_space_tess
GLU_EXT_nurbs_tessellator
GLU_FALSE
GLU_TRUE
GLU_VERSION_1_1
GLU_VERSION_1_2
GLU_VERSION_1_3
GLU_VERSION
View md
----------------------------------------------------------------------
- The UNIX filesystem as an object store
----------------------------------------------------------------------
With MP3 we have ID3; i.e. a standard for metadata. Thus we have audio
file organizers like iTunes, Amarok, and Banshee.
But what about PDF files (research papers, books, manuals)? Images?
Movies? The situation isn't as nice for these.
View named-arguments.md

Introduction

There are various approaches to optional named arguments in Scheme.

It's easy to define a procedure which accepts optional arguments:

(define (xyz . args) ...)

It's also possible to have the procedure itself handle named arguments: