Public Vars

Back

string? (clj)

(source)

variable

(string? x)
Return true if x is a String

Examples

arohner/spectrum
(ns spectrum.core-specs
  (:require [clojure.core :as core]
            [clojure.spec.alpha :as s]
            [spectrum.core :as st]
            [spectrum.types :as t]
            [spectrum.util :refer [def-instance-predicate]]))

(st/var-spec #'clojure.core/*ns* #'namespace?)
(st/var-spec #'clojure.core/*file* #'string?)
(st/var-spec #'clojure.core/*print-dup* #'boolean?)
(st/var-spec #'clojure.core/*unchecked-math* #'boolean?)
(st/var-spec #'clojure.core/*agent* (t/or-t [(t/class-t clojure.lang.Agent) (t/value-t nil)]))
(st/var-spec #'clojure.core/*warn-on-reflection* #'boolean?)
hraberg/deuce
(ns deuce.emacs.callproc
  (:use [deuce.emacs-lisp :only (defun defvar) :as el])
  (:require [clojure.core :as c]
            [clojure.string :as s]
            [clojure.java.io :as io]
            [clojure.java.shell :as sh]
            [deuce.emacs.buffer :as buffer]
            [deuce.emacs.data :as data]
            [deuce.emacs.editfns :as editfns])
  (:import [java.io File])
  (:refer-clojure :exclude []))

  If BUFFER is 0, `call-process' returns immediately with value nil.
  Otherwise it waits for PROGRAM to terminate
  and returns a numeric exit status or a signal description string.
  If you quit, the process is killed with SIGINT, or SIGKILL if you quit again."
  (let [opts (if infile [:in (io/file infile)] [])
        no-wait? (= 0 buffer)
        buffer (or no-wait?
                   (and (data/consp buffer) (= :file (data/car buffer)) (data/cdr buffer))
                   (and (true? buffer) (buffer/current-buffer))
                   (el/check-type 'bufferp (or (when (data/consp buffer) (data/car buffer))
                                               buffer (buffer/current-buffer))))
        stderr (when (data/consp buffer) (data/cdr buffer))
        runner (if no-wait? #(do (future-call %) nil) #(%))]
    (runner #(let [{:keys [exit out err]}
                   (apply sh/sh (concat (cons program args) opts))]
               (when (data/bufferp buffer)
                 (binding [buffer/*current-buffer* buffer]
                   (editfns/insert out)
                   (when (true? stderr)
                     (editfns/insert err))))
               (when (string? buffer)
                 (spit (io/file buffer) out))
               (when (string? stderr)
                 (spit (io/file stderr) err))
               exit))))
mhuebert/maria
(ns cells.cell
  (:refer-clojure :exclude [bound-fn get])
  (:require [clojure.core :as core]
            [cells.util :as util]
            [applied-science.js-interop :as j]))

(defmacro defcell
  "Defines a named cell."
  [the-name & body]
  (let [[docstring body] (if (string? (first body))
                           [(first body) (rest body)]
                           [nil body])
        [options body] (if (and (map? (first body)) (> (count body) 1))
                         [(first body) (rest body)]
                         [nil body])
        f `(fn [~'self] ~@body)]
    `(do
       ;; support re-evaluation without breaking links
       (declare ~the-name)
       (let [prev-cell# ~the-name]
         (def ~(with-meta the-name options)
           ~@(when docstring (list docstring))
           (if (some? prev-cell#)
             (~'cells.cell/update-cell* prev-cell# ~f)
             (~'cells.cell/cell* ~f)))))))
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/string? (t/Pred t/Str)
cc/char? #?(:clj (t/Pred Character)
            :cljs [t/Any :-> t/Bool :filters {:then (is t/Str 0)}])
bsless/more.async
(ns more.async.dataflow.node
  (:require
   [clojure.spec.alpha :as s]
   [clojure.core.async :as a]
   [more.async :as ma]
   [clojure.data]))

(s/def ::name (s/or :keyword keyword?
                    :string string?
                    :number number?
                    :symbol symbol?))