fix and improve "qml-lisp" example; allow nested QVariantLists (JS arrays in QML);

This commit is contained in:
polos 2017-01-17 10:13:45 +01:00
parent 0e82b0a517
commit 03c7a5ded5
5 changed files with 27 additions and 10 deletions

View file

@ -7,9 +7,17 @@
(defvar *qml-lisp* (qload-c++ "lib/qml_lisp"))
(defun string-to-symbol (name)
(let* ((upper (string-upcase name))
(p (position #\: name)))
(if p
(intern (subseq upper (1+ (position #\: name :from-end t)))
(subseq upper 0 p))
(intern upper))))
(defun qml-apply (function arguments)
(let ((value (apply (intern (string-upcase function)) arguments)))
(let ((value (apply (string-to-symbol function)
arguments)))
(if (stringp value)
value
(princ-to-string value))))