This file contains 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 easy.scheduler | |
(:require [clojure.data.priority-map :refer :all])) | |
(def ^:dynamic *task* identity) | |
(def result (atom (transient {}))) | |
(def todo (atom (priority-map))) | |
(deftype Now [o] |
This file contains 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
;Starting with the example of | |
(def rows 3) | |
(def cols 3) | |
(def cells (for [row (range rows), col (range cols)] [row col])) | |
(defn select-cells-by-row [row] | |
(filter (fn [[r c]] (= row r)) cells)) |
This file contains 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
(defn grid [rows cols] | |
(let [cells (for [row (range rows), col (range cols)] [row col])] | |
(defn select-cells-by-row [row] | |
(filter (fn [[r c]] (= row r)) cells)) | |
(defn print-cells-by-row [row] | |
(doseq [cell (select-cells-by-row row)] | |
(println cell))) |