Public Vars

Back

drop (clj)

(source)

function

(drop n) (drop n coll)
Returns a laziness-preserving sequence of all but the first n items in coll. Returns a stateful transducer when no collection is provided.

Examples

clojure/core.async
;; The clojure.core.async namespace contains the public API.
(require '[clojure.core.async :as async :refer :all])

;; Use `dropping-buffer` to drop newest values when the buffer is full:
(chan (dropping-buffer 10))

;; Use `sliding-buffer` to drop oldest values when the buffer is full:
(chan (sliding-buffer 10))
HumbleUI/HumbleUI
(ns examples
  (:require
    [clojure.core.server :as server]
    [examples.7guis-converter]
    [examples.align]
    [examples.animation]
    [examples.backdrop]
    [examples.blur]
    [examples.bmi-calculator]
    [examples.button]
    [examples.calculator]
    [examples.canvas]
    [examples.canvas-shapes]
    [examples.checkbox]
    [examples.container]
    [examples.effects]
    [examples.errors]
    [examples.event-bubbling]
    [examples.framerate]
    [examples.grid]
    [examples.image-snapshot]
    [examples.label]
    [examples.oklch]
    [examples.paragraph]
    [examples.scroll]
    [examples.settings]
    [examples.slider]
    [examples.stack]
    [examples.state :as state]
    [examples.svg]
    [examples.text-field]
    [examples.text-field-debug]
    [examples.todomvc]
    [examples.toggle]
    [examples.tooltip]
    [examples.tree]
    [examples.treemap]
    [examples.wordle]
    [io.github.humbleui.app :as app]
    [io.github.humbleui.debug :as debug]
    [io.github.humbleui.paint :as paint]
    [io.github.humbleui.window :as window]
    [io.github.humbleui.ui :as ui]))

(def examples
  (sorted-map
    "7 GUIs: Converter" examples.7guis-converter/ui
    "Align" examples.align/ui
    "Animation" examples.animation/ui
    "Backdrop" examples.backdrop/ui
    "Blur" examples.blur/ui
    "BMI Calculator" examples.bmi-calculator/ui
    "Button" examples.button/ui
    "Calculator" examples.calculator/ui
    "Canvas" examples.canvas/ui
    "Canvas Shapes" examples.canvas-shapes/ui
    "Checkbox" examples.checkbox/ui
    "Container" examples.container/ui
    "Effects" examples.effects/ui
    "Errors" examples.errors/ui
    "Event Bubbling" examples.event-bubbling/ui
    "Framerate" examples.framerate/ui
    "Grid" examples.grid/ui
    "Image Snapshot" examples.image-snapshot/ui
    "Label" examples.label/ui
    "OkLCH" examples.oklch/ui
    "Paragraph" examples.paragraph/ui
    "Scroll" examples.scroll/ui
    "Settings" examples.settings/ui
    "Slider" examples.slider/ui
    "Stack" examples.stack/ui
    "SVG" examples.svg/ui
    "Text Field" examples.text-field/ui
    "Text Field Debug" examples.text-field-debug/ui
    "Todo MVC" examples.todomvc/ui
    "Toggle" examples.toggle/ui
    "Tooltip" examples.tooltip/ui
    "Tree" examples.tree/ui
    "Treemap" examples.treemap/ui
    "Wordle" examples.wordle/ui))
typedclojure/typedclojure
(ns ^:no-doc typed.ann.clojure
  "Type annotations for the base Clojure distribution."
  #?(:cljs (:require-macros [typed.ann-macros.clojure :as macros]))
  (:require [clojure.core :as cc]
            [typed.clojure :as t]
            #?(:clj [typed.ann-macros.clojure :as macros])
            #?(:clj typed.ann.clojure.jvm) ;; jvm annotations
            #?(:clj clojure.core.typed))
  #?(:clj
     (:import (clojure.lang PersistentHashSet PersistentList
                            APersistentMap #_IPersistentCollection
                            #_ITransientSet
                            IRef)
              (java.util Comparator Collection))))


cc/take-while (t/All [x y] (t/IFn [[x :-> t/Any] :-> (t/Transducer x x)]
                                  [[x :-> t/Any] (t/Seqable x) :-> (t/ASeq x)]))
cc/drop-while (t/All [x] (t/IFn [[x :-> t/Any] :-> (t/Transducer x x)]
                                [[x :-> t/Any] (t/Seqable x) :-> (t/ASeq x)]))

cc/take (t/All [x] (t/IFn [t/Int :-> (t/Transducer x x)]
                          [t/Int (t/Seqable x) :-> (t/ASeq x)]))
cc/drop (t/All [x] (t/IFn [t/Int :-> (t/Transducer x x)]
                          [t/Int (t/Seqable x) :-> (t/ASeq x)]))
cc/take-last (t/All [x] [t/Int (t/Seqable x) :-> (t/NilableNonEmptyASeq x)])
cc/drop-last (t/All [x] [(t/? t/Int) (t/Seqable x) :-> (t/ASeq x)])
hraberg/shen.clj
;; src/shen/overwrite.clj
(ns shen
  (:use [shen.primitives])
  (:require [clojure.core :as c])
  (:refer-clojure :only []))

(defun macroexpand (V510)
  (let Y (shen-compose (c/drop-while c/nil?
                                     (c/map #(c/when-let [m (c/ns-resolve 'shen %)] @m)
                                            (value '*macros*))) V510)
       (if (= V510 Y) V510 (shen-walk macroexpand Y))))
Cnly/clj-latex
(ns dptab
  (:require [clojure.core.matrix :as m]
            [clj-latex.core :as l]))

(println
 (l/render-latex
   (:documentclass 'article)
   (:usepackage 'tikz)
   (:usepackage 'amsmath)
   (:newcommand :rn [2]
                (list
                  (:tikz ["remember picture", "baseline=(#1.base)"])
                  (:node ["inner sep=0"]) "(#1) {$#2$};"))
   ('document
     (let [[rows cols] [8 8]
           g (fn [i j] (if (= i j)
                         1
                         -1))
           tab (loop [tab (vec (repeat rows (vec (repeat cols 0))))
                      ijs (drop 1 (for [i (range rows)
                                        j (range cols)]
                                    [i j]))]
                 (if-let [[i j] (first ijs)]
                   (let [get-in-tab #(get-in tab %& ##-Inf)
                         v-top (+ (get-in-tab (dec i) j) -3)
                         v-left (+ (get-in-tab i (dec j)) -3)
                         v-topleft (+ (get-in-tab (dec i) (dec j)) (g i j))]
                     (recur (assoc-in tab [i j] (max v-top v-left v-topleft))
                            (next ijs)))
                   tab))
           tab (m/emap-indexed (fn [[i j] elem]
                                 (format "\\rn{%d%d}{%s}" i j elem)) tab)]
       (list
         (l/matrix 'matrix tab)
         ('tikzpicture [['overlay, "remember picture"]]
                       (for [i (range (- rows 1))]
                         (list (:draw ['->]) (format "(%d%d)--(%d%d);" i i (inc i) (inc i))))))))))