mirror of
https://github.com/vale981/cl-scrape-telegram-api
synced 2025-03-04 15:51:38 -05:00
18 lines
510 B
Common Lisp
18 lines
510 B
Common Lisp
(in-package :space.protagon.cl-telegram-scrape.utils)
|
|
|
|
(defun lispify (str)
|
|
"Converts a snake case string to dash-style."
|
|
(string-upcase (cl-ppcre:regex-replace-all "_" str "-")))
|
|
|
|
(defun telegramify (str)
|
|
"Converts dash-style to snake-case."
|
|
(string-downcase (cl-ppcre:regex-replace-all "-" str "_")))
|
|
|
|
(defun camel->symbol (ident)
|
|
(intern (json:camel-case-to-lisp ident)))
|
|
|
|
(defun snake->keyword (str)
|
|
(-> str (lispify) (make-keyword)))
|
|
|
|
(defun snake->symbol (str)
|
|
(-> str (lispify) (intern)))
|