Moby My take on how Moby Works ... The Moby Scheme Compiler for Smartphones ... 1.2Simulations and Animations: "world.ss" ... How to Design Worlds: Imagi... Shriram Krishnamurthi: Talk... YouTube - Handbells for the... Handbells for the 21st Century InfoQ: Javascript as Compil... Another language that compiles to Javascript is... examples/bell-choir.ss at m... The CONTINUE Server Shriram Krishnamurthi Sy... How to Design Programs: An ... Contents Preface IProcessing ... XML Transformation-by-Example for XML Shriram Kri... SXSLT: Manipulation Language for XML Oleg Kis... Flapjax Demos Catch Up Delicious Dra... Papers Shriram Krishnamurthi: Publ... Chronological List of All Papers These papers...
via http://twitter.com/programmingjoy Javascript as Compiler Target: Clamato, GWT Smalltalk, Python, Scheme http://www.infoq.com/news/2009/09/javascript-compilation-target (require moby/stub/world) (define WIDTH 320) (define HEIGHT 480) (define (render w) (place-image (text "Hello World" 10 "Black") 20 20 (empty-scene WIDTH HEIGHT))) (big-bang WIDTH HEIGHT 10 0) (on-redraw render)
After a few minutes of poking around, I was able to compile this to Java and then run it on the Android Emulator:
(defprocess root (fuzziness)
(defvariable blobs #’union)
(always
(when (eq (read-sensor ’image) ’black)
(subprocess (measure-blob) :gradient fuzziness)
(setf blobs
(list (get-from-sub (measure-blob) blob)))))
(avoid
(read-sensor ’query)
(let ((q (first (read-sensor ’query))))
(cond
((eq q ’blobs)
(actuate ’response (regional blobs)))
((eq q ’area)
(actuate ’response
(fold #’+ (mapcar #’second
(regional blobs)))))))))
(defprocess measure-blob ()
(defvariable uid #’max :atomic :base 0 :init (random 1))
(defvariable area #’sum :reduction :base 0 :init 1)
(defvariable blob :local)
(always
(setf blob (list uid area))))
Code to find a set of fuzzy blobs and their areas in a binary image. Each contiguous black area of the image runs a connected measure-blob pro- cess that names it and calculates its area. The set of blobs is collected by the root process and made accessible to the user on the response actuator...
1. XML and Scheme 1. Tools: SSAX, SXML, SXPath, SXSLT 2. Applications, Examples, Sample Code 3. Papers and Presentations 4. SSAX-SXML Mailing list SSAX-SXML SourceForge Project 5. Miscellanea 6. Papers and Presentations 7. Functional XML parsing framework SAX/DOM and SXML parsers with support for XML Namespaces and validation 8. SXML specification 9. SXPath -- SXML query language, XPath implementation 10. SXML traversals and transformations 11. HSXML: Typed SXML 12. Applications, Examples, Sample Code 13. HTML/XML authoring in Scheme 14. Writing LaTeX/PDF mathematical papers with SXML 15. Joint processing of two immutable SXML documents with update cursors 16. Literate XML/DTD programming 17. SXML as a normalized database 18. Complete examples of practical (context-sensitive) SXML Transformations 19. Complete examples of stream-wise (SAX) and DOM parsing ... 1. Last updated March 4, 2007
* http://mshook.appspot.com/z/d4m.htm?/mshook/scheme * The Ten Commandments 1. How to recur on a list of atoms, a number and an S-expression | 23 64 83 2. Cons to build | 37 3. Typical element, cons & recur | 45 4. Change >= 1 arg closer to termination & test | 57 65 84 5. +, X & cons; test 0,1,() | 67 6. When to simplify | 94 7. Subparts: sublists & subexpressions | 103 8. Abstract reps w/ funcs | 107 9. Abstract patterns w/ funcs | 134 10. Funcs to collect > 1 value | 140 * The Five Rules 1. Car 5 2. Cdr 7 3. Cons 9 4. Null? 10 5. Eq? 12 * Dimensions of functions o On lats (lists of atoms - flat), numbers or S-expression (hierarchy) o Test, insert (L/R), replace, remove o Straight/single function, abstracted/generalized * Data types and structures o atom 3 o number o list 3 & 4 o S-expression 3 & 4 o lat (list of atoms) 15 o set 111 o pair 117 & 118 o rel 119 more at http://tinyurl.com/kll3de
This document was generated using the LaTeX2HTML translator Version 2002-2-1 (1.70)
Copyright © 1993, 1994, 1995, 1996,
Nikos Drakos,
Computer Based Learning Unit, University of Leeds.
Copyright © 1997, 1998, 1999,
Ross Moore,
Mathematics Department, Macquarie University, Sydney.
The command line arguments were:
latex2html recursive.tex
The translation was initiated by John McCarthy on 2006-08-13
(define db (quote (
((content)(tags))
((here is an example of content) (example content))
((an entry is a list containing two lists. The first list is the content. The second list is tags) (explanation tags))
)))
(define get-content (lambda (entry) (car entry)))
(define get-tags (lambda (entry) (cadr entry)))
(define subset? (lambda (keys lat)
(cond ((null? keys) #t)
((memq (car keys) lat) (subset? (cdr keys) lat))
(#t #f))))
(define tag-query (lambda (tags db)
(cond ((null? db) '())
((subset? tags (get-tags (car db))) (cons (car db) (tag-query tags (cdr db))))
(#t (tag-query tags (cdr db))))))
(defun eval. (e a)
(cond
((atom e) (assoc. e a))
((atom (car e))
(cond
((eq (car e) 'quote) (cadr e))
((eq (car e) 'atom) (atom (eval. (cadr e) a)))
((eq (car e) 'eq) (eq (eval. (cadr e) a)
(eval. (caddr e) a)))
((eq (car e) 'car) (car (eval. (cadr e) a)))
((eq (car e) 'cdr) (cdr (eval. (cadr e) a)))
((eq (car e) 'cons) (cons (eval. (cadr e) a)
(eval. (caddr e) a)))
((eq (car e) 'cond) (evcon. (cdr e) a))
('t (eval. (cons (assoc. (car e) a)
(cdr e))
a))))
((eq (caar e) 'label)
(eval. (cons (caddar e) (cdr e))
(cons (list (cadar e) (car e)) a)))
((eq (caar e) 'lambda)
(eval. (caddar e)
(append. (pair. (cadar e) (evlis. (cdr e) a))
a)))))
For something even smaller, download miniPicoLisp.tgz. It is a minimal version, without support for databases, UTF-8, bignums, IPC, networking and other system-dependent functions. A kind of "pure" Pico Lisp (not "pure Lisp"!). It supports the full Pico Lisp language, but runs faster, and uses even less memory space. It should also not be restricted to Unix. In addition, it compiles and runs also on 64-bit systems.
Jon Kleiser wrote an OpenGL library gl.tgz, and a Chinese Checkers program running on top of it.
(define (eval exp env)
(cond ((self-evaluating? exp) exp)
((variable? exp) (lookup-variable-value exp env))
((quoted? exp) (text-of-quotation exp))
((assignment? exp) (eval-assignment exp env))
((definition? exp) (eval-definition exp env))
((if? exp) (eval-if exp env))
((lambda? exp)
(make-procedure (lambda-parameters exp)
(lambda-body exp)
env))
((begin? exp)
(eval-sequence (begin-actions exp) env))
((cond? exp) (eval (cond->if exp) env))
((application? exp)
(apply (eval (operator exp) env)
(list-of-values (operands exp) env)))
(else
(error "Unknown expression type -- EVAL" exp))))
We want to write a function that generates accumulators-- a function that takes a number n, and returns a function that takes another number i and returns n incremented by i.