summaryrefslogtreecommitdiff
path: root/src/tg
diff options
context:
space:
mode:
authorGravatar Uko Kokņevičs2025-10-18 08:42:44 +0300
committerGravatar Uko Kokņevičs2025-10-18 08:42:44 +0300
commit9e7c8dfab25da9beb86fd4ed4115895eedb4c8ab (patch)
treed05cf25dc5aeed47f8b2585ecc5a81ab80cbdbaf /src/tg
parentBunch more tiny improvements (diff)
downloadukkoclot-9e7c8dfab25da9beb86fd4ed4115895eedb4c8ab.tar.gz
ukkoclot-9e7c8dfab25da9beb86fd4ed4115895eedb4c8ab.tar.xz
ukkoclot-9e7c8dfab25da9beb86fd4ed4115895eedb4c8ab.zip
Replace bunch of our string utilities with str library
Diffstat (limited to 'src/tg')
-rw-r--r--src/tg/method-macros.lisp6
-rw-r--r--src/tg/type-macros.lisp4
2 files changed, 5 insertions, 5 deletions
diff --git a/src/tg/method-macros.lisp b/src/tg/method-macros.lisp
index b924e15..0be6f00 100644
--- a/src/tg/method-macros.lisp
+++ b/src/tg/method-macros.lisp
@@ -6,8 +6,8 @@
6 (:import-from :alexandria :with-gensyms) 6 (:import-from :alexandria :with-gensyms)
7 (:import-from :com.dieggsy.f-string :enable-f-strings) 7 (:import-from :com.dieggsy.f-string :enable-f-strings)
8 (:import-from :serapeum :take) 8 (:import-from :serapeum :take)
9 (:import-from :str)
9 (:import-from :ukkoclot/state :bot) 10 (:import-from :ukkoclot/state :bot)
10 (:import-from :ukkoclot/strings :ends-with :lisp->camel-case)
11 (:import-from :ukkoclot/transport :do-call) 11 (:import-from :ukkoclot/transport :do-call)
12 (:export :define-tg-method)) 12 (:export :define-tg-method))
13(in-package :ukkoclot/tg/method-macros) 13(in-package :ukkoclot/tg/method-macros)
@@ -36,8 +36,8 @@
36 (collect (apply #'make-param param-spec)))) 36 (collect (apply #'make-param param-spec))))
37 37
38 (defun path-from-name (name) 38 (defun path-from-name (name)
39 (let ((str (lisp->camel-case (symbol-name name)))) 39 (let ((str (str:camel-case name)))
40 (if (ends-with str "%") 40 (if (str:ends-with-p "%" str :ignore-case nil)
41 (take (- (length str) 1) str) 41 (take (- (length str) 1) str)
42 str))) 42 str)))
43 43
diff --git a/src/tg/type-macros.lisp b/src/tg/type-macros.lisp
index 5f99cba..75afab0 100644
--- a/src/tg/type-macros.lisp
+++ b/src/tg/type-macros.lisp
@@ -5,9 +5,9 @@
5 (:use :c2cl :iterate) 5 (:use :c2cl :iterate)
6 (:import-from :alexandria :with-gensyms) 6 (:import-from :alexandria :with-gensyms)
7 (:import-from :com.dieggsy.f-string :enable-f-strings) 7 (:import-from :com.dieggsy.f-string :enable-f-strings)
8 (:import-from :str)
8 (:import-from :ukkoclot/serializing :parse-value) 9 (:import-from :ukkoclot/serializing :parse-value)
9 (:import-from :ukkoclot/hash-tables :gethash-lazy) 10 (:import-from :ukkoclot/hash-tables :gethash-lazy)
10 (:import-from :ukkoclot/strings :lisp->snake-case)
11 (:local-nicknames 11 (:local-nicknames
12 (:jzon :com.inuoe.jzon)) 12 (:jzon :com.inuoe.jzon))
13 (:export :define-tg-type)) 13 (:export :define-tg-type))
@@ -39,7 +39,7 @@
39 (intern (concatenate 'string (symbol-name name) "-" (symbol-name (field-name field))))) 39 (intern (concatenate 'string (symbol-name name) "-" (symbol-name (field-name field)))))
40 40
41 (defun field-hash-key (field) 41 (defun field-hash-key (field)
42 (string-downcase (lisp->snake-case (symbol-name (field-name field))))) 42 (str:snake-case (field-name field)))
43 43
44 (defun field-keyword (field) 44 (defun field-keyword (field)
45 (intern (symbol-name (field-name field)) :keyword)) 45 (intern (symbol-name (field-name field)) :keyword))