Skip to content

Instantly share code, notes, and snippets.

🤷‍♂
I know the value and cost of nothing

Ohta Shogo athos

🤷‍♂
I know the value and cost of nothing
Block or report user

Report or block athos

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View hatsukoi_clothes5.clj
(def players
(->> (repeatedly #(read *in* false nil))
(take-while identity)
(map-indexed #(vector % ('{J 11 Q 12 K 13 A 14 2 15} %2 %2)))
(into clojure.lang.PersistentQueue/EMPTY)))
(defn solve [ps]
(loop [[[id n :as p] :as ps] ps, card nil, passes 0, winners []]
(cond (empty? ps) winners
(= passes (count ps)) (recur ps nil 0 winners)
View example.clj
(defn include? [xs ys]
(let [ys' (frequencies ys)]
(reduce (fn [_ [e n]]
(or (some->> (ys' e) (<= n))
(reduced false)))
true
(frequencies xs))))
View example.clj
(defn include? [[x & xs :as xxs] [y & ys :as yys]]
(or (empty? xxs)
(and (not (empty? yys))
(if (= x y)
(recur xs ys)
(recur xxs ys)))))
View shadowing.ex
> defmodule M do
> def f do
> x = 0
> {fn -> x = 1 end, fn -> x end}
> end
> end
iex:4: warning: variable x is unused
{:module, M,
<<70, 79, 82, 49, 0, 0, 5, 24, 66, 69, 65, 77, 69, 120, 68, 99, 0, 0, 0, 124, 131, 104, 2, 100, 0, 14, 101, 108, 105, 120, 105, 114, 95, 100, 111, 99, 115, 95, 118, 49, 108, 0, 0, 0, 4, 104, 2, ...>>,
{:f, 0}}
View agenda.org

gen-class 勉強会 プログラム

No.タイトル担当レベル
1Java のクラスの作り方@tnoda\_未経験者
2Docstring 逐条講義@tnoda\_ビギナー
3gen-class の内部実装の話@athos0220上級者
4アノテーションの使い方@tnoda\_中級者
5gen-class クイズ@tnoda\_中級者
View core.clj
(ns redef-as-serializable.core)
(defmacro redef-as-serializable [& ts]
`(do ~@(for [t ts
:let [c (resolve t)
fields (mapv #(symbol (.getName %)) (.getDeclaredFields c))]]
`(deftype ~(symbol (str t \')) ~fields
java.io.Serializable))))
View tokyoclj#23.md

Clojure製ボットフレームワークを作る

リポジトリ on GitHub

前提

  • Hubot: GitHub製ボットフレームワーク(CoffeeScript)
    • アダプター: ボットを動かすサービスの差を吸収するレイヤー
    • スクリプト: コマンドに対するアクションを規定
View core.async_using_partial_continuation.scm
(use gauche.partcont)
(use util.queue)
(define-class <channel> (buf takes puts))
(define (chan)
(make <channel> (make-queue) (make-queue) (make-queue)))
(define-syntax go
(syntax-rules ()
@athos
athos / rich_hickey_q_and_a.md
Last active Aug 29, 2015
This document is translated from the interview at http://codequarterly.com/2011/rich-hickey/
View rich_hickey_q_and_a.md

Rich Hickey Q&A

by Michael Fogus

Best known as the inventor of Clojure, a Lisp that runs on the Java Virtual Machine and the first new member of the Lisp family to attract any widespread interest since Scheme and Common Lisp, Rich Hickey has been a software developer and consultant for two decades.

Rich Hickeyは20年来のソフトウェア技術者およびコンサルタントで、Clojureの創始者としてよく知られる。ClojureはJava仮想マシン上で動作するLispで、Lisp族の中ではSchemeやCommon Lisp以来はじめて幅広い人の興味を引いた新しい言語だ。

View license_of_talks.md
Title Conference License
Transducers Strange Loop 2014 CC BY
Implementation details of core.async Channels EuroClojure CC BY-NC
Design, Composition and Performance QCon San Francisco 2013 InfoQ *1
Clojure core.async Channels Strange Loop 2013 InfoQ *1
The Language of the System Clojure/conj 2012 standard YouTube license *2
The Value of Values JaxConf 2012 standard YouTube license *2
Reducers QCon NY 2012 InfoQ *1
Simple Made Easy
You can’t perform that action at this time.