We like to keep the source consistent and readable. Herein are some guidelines that should help with that.
All types and functions start with git_, and all #define macros start with GIT_.
| (ql:quickload '(drakma cl-interpol yason)) | |
| (defpackage dictionary-api-scraper | |
| (:nicknames :dictionary) | |
| (:use :cl) | |
| (:import-from :drakma | |
| :http-request) | |
| (:import-from :babel | |
| :octets-to-string) | |
| (:import-from :yason |
| (defmacro ->> (gen &rest forms) | |
| "Clojure's ->> macro" | |
| (reduce (lambda (g f) | |
| (cond ((symbolp f) (list f g)) | |
| ((consp f) `(,@f ,g)) | |
| (t (error "invalid form : ~S" f)))) | |
| forms :initial-value gen)) | |
| (defmacro $ (&rest xs) | |
| "Gauche's $ macro (minimal ver.)" |
| From [email protected] Thu Oct 20 16:53:41 EDT 1994 | |
| Article: 15160 of comp.lang.lisp | |
| Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!usenet.eel.ufl.edu!usenet.cis.ufl.edu!caen!math.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!ns.mcs.kent.edu!kira.cc.uakron.edu!malgudi.oar.net!malgudi.oar.net!welch | |
| From: [email protected] (Arun Welch) | |
| Newsgroups: comp.lang.lisp | |
| Subject: CL History (was Re: Why do people like C?) | |
| Date: 20 Oct 94 15:34:10 | |
| Organization: OARnet | |
| Lines: 3244 | |
| Message-ID: <[email protected]> |
| ;;; -*- lexical-binding: t -*- | |
| (define-slime-contrib slime-documentation-search | |
| "Hand off a documenation search to a web site." | |
| (:authors "Ben Hyde <[email protected]>") | |
| (:license "GPL") | |
| (:on-load | |
| (define-key slime-doc-map "\C-s" 'slime-documention-search) | |
| (define-key slime-doc-map "s" 'slime-documention-search))) |
| (defmacro clj-hash (&rest kvs) | |
| "Destructures `kvs`: assums keys and values are paired together: | |
| kvs ::= k1 v1 ... kn vn | |
| Defines a sequence of functions ki that will obtain the value of ki | |
| from a hash table. | |
| Raises simple-error on ki not being a keyword. |
| (defclass wrapped-stream (fundamental-stream) | |
| ((stream :initarg :stream :reader stream-of))) | |
| (defmethod stream-element-type ((stream wrapped-stream)) | |
| (stream-element-type (stream-of stream))) | |
| (defmethod close ((stream wrapped-stream) &key abort) | |
| (close (stream-of stream) :abort abort)) | |
| (defclass wrapped-character-input-stream |
| on run | |
| -- just here to get things started... | |
| end run | |
| on idle | |
| tell application "Notes" | |
| if exists note "What apps are running?" then | |
| delete note "What apps are running?" | |
| tell application "Finder" | |
| set myRunningApps to name of every process whose visible is true |
| ;;; THIS IS A PROOF OF CONCEPT. This has been "released" in case someone | |
| ;;; actually wants to develop it into a usable tool. Don't even think | |
| ;;; about using this version for any sort of production use. | |
| ;;; Author: Juho Snellman | |
| ;;; http://jsnell.iki.fi/blog/archive/2005-07-06.html | |
| (defparameter *retain* (make-hash-table :test 'eq)) | |
| (defparameter *ignore* (make-hash-table :test 'eq)) | |
| (defparameter *classes* nil) |
| (deftype octet () '(unsigned-byte 8)) | |
| (defun read-le-uint (size in) | |
| (loop FOR i FROM 0 BELOW size | |
| SUM (ash (read-byte in) (* i 8)))) | |
| (defun read-bytes (size in) | |
| (let ((ary (make-array size :element-type 'octet))) | |
| (read-sequence ary in) | |
| ary)) |