mirror of
https://github.com/peklaiho/madlisp.git
synced 2024-11-26 07:04:27 +00:00
remove first-or-null, not required because first returns null already
This commit is contained in:
parent
45bc9ec2ef
commit
c4e0a991c6
@ -3,9 +3,6 @@
|
|||||||
;; Generic utility functions.
|
;; Generic utility functions.
|
||||||
;;
|
;;
|
||||||
|
|
||||||
;; Return first item of sequence, or null if it is empty.
|
|
||||||
(defn first-or-null (seq) (if (empty? seq) null (first seq)))
|
|
||||||
|
|
||||||
;; Split string by whitespace, removing empty strings.
|
;; Split string by whitespace, removing empty strings.
|
||||||
(defn split-ws (s) (re-split "/[\\s]+/" s))
|
(defn split-ws (s) (re-split "/[\\s]+/" s))
|
||||||
|
|
||||||
@ -13,4 +10,4 @@
|
|||||||
;; Useful for parsing a string for command name and arguments.
|
;; Useful for parsing a string for command name and arguments.
|
||||||
(defn str-first-rest (s)
|
(defn str-first-rest (s)
|
||||||
(let (words (split-ws s))
|
(let (words (split-ws s))
|
||||||
[(first-or-null words) (tail words)]))
|
[(first words) (tail words)]))
|
||||||
|
Loading…
Reference in New Issue
Block a user