Skip to content

Instantly share code, notes, and snippets.

View shakdwipeea's full-sized avatar
🎯
Focusing

Akash Shakdwipeea shakdwipeea

🎯
Focusing
View GitHub Profile
@shakdwipeea
shakdwipeea / overview.org
Last active April 4, 2022 07:54
lisp notes

LISP

originated around 1958

Jhon McCarthy

lots of implementation

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;
@shakdwipeea
shakdwipeea / strings.ss
Created September 12, 2019 09:59
ffi macros
(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)