Clojure reader written in Clojure by @hiredman_ (2009) https://github.com/hiredman/clojure/blob/f4a75e9bf35a5eff2c4dec85b36d37f59d04cd59/src/clj/clojure/reader.clj
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
def output name=((default=true); "caius") | |
puts "name: #{name.inspect}" | |
puts "default: #{default.inspect}" | |
end | |
output | |
# >> name: "caius" | |
# >> default: true | |
output "avdi" |
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
#!/usr/bin/env groovy | |
import static java.util.Calendar.YEAR | |
import groovy.text.SimpleTemplateEngine | |
def usage = """\nUSAGE: | |
Give it your API key, your Goodreads.com user ID, and the name of the shelf | |
you want to convert into a timeline: | |
./GetTimeline.groovy api_key user_id [shelf-name] |
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
(ns match.core | |
(:use [clojure.core.logic.unify :only [unifier unifier* binding-map | |
binding-map* prep replace-lvar | |
lvarq-sym? rem-?]] | |
[clojure.walk :only [postwalk]]) | |
(:require [clojure.core.logic.minikanren :as mk])) | |
;;borrowed from contrib, thanks steve | |
(defmacro cond-let | |
"Takes a binding-form and a set of test/expr pairs. Evaluates each test |
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
-- Based on "A Rational Deconstruction of Landin's SECD Machine" by Olivier Danvy | |
-- (BRICS-RS-03-33) | |
module SECD where | |
import Data.Maybe | |
type Ident = String | |
type Env a = [(Ident, a)] |
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
;; As a goal | |
;; Non-relational | |
;; Accepts these patterns of arguments: | |
;; IOO | |
;; III | |
;; IOI | |
;; IIO | |
;; I=input (ground), O=output (not ground) |
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
(ns pharoh.core | |
(:import #_(org.drools.compiler DrlParser) | |
#_(org.drools.spi Consequence) | |
(java.beans PropertyChangeSupport))) | |
(definterface IBean | |
(init []) | |
(addPropertyChangeListener [pcl]) | |
(removePropertyChangeListener [pcl])) |
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
(** Task X: Treap. *) | |
module Treap = struct | |
type ('a, 'b) t = | |
| Empty | |
| Node of ('a, 'b) t * 'a * 'b * ('a, 'b) t | |
let empty = Empty | |
let rec merge l r = match (l, r) with |
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
open System.Threading | |
type Atom<'T when 'T : not struct>(value : 'T) = | |
let refCell = ref value | |
let rec swap f = | |
let currentValue = !refCell | |
let result = Interlocked.CompareExchange<'T>(refCell, f currentValue, currentValue) | |
if obj.ReferenceEquals(result, currentValue) then () | |
else Thread.SpinWait 20; swap f |
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
#!/usr/bin/env ruby -w | |
# | |
# Trims Goodreads CSV files so they import into Delicious Library essential data only. | |
# | |
require 'rubygems' | |
require 'faster_csv' | |
path = ARGV.empty? ? "/Users/rgreen/Downloads/goodreads_export.csv" : ARGV[0] |