Skip to content

Instantly share code, notes, and snippets.

(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)
(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 "!" ))
(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)))
(library (define-is-type-syntax)
(export define-is-type-syntax)
(import (rnrs)
(dharmalab misc gen-id))
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define-syntax define-get-field-syntax
(import (define-is-type-syntax))
;; Define the pt type:
(define-record-type pt
(fields (mutable x)
(mutable y)))
;; Generate the 'is-pt' macro:
(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))
(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

abc

123

456

----------------------------------------------------------------------
- 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.

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: