mlisp/debug.lsp

49 lines
1.3 KiB
Common Lisp

(print (string-split "split me by space" "\\s+"))
(print (string-rtrim "abc "))
(print (string-ltrim " abc"))
(print (string-trim " abc "))
(defun string-upcase (str)
(string-case str "upper"))
(defun string-downcase (str)
(string-case str "lower"))
(print (string-upcase "abcABCD"))
(print (string-downcase "abcABCD"))
;; (print (sprintf "%.2f" (list 1.25)))
;; (print (sprintf "%.2f" '(1.23456)))
;; (print (sprintf "%d" '(10000000)))
;; (define q 1.23)
;; (print (sprintf "%+.2f%%" (list q)))
;; (define q -1.23)
;; (print (sprintf "%+.2f%%" (list q)))
;; (define term-rst-esc "\x1B[0m")
;; (define term-red-esc '"\x1B[31m")
;; (define term-green-esc "\x1B[32m")
;; (defun term-red (str) (sprintf (+ term-red-esc str term-rst-esc)))
;; (print (+ (term-red (sprintf "%.2f" (list 1.11))) " "
;; (term-green (sprintf "%.2f" (list 1.11))) " "
;; (term-blue (sprintf "%.2f" (list 1.11))) " "
;; (term-yellow (sprintf "%.2f" (list 1.11))) " "
;; ))
;; (benchmark "benchmark makelist 1000 : " (make-list 1000))
;; (benchmark "benchmark range 1000 : " (range 1 1000))
;; (define fdx_list (parse-csv (read-file "tests/csv_data.csv")))
;; (print fdx_list)
(print (and (print "xx") (= 1 0) (print "yy")))
; (sleep 1.5)