Skip to content

Instantly share code, notes, and snippets.

Rich Already Answered That!

A list of commonly asked questions, design decisions, reasons why Clojure is the way it is as they were answered directly by Rich (even when from many years ago, those answers are pretty much valid today!). Feel free to point friends and colleagues here next time they ask (again). Answers are pasted verbatim (I've made small adjustments for readibility, but never changed a sentence) from mailing lists, articles, chats.

How to use:

  • The link below in the summary jumps at the answer on this page.
  • The link on the question itself points back at the original post.

Summary

yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
cd /usr/src
wget https://www.kernel.org/pub/software/scm/git/git-<version>.tar.gz
tar xzf git-<version>.gz
cd git-<version>
make configure
./configure --prefix=/usr
make all
https://www.infoq.com/news/2009/01/clojure-interview-halloway
Introduction to Clojure
Copyright© 2016 by Bill Burcham [email protected]
Philosophy of (Good) Software—Why Clojure?
Are We There Yet (video)
@dosbol
dosbol / gist:e453fcdbc40edda8ec8923f4e5d90398
Created March 19, 2019 09:06
Расписание встреч с использованием re-frame
Браузерное приложение - расписание встреч. Возможности: добавление встреч, удаление, редактирование.
На главном экране отображаются все встречи на выбранный день (соответственно есть контрол в выбором даты).
У встречи есть три состояния: запланирована, в процессе, завершена. Создавать встречи на прошлое запрещено,
они не должны пересекаться, отображение даты и времени должно быть в часовом поясе браузера.
Экран добавления встречи: дата и время начала, дата и время окончания, часовой пояс
(доступны три часовых пояса: Москва, Хабаровск, Гринвич), краткое описание.
При вводе времени валидировать формат: dd.MM.yyyy hh:mm A, где dd - день, MM - месяц, yyyy - год,
hh - часы от 1 до 12, mm - минуты, A - AM/PM.
const selectRandom = numbers => {
return numbers[Math.floor(Math.random() * numbers.length)];
}
const strategy1 = numbers => {
return numbers[0];
}
const strategy2 = numbers => {
return selectRandom(numbers);
@dosbol
dosbol / Advent of Code - 2019
Last active December 21, 2019 16:58
advent-of-code-2019.clj
(defn solve1-1 [x]
(int (- (Math/floor (/ x 3)) 2)))
(->> input
(map solve1-1)
(apply +))
(defn solve1-2 [s x]
(if (<= (solve1-1 x) 0) s
(recur (+ s (solve1-1 x)) (solve1-1 x))))
https://github.com/clojure/clojure/blob/b8c78ebf79b6a996f349dd112aaed658c132735d/src/clj/clojure/walk.clj
***********************************************************************
"I'm" -> "I am"
"They're" -> "they are"
матчатся по реджексам.
###########
queue of 10
###########
##############
pedestal: sync
##############
10.61µs
Evaluation count : 51774 in 6 samples of 8629 calls.

Lessons learned; The nice and accurate counsel of Alex Miller, programmer

TL:DR

  • Be intentional
  • Stay connected to the problem
  • Use tables to explore alternatives
  • Make a picture

1. Read the docs!