This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; | |
| ;;(in-package :3d-engine) | |
| (in-package :cl-user) | |
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; INIT | |
| ;;(pushnew "/home/malune/.sbcl/systems/" asdf:*central-registry*) | |
| ;; | |
| (asdf:operate 'asdf:load-op :cl-glut) | |
| (asdf:operate 'asdf:load-op :split-sequence) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (asdf:oos 'asdf:load-op :contextl) | |
| (in-package :contextl-user) | |
| (defclass grouped-layer (standard-layer-class) ()) | |
| (defgeneric group-root (layer)) | |
| (defgeneric default-layer (layer)) | |
| (define-layered-method adjoin-layer-using-class |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| : fizz? ( n -- ? ) | |
| 3 mod 0 = ; | |
| : buzz? ( n -- ? ) | |
| 5 mod 0 = ; | |
| : fizzbuzz? ( n -- ? ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;;------------------------------------------------------------------------------ | |
| (eval-when (:compile-toplevel) | |
| (ql:quickload :series)) | |
| (defpackage luhn | |
| (:use :cl :series)) | |
| (in-package :luhn) | |
| ;;-- sums integer digits as long as x is < 100. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defparameter *white-colour* #\O) | |
| (defun make-image (m n) | |
| (make-array (list m n) :initial-element *white-colour*)) | |
| (defun clear (image) | |
| (loop for i from 0 below (reduce #'* (array-dimensions image)) do | |
| (setf (row-major-aref image i) *white-colour*))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; Examples | |
| ;;------------------------------------------------------------------------------ | |
| ;; 1. non-commands | |
| ;; There are two types of 'non-commands', | |
| ;; a) integers | |
| ;; b) symbols | |
| ;; | |
| ;; Symbols are looked up, so if you provide an initial environment, with a | |
| ;; symbol defined, it will be appropriately looked up. | |
| ;; e.g: (lookup 'x '((x . 0))) -> 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; Examples | |
| ;;------------------------------------------------------------------------------ | |
| ;; 1. non-commands | |
| ;; There are two types of 'non-commands', | |
| ;; a) integers | |
| ;; b) symbols | |
| ;; | |
| ;; Symbols are looked up, so if you provide an initial environment, with a | |
| ;; symbol defined, it will be appropriately looked up. | |
| ;; e.g: (lookup 'x '((x . 0))) -> 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; base types | |
| (defvar *regex-null* nil) | |
| (defvar *regex-empty* t) | |
| ;; predicates | |
| (defun regex-alt? (re) | |
| (and (consp re) (eq (car re) 'alt))) | |
| (defun regex-seq? (re) | |
| (and (consp re) (eq (car re) 'seq))) | |
| (defun regex-rep? (re) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| processEvent :: NE.NonEmpty ViewEvent -> EventState -> EventState | |
| processEvent trigger (_, ij, nm) = | |
| case NE.head trigger of | |
| Init -> | |
| (Just Refresh, ij, nm) | |
| Prev -> | |
| prevEvent ij nm | |
| Next -> | |
| nextEvent ij nm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# LANGUAGE JavaScriptFFI #-} | |
| module Scorch.GHCJS.File | |
| ( | |
| readFileAsync | |
| ) where | |
| import Control.Monad.Trans (liftIO) | |
| import GHCJS.Types | |
| import GHCJS.Foreign | |
| import GHCJS.DOM.File (File) |