;;;; Ru*** roLeplay Playground virtual tabletop ;;;; Copyright (C) 2022 Zull ;;;; ;;;; This program is free software: you can redistribute it and/or modify ;;;; it under the terms of the GNU General Public License as published by ;;;; the Free Software Foundation, either version 3 of the License, or ;;;; (at your option) any later version. ;;;; ;;;; This program is distributed in the hope that it will be useful, ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;;; GNU General Public License for more details. ;;;; ;;;; You should have received a copy of the GNU General Public License ;;;; along with this program. If not, see . (in-package :core) ;; posso usare le hash piuttosto che interpretarlo sul momento. Infatti creerò un metodo che ;; analizza json e lo traduce in una tabella hash e una funzione che prende la hash e crea ;; l'oggetto tramite i metodi standard. ;; ;; (defparameter a (make-hash-table)) ; crea una hash con make-hash-table ;; (gethash 'key a) ; recupera la hash con chiave key, questa è settable (defun parse-list (linput) (if (listp (car linput)) (loop :for l :in linput :do (parse-list l)) (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)) )) (defun decompose-alist (alist search-list) (apply 'concatenate 'list (loop :for search-term :in search-list :collect (when (assoc search-term alist) (list search-term (cdr (assoc search-term alist)))) )))