Jhon McCarthy
scheme, lisp, clojure, lfe, racket
- web-dev: clojure, racket, gerbil scheme, gambit scheme
- erlang runtime: lfe
| (define time-since-last | |
| (lambda (α t) | |
| (- 1 (exp (/ (- t) α))))) | |
| (define ρ 200) | |
| (define wait-time | |
| (lambda (α β x) |
| (def e {:name "E"}) | |
| (def f {:name "F"}) | |
| (def c {:name "C" :left e :right f}) | |
| (def d {:name "D"}) | |
| (def b {:name "B" :left d}) | |
| (def a {:name "A" :left b :right c}) | |
| (def i {:name "I"}) | |
| (def j {:name "J"}) |
| #include <assimp/cimport.h> // Plain-C interface | |
| #include <assimp/scene.h> // Output data structure | |
| #include <assimp/postprocess.h> // Post processing flags | |
| #include <stdio.h> | |
| int main() | |
| { | |
| // Start the import on the given file with some example postprocessing | |
| // Usually - if speed is not the most important aspect for you - you'll t |
| (define-syntax define-record-with-defaults | |
| (lambda (stx) | |
| (syntax-case stx () | |
| ((_ record-name (field-info ...)) | |
| (with-syntax (((field-names ...) (map (lambda (field-value) | |
| (let ((val (syntax->datum field-value))) | |
| (cond | |
| ((symbol? val) (datum->syntax #'record-name val)) | |
| ((pair? val) (datum->syntax #'record-name (car val))) | |
| (else (syntax-error "either a symbol or pair supported"))))) |
| ;; rough draft of nng rest server in chez scheme | |
| ;; some things dont work | |
| (library (server) | |
| (export ) | |
| (import (chezscheme) | |
| (prelude) | |
| (ffi)) |
| (define data (list 0.0 -0.5 1.0 0.0 0.0 | |
| 0.5 0.5 0.0 1.0 0.0 | |
| -0.5 0.5 0.0 0.0 1.0)) | |
| (define buffer-data (let (v (make-u8vector (* 15 4))) | |
| (let lp ((rest data) (i 0)) | |
| (match rest | |
| ([x . rest] | |
| (displayln "i:" i "x:" x) |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <title>three.js webgl - lights - hemisphere light</title> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"> | |
| <link type="text/css" rel="stylesheet" href="main.css"> | |
| <style> | |
| body { | |
| color: #444; |
| (import :std/foreign) | |
| (import (for-syntax :play/stxutil)) | |
| (export #t) | |
| (begin-ffi () | |
| (c-declare "#include<string.h>")) | |
| (defsyntax (access stx) |
| (import :std/foreign) | |
| (export #t) | |
| (begin-ffi (first-c | |
| malloc-integer-list) | |
| (define-c-lambda first-c | |
| ((pointer (pointer int))) | |
| (pointer int) |