Skip to content

Instantly share code, notes, and snippets.

Classes for representing forces on objects

In this walkthrough, one thing you may notice is the large number of Symbol objects that are defined. For example, for just the ball, the following are defined:

var F1_m1 = new Symbol("F1_m1");        // force 1 on mass 1
var F2_m1 = new Symbol("F2_m1");        // force 2 on mass 1

var th1_m1 = new Symbol("th1_m1");      // direction of force 1 on mass 1
(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.