1 ;;;; Ru*** roLeplay Playground virtual tabletop
2 ;;;; Copyright (C) 2022 Zull
4 ;;;; This program is free software: you can redistribute it and/or modify
5 ;;;; it under the terms of the GNU General Public License as published by
6 ;;;; the Free Software Foundation, either version 3 of the License, or
7 ;;;; (at your option) any later version.
9 ;;;; This program is distributed in the hope that it will be useful,
10 ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ;;;; GNU General Public License for more details.
14 ;;;; You should have received a copy of the GNU General Public License
15 ;;;; along with this program. If not, see <https://www.gnu.org/licenses/>.
20 ;; posso usare le hash piuttosto che interpretarlo sul momento. Infatti creerò un metodo che
21 ;; analizza json e lo traduce in una tabella hash e una funzione che prende la hash e crea
22 ;; l'oggetto tramite i metodi standard.
24 ;; (defparameter a (make-hash-table)) ; crea una hash con make-hash-table
25 ;; (gethash 'key a) ; recupera la hash con chiave key, questa è settable
26 (defun parse-list (linput)
27 (if (listp (car linput))
28 (loop :for l :in linput
31 (FORMAT t "TEXT IS ~A, ~A AND ~A~%" (CAR LINPUT) (CADR LINPUT) (CADDR LINPUT)) ; devi ricordanti che i campi non sono (a b c) ma sono ((a1 . a2) (b1 . b2) (c1 . c2))
34 (defun decompose-alist (alist search-list)
35 (apply 'concatenate 'list
36 (loop :for search-term :in search-list
38 (when (assoc search-term alist)
40 (cdr (assoc search-term alist))))