Public Vars

Back

parse-long (clj)

(source)

function

(parse-long s)
Parse string of decimal digits with optional leading -/+ and return a Long value, or nil if parse fails

Examples

originrose/cortex
(ns cortex.util-test
  (:refer-clojure :exclude [defonce])
  (:require
    #?(:cljs [cljs.test :refer-macros [deftest is testing]]
       :clj [clojure.test :refer [deftest is testing]])
    [clojure.core.matrix :as m]
    [clojure.string :as str]
    [cortex.util :refer :all]))

(deftest parse-long-test
  (is (= (parse-long "5") 5))
  (is (= (parse-long "-47") -47)))
originrose/cortex
(ns cortex.optimise.util-test
  (:refer-clojure :exclude [defonce])
  (:require [cortex.optimise.util :refer :all]
            [clojure.core.matrix :as m]
            [clojure.test :refer :all]))

(deftest parse-long-test
  (is (= (parse-long "5") 5))
  (is (= (parse-long "-47") -47)))
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/long [#?(:cljs t/Num :default (t/U Character t/Num)) :-> #?(:cljs t/AnyInteger :default Long)]
cc/parse-long [t/Str :-> (t/Option #?(:cljs t/AnyInteger :default Long))]
#?@(:cljs [] :default [
cc/num [t/Num :-> t/Num]
])
#?@(:cljs [
cc/short [t/Num :-> t/Num]
] :default [
cc/short [(t/U Character t/Num) :-> Short]
])
babashka/sci.configs
(ns sci.configs.clojure-1-11
  (:require [sci.core :as sci]
            [sci.impl.utils :refer [clojure-core-ns]]
            [clojure.core :as c]))

(def ^:private clojure-core-namespace-extras-1-11
  {'abs (sci/copy-var c/abs clojure-core-ns)
   'NaN? (sci/copy-var c/NaN? clojure-core-ns)
   'infinite? (sci/copy-var c/infinite? clojure-core-ns)
   'parse-double (sci/copy-var c/parse-double clojure-core-ns)
   'parse-long (sci/copy-var c/parse-long clojure-core-ns)
   'parse-boolean (sci/copy-var c/parse-boolean clojure-core-ns)
   'parse-uuid (sci/copy-var c/parse-uuid clojure-core-ns)
   'random-uuid (sci/copy-var c/random-uuid clojure-core-ns)
   'update-keys (sci/copy-var c/update-keys clojure-core-ns)
   'update-vals (sci/copy-var c/update-vals clojure-core-ns)
   'iteration (sci/copy-var c/iteration clojure-core-ns)})